Rework stop markers/labels to be more manual #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Figuring out how to programmatically place stop markers and labels has been basically the #1 blocker for all eternity, because it's a really hard problem with a million edge cases that requires serious graphical design thinking. Making it more manual will require a bit of design work for new syntax, and it will put more work on map designers to place markers and labels, but a tool that's hard to use is better than one that doesn't work at all.
One thing that might be useful would be a way to specify an offset on a line. We could reuse the syntax used for defining routes:
point_a --(1) point_b.But that has the complication that it's ill-defined until after routes have been defined (since the width of a given offset depends on the routes along a given segment).
Also, what happens if the width of the given offset isn't the same at all points on the specified segment?
Probably the answer to both of those is to throw an error when it's poorly-defined.
Oh, but there isn't actually a way for the program to know when all the routes have been defined… Maybe we should make the "route definition" and "stop definition" sections explicit, and not allow defining routes/stops outside of their respective sections?
Or maybe just allow it everywhere, using the default
line_sepif necessary, and if the relevant widths change later, don't worry about it; the point stays at its initial definition.Not sure what the syntax should be. Some challenges:
Expressiontype can only resolve to a number, point, or line, so we can't just parse a list ofExpressionsA potential syntax:
So for example
Maybe I should add a string type. Maybe also write a
formatfunction while I'm at it…Oh boy, adding a string type is complicated because
Valueis currentlyCopy, so I'd need to either add a lifetime (to use borrowed&strs) or change everything that relies onCopyto insteadcloneit…Okay that wasn't too hard (#12). Now I can actually start working on something like the syntax I described above.
oh hmm, that
--(x)syntax would have to be special-cased into the parser. But I could maybe add a syntax for offsetting a line… something likea<>b ^^ 3oh but also binary operators as they currently work don't have access to the evaluation context (and therefore
line_sepand related info). Maybe it can just operate in real units. That at least makes it possible to put things at non-integer offsets etc.