MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / draw_branch

Function draw_branch

experiments/human_eval/draw_llm_token_cost_tree.py:121–134  ·  view source on GitHub ↗
(
    draw: ImageDraw.ImageDraw,
    group_y: float,
    leaf_ys: list[float],
    color: tuple[int, int, int],
)

Source from the content-addressed store, hash-verified

119
120
121def draw_branch(
122 draw: ImageDraw.ImageDraw,
123 group_y: float,
124 leaf_ys: list[float],
125 color: tuple[int, int, int],
126) -> None:
127 stem_x = GROUP_X + 84
128 leaf_join_x = LEAF_X - 26
129 draw.line((ROOT_X + 72, group_y, GROUP_X - 64, group_y), fill=LINE, width=2)
130 draw.line((stem_x, min(leaf_ys), stem_x, max(leaf_ys)), fill=LINE, width=2)
131 draw.line((GROUP_X + 72, group_y, stem_x, group_y), fill=LINE, width=2)
132 for y in leaf_ys:
133 draw.line((stem_x, y, leaf_join_x, y), fill=LINE, width=2)
134 draw.ellipse((leaf_join_x - 5, y - 5, leaf_join_x + 5, y + 5), fill=color)
135
136
137def draw_png() -> Image.Image:

Callers 1

draw_pngFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected