From ca80df9ade3d0743c7be9d7f7da6d5cfa766fe1c Mon Sep 17 00:00:00 2001 From: giles Date: Thu, 2 Jul 2026 11:00:40 +0000 Subject: [PATCH] otel: hover tooltips on waterfall bars (SVG ) --- lib/host/otel.sx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/host/otel.sx b/lib/host/otel.sx index 08539ba2..3d0c1b3a 100644 --- a/lib/host/otel.sx +++ b/lib/host/otel.sx @@ -213,11 +213,15 @@ (fn (status) (if (= status "error") "#e45756" "#4c9a8f"))) ;; one <g> (bar + name + duration) per rect. The bar is the only <rect>, so -;; count(rect) == count(span); axis chrome uses <line>/<text>. +;; count(rect) == count(span); axis chrome uses <line>/<text>. A leading <title> +;; gives a native hover tooltip with the full span name (the inline label clips on +;; narrow bars). (define otel/-rect->g (fn (r) (quasiquote (g + (title (unquote (str (get r :name) " · " (otel/-ms (get r :dur)) + (if (= (get r :status) "error") " · error" "")))) (rect :x (unquote (get r :x)) :y (unquote (get r :y)) :width (unquote (get r :w)) :height (unquote (- otel/-row-h 2)) :fill (unquote (otel/-bar-fill (get r :status))) :rx 2)