0

I have created a tree structure following the link Reading DOT files in javascript/d3

I need to fill the nodes with color.

Tree data:

enter image description here

I tried adding

[label="abcd" labelStyle="font: 300 14px" style=filled fillcolor=red]
[label="abcd" style=filled color=red]

Could anyone please suggest or point me in right direction.

Thanks

Community
  • 1
  • 1
Harsha
  • 33
  • 9

1 Answers1

0

In you CSS section add this

.node rect {
            stroke: #333;
            fill: #ff0000;
        }

This will make your node color red.

Artiga
  • 776
  • 2
  • 16
  • 37
  • Let's say that you wanted different colors for different nodes. Is dagre-d3 able to honor attributes set in the original DOT source? – user888379 Apr 12 '16 at 19:44