I’m looking to build a wasm library from just a few components at a time.
I’m looking to produce a very small subset of graphviz into a build.
probably something like Text → (cgraph) → gvc → (dot) → (json/svg)
I was able to build a very small subset but there seems to be a large/complex system of dynamic plugin loading. I see that this is handled very dynamically and I’m ok with setting up the static context.
my plan is to first get a minimal version of dot working using GCC (hopefully i can use just the c code) and then switch over to emcc to produce a wasm file. I would like these to be minimal.
The build setups do seem pretty complicated. so i thought i’d start here with the communication.
I was able to produce a version that would (seemingly) produce the dot layout. but i couldn’t get any of the rendering plugins working. they are all setup as dynamic, which makes the thing pretty difficult to figure out.
even using
gvconfig_plugin_install_builtins() didn’t seem to have much a positive affect.
Yeah I found this. And it does have some of the missing information inside of it (how to setup lt_preloaded_symbols ). There are still some mysteries. There are a lot of code folders that do not explicitly say what the component actually does. I had a subset built that would do the layout, but for some reason, it didn’t handle the text widths properly. I figure there is an optional componet that i didn’t include or a preprocessor macro that is set incorrectly. The builds look like they can be pretty complicated and its hard to figure out which options to enable for a particular situation.
Yes, the Graphviz build is unfortunately pretty complicated. There are three independent build systems (Autotools, CMake, MS Build), of which Autotools is the most complete. The directory ci/ in the repository contains details of how automated testing builds Graphviz which may be helpful.
Something that may be relevant is that the most accurate SVG rendering is usually using the Cairo backend (-Tsvg:cairo). This delegates all font stuff and text rendering to Cairo. I am unsure if/how Cairo is available in a JS/WASM environment.