Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce0a56a

Browse files
committed
make waterfall NOT a 'bar' category
- this was causing more issues than it solved.
1 parent 6b3eeab commit ce0a56a

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/components/legend/style.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,6 @@ module.exports = function style(s, gd) {
283283

284284
function styleBars(d) {
285285
var trace = d[0].trace;
286-
if(trace.type === 'waterfall') return d;
287-
288286
var marker = trace.marker || {};
289287
var markerLine = marker.line || {};
290288

src/plots/cartesian/axes.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,14 +2823,16 @@ function hasBarsOrFill(gd, ax) {
28232823
for(var i = 0; i < fullData.length; i++) {
28242824
var trace = fullData[i];
28252825

2826-
if(trace.visible === true &&
2827-
(trace.xaxis + trace.yaxis) === subplot &&
2828-
(
2829-
Registry.traceIs(trace, 'bar') && trace.orientation === {x: 'h', y: 'v'}[axLetter] ||
2830-
trace.fill && trace.fill.charAt(trace.fill.length - 1) === axLetter
2831-
)
2832-
) {
2833-
return true;
2826+
if(trace.visible === true && (trace.xaxis + trace.yaxis) === subplot) {
2827+
if(
2828+
(Registry.traceIs(trace, 'bar') || trace.type === 'waterfall') &&
2829+
trace.orientation === {x: 'h', y: 'v'}[axLetter]
2830+
) return true;
2831+
2832+
if(
2833+
trace.fill &&
2834+
trace.fill.charAt(trace.fill.length - 1) === axLetter
2835+
) return true;
28342836
}
28352837
}
28362838
return false;

src/traces/bar/cross_trace_calc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function crossTraceCalc(gd, plotinfo) {
3737
var fullTrace = fullTraces[i];
3838
if(
3939
fullTrace.visible === true &&
40-
(Registry.traceIs(fullTrace, 'bar') && fullTrace.type !== 'waterfall') &&
40+
Registry.traceIs(fullTrace, 'bar') &&
4141
fullTrace.xaxis === xa._id &&
4242
fullTrace.yaxis === ya._id
4343
) {

src/traces/waterfall/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Waterfall.selectPoints = require('../bar/select');
2727
Waterfall.moduleType = 'trace';
2828
Waterfall.name = 'waterfall';
2929
Waterfall.basePlotModule = require('../../plots/cartesian');
30-
Waterfall.categories = ['cartesian', 'svg', 'bar', 'oriented', 'showLegend', 'zoomScale'];
30+
Waterfall.categories = ['cartesian', 'svg', 'oriented', 'showLegend', 'zoomScale'];
3131
Waterfall.meta = {
3232
description: [
3333
'Draws waterfall trace which is useful graph to displays the',

0 commit comments

Comments
 (0)