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

Migrate to react-charts #28

Merged
merged 27 commits into from
Jan 7, 2022
Merged

Migrate to react-charts #28

merged 27 commits into from
Jan 7, 2022

Conversation

bmaupin
Copy link
Owner

@bmaupin bmaupin commented Jan 7, 2022

This offers a number of advantages:

  • It's maintained so we should be able to upgrade to React 17 (Upgrade to React 17 #23)
  • It has a nicer proximity hover (with react-vis we had to hover over every single point
  • It resizes more quickly than react-vis
  • The tooltip hover styling is a little bit nicer

The downside is that it has most features enabled out-of-the box so they need to be opted out (react-vis was opt-in) which ends up being more code in the end 🤷‍♂️

bmaupin added 27 commits January 5, 2022 13:10
react-vis hasn't been maintained for a long time and react-charts seems like the most promising react charts library ...
... to match the style of the old chart
Null values were still showing, sometimes on top of other series points and sometimes underneath. When showing underneath another point there was a small outline artifact
By default, each series point/datum circle 'moves' into place
This is nicer anyway since it moves all of the related x-axis code together inside the primaryAxis function
... and rename SeriesPointWithHint to something shorter but still just as descriptive :)
- Add right Y axis
- Remove redundancy in generateLeftYAxisLabels/generateRightYAxisLabels
- Update generateLeftYAxisLabels/generateRightYAxisLabels to filter out zero values
- Fix sort for generateRightYAxisLabels
- When a series is focused, make the focused series' line and circles slightly thicker
- When a series is focused, make the other series' line and circles more transparent
- When no series is focused, return all series to normal formatting
The default is to show all data for the selected x-axis value
Unfortunately it still shows zero values and the order seems to be set based on the first value
Also rename hintTitle and hintValue for more clarity and clean up some more react-vis code
This fixes the following React warning:

> Warning: Cannot update a component (`Chart`) while rendering a different component (`TooltipRenderer`).
This fixes the following React warning:

> Warning: Cannot update a component (`Chart`) while rendering a different component (`Line`)
- Add more spacing to top of button group since initially it's too small for the bottom button group (although annoyingly it changes when the window's resized; this still needs to be dealt with)
- Limit the chart width to 800px and make sure it's always centered using flex
- Move button-group-grid CSS to ButtonGroup.css
- Remove remaining react-vis code
- Uninstall react-vis
This also lets us remove the explicit min/max 😁
@bmaupin bmaupin merged commit 78a51dd into main Jan 7, 2022
@bmaupin bmaupin deleted the migrate-to-react-charts branch January 7, 2022 18:24
bmaupin added a commit that referenced this pull request Mar 15, 2023
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.

1 participant