-
Notifications
You must be signed in to change notification settings - Fork 185
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
Zoom bar #649
Zoom bar #649
Conversation
converting this PR into a draft |
d4ed056
to
cd96b2b
Compare
Looking great :hlyang397 💯 |
6774132
to
3863d79
Compare
@theiliad Thanks for your review. |
question, do we have a way of setting the range of the zoomed area through options? e.g. if you were rendering a graph with many points and wanted it initially to zoom into an area and only show 10-20 points? |
Thanks for your review comment.
Are you talking about the dragging event on the graph ? We didn't implement it yet.
We will include these features in next phase.
The handle height is overwritten by d3.js brush library. I would put this as low priority before I can find the solution. For rest problems, I have created issues in our tool. |
12f4fc4
to
a37a6c4
Compare
@theiliad, There are some issues still in progress, and may need more discussion.
All comments are welcome, thanks. |
would something like: react.overlay:hover {
pointer-events: none;
} work? we've gotta find a way to show tooltips on hover
|
So the singular tooltip works now but not the multiline tooltip. I think we might have to get rid of the brush overlay and release events such as |
Could you give me an example of multiline tooltip? Thanks. |
https://carbon-design-system.github.io/carbon-charts/?path=/story/line--line-time-series |
* feat: initial zoom bar implementation from PR 511 * fix: update ZoomBar to match new data format - fix trailing-comma - update scales-cartesian.getValueFromScale() - update line time-series 15 seconds demo data * feat: use d3-brush to implement selection * fix: add left margin to align to chart - using .scss to set fill and stroke color * feat: set brush selection to zoomDomain in Model - use flag to avoid recursive update event * feat: create ZoomBarOptions and default configuration - default to disable zoombar * feat: create zoombar story in storybook * fix: set tslint trailing-comma to never * fix: allow zoomDomain to update for every brush event * feat: provide ZoomBar options for brush event callback - selected x range and domain as callback parameters * feat: apply clipPath to line chart - v1 * feat: apply cover to axis chart * refactor: clean code * feat: set axes margins as zoom bar left margin * refactor: add todo * fix: double the minTickSize for datetime ticks * feat: add chart brush * refactor: add brush in axis chart component * refactor: move brush functions to ZoomBar class function * fix: handel situation of zoom bar selection[0] equals selection[1] * feat: ZoomBar could update brush based on zoomDomain - fix some brush handle UI bugs * fix: handle empty selection * fix: set to default full range when same selection of brush * fix: fix bug when selection === null * feat: add ZoomBarOptions.initZoomDomain - update storybook - add init() and destroy() in ZoomBar * feat: create Zoombar storybook demo group * fix: apply cover to stacked bar * feat: create ZoomBar event and handler - use Events.ZoomBar.UPDATE to handle axesMargins update * fix: fix merge error - move ZoomBarOptions from BaseChartOptions to AxisChartOptions * feat: update color for non-highlighted areas - remove zoombar graph line - add zoombar unselected graph area with clip - add zoombar baseline - clear d3.brush selection style * fix: avoid extra brush handle update * fix: fix the brush handle style * refactor: remove unnecessary svg.brush-container * fix: move brush layer to back to allow tooltips in graph * feat: add stacked-area chart with zoom bar in storybook * refactor: delete unused axis-zoom service * feat: allow addSpaceOnEdges to work with zoom bar - extends domain in zoom bar and brush * refactor: code refactoring - reduce code differences from master branch * fix: display multiline tooltip with zoom bar - use ruler backdrop as brush area - svg.chart-grid-backdrop * feat: create ZoomBarOptions and default configuration - default to disable zoombar * fix: chart brush with correct range * fix: remove graph out of zoom domain * refactor: code refactoring - create getZoomBarData(), getDefaultZoomBarDomain() in model - remove unused code * fix: set min selection difference threshold * refactor: code refactoring - zoom-bar.scss - remove unused scss settings * fix: avoid extra/duplicate external callback * fix: remove ZoomBarOptions in BaseChartOptions * refactor: change initZoomDomain to initialZoomDomain - remove unnecessary undefined setting * refactor: use Tools.getProperty to load zoomBarOptions * refactor: update code format * refactor: use Tools.getProperty to get initialZoomDomain * refactor: Change Cover to ChartClip * refactor: Change Brush to ChartBrush * refactor: set model.set() function default config * fix: remove unnecessary selector * refactor: create reusable getMainXScaleType() * refactor: make sure zoom bar only shows with supported options - zoomBar is available when -- zoomBar is enabled -- main X axis position is bottom -- main X axis scale type is time * refactor: set clip-path url in containerSVG * refactor: dispatch zoombar selection events instead of callback * feat: update chart brush selection storke to dash * feat: show tooltip when mouseover zoombar handle * fix: avoid tick rotation flip during zoom domain changing - always rotate ticks during zoom domain changing * fix: move chart brush selection above all graphs * fix: use another svg to display front selection * fix: set cursor for front selection * fix: use unique chartClipId for each chart * fix: keep zoom bar handle inside zoom bar range * fix: use DOMUtils.appendOrSelect in case the element does not exist yet * feat: allow user to set zoom bar data * fix: definedZoomBarData needs at least two elements * fix: axis needs to set opacity if not loading * fix: format zoom bar handle tooltip * fix: don't set brush handle tooltip if domain is undefined * fix: filter out invalid domain value to avoid exception * feat: initial zoom bar implementation from PR 511 * fix: update ZoomBar to match new data format - fix trailing-comma - update scales-cartesian.getValueFromScale() - update line time-series 15 seconds demo data * feat: use d3-brush to implement selection * fix: add left margin to align to chart - using .scss to set fill and stroke color * feat: set brush selection to zoomDomain in Model - use flag to avoid recursive update event * feat: create ZoomBarOptions and default configuration - default to disable zoombar * feat: create zoombar story in storybook * fix: set tslint trailing-comma to never * fix: allow zoomDomain to update for every brush event * feat: provide ZoomBar options for brush event callback - selected x range and domain as callback parameters * feat: apply clipPath to line chart - v1 * feat: apply cover to axis chart * refactor: clean code * feat: set axes margins as zoom bar left margin * refactor: add todo * fix: double the minTickSize for datetime ticks * feat: add chart brush * refactor: add brush in axis chart component * refactor: move brush functions to ZoomBar class function * fix: handel situation of zoom bar selection[0] equals selection[1] * feat: ZoomBar could update brush based on zoomDomain - fix some brush handle UI bugs * fix: handle empty selection * fix: set to default full range when same selection of brush * fix: fix bug when selection === null * feat: add ZoomBarOptions.initZoomDomain - update storybook - add init() and destroy() in ZoomBar * feat: create Zoombar storybook demo group * fix: apply cover to stacked bar * feat: create ZoomBar event and handler - use Events.ZoomBar.UPDATE to handle axesMargins update * fix: fix merge error - move ZoomBarOptions from BaseChartOptions to AxisChartOptions * feat: update color for non-highlighted areas - remove zoombar graph line - add zoombar unselected graph area with clip - add zoombar baseline - clear d3.brush selection style * fix: avoid extra brush handle update * fix: fix the brush handle style * refactor: remove unnecessary svg.brush-container * fix: move brush layer to back to allow tooltips in graph * feat: add stacked-area chart with zoom bar in storybook * refactor: delete unused axis-zoom service * feat: allow addSpaceOnEdges to work with zoom bar - extends domain in zoom bar and brush * refactor: code refactoring - reduce code differences from master branch * fix: display multiline tooltip with zoom bar - use ruler backdrop as brush area - svg.chart-grid-backdrop * feat: create ZoomBarOptions and default configuration - default to disable zoombar * fix: chart brush with correct range * fix: remove graph out of zoom domain * refactor: code refactoring - create getZoomBarData(), getDefaultZoomBarDomain() in model - remove unused code * fix: set min selection difference threshold * refactor: code refactoring - zoom-bar.scss - remove unused scss settings * fix: avoid extra/duplicate external callback * fix: remove ZoomBarOptions in BaseChartOptions * refactor: change initZoomDomain to initialZoomDomain - remove unnecessary undefined setting * refactor: use Tools.getProperty to load zoomBarOptions * refactor: update code format * refactor: use Tools.getProperty to get initialZoomDomain * refactor: Change Cover to ChartClip * refactor: Change Brush to ChartBrush * refactor: set model.set() function default config * fix: remove unnecessary selector * refactor: create reusable getMainXScaleType() * refactor: make sure zoom bar only shows with supported options - zoomBar is available when -- zoomBar is enabled -- main X axis position is bottom -- main X axis scale type is time * refactor: set clip-path url in containerSVG * refactor: dispatch zoombar selection events instead of callback * feat: update chart brush selection storke to dash * feat: show tooltip when mouseover zoombar handle * fix: avoid tick rotation flip during zoom domain changing - always rotate ticks during zoom domain changing * fix: move chart brush selection above all graphs * fix: use another svg to display front selection * fix: set cursor for front selection * fix: use unique chartClipId for each chart * fix: keep zoom bar handle inside zoom bar range * fix: use DOMUtils.appendOrSelect in case the element does not exist yet * feat: allow user to set zoom bar data * fix: definedZoomBarData needs at least two elements * fix: axis needs to set opacity if not loading * fix: format zoom bar handle tooltip * fix: don't set brush handle tooltip if domain is undefined * fix: filter out invalid domain value to avoid exception * fix: never out of zoom domain if only one bar in chart * fix: don't set zoomDomain to invalid value * refactor code * format * feat: add zoom bar skeleton and demo * update zoom bar option APIs * bugfix for tooltips * add ChartClip to charts only when zoombar is enabled * format * update interfaces * fix zoombar background width issue Co-authored-by: Jennifer Chao <[email protected]> Co-authored-by: Jennifer Chao <[email protected]> Co-authored-by: Eliad Moosavi <[email protected]>
Updates
For #380
#698
Demo screenshot or recording
Review checklist (for reviewers only)