Maybe the core of gml4gtk can be manual translated into javascript to run it in the browser.

But there is already a working GNU GPL 3 free sugiyama layout lib
in documented  javascript in dgraph  https://github.com/speich/dGraph

And this is a local copy in dGraph-master.tar.gz

To run this javascript sugiyama layout in the browser is here this link which generates svg image data

Now add a parser and dfs() to put the nodes in vertical levels  and textarea in a window
and there is a web based small graph layout tool usable for at least small graph data.

Some graph basics in javascript are at this link
Also in this project https://github.com/trekhleb/javascript-algorithms

Here is a parser for graphviz xdot dot format with the node/edge coordinates it is here

The javascript source for GML and DOT graph parsers is her in dot-gml-js-parsers.tar.gz
Here is a dot grammar for use with javascript and peg.js
dgraph
The sfg.c layout library in gml4gtk can be compiled to javascript using emscripten
but a first test using wasm and clang is at this link  or here at single-file-graph-layout

The dagre-svg javascript uses dagre for layout in the browser at https://gitlab.com/andrewfulrich/dagre-svg
The editor demo of it is here in graph-editor or here in dagre-svg-index
The dagre-d3 lib has a api but part of it is documented at https://github.com/dagrejs/graphlib/wiki/API-Reference
This is  small javascript with html to create a graph drawing but without layout, see also google v8 here

Here are more free javascript barycenter algorithms and graph topic sources to study:

visualize regexp website with javascript https://github.com/joelonsql/reason-re-nfa     and https://compiler.org/reason-re-nfa/src/index.html

todo: vis.js uses emscripten to compile C dot source to java script and has the code and
infrastructure to draw the graph data in the browser, but sfg.c from gml4gtk can be used
instead of dot c source for the same task.

drawthe uses d3.js for graph layout and has good webpage at http://go.drawthe.net/

This is javascript to show dfs, bfs, dykstra path graph algorithms https://josephprichard.github.io/Pathfinder/
This is javascript which moves the mouse magically automatic on your screen is here
This is javascript to show fake page progress info before showing page is here
This is javascript to show a word clock here

This is javascript to do text rot13 but now more advanced rot8000 at rot8000

This is javascipr page to see the apollo rocket launch at ApolloXV-master/index.html

vanille javascript to learn is here at https://github.com/snipcart/learn-vanilla-js
javascript for science page is about javascript programming http://js4ds.org/#s:intro
javascript about using data structures algorithms is collected at https://github.com/trekhleb/javascript-algorithms

Here is a html page setup with javascript and fully documented https://html5boilerplate.com/

javascript and wasm modules at https://pascalpares.appspot.ovh/webassembly-for-javascript-developers/
transform javacript source into graph data at https://github.com/crubier/code-to-graph
example javascript doing 3d drawing and keyboard input from doersino github tixyz
example of the springy spring embedder in javascript here in springy
about javascript programming https://github.com/leonardomso/33-js-concepts
javascript graph algorithms https://dev.to/amejiarosario/graph-data-structures-for-beginners-5edn
drawing on html5 canvas html5canvasloading.html
snippets at https://www.30secondsofcode.org/
generate art with javascript drawing uji at uji-main
about adding sfg.c as node.js module https://medium.com/jspoint/a-simple-guide-to-load-c-c-code-into-node-js-javascript-applications-3fcccf54fd32
instead of mouse use webcam and hands or face tracking with application in js https://github.com/midiblocks/handsfree
Here is a dataflow editor with blog how it works and a demo https://github.com/joeltg/react-dataflow-editor
Explined in a blog at https://research.protocol.ai/blog/2021/designing-a-dataflow-editor-with-typescript-and-react/
ed

another type of layout are sequence diagrams, in javascript examples at https://bramp.github.io/js-sequence-diagrams/
seq
This is a prject explinig writing wasm by hand wit ocumented ecxample https://github.com/diekmann/wasm-fizzbuzz

Create svg drawings from ascii art with editor at https://ivanceras.github.io/svgbob-editor/
here is ablog about understanding json schema at https://json-schema.org/understanding-json-schema/index.html

https://www.reddit.com/r/javascript/comments/oo5b6k/askjs_how_can_i_structure_my_js_library/

I have a single class that i export with

export class ClassName {...}


<script type="module" src="https://example.com/path/to/your/script.js"></script>
<script type="module">
import { ClassName } from 'https://example.com/path/to/your/script.js' 
</script>



assemblyscript has online example how typescript is translated into wasm assembly at
https://www.assemblyscript.org/
collecction of javascript data structures and graph routines are at
https://github.com/TheAlgorithms/Javascript

Or all for java, javascript, python.C, C++, go here in this zipfile here in   thealgorithms.zip

freecodecamp has many short education articles, for example this about graph routines in javascript
https://www.freecodecamp.org/news/8-essential-graph-algorithms-in-javascript/

To work with very big graph drawings a program can generate tiles of a big image
then javascript can browse the tiles in the browser with https://leafletjs.com/
and there are more of such solutions

some more on tree traversal in javascript with nice pictures at https://stackfull.dev/tree-data-structure-in-javascript

Drawing splines with multiple points using chaikin algo at
https://www.bit-101.com/blog/2021/08/chaikins-algorithm-drawing-curves/

run graph algo visible in the browser at
https://deepdaydreams.github.io/algo-theory/graph-traversal/index.html#first

languages which compile to javascript at
https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS

more about directed sugiyama drawing with good text at
https://giters.com/simonegasperoni/sugiyama-drawings

iteractive math javascript projects
https://github.com/ubavic/awesome-interactive-math

something like draggable layout would be usable for graph layout drawings
https://packery.metafizzy.co/draggable.html

javascript to c compiler
https://github.com/timruffles/js-to-c

javascript libs en tools
https://notes.eatonphil.com/javascript-implementations.html

programming lnguages resources
https://bernsteinbear.com/pl-resources/