Fork me on GitHub
#membrane
<
2023-02-28
>
genekim05:02:21

@smith.adriane New version of membrane with skia/svg support works fantastic! So fantastic!!! Thank you for pushing out that release! Posting video and source code in a reply. 🙏🎉

genekim05:02:12

21m video on getting it working here! https://capture.dropbox.com/fQZtu2x6jA99D1YY Source to make the demo run here: https://github.com/realgenekim/simulator-couch-paint/blob/6d21e1966ae5b26523ed0e5d017c42ee94aac4b1/notebooks/s03_vega_graphs.clj#L194 AMAZING!!!! I think I’ll be able to make a new vega-lite graph for every frame, plotting the current turn in a different color. (Maybe — not sure how fast spinning up a new GraalJS instance is, which darkstar does for every vega>SVG transform. I’ll try that tonight or tomorow!)

genekim05:02:14

PS: About 42ms to convert vega-lite>SVG. I could generate each graph for each frame in a future ahead of time — pretty sure it will work great!!! 🎉

genekim05:02:04

Those are three different Vega-lite SVG graphs, by the way. So great!! 🎉 🎉 🎉

🔥 2
phronmophobic05:02:53

Very cool! Some sort of lazy loading should work well for that.

phronmophobic06:02:36

When the window stops responding to the close event and new windows no longer show up, that usually either means the main thread is blocked or that AWT has mucked with things (or both).

phronmophobic06:02:18

One trick you can try is to call (skia/run #(/ 1 0)) to try and throw an exception on the main thread and hopefully clean things up so you can get back to a normal state, but that only works sometimes depending on the issue.

genekim19:02:18

@smith.adriane having fun getting some Vega-lite graphs working — will have something to show off in next day or two. I think the SVG capability is quite a fantastic unlock — you mentioned wanting to use graphviz for force directed graph diagrams. It can emit SVG And there’s apparently even a version that runs entirely in, umm, Java and GraalJS… (??) https://github.com/nidi3/graphviz-java So no need to shell out to it.

phronmophobic19:02:36

Neat! Would love to hear experience reports if you give it a shot. I think what I really want is access to the underlying graph layout algorithms. Between, java, js, and the underlying c, there's a lot of layers to wade through. Last time I checked, I think that even the underlying c library was heavily oriented towards the dot DSL. I also seem to remember that the shapes, text, and fonts used by graphviz were deeply embedded, but maybe there's a way to manually feed in shapes. If I were to use graphviz, I would also heavily consider cutting out a few layers by using the underlying c library via https://github.com/phronmophobic/clong. My experience is that C libraries tend to be more data oriented than their Java wrappers!

phronmophobic19:02:53

Hmmm, seems that I haven't actually tried this since the creation of clong.

phronmophobic19:02:10

Too many cool ideas to try!

genekim19:02:50

Calling into C. Amazing and also crazy!! (But probably quite routine for you, given the embedded browser and skia stuff you do all the time.) Apparently the Java library I mentioned calls into this library, which is graphviz compiled into WASM. https://github.com/mdaines/viz.js Which is equally (well, actually, even more) crazy! But I’m also in awe that all these possibilities are even doable!

genekim19:02:58

And you’re so right — the Java wrapper is opposite of data oriented.

phronmophobic20:02:50

C code is actually not too bad to work with compared to many Java and C++ libs. Wrapping a Java library is usually so much more painful than wrapping a c library.

genekim21:02:49

@smith.adriane I integrated the vega-lite/SVG into my membrane app! 1:15m movie here! https://capture.dropbox.com/Sc7RLLwuCzNym6KP (I compute the SVG each frame, which is dragging the frame rate down. But it was quickest route to get something running.)

🤯 6
phronmophobic21:02:08

That is so cool!