Skip to content

Commit bc3358f

Browse files
committed
solved dividers remove
1 parent e03e17e commit bc3358f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

devtools/test_dashboard/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
// type: "box",
143143
// };
144144

145-
var data = [trace2];
145+
var data = [trace1];
146146

147147
Plotly.newPlot("tester", data, { margin: { t: 0, l: 50, r: 0 } });
148148
</script>

src/plots/cartesian/axes.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ axes.drawOne = function(gd, ax, opts) {
25392539

25402540
tickNames = tickNames.sort();
25412541

2542-
ax.levels.slice().forEach(function(_lvl, idx) {
2542+
ax.levels.forEach(function(_lvl, idx) {
25432543
seq.push(function() {
25442544
ax._depth = (majorTickSigns[4] * (getLabelLevelBbox(tickNames.slice()[_lvl])[ax.side] - mainLinePosition));
25452545

@@ -2551,7 +2551,8 @@ axes.drawOne = function(gd, ax, opts) {
25512551
vals: levelDividers,
25522552
layer: mainAxLayer,
25532553
path: axes.makeTickPath(ax, mainLinePosition, majorTickSigns[4], { len: ax._depth }),
2554-
transFn: transTickFn
2554+
transFn: transTickFn,
2555+
level: _lvl
25552556
});
25562557
});
25572558
});
@@ -3783,11 +3784,17 @@ function drawDividers(gd, ax, opts) {
37833784
var cls = ax._id + 'divider';
37843785
var vals = opts.vals;
37853786

3787+
37863788
var dividers = opts.layer.selectAll('path.' + cls)
3787-
.data(vals, tickDataFn);
3789+
.data(vals, tickDataFn);
37883790

3789-
// TODO Has to be removed to loop through all dividers??
3790-
// dividers.exit().remove();
3791+
if(ax.type === 'multicategory') {
3792+
if(opts.level === 0) {
3793+
dividers.exit().remove();
3794+
}
3795+
} else {
3796+
dividers.exit().remove();
3797+
}
37913798

37923799
dividers.enter().insert('path', ':first-child')
37933800
.classed(cls, 1)

0 commit comments

Comments
 (0)