sam-silv / histoslider

:bar_chart: A D3 based histogram slider component for React.
http://samhogg.github.io/histoslider/
MIT License
30 stars 28 forks source link

Allow to pass in a function to format the label #105

Closed martinfrancois closed 4 years ago

martinfrancois commented 4 years ago

In our project, we want to use a histogram slider with dates. Unfortunately, as d3-format doesn't support date and time, we would need to define a custom way of rendering the labels. This PR will allow to pass in a function as formatLabelFunction which will be used instead of d3Format(...) if one is passed in. I would be open to any kinds of changes, thanks!

sam-silv commented 4 years ago

Thanks for the contribution! Just one nit then happy to merge and republish

martinfrancois commented 4 years ago

You're welcome, thanks a lot for the quick response! 👍