I'm not (yet) sure what these do. (I can see why we might need them, but if so, we wouldn't want to hard code specific numbers, would we?) And do we need parallel xInteractionBounds?
Can we simplify this so that rather than the coder having to remember the index number of the lines they're looking for, that we use the line's label to reference the relevant lines?
We should be able to put all of these color definitions into a simpler array -- just one object instead of many.
It would also be amazing if we can have the code read the name of each curve, and then apply the relevant color automagically (if that color exists).
- colors are now in one object
- Now, a line with label 'Demand' will default to blue. Same with supply. If a color is not given and the label is not mapped to a default color, it will be black.
We will want to fool around with this a bit. At the moment, the margins are too wide, and so we're leaving too much white space. I was thinking about hard coding pixel numbers here, and then it occurred to me that the optimal sizing and margins probably vary quite a bit. We don't want the margins getting too small when the width is small (hence there should be an absolute minimum), but we want more white space when we can get it (hence it should scale with width at some point).
Hey, I managed to get the drag to work! The short answer is that you want to use the "dx" and "dy" variables. The longer answer is that in so doing, I created something ugly, and I'm sure there's an easier way. (I'll leave that to you!)
Should we add some background highlighting when the user picks up a graph? Something like 50% extra width at 50% transparency? Or perhaps something even brighter?
Let’s add something that looks like a highlighter glowing around the item you’ve picked up. I just want to make it feel super obvious that “this is the curve you’re moving”
1. Can we make it so that these titles and subtitles can also use html/in-line CSS? eg "<b>This is a bold title</b>"?
2. Can we also add a third "Description" field that is below the subtitle? This would be so that we could show the extended labelling of A, B, C, etc seen in most graphs (such as 14-6)?
I've learned that the current code won't place default ticks if we don't explicitly add tickValues and tickFormat. Can we fix this, so that adding custom ticks is an option, rather than a necessity?