INNER CODE UNIT · Python
x_pos
F-R-L/forge-film · forge/webui/app.py:38
x_pos = {sid: i + 1 for i, sid in enumerate(scene_ids)}
y_pos = 0.5
# Draw edges
for src, dsts in plan.dag.items():
for dst in dsts:
if src in x_pos and dst in x_pos:
ax.annotate(
"",
xy=(x_pos[dst], y_pos),
xytext=(x_pos[src], y_pos),
arrowprops=dict(arrowstyle="->", color="#555", lw=1.5),
)
# Draw nodes
for s in plan.scenes:
x = x_pos[s.id]
color = plt.cm.RdYlGn(1.0 - (s.complexity - 1) / 9.0)