-
Notifications
You must be signed in to change notification settings - Fork 77
Conversation
38745e9
to
7e45ee6
Compare
Codecov Report
@@ Coverage Diff @@
## master #148 +/- ##
=========================================
+ Coverage 19.87% 25.9% +6.02%
=========================================
Files 8 8
Lines 161 166 +5
Branches 10 10
=========================================
+ Hits 32 43 +11
+ Misses 128 122 -6
Partials 1 1
Continue to review full report at Codecov.
|
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 LGTM. I agree about disabling custom bounds for expanded (0-100%) area charts, and I also agree with using the domain for stream area charts 👍
chart.style() === 'stream' | ||
) { | ||
// Because there are custom bounds, we need to override them back to the domain of the | ||
// chart since this is a stream area chart |
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.
domain of the data
?
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.
Done.
applyYAxisBounds(); | ||
|
||
// Also reapply on each state change to account for enabled/disabled series | ||
chart.dispatch.on('stateChange.applyYAxisBounds', () => { |
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.
can we remove the extra arrow func here?
chart.dispatch.on('stateChange.applyYAxisBounds', applyYAxisBounds)
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.
good catch, done!
7e45ee6
to
addb096
Compare
addb096
to
39e8a2e
Compare
tests added too |
🔥 |
🐛 Bug Fix
Further fixes to the custom y axis bounds for nvd3 charts. We were only respecting custom y axis bounds if they were both set; this allows the user to only set 1 custom y axis bound. The other one will be automatically calculated based on what type of chart this is and what the max/min data values are.
Note that this also special cases expanded area and stream area charts from having custom y axis bounds. These charts don't make much sense without the default bounds, so I've disabled them.
Screenshots:
bounds 0 - 3 billion
bounds 1 billion - null
ignore custom bounds
bar charts without bounds still work
reviewers: @khtruong @kristw @williaster @graceguo-supercat