FormidableLabs / victory

A collection of composable React components for building interactive data visualizations
http://commerce.nearform.com/open-source/victory/
Other
10.96k stars 526 forks source link

Multiple ticks that fall within a discontinuity #2781

Open carbonrobot opened 7 months ago

carbonrobot commented 7 months ago

Describe the bug

Console warning in docs site for Common Props. "There are multiple ticks that fall within a discontinuity, which has led to them being rendered on top of each other. Consider using scale.ticks to explicitly specify the ticks for the scale."

Burnett2k commented 7 months ago

I've been researching this for the past day and struggling to find a fix so far. It appears the issue is more that there's too many data points to fit in the chart rather than actually using it incorrectly. This can be observed by changing data to only include 3-4 days instead of 7-8.

At this point, I'm not sure how much time it's worth to continue digging into this warning. I can spend a few more hours on it today, but we might just need to remove or adapt the example if we really want to get rid of this warning.

carbonrobot commented 7 months ago

Could we change the scale on the demo?

Burnett2k commented 7 months ago

@carbonrobot I'm not sure how we could change the scale without eliminating the purpose of the demo. The demo is trying to provide an example of how to render a chart that ignores weekend data and to do that it seems we need to use a discontinuousScale. I think we could write our own implementation to do something similar, but it would get really complicated and would probably not make sense to provide in a demo.

Do you mind expanding on what we could change the scale to? I'm still struggling with some of these d3 concepts and not finding a path forward on this one. I actually don't see that there's a 'bug' here, really just a warning that could probably potentially be ignored.

I suppose an alternate route would be to post an issue / question with the d3 discontinuity package with this example to see what they suggest.