Fork me on GitHub
#clerk
<
2024-07-04
>
Drew Verlee04:07:11

Are their any minimal examples of weighted directed graphs in vega, vega-list or ploty someone can point to?

phronmophobic04:07:51

Have you considered clerk's mermaid.js integration?

phronmophobic04:07:18

it kinda depends on how you want to visualize them

Drew Verlee05:07:24

The mermaid view is fine, but i would rather the input be a triplet [start stop weight] then a text (e.g -->) . I figure out how to do this with ubergraph (see picture) but it leaves a bit to be desired. like i wish the {} was gone and the word weight isn't necessary. Not sure thats easily fixable. i would need to glance at the docs again...

Drew Verlee05:07:01

The mermaid ones look better for my usecase:

phronmophobic05:07:45

you can also try clj-graphviz, which uses clerk for documentation. although, I’m not sure I’m totally happy with how I wrote it. It’s sometimes clunky to succinctly control how code is visualized along with output. https://phronmophobic.github.io/clj-graphviz/

👀 1
Drew Verlee05:07:50

i'm fine with clunky + easy. would using clj-graphviz require a call to clerk/with-viewer {:transform-fn ... :render-fn ...} ?

phronmophobic05:07:49

It’s been a while, but as long as you don’t care about showing the code that produced the image, you should be able to just use a helper function that returns an image.

👍 1
phronmophobic05:07:21

my implementation was a bit clunky because I cared about how the code and the output looked

jackrusher05:07:34

This notebook has (at the very bottom) an example of something like what you’re trying to do https://github.com/nextjournal/clerk-demo/blob/main/notebooks/semantic.clj

Drew Verlee06:07:02

Thanks a ton!! I'll look first thing in the morning.