Coder Social home page Coder Social logo

dagre-es's People

Contributors

aloisklink avatar briacharfang avatar chanwutk avatar pr0dt0s avatar remcohaszing avatar rustedgrail avatar sidharthv96 avatar tbo47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dagre-es's Issues

Autolayout does not work correctly for groups of nodes. Where did I go wrong?

Autolayout does not work correctly for groups of nodes. I made an autolayout for nodes, but when I use groups, the position for this group is not set correctly.
I put all the nodes in the graph, and the nodes that contain the parent group I used in the setParent method.
image
After calling the Laout function, the positions are given out, but not quite the correct positions are given to the groups of nodes. What could be the problem?
image

position function not working properly when a node is named ´length´.

Since PositionX returns an object, if a property is named length the forEach treats the object as an array.

function position(g) {
g = util.asNonCompoundGraph(g);
positionY(g);
_.forEach(positionX(g), function (x, v) {
g.node(v).x = x;
});
}

This should be changed to a forOwn according to lodash.

https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/forEach.js#L5-L11

Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To avoid this behavior use forIn or forOwn for object iteration.

Why do these graphs cause errors?

Very apologies if this has been asked before somewhere. I did look for a similar issue.

I'm trying to figure out why some seemingly basic edges cause errors.

// Set the nodes
g.setNode('a', {
  label: 'A'
});
g.setNode('b', {
  label: 'B'
});
g.setNode('c', {
  label: 'C'
});
g.setNode('d', {
  label: 'D'
});
// Set the parents
g.setParent('b', 'a');
g.setParent('c', 'b');

// These edges cause errors:
//g.setEdge('a', 'b');
//g.setEdge('a', 'c');
//g.setEdge('a', 'd');
//g.setEdge('b', 'c');
//g.setEdge('a', 'a');
//g.setEdge('b', 'b');

// These edges don't cause errors
//g.setEdge('c', 'd');
//g.setEdge('d', 'c');
//g.setEdge('c', 'c');
//g.setEdge('d', 'd');

Here is a jsfiddle to demonstrate, just uncomment an edge that causes an error.

There is a package called dagre-cluster-fix on npm, but it did not seem to solve anything. I thought I'd better reach out to the community before I got too deep in trying to discern what dagre-cluster-fix might be doing to try to solve the errors, if indeed that is the error it is designed to solve; the npm page is pretty useless for explaining its function/purpose so I don't yet know.

Any guidance, advice, dagre-related theory, deeper documentation, is very much appreciated! If this is acknowledged as an issue, if it were desirable, I'd be willing to learn the theory behind dagre to try to contribute and solve this issue.

Thanks for your time!

Draw edge from child to parent

There was an issue in the old repo raised because when drawing an edge from child to parent there is an error (or between any node and cluster), with a possible solution here. Would a PR be welcome integrating a fix into this project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.