dagrejs / dagre-d3

A D3-based renderer for Dagre
MIT License
2.86k stars 592 forks source link

opacity:0 #42

Closed philfreo closed 10 years ago

philfreo commented 10 years ago

I just tried a simple example (mostly a copy/paste from interactive-demo.html) with one node (labeled "a") and for some reason the has a style="opacity: 0;" on it. If I remove that style manually in the Chrome inspector the graph appears fine.

What would cause the opacity:0?

philfreo commented 10 years ago

screenshot 2014-05-02 09 50 02

Adding the following CSS makes the graph show, but I'm not sure why it's necessary.

svg g, svg path { opacity: 1 !important; }

cpettitt commented 10 years ago

Can you post the modified code? Are you seeing the same problem with the regular interactive-demo? If so, any errors in the console?

philfreo commented 10 years ago

I wasn't getting any errors in console, but I actually can't reproduce this issue anymore, sorry for the unnecessary ticket.

Off topic and not sure if it's in the scope of dagre/dagre-d3 or not, but would it make sense to have a new layout type in dagre (instead of left->right or top->bottom) that's more of a force-directed graph? In graphviz, something like layout: sfdp. Or a layout using d3's built in force layout like http://bl.ocks.org/mbostock/4062045

cpettitt commented 10 years ago

The d3 folks have done a really good job with force-directed graphs and I can't see myself doing it any better. I could see adding a helper somewhere to convert a graphlib graph into something compatible with d3, but I think the amount of code would turn out to be pretty small.

philfreo commented 10 years ago

Ya that makes sense - I first discovered your library and loved how simple it was to make a good looking directed graph with labels on the nodes and on the edges. I saw the bl.ocks link above but (am new to d3) haven't seen a similar example with rectangular nodes, node/edge labels, etc.