-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In node.js method getBBox is missing. #46
Comments
What DOM are you using in node.js? If you are trying to run a layout algorithm without a DOM, dagre (versus dagre-d3) would be the way to go. |
I am using jsdom. I have verified I can output SVG's just fine (e.g. adding a simple circle to the svg element, and so on) - it's only the missing getBBox method that's the problem. |
Take a look at this comment from Mike Bostock (author of D3). He says that jsdom doesn't have proper SVG support and recommends using PhantomJS. I have personally used PhantomJS with dagre-d3 in the past. See https://github.com/cpettitt/dagre-d3-cli as a proof-of-concept example. |
Can confirm that the renderer works with PhantomJS and not jsdom, both within a node.js context and standalone. May I suggest a comment in the documentation stating that getBBox is only available in PhantomJS as far as we know for now? Thanks for your time! |
Attempting to run the renderer in node.js results in the following error:
due to the following line in Renderer.js:
The text was updated successfully, but these errors were encountered: