Home / Function/ update_styles() — langchain Function Reference

update_styles() — langchain Function Reference

Architecture documentation for the update_styles() function in graph_png.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7f677b4d_9894_50a2_95a4_6e4ecc8b4799["update_styles()"]
  5a670bac_6993_ecfd_ad71_f79187c3df76["PngDrawer"]
  7f677b4d_9894_50a2_95a4_6e4ecc8b4799 -->|defined in| 5a670bac_6993_ecfd_ad71_f79187c3df76
  80a735b5_4997_c6b1_cea7_cd7a0638ba48["draw()"]
  80a735b5_4997_c6b1_cea7_cd7a0638ba48 -->|calls| 7f677b4d_9894_50a2_95a4_6e4ecc8b4799
  style 7f677b4d_9894_50a2_95a4_6e4ecc8b4799 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/graph_png.py lines 205–215

    def update_styles(viz: Any, graph: Graph) -> None:
        """Update the styles of the entrypoint and END nodes.

        Args:
            viz: The graphviz object.
            graph: The graph to draw.
        """
        if first := graph.first_node():
            viz.get_node(first.id).attr.update(fillcolor="lightblue")
        if last := graph.last_node():
            viz.get_node(last.id).attr.update(fillcolor="orange")

Domain

Subdomains

Called By

Frequently Asked Questions

What does update_styles() do?
update_styles() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/graph_png.py.
Where is update_styles() defined?
update_styles() is defined in libs/core/langchain_core/runnables/graph_png.py at line 205.
What calls update_styles()?
update_styles() is called by 1 function(s): draw.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free