Re: RDF graph to SVG force-directed layout

"Paul Tyson [email protected]" <[email protected]>
Newsgroups gmane.text.xml.xsl.general.mulberrytech
Message-ID <[email protected]>
I also thought of d3.js, but don’t know if it fits your overall architecture or data flow.

Years ago I experimented with json-ld from fuseki into a d3 client that rendered very nice graphs. It showed great promise. But as it had no xsl, that solution would be off-topic for this list.

Regards,
—Paul

> On Oct 14, 2020, at 17:37, Liam R. E. Quin [email protected] <[email protected]> wrote:
> 
> On Wed, 2020-10-14 at 21:01 +0000, Martynas Jusevičius
> [email protected] wrote:
>> Hi,
>> 
>> could anyone suggest any optimizations to this stylesheet that
>> transforms a graph encoded as RDF/XML to an SVG directed graph
>> layout:
> 
> without looking in detail - are you able to use d3.js in the browser to
> do the fotce calulation part? It might not be faster but watching the
> SVG objects  move  gradually into equilibrium has its own fascination.
> 
> Most of these algorithms are likely to be at best O(n²) × Niterations,
> so there's some inherent  slowness.
> 
> Looking slightly more  closely -
> * consider using xsl:iterate instead of a recursive template at line
> 282;
> * run the stylesheet on the command-line and have Saxon write out
> profiling information to see where the time goes
> * add as= to any templates * variables that don't already have them
> * use on-no-match="shallow-copy" on an xsl:mode declaration for
> ac:SVTPositioning and delete the template on line 303
> * consider using maps rather than elements during positioning, as
> creating DOM elements in a browser is likely to be slow
> 
> But an algorithm with worse than n^2 complexity is always likely to
> have problems as n increases - the trick (as with e.g. QuickSort) is to
> remember complexity is usually an average best case, and find values
> for which the algorithm does better. E.g. removing nodes from
> consideration when they stop moving under a certain amount each time.
> 
> Liam
> 
> 
> -- 
> Liam Quin, https://www.delightfulcomputing.com/
> Available for XML/Document/Information Architecture/XSLT/
> XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
> Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org
> 
--~----------------------------------------------------------------
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.