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

[VisCanvas] axes and grid props #1469

Open
axelboc opened this issue Aug 10, 2023 · 0 comments
Open

[VisCanvas] axes and grid props #1469

axelboc opened this issue Aug 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@axelboc
Copy link
Contributor

axelboc commented Aug 10, 2023

Since extracting the logic out of VisCanvas does not seem practical (cf. #1276), here is an API proposal to at least:

  • separate out the cosmetic options from abscissaConfig and ordinateConfig (i.e. showGrid and label);
  • allow more control and extensibility than showAxes.
<VisCanvas /> // no axes, no grid
<VisCanvas axes grid /> // left/bottom axes + vertical/horizontal grid
<VisCanvas axes={{ left: true } }} grid={{ horizontal: true }} /> // left axis + horizontal grid
<VisCanvas axes={{ left: "Energy" } }} /> // left axis with label
<VisCanvas axes={{ left: { label: "Energy" } } }} /> // same but via options object for future extensibility (e.g. `showAxisLine: false`)

// and in the future, perhaps:
<VisCanvas axes={{ top: true }} />
<VisCanvas axes={{ left: true, right: true }} /> // with the same ticks and tick labels (since they'd be sharing the same ordinate scale)

I considered an opt-out API instead, where the left/bottom axes and the grid would be rendered by default and would have to be turned off, but it felt too cumbersome. I prefer an opt-in API with concise prop names and convenient shorthands.

@axelboc axelboc added the enhancement New feature or request label Aug 10, 2023
@axelboc axelboc added this to the v9 milestone Aug 10, 2023
@axelboc axelboc removed this from the v9 milestone Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant