dagrejs / dagre-d3

A D3-based renderer for Dagre
MIT License
2.84k stars 587 forks source link

pretty messy install, inadequate wiki docs #242

Open costa opened 8 years ago

costa commented 8 years ago

I've burnt some time trying to bootstrap it: — tried to make it work with RequireJS first — failed; — tried to copy the interactive demo with Bower install — failed; — Issues and even PRs are plentiful yet unanswered; It's dead alright, which is a pity, it looked the best to me from: http://modeling-languages.com/javascript-drawing-libraries-diagrams/

Any direction is appreciated. And thanks for the original effort to the author.

oskip commented 8 years ago

Have you tried http://visjs.org/?

ondrejhlavacek commented 8 years ago

Ow, that's a pity :-(

git-ashish commented 8 years ago

I have been using it for a project which is in production. We didn't yet have the need to make any changes to the existing code but it works great for our current use cases.

The repo just works fine, may need some tweaks with the links etc but the demos work pretty well.

costa commented 8 years ago

Thanks for your replies. @git-ashish can you share any tweaks that you mentioned please? As in how to make say the interactive demo work following a bower install? (I'm getting dagreD3 undefined error with the demo, which I can say is pretty bad) Or are you getting at just copying the files from master here and into my project soIi will link them rpthe same way the actual demo here does?

costa commented 8 years ago

UPDATE I have managed to set it (an interactive-demo-like page) up after installing graphlib-dot via bower:

$ bower install -S graphlib-dot
bower graphlib-dot#*            cached https://github.com/cpettitt/graphlib-dot.git#0.6.2
bower graphlib-dot#*          validate 0.6.2 against https://github.com/cpettitt/graphlib-dot.git#*
bower lodash#^2.4.1             cached https://github.com/lodash/lodash.git#2.4.2
bower lodash#^2.4.1           validate 2.4.2 against https://github.com/lodash/lodash.git#^2.4.1

Unable to find a suitable version for lodash, please choose one by typing one of the numbers below:
    1) lodash#^2.4.1 which resolved to 2.4.2 and is required by graphlib-dot#0.6.2
    2) lodash#^3.10.0 which resolved to 3.10.1 and is required by dagre#0.7.4, dagre-d3#0.4.17, graphlib#1.0.7

Prefix the choice with ! to persist it to bower.json

? Answer 1
bower lodash#^2.4.1            install lodash#2.4.2
bower graphlib-dot#^0.6.2      install graphlib-dot#0.6.2

lodash#2.4.2 bower_components/lodash

graphlib-dot#0.6.2 bower_components/graphlib-dot
├── graphlib#1.0.7
└── lodash#2.4.2

and including all of these:

    <script src="bower_components/lodash/dist/lodash.js"></script>
    <script src="bower_components/graphlib/dist/graphlib.core.js"></script>
    <script src="bower_components/graphlib-dot/dist/graphlib-dot.core.js"></script>
    <script src="bower_components/dagre/dist/dagre.core.js"></script>
    <script src="bower_components/d3/d3.js"></script>
    <script src="bower_components/dagre-d3/dist/dagre-d3.core.js"></script>

I am still not sure how all the dependencies work out here (with .core.js files containing dependencies inline, etc), but it seems that my PR above is unnecessary, and I will update this issue with the report on my progress.

minecraft2048 commented 8 years ago

This is the root of this problem: #256 as most, if not all of the tutorials about dagre-d3 layout uses renderer, while it turns out that renderer is deprecated and it is changed to render, with no documentation on how to set its layout. And yes, I have tried vis.js, and found it crashes with my dataset, which is hierarchical graph with some nodes that have multiple parents, and even if it doesn't crash, it is much slower than dagre-d3

tarpdalton commented 8 years ago

https://github.com/cpettitt/dagre-d3/issues/117 graph() takes the normal layout properties

g.graph().rankSep = 25; g.graph().nodeSep = 25;