You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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<VisCanvasaxesgrid/>// left/bottom axes + vertical/horizontal grid<VisCanvasaxes={{left: true}}}grid={{horizontal: true}}/>// left axis + horizontal grid<VisCanvasaxes={{left: "Energy"}}}/>// left axis with label<VisCanvasaxes={{left: {label: "Energy"}}}}/> // same but via options object for future extensibility (e.g. `showAxisLine: false`)
// and in the future, perhaps:
<VisCanvasaxes={{top: true}}/><VisCanvasaxes={{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.
The text was updated successfully, but these errors were encountered:
Since extracting the logic out of
VisCanvas
does not seem practical (cf. #1276), here is an API proposal to at least:abscissaConfig
andordinateConfig
(i.e.showGrid
andlabel
);showAxes
.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.
The text was updated successfully, but these errors were encountered: