Skip to content

Commit d57f5f0

Browse files
committed
codepen cleanup
1 parent 36efc91 commit d57f5f0

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

src/plots/cartesian/axes.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,9 +2504,8 @@ axes.drawOne = function(gd, ax, opts) {
25042504
});
25052505

25062506
var tickNames = ['tick'];
2507+
25072508
if(ax.type === 'multicategory') {
2508-
// https://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example
2509-
console.log('slice', ax.levels.slice().reverse().slice(0, ax.levelNr - 1));
25102509
ax.levels.slice().reverse().slice(0, ax.levelNr - 1).forEach(function(_lvl) {
25112510
var pad = {x: 0 * _lvl, y: 10}[axLetter];
25122511

@@ -2531,25 +2530,17 @@ axes.drawOne = function(gd, ax, opts) {
25312530
});
25322531

25332532
tickNames = tickNames.sort();
2534-
console.log('tickNames', tickNames);
25352533

25362534
ax.levels.slice().forEach(function(_lvl, idx) {
25372535
seq.push(function() {
25382536
ax._depth = (majorTickSigns[4] * (getLabelLevelBbox(tickNames.slice()[_lvl])[ax.side] - mainLinePosition));
2539-
console.log('depth', ax._depth);
2540-
2541-
// TODO Has to be removed to loop through all dividers?
2542-
// console.log('dividers', dividerVals);
25432537

25442538
var levelDividers = dividerVals.slice().filter(function(divider) {
25452539
return divider.level === idx;
25462540
});
25472541

2548-
console.log('levelDividers', levelDividers);
2549-
25502542
return drawDividers(gd, ax, {
25512543
vals: levelDividers,
2552-
// vals: [],
25532544
layer: mainAxLayer,
25542545
path: axes.makeTickPath(ax, mainLinePosition, majorTickSigns[4], { len: ax._depth }),
25552546
transFn: transTickFn
@@ -3787,6 +3778,7 @@ function drawDividers(gd, ax, opts) {
37873778
var dividers = opts.layer.selectAll('path.' + cls)
37883779
.data(vals, tickDataFn);
37893780

3781+
// TODO Has to be removed to loop through all dividers??
37903782
// dividers.exit().remove();
37913783

37923784
dividers.enter().insert('path', ':first-child')

src/plots/cartesian/set_convert.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,7 @@ module.exports = function setConvert(ax, fullLayout) {
390390

391391
if(axLetter in trace) {
392392
var arrayIn = trace[axLetter];
393-
console.log(arrayIn);
394-
// var arrayIn = trace[axLetter].slice(0, 2);
395393

396-
397-
// if(isArrayOrTypedArray(arrayIn[0]) && isArrayOrTypedArray(arrayIn[1])) {
398394
var arrays = arrayIn.map(function(x) {
399395
return x;
400396
});
@@ -404,6 +400,7 @@ module.exports = function setConvert(ax, fullLayout) {
404400

405401
Array.prototype.push.apply(fullObjectList, objList);
406402

403+
// convert the trace data from list to object and sort (backwards, stable sort)
407404
var sortedObjectList = sortLib.sortObjectList(cols, objList);
408405
var matrix = sortLib.objectListToList(sortedObjectList);
409406
var sortedMatrix = sortLib.sortedMatrix(matrix);
@@ -412,28 +409,21 @@ module.exports = function setConvert(ax, fullLayout) {
412409
var y = sortedMatrix[1];
413410

414411
// Could/should set sorted y axis values for each trace as the sorted values are already available.
415-
// Need write access to gd._fullData
416-
412+
// Need write access to gd._fullData, bad?
417413
var transposedXs = sortLib.transpose(xs);
418-
// debugger;
419414
gd._fullData[i].x = transposedXs;
420415
gd._fullData[i].y = y;
421-
// console.log('trace', i);
422-
// console.log('gd', gd._fullData[i]);
423-
// }
424416
}
425417
}
426418
ax.levelNr = xs[0].length;
427419
ax.levels = xs[0].map(function(_, idx) {return idx;});
428420

429421

430-
console.log('fullObjectList', fullObjectList);
431422
var fullSortedObjectList = sortLib.sortObjectList(cols, fullObjectList.slice());
432423
var fullList = sortLib.objectListToList(fullSortedObjectList);
433424
var fullSortedMatrix = sortLib.sortedMatrix(fullList);
434425

435426
var fullXs = fullSortedMatrix[0].slice();
436-
console.log('fullXs', fullXs);
437427

438428
for(i = 0; i < fullXs.length; i++) {
439429
setCategoryIndex(fullXs[i]);

0 commit comments

Comments
 (0)