-
Notifications
You must be signed in to change notification settings - Fork 21
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
[VisCanvas] Extract axes/grid rendering logic #1276
Comments
Decoupling grids from axes might not be a good idea: #1429 (comment) – it seems simpler to have one component for each axis (x/y) and to keep rendering the corresponding grid inside: <XAxis />
<YAxis /> // each with prop `showGrid` defaulting to `true`, and `showAxisLine` defaulting to `!showGrid`
<DefaultAxes /> // defaults to both `XAxis` and `YAxis` with grids visible and axis lines hidden, but configurable like `DefaultInteractions` |
Got a prototype working, but it uncovered an issue: with a declarative API, there's no easy way to "pre-allocate" space next to the canvas for the axes, and since the axes are rendered after the canvas (because of |
Closed in favour of #1276 |
I'd like to investigate the feasibility of switching to an API like this:
The idea is to make some of
VisCanvas
's props such asshowAxes
andAxisConfig.showGrid
obsolete. The goal is to make the API simpler, but also to remove a lot of internal rendering logic fromVisCanvas
. Toggling the axes, the grid, the plot title or the axis labels becomes a matter of rendering the corresponding components conditionally (or adding ternaries to some of the props), and those components can have their own dedicated documentation sections on the Storybook site.The main challenge is of course dealing with axis offsets.
The text was updated successfully, but these errors were encountered: