fix: move reference line labels off the bars in the scaling plots
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-16
@@ -198,7 +198,7 @@ class Svg:
|
||||
cy - 3,
|
||||
color=color,
|
||||
width=2,
|
||||
dash="5 4" if kind == "dash" else "",
|
||||
dash={"dash": "5 4", "dots": "2 4"}.get(kind, ""),
|
||||
)
|
||||
self.text(cx + 22, cy + 1, label, color=INK_2)
|
||||
cx += item_w
|
||||
@@ -388,12 +388,12 @@ def plot_p95(label: dict[str, Any], title: str) -> str:
|
||||
width=1.5,
|
||||
dash="6 4",
|
||||
)
|
||||
# подпись SLO слева: справа линии конфигураций пересекают порог
|
||||
svg.text(
|
||||
left + plot_w - 4,
|
||||
left + 6,
|
||||
sy(slo) - 6,
|
||||
f"SLO p95 {slo:g} мс",
|
||||
color=INK_2,
|
||||
anchor="end",
|
||||
)
|
||||
svg.text(
|
||||
left + plot_w / 2,
|
||||
@@ -506,13 +506,6 @@ def plot_cpu(labels: list[dict[str, Any]], title: str) -> str:
|
||||
width=1.5,
|
||||
dash="2 4",
|
||||
)
|
||||
svg.text(
|
||||
left + plot_w - 4,
|
||||
sy(perf) - 6,
|
||||
f"{perf} производительных ядер хоста",
|
||||
color=INK_2,
|
||||
anchor="end",
|
||||
)
|
||||
slot = plot_w / max(1, len(bars))
|
||||
bar_w = min(24.0, slot * 0.6)
|
||||
for index, (name, values, c) in enumerate(bars):
|
||||
@@ -565,12 +558,13 @@ def plot_cpu(labels: list[dict[str, Any]], title: str) -> str:
|
||||
anchor="middle",
|
||||
rotate=True,
|
||||
)
|
||||
svg.legend(
|
||||
[(SERIES[i], text, "box") for i, (_, text) in enumerate(COMPONENTS)],
|
||||
left,
|
||||
98,
|
||||
plot_w,
|
||||
)
|
||||
# подпись линии ядер хоста — в легенде: на линии её закрывают столбики
|
||||
items = [
|
||||
(SERIES[i], text, "box") for i, (_, text) in enumerate(COMPONENTS)
|
||||
]
|
||||
if perf:
|
||||
items.append((MUTED, f"{perf} производительных ядер хоста", "dots"))
|
||||
svg.legend(items, left, 98, plot_w)
|
||||
return svg.render()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user