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
What if scales were immutable, and all methods that currently mutate scales instead returned new scales? It would eliminate the need for scale.copy, simplify the logic in d3-axis, and generally make scales easier to understand.
It would require a change to the implicit domain behavior of ordinal scales: these scales mutate on use! It’s not too onerous to require you to initialize the scale’s domain, however, and that is already a strongly recommended pattern for deterministic behavior and generating keys.
The text was updated successfully, but these errors were encountered:
I'm working on a charting "library" and was finding that immutable scales are pretty much a necessity to keep my sanity. Especially as I implement zooming which has to muck with the domain.
Have you thought about this further?
The other thing that I am thinking about is that the tick marks should probably also be separated. As is, you can't "wrap" a scale because if the original scales domain is not updates the tick marks are not generated appropriately. The log and linear tick marks would probably be roughly the same if separated. Have a tick mark generator and pass it a scale, and it can work it's magic.
What if scales were immutable, and all methods that currently mutate scales instead returned new scales? It would eliminate the need for scale.copy, simplify the logic in d3-axis, and generally make scales easier to understand.
It would require a change to the implicit domain behavior of ordinal scales: these scales mutate on use! It’s not too onerous to require you to initialize the scale’s domain, however, and that is already a strongly recommended pattern for deterministic behavior and generating keys.
The text was updated successfully, but these errors were encountered: