Skip to content
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 78 commits into from
Mar 28, 2019
Merged

Waterfall charts #3531

merged 78 commits into from
Mar 28, 2019

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Feb 10, 2019

Fixes #3037.
A prototype for waterfall new trace type mainly based on bar.

TODO:

  • add a selection test
  • Why aren't arrayOk offset and width working?
  • add total color container an keep marker similar to bars
  • implement waterfallmode, waterfallgap and waterfallgroupgap
  • fixup cliponaxis:false support
  • fixup lasso/select

codepen
waterfall_profit-loss_2018_positive-negative

src/traces/bar/calc.js Outdated Show resolved Hide resolved
src/traces/bar/calc.js Outdated Show resolved Hide resolved

width: barAttrs.width,

marker: extendFlat({}, barAttrs.marker, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have two marker containers for waterfall traces: one for increasing bars and one for decreasing bars, similar to how ohlc and candlestick do it.

increasing: directionAttrs(INCREASING_COLOR),
decreasing: directionAttrs(DECREASING_COLOR),

@etpinard
Copy link
Contributor

@archmoj can you point me the "real" waterfall mocks you added? I see that you remade all the bar mocks with waterfall traces. That's cool, but not 100% helpful as some bar attributes won't apply to waterfall traces (e.g. as mentioned in #3531 (comment))

Similarly, copying the entire bar_test.js suite and switching traces to type: 'waterfall' is an overkill. We don't have to test "all" the Bar logic that we're reusing to render waterfall traces.

@archmoj
Copy link
Contributor Author

archmoj commented Feb 11, 2019

@archmoj can you point me the "real" waterfall mocks you added?

Most of them start with waterfall_profit-loss_. Thanks.

archmoj and others added 8 commits March 27, 2019 12:22
- this was causing more issues than it solved.
- use (increasing|decreasing|totals).marker containers
- use calcdata[i][j].dir (like ohlc/candlestick) to determine cont
- 🔪 arraysToCalcdata, *.marker* attrs are editType:'style'
- adapt Bar.plot and Bar textPointStyle for waterfall use
- split out reusable Bar.hoverPoints logic for waterfall use
- bring some Bar methods back to `master`
@etpinard
Copy link
Contributor

Update: branch master...waterfall_tests-tmp has the latest (most bug-free) version of waterfall.

We're currently still testing a few things on that branch. We'll rebase those commits those tomorrow morning.

@archmoj
Copy link
Contributor Author

archmoj commented Mar 28, 2019

Update: branch master...waterfall_tests-tmp has the latest (most bug-free) version of waterfall.

We're currently still testing a few things on that branch. We'll rebase those commits those tomorrow morning.

@etpinard few more tests are added here: waterfall_tests-tmp...waterfall_more-tests

@etpinard
Copy link
Contributor

💃 💃 💃

Awesome work!

@archmoj archmoj merged commit 978303e into master Mar 28, 2019
@archmoj archmoj deleted the waterfall-new-trace branch March 28, 2019 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Waterfall trace type
4 participants