Style drawNode() with Attributer
See original GitHub issueIs it possible to style nodes created with drawNode()
with the specified attributer
? For example:
const dot = `
digraph {
a -> b
a -> c
}`;
const graphviz = d3.select("#graph")
.graphviz(false)
.attributer(function(d) {
if (d.tag == "ellipse") {
d.attributes.fill = "red";
}
})
.renderDot(dot);
graphviz.drawNode(100, 0, 'New node')
I would expect the newly drawn node to have fill: red
, but that is not the case. The docs specify that you can specify styles using DOT attributes, but it would be nice to to both a) only have to specify node styles once and b) be able to use CSS to style drawNode() nodes.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Tutorial — NetworkX 2.8.8 documentation
Attributes such as weights, labels, colors, or whatever Python object you like, can be attached to graphs, nodes, or edges. Each graph, node,...
Read more >Nodes and Edges - PGF/TikZ Manual
Styles for nodes. This option causes ⟨code⟩ to be executed at the beginning of a node. Using this option multiple times will cause...
Read more >c# - TreeView custom DrawNode .NET 3.5 Windows Forms
1 Answer 1 · int Compare(object x, object y) · ExplorerTreeView() · void PopulateTreeView(string DirectoryName) · bool PathIsDirectory(string ...
Read more >TikZ and pgf
\end{tikzpicture}. • style=key attribute This style is intended for key attributes. By default, the will cause the attribute to be typeset in italics....
Read more >Drawing basics | NetworkX Guide
There are numerous styling options which let you customize your graph. For example, you can define colors of the nodes, draw node and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yup, sorry - markdown removed my text that looked like HTML elements. Fixed it
Thanks so much for the Codepen. It helps a lot to see something in action.
color="black;0.99:red"
. See this example. I don’t know why it works though.drawNode()
. I have to think about this some more.