Open Fil opened 1 year ago
Another feature would be to allow the user to specify values that must be in the domain; for example when you don't know exactly what the values will be in your dataset, but you absolutely want the domain to include [0, 10] — maybe just to create a scale that doesn't show “0, 0.5, 1, 1.5, 2.0” as ticks (related: #355 #1268).
This suggestion seems related to your 2nd comment. But just to be sure we mean the same thing:
It would be useful if I could specify values that must be included on each axis, but the axis-ranges won't change unless necessary. For example:
Plot.plot({ x: { include: [10, 30] },
y: { include: [-1000, +1000] }, ... });
If the data has x-values between 5 and 40, then the x-range won't change. But if the data only has x-values between 15 and 20, then the x-axis will be expanded to the desired range between 10 and 30. Similar for the y-range.
Possibilities:
min and max is more straightforward, but we'd have to decide what happens when people specify both a min and an explicit domain (a warning maybe?).
domain as a function opens lots of other possibilities (like custom “nicing”), which might be a pro or a con.