Fork me on GitHub
#off-topic
<
2021-04-20
>
noisesmith19:04:44

is there an good diagramming tool format that's both understood by an intuitive graph editor GUI and easy to parse into a graph in code?

noisesmith19:04:10

dia and yed look promising, but I'm not finding the resources for my particular use case in either

noisesmith19:04:49

maybe I can bite the bullet and use yed's graphml

andy.fingerhut19:04:04

Graphviz is good for generating text by hand, or from a program, to describe a graph with optional node and edge labels, and control a lot about its presentation. I don't recall if there is a good way to turn that into something that you can further easily edit by hand with a GUI program, unless you just want to "paint on top of it"

noisesmith19:04:15

right, I want a graph I can walk or even edit and re-export

noisesmith19:04:44

right now I'm messing with clojure.xml and graphml export, it's got some ugliness but looks like it will work

noisesmith19:04:58

but if there's something simple I'd love to hear about it

noisesmith19:04:57

concretely, I have a DSL for a design task where using a graph editor would be intuitive and save me a bunch of work

noisesmith19:04:11

so I want to be able to load up a graph from the gui into clojure

andy.fingerhut19:04:42

I half recall that there might be some output format that Graphviz can produce that can be read and edited in a GUI program, perhaps xfig?

andy.fingerhut20:04:54

Yeah, if you do dot -Tfig foo.dot > foo.fig, that foo.fig file can be read and edited via xfig. I haven't used this much, but it is possible.

andy.fingerhut20:04:42

The resulting file is a text file in xfig-specific format, and not designed to be restricted to graph data structures, nor to be able to extract the graph structure from it. It is a visual rectangle/line/text-with-positions kind of file format.

noisesmith20:04:17

yeah - I figured out how to get vanilla clojure data out of the graphml, and the lowest effort way to get precisely what I need is going to be editing in yed, and loading into clojure via data.xml - thanks

andy.fingerhut20:04:37

I haven't seen yed before. Looks interesting. Looking at web site I would guess it is commercial product that costs money to buy a license? Not obvious from a couple of mins of browsing their site, to me.

lilactown20:04:03

how fun/horrible would it be to use a macro that took in an ASCII graph diagram and emitted code

lilactown20:04:40

(not for your specifically noisesmith just in general)

noisesmith20:04:14

haha - ascii art image recognition sounds like a fun toy task

noisesmith20:04:31

the rules are definitely simpler than they would be for photos...

noisesmith20:04:04

doesn't emacs have something like this in its stdlib?

noisesmith20:04:31

but I wanted intuitive so that's emacs ruled out 👿

lilactown20:04:53

Emacs has an ASCII diagram editor I've used in org mode yeah

dpsutton20:04:11

racket has 2d control flow like this

dpsutton20:04:45

(define (same? a b)
  #2dcond
  ╔═════════════╦═══════════════════════╦═════════════╗
  ║             ║       (pair? a)       ║ (number? a) ║
  ╠═════════════╬═══════════════════════╬═════════════╣
  ║ (pair? b)   ║ (and (same? (car a)   ║     #f      ║
  ║             ║             (car b))  ║             ║
  ║             ║      (same? (cdr a)   ║             ║
  ║             ║             (cdr b))) ║             ║
  ╠═════════════╬═══════════════════════╬═════════════╣
  ║ (number? b) ║          #f           ║   (= a b)   ║
  ╚═════════════╩═══════════════════════╩═════════════╝)

🤯 10
dpsutton21:04:39

yeah. can't imagine what it's like to actually use it in real life but it is quite a beautiful proof of concept

dpsutton21:04:00

I won't flood with more examples but this is quite pretty

(define (subtype? a b)
  #2dmatch
  ╔══════════╦══════════╦═══════╦══════════╗
  ║   a  b   ║ 'Integer ║ 'Real ║ 'Complex ║
  ╠══════════╬══════════╩═══════╩══════════╣
  ║ 'Integer ║             #t              ║
  ╠══════════╬══════════╗                  ║
  ║ 'Real    ║          ║                  ║
  ╠══════════╣          ╚═══════╗          ║
  ║ 'Complex ║        #f        ║          ║
  ╚══════════╩══════════════════╩══════════╝)

👀 2
😍 2
lilactown21:04:13

I was thinking about this in the context of drawing a literal signal graph when using some reactive dataflow lib

dpsutton21:04:51

the BNF grammar is something else haha

Stuart21:04:53

Catastrophic Failure!

💥 6
raspasov22:04:33

What does everybody use for usage analytics in your CLJS + React / ReactNative app? Generally familiar with the standard stuff like Mixpanel, Google Analytics, etc. Generally ok with any good tool: free, paid, open source, closed source, et al. Looking for creative ideas.

Daniel Tan01:04:15

mixpanel is ok

👍 3