Hi folks, is anyone working on styling the static ...
# hamilton-help
j
Hi folks, is anyone working on styling the static DAG visualizations? I'm interested in visually grouping them by module.
👀 1
I'll use this thread as I mock things up.
s
I think the best place to start would be to see if using the custom styling function can get you what you want, e.g. https://github.com/DAGWorks-Inc/hamilton/tree/main/examples/styling_visualization
otherwise graphviz isn’t that fun to work with — so if you want more structural modifications that might be require some surgery to the display function in hamilton…
j
Thanks, and this is a reminder for me to look in the examples more. None of them are indexed well by Google it seems.
e
You can also prototype on the graph if you want to go out of the box /start fresh (although as @Stefan Krawczyk recommends, you should start from what we’ve got)
Copy code
from hamilton import graph_types

dr = driver.Builder()....build()

graph_you_can_use = graph_types.HamiltonGraph.from_graph(dr.graph)
t
To chime in too, the "custom styling" example shows how to set styles to the nodes in the graph. If you want to change the nodes included in the graph (e.g., collapse a node) or the layout (using subgraphs), you will need to use graphviz directly
j
Thanks! I’ll give it a shot here