rawgraphs / rawgraphs-charts

A curated selection of charts provided through RAWGraphs interface
https://rawgraphs.io/
Apache License 2.0
93 stars 42 forks source link

add ticks option to axes #73

Closed mikima closed 2 years ago

mikima commented 3 years ago

We could expose the ticks value, see https://observablehq.com/@d3/axis-ticks

mikima commented 3 years ago

nice solution is to use

.tickValues(xScale.ticks(1).concat(xScale.domain()))

see https://stackoverflow.com/a/21767045/2871191

mikima commented 3 years ago

a possible solution is to add the ability to override the automatic settings and set manually the amount of ticks. There are few issues (below the video)

https://user-images.githubusercontent.com/907536/115743440-f91dd780-a391-11eb-85ae-23d985e7a0e5.mp4

Issues (@giorgiouboldi feedbacks are welcome):

giorgiouboldi commented 3 years ago

Very very nice. I understand that in some cases the input and the result are not clear but it's quite difficult to think a different way to do it. There is nothing made especially for dates so that you can select the unit (days,months,years,etc)?

mikima commented 3 years ago

no it's not possible (in a simple way) to define the unit for dates. It's possible to provide the array of values you want to show on the axis, but i think it would become too complex.

Does it make sense to put these options in an "Axes" group as in the video?