RDF graph to SVG force-directed layout

"Martynas Jusevičius [email protected]" <[email protected]>
Newsgroups gmane.text.xml.xsl.general.mulberrytech
Message-ID <[email protected]>
Hi,

could anyone suggest any optimizations to this stylesheet that
transforms a graph encoded as RDF/XML to an SVG directed graph layout:
https://github.com/AtomGraph/Web-Client/blob/develop/src/main/webapp/static/com/atomgraph/client/xsl/converters/RDFXML2SVG.xsl

Output example: https://twitter.com/namedgraph/status/1316476355874304001

The problem is that it's quite slow: <100 nodes and 5 steps take a few
minutes running on Saxon-JS 2 in Firefox or Chrome.

It's based on a paper on force directed layout in XSLT: "GraphML
Transformation":
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.182.3680&rep=rep1&type=pdf#page=58

The algorithm:
1. position resource nodes (optionally also literals) randomly.
(TO-DO: position on an ellipse?)
2. move nodes in a loop using the force-directed algorithm
3. draw lines between the nodes, calculating the correct intersection
with the node border

Note: only "flat" RDF/XML (properties grouped into descriptions; no
nesting) is supported. It's called RDFXML_PLAIN in Jena.

If anyone would like a sample file, I can easily provide :)


Martynas
atomgraph.com
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/3329386
or by email: [email protected]
--~--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.