-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Waterfall charts #3531
Merged
Merged
Waterfall charts #3531
Changes from 58 commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
8f89564
started waterfall
archmoj 5678653
rm traceIs waterfall as it described as bar
archmoj cfe8eb2
isFall > isSum as we may use rise and fall for positive and negative …
archmoj dbc98b5
separated calc for waterfall - pass 1
archmoj acc3640
removed barnorm stack and base
archmoj 9537ee8
removed more useless mocks
archmoj 6be0a4a
easier to use api
archmoj d6a69f2
new baselines
archmoj 34b6a0a
handle undefined cases in extract instructions
archmoj aa58571
new baselines
archmoj 6a4666a
auto compute color array based on vals when array left empty
archmoj 3fb3597
new baselines
archmoj dc1b420
defualt to remove instructions from ax text
archmoj f8507ce
only accept valid tokens
archmoj a875ac7
new baselines
archmoj 69956a0
only run waterfalls on CI for now
archmoj 82dfd18
use operators instead of instr and token
archmoj 87ad17c
handle initial values
archmoj b0fdced
correct baselines cases without an initial value
archmoj 4c4c8e5
refactor plot using isHorizontal and else fixup
archmoj c052205
describe connectors
archmoj fb28e30
draw connector at the end of each bar
archmoj ea4863f
extend connectors using dtick
archmoj af60c1f
fixed shape and dist between connectors
archmoj 1827ee6
new baselines
archmoj 89e66bb
revised includes
archmoj 4383a71
providing a separate array for the operators
archmoj 2454e6c
removed last connector
archmoj 3533448
new baselines without last connector
archmoj cd16944
Merge branch 'master' into waterfall-new-trace_dev1
archmoj f9b36cb
consider alignment and offset group across matching axes in waterfall
archmoj 3386803
removed few unused parameters from bar cross_trace_calc
archmoj d1c8c48
inherit from bars - pass 1
archmoj cd81dcd
rm triangles
archmoj e7602e2
removed operator - used null magic number and added initialized attri…
archmoj d1bbae6
removed errorbar support
archmoj 59ee151
removed errorbars
archmoj d8d54cd
support non-array base - waterfall tests
archmoj c1ed50f
revised connector line shapes
archmoj 346c637
revised connectors - hover showing initial - multicategory example
archmoj fed3c97
Revision based on Etienne review - pass 1
archmoj aa8abe4
fixup attributes width offset connector lines plot and test
archmoj a05352f
arrayOk width and offset back - apply offset arrays in connector draw
archmoj 20d1cbc
added totals container and fixed hover colors
archmoj 692c6d4
fix hover color in test
archmoj c0b1017
waterfallmode
archmoj 9533558
waterfallgap
archmoj 2480892
waterfallgroupgap
archmoj f3f7d84
fixup waterfall mode gap groupgap
archmoj 7e41079
rename inner node in <g.lines> -> <g.line>
etpinard 84e3a27
fix `cliponaxis:false` for waterfall traces
etpinard 00070ba
always drawn waterfall trace below bar/histogram
etpinard dcab107
fixup waterfall/bar mode/gap/groupgap interplay
etpinard d52116b
revised waterfall marker logic
archmoj 6d37db9
drop steps connector mode
archmoj fb0d7a9
added connector visible drop false mode
archmoj 9e941ba
tweak bar endpoints to adjust with connector in mode between
archmoj 2a25753
dont coerce connector if visible false
archmoj 1825027
turn connector.(color|dash|width) into -> connector.line.(color|dash|…
archmoj 4a044e4
make restyle connector visible (true|false) work
archmoj c53bcce
fixup restyle connector visible remove nodes
archmoj 3b984ff
added connector restyle visible true false
archmoj 6b3eeab
no need to loop over all the traces when waterfallmode is not group
archmoj ce0a56a
make waterfall NOT a 'bar' category
etpinard 412bf9d
revamp waterfall marker style logic
etpinard a55777f
:hocho: [un]selected style container for waterfall (for now)
etpinard dee39dc
do not show hover label when size===0
etpinard a138ebd
adapt waterfall legend to new *marker* styles ...
etpinard 7019a12
fixup (from :hocho: 'bar' category commit)
etpinard 8bbc863
fixup waterfall mocks and baselines
etpinard b6fdaed
fixup mock list
etpinard cb8f1ec
adapt failing waterfall jasmine tests
archmoj 1447b40
fixup waterfall bar path query
etpinard 4eb5daf
add a flaky flag for one test
archmoj f3a071e
waterfall marker description - set default to between mode - added sp…
archmoj 1721ab7
fix waterfall connectors - not to draw lines between null amounts - u…
archmoj 7655664
Merge remote-tracking branch 'origin/master' into waterfall-new-trace
archmoj 1d275f5
set a noCI flag for the select test
archmoj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright 2012-2019, Plotly, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = require('../src/traces/waterfall'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ module.exports = function style(s, gd) { | |
.enter().append('g') | ||
.classed('legendpoints', true); | ||
}) | ||
.each(styleWaterfalls) | ||
.each(styleBars) | ||
.each(styleBoxes) | ||
.each(stylePies) | ||
|
@@ -241,8 +242,49 @@ module.exports = function style(s, gd) { | |
txt.selectAll('text').call(Drawing.textPointStyle, tMod, gd); | ||
} | ||
|
||
function styleWaterfalls(d) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
var trace = d[0].trace; | ||
if(trace.type !== 'waterfall') return d; | ||
|
||
var barpath = d3.select(this).select('g.legendpoints') | ||
.selectAll('path.legendbar') | ||
.data(Registry.traceIs(trace, 'bar') ? [d, d, d] : []); | ||
barpath.enter().append('path').classed('legendbar', true) | ||
.attr('d', function(_, i) { | ||
return ( | ||
(i === 0) ? 'M-6,-6V6H0Z' : | ||
(i === 1) ? 'M6,6V-6H0Z' : 'M6,6H0L-6,-6H-0Z' | ||
); | ||
}) | ||
.attr('transform', 'translate(20,0)'); | ||
barpath.exit().remove(); | ||
|
||
barpath.each(function(d, i) { | ||
|
||
var container = trace.marker || trace[ | ||
(i % 3 === 0) ? 'increasing' : | ||
(i % 3 === 1) ? 'decreasing' : 'totals' | ||
]; | ||
|
||
var line = container.line || {}; | ||
|
||
var p = d3.select(this); | ||
var d0 = d[0]; | ||
var w = (d0.mlw + 1 || line.width + 1) - 1; | ||
|
||
p.style('stroke-width', w + 'px') | ||
.call(Color.fill, container.color); | ||
|
||
if(w) { | ||
p.call(Color.stroke, container.color); | ||
} | ||
}); | ||
} | ||
|
||
function styleBars(d) { | ||
var trace = d[0].trace; | ||
if(trace.type === 'waterfall') return d; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this line? In other words, why is |
||
|
||
var marker = trace.marker || {}; | ||
var markerLine = marker.line || {}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This thing doesn't do any drawing now. Can we move that to
waterfall/calc.js
?