I've got a graph that I want graphviz to layout and visualize for me. The graph has 122 edges and 123 nodes. The edges are of 4 different kinds and I want them to be visually distinguishable. However I've not yet decided what would be the best way of doing that, I'd like to play around with the dials a bit. Unfortunately I do not see anything like a "class" or "stylesheet" attribute for edges. I can only set visual attributes individually for every edge (lots of repetition). Perhaps I've missed something? Is there maybe some way after all to add edges to 4 different groups and then style the groups, not each edge individually?
相关问题
- Setting subgraph attributes in Rgraphviz
- PHP Adding stylesheets to header
- Comparing value of a certain row with all previous
- How to include a safari only style in scss ? [dupl
- returns Zeros for Dates that dont exist MYSQL GROU
相关文章
- Get grouped comma separated values with linq
- Python relative import with more than two dots
- PygraphViz Import Error With PyCharm
- Bind a char to an enum type
- What is the fastest way to map group names of nump
- Ubuntu graphviz 'sfdp' not working
- In OOP, what is the best practice in regards to us
- Why do some users quote classnames in Perl?
To style edges (or nodes) by group rather than individually, use subgraph.
like so:
So if you put the code above in a file w/ a ".dot" extension; then render it in graphviz,, you'll see three different types of edges, appearance-wise.
One type is the just the default (color=black, thickness=1, etc.)--i.e., these edges not assigned to a subgraph.
The other two types of edges(a thin, dark-green group, and a thick, bright-yellow group) are styled based on assignment to one of two subgraph clusters.
Subgraph is often used to visually highlight a node cluster (i.e., to distinguish a particular contiguous 'group' of nodes from the rest of the nodes in the graph); however, there is no requirement (as you can see from my example) that the edges you chose to style by assignment to a given subgraph, belong to a contiguous 'group' of nodes--you can designate any edges you wish for assignment to a given sub-graph.)
to me, styling nodes by group is analogous to the HTML practice of defining a class and assigning it to a collection of divs in HTML markup
While @doug's answer is correct (use subgraphs to assign similar style to groups of objects), I believe my example is better: