Untitled

 avatar
unknown
plain_text
10 months ago
1.3 kB
11
Indexable
from graphviz import Digraph

# Create a directed graph
dot = Digraph("LearningProcess", format="png")
dot.attr(rankdir="LR", size="8,5")  # Left-to-right flow

# Define node styles
node_style = {
    "shape": "rectangle",
    "style": "rounded,filled",
    "fillcolor": "#e6f2ff",
    "color": "#003366",
    "fontname": "Helvetica",
    "fontsize": "11"
}

# Add nodes
steps = [
    ("1", "Activate Prior Knowledge"),
    ("2", "Explore & Brainstorm"),
    ("3", "First Attempt / Draft"),
    ("4", "Feedback & Reflection"),
    ("5", "Refinement / Revision"),
    ("6", "Application / Sharing"),
    ("7", "Integrate & Carry Forward")
]

for step_id, label in steps:
    dot.node(step_id, label, **node_style)

# Add edges for main linear flow
for i in range(len(steps) - 1):
    dot.edge(steps[i][0], steps[i+1][0], color="#003366")

# Add loopbacks from Feedback & Reflection
dot.edge("4", "2", style="dashed", color="#ff6600", label="loopback")
dot.edge("4", "3", style="dashed", color="#ff6600", label="loopback")

# Add final arrow looping back to Prior Knowledge
dot.edge("7", "1", style="dashed", color="#009933", label="next cycle")

# Render to file
output_path = "/mnt/data/Learning_Process_Flowchart"
dot.render(output_path)

output_path + ".png"
Editor is loading...
Leave a Comment