3 ms·
Hey everyone! I stumbled into a syntax for flowcharts and other data/graphs that I think is pretty interesting. I'd love to get peoples feedback on what works/d
by tonerow 4y ago
Hey everyone! I stumbled into a syntax for flowcharts and other data/graphs that I think is pretty interesting. I'd love to get peoples feedback on what works/doesn't work and ways to improve it. Thanks!
- masukomi 4y agoinitial thoughts: - if indentation is significant, then save yourself headaches and require either tabs or spaces. Don't allow both. - not sure why i'd want to use this instead of plantuml which can do this, plus so much more.
- anoncept 4y agoThis looks like a really nice attempt to improve the comfort and capability of styling drawings of small graphs that I’m excited to explore; thanks for building and sharing it!
- catapart 4y agoI've been approaching a similar problem, recently, in trying to represent my javascript node-graph elements as plain text. Very different output and use case, but I settled on the same kind of "psuedo-selector" idea that you seem to have. Hash to tag id's, wrappers to allow for complex content, and I even went as far as to use query string format to allow for dynamic event raising (when a node is hit, I can trigger an event with a key and value pair). I can show a video of it, if it's of interest, but I don't think there's much I can help recommend. This comment is just to say that I like what you're doing and have found myself in a similar situation so I'll be very eager to hear what the community has to say about your project!
- tonerow 4y agoThat sounds really cool! When you say query string, am I right in thinking of URL search params? i.e., "?trigger=event1" kind of thing?
- catapart 4y agoYes, exactly! For example `(myVar=myVal&key=value)` I use a runtime list of regex to parse the text into tokens, so it's completely dynamic but my current project I have a need to "condition" the nodes (only show up if certain conditions are true) and also to set values upon node actions (in this case, "selecting" a node can set values; i.e. `<myVar="a weirdly formatted new value"&key=newKey>`, or whatever). As far as I can tell, allowing the library that will generate compile-time/runtime objects from the nodes to receive those types of key-value pairs can allow for whatever text-substitution, state-setting, or event triggers a consuming app would need. Very interested if you can think of some outlier functionality that I'm missing, though!
- tonerow 4y agoIt definitely seems like your use-case is more complex than just rendering the diagrams. I think that is very cool. I'd love to see the video if you want to share it (my email is on my hn profile)
- catapart 4y agoOh for sure! I'm actually using the parsing to generate a branching dialog markup syntax, so it's keeping track of things like if you've already chosen an option, or if your character has the stats to even show an option to you. The intention, though, was the make the variable assignment general-purpose enough for whatever node data needed to be stored. So, in my case, I'll be storing things like "x" and "y" positions, so that the nodes can be restored to their absolute position on the graph. As for the video, please feel free to ask any questions; I'm sorry about it being kind of slow and incomplete. This was recorded to showcase how the tokenization is dynamic: https://streamja.com/JKPkJ https://streamja.com/JKPkJ