ggsonic / kklayout Goto Github PK
View Code? Open in Web Editor NEWphp version Implemention of the Kamada-Kawai algorithm for Force Directed Graph layout
php version Implemention of the Kamada-Kawai algorithm for Force Directed Graph layout
This is a php version implemention of the Kamada-Kawai algorithm for force directed graph layout. Does not respect filter calls, and sometimes crashes when the view changes to it. see "Tomihisa Kamada and Satoru Kawai: An algorithm for drawing general indirect graphs. Information Processing Letters 31(1):7-15, 1989" see "Tomihisa Kamada: On visualization of abstract objects and relations. Ph.D. dissertation, Dept. of Information Science, Univ. of Tokyo, Dec. 1988." author ggsonic *the getDistance function needs to be hacked. For now, it is just a very simple strategy to get the weight of distance code sample to use: <?php $nodes = array(); /* Create 11 random nodes */ for($i=0;$i<=10;$i++) { $Connections = ""; $RandCx1 = rand(0,1); for($j=0;$j<=$RandCx1;$j++) { $RandCx2 = rand(0,10); if ( $RandCx2 != $j ) { $Connections[] = $RandCx2; } } $nodes[$i] = array('idx' => $i, "conn" => $Connections); } $kklayout = new KKLayout ( $nodes ); $kklayout->initialize (); while ( ! $kklayout->done () ) { $kklayout->step (); } //var_dump($kklayout->xydata);exit; ?>
You just saved my day. Thank you so much (yes, this is an issue since I can not find another way to contact you).
There're still some cases where the graph is broken, but it's not so important for my case.
Anyway, let me send you beer-money or something.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.