[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: RDF graph to SVG force-directed layout

Subject: Re: RDF graph to SVG force-directed layout
From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Oct 2020 22:36:43 -0000
Re:  RDF graph to SVG force-directed layout
On Wed, 2020-10-14 at 21:01 +0000, Martynas JuseviD
ius
martynas@xxxxxxxxxxxxx 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(nB2) C 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,B 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: B http://www.fromoldbooks.org

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.