tbo47 / dagre-es Goto Github PK
View Code? Open in Web Editor NEWThe dagrejs library exported as ES modules.
License: Other
The dagrejs library exported as ES modules.
License: Other
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.
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?
Since PositionX returns an object, if a property is named length the forEach treats the object as an array.
dagre-es/src/dagre/position/index.js
Lines 7 to 14 in 761b78f
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
orforOwn
for object iteration.
Seems like the https://www.npmjs.com/package/@dagrejs/dagre?activeTab=versions is getting new updates and is maintained.
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!
Hi,
We're trying to migrate mermaid-js from dagre-d3 to dagre-es, but ran into trouble because some members are not exported in dagre-es.
mermaid-js/mermaid#3712 (comment)
Can we work together to expose the required items from dagre-es?
Thank you :)
excuse me ,Did you modify his original layout algorithm
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.