llmtop 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +259 -2
- package/bin/llmtop.mjs +101 -0
- package/dashboard/dist/apple-touch-icon.png +0 -0
- package/dashboard/dist/assets/index-BVbAwMVB.js +9 -0
- package/dashboard/dist/assets/index-Cp7Swcz5.css +1 -0
- package/dashboard/dist/assets/llmtop-lockup-DtFPJmhv.svg +1 -0
- package/dashboard/dist/assets/llmtop-lockup-reversed-D9OmQIVU.svg +1 -0
- package/dashboard/dist/favicon.ico +0 -0
- package/dashboard/dist/favicon.svg +1 -0
- package/dashboard/dist/index.html +19 -0
- package/dashboard/dist/llmtop-mark-192.png +0 -0
- package/dashboard/dist/llmtop-mark-512.png +0 -0
- package/dashboard/dist/site.webmanifest +11 -0
- package/dashboard/src/App.tsx +213 -0
- package/dashboard/src/controls/DateRange.tsx +108 -0
- package/dashboard/src/controls/Disclosure.tsx +15 -0
- package/dashboard/src/controls/Search.tsx +18 -0
- package/dashboard/src/controls/Select.tsx +48 -0
- package/dashboard/src/controls/popover.tsx +31 -0
- package/dashboard/src/dash.ts +23 -0
- package/dashboard/src/extra.test.ts +9 -0
- package/dashboard/src/extra.ts +16 -0
- package/dashboard/src/format.ts +29 -0
- package/dashboard/src/i18n.tsx +52 -0
- package/dashboard/src/index.ts +7 -0
- package/dashboard/src/main.tsx +7 -0
- package/dashboard/src/model.test.ts +110 -0
- package/dashboard/src/model.ts +255 -0
- package/dashboard/src/state.test.ts +48 -0
- package/dashboard/src/state.ts +61 -0
- package/dashboard/src/styles.css +401 -0
- package/dashboard/src/tip.ts +51 -0
- package/dashboard/src/treemap.test.ts +23 -0
- package/dashboard/src/treemap.ts +30 -0
- package/dashboard/src/ui.tsx +327 -0
- package/dashboard/src/views/Activity.tsx +177 -0
- package/dashboard/src/views/Context.tsx +183 -0
- package/dashboard/src/views/Models.tsx +155 -0
- package/dashboard/src/views/Overview.tsx +83 -0
- package/dashboard/src/views/Projects.tsx +116 -0
- package/dashboard/src/views/Sessions.tsx +54 -0
- package/dashboard/src/views/Subagents.tsx +102 -0
- package/docs/brand/README.md +91 -0
- package/docs/brand/brand.json +67 -0
- package/docs/brand/favicon.ico +0 -0
- package/docs/brand/png/apple-touch-icon.png +0 -0
- package/docs/brand/png/favicon-16.png +0 -0
- package/docs/brand/png/favicon-32.png +0 -0
- package/docs/brand/png/favicon-48.png +0 -0
- package/docs/brand/png/llmtop-lockup-reversed@2x.png +0 -0
- package/docs/brand/png/llmtop-lockup@2x.png +0 -0
- package/docs/brand/png/llmtop-mark-1024.png +0 -0
- package/docs/brand/png/llmtop-mark-192.png +0 -0
- package/docs/brand/png/llmtop-mark-512.png +0 -0
- package/docs/brand/png/llmtop-wordmark@2x.png +0 -0
- package/docs/brand/source/build_brand.py +173 -0
- package/docs/brand/svg/favicon.svg +1 -0
- package/docs/brand/svg/llmtop-glyph.svg +1 -0
- package/docs/brand/svg/llmtop-lockup-reversed.svg +1 -0
- package/docs/brand/svg/llmtop-lockup.svg +1 -0
- package/docs/brand/svg/llmtop-mark-light.svg +1 -0
- package/docs/brand/svg/llmtop-mark.svg +1 -0
- package/docs/brand/svg/llmtop-wordmark-reversed.svg +1 -0
- package/docs/brand/svg/llmtop-wordmark.svg +1 -0
- package/llmtop.config.example.json +10 -0
- package/package.json +71 -4
- package/prices.md +27 -0
- package/src/api.mjs +53 -0
- package/src/archive.mjs +142 -0
- package/src/config.mjs +55 -0
- package/src/context.mjs +151 -0
- package/src/dashboard.mjs +61 -0
- package/src/db.mjs +102 -0
- package/src/derive.mjs +346 -0
- package/src/effort.mjs +18 -0
- package/src/format.mjs +19 -0
- package/src/paths.mjs +82 -0
- package/src/prices-command.mjs +25 -0
- package/src/prices.mjs +146 -0
- package/src/providers/agy.mjs +438 -0
- package/src/providers/claude.mjs +274 -0
- package/src/providers/codex.mjs +589 -0
- package/src/providers/index.mjs +25 -0
- package/src/rebuilds.mjs +85 -0
- package/src/scan.mjs +214 -0
- package/src/serve.mjs +44 -0
- package/src/show.mjs +20 -0
- package/src/usage-command.mjs +110 -0
- package/src/usage.mjs +388 -0
- package/src/zone.mjs +15 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// What the address bar holds: the view as the path, the window, filters, chart metric, sort and search as the
|
|
2
|
+
// query. Filters are kept by name, so a link still means the same project after new data reorders the lists.
|
|
3
|
+
// Defaults are left out of the URL.
|
|
4
|
+
|
|
5
|
+
export const VIEWS = ["overview", "activity", "context", "models", "projects", "sessions", "subagents"] as const;
|
|
6
|
+
// A built-in view, or the id of one a host package adds.
|
|
7
|
+
export type View = string;
|
|
8
|
+
export const RANGES = ["1", "7", "14", "30", "all"] as const;
|
|
9
|
+
export const SORTS = ["start", "dur", "turns", "out", "cost", "ctx"] as const;
|
|
10
|
+
export type SortKey = (typeof SORTS)[number];
|
|
11
|
+
|
|
12
|
+
export type UrlState = {
|
|
13
|
+
view: View;
|
|
14
|
+
range: string; // one of RANGES, or "" for the custom window from–to
|
|
15
|
+
from: string; to: string;
|
|
16
|
+
provider: string; project: string; model: string; effort: string; // "" for all
|
|
17
|
+
metric: "out" | "cost" | "sess";
|
|
18
|
+
split: "model" | "provider" | "project" | "effort" | "kind"; // how the overview splits its chart; kind is for cost only
|
|
19
|
+
heat: "req" | "out"; // what the hour heatmap counts
|
|
20
|
+
chart: "bar" | "area" | "share"; // how per-day and per-hour charts draw their totals, or each slot as 100%
|
|
21
|
+
sort: SortKey; dir: 1 | -1;
|
|
22
|
+
q: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const DEFAULTS: UrlState = { view: "overview", range: "14", from: "", to: "", provider: "", project: "", model: "", effort: "", metric: "out", split: "model", heat: "req", chart: "bar", sort: "start", dir: -1, q: "" };
|
|
26
|
+
|
|
27
|
+
const DAY = /^\d{4}-\d{2}-\d{2}$/;
|
|
28
|
+
const oneOf = <T extends string>(list: readonly T[], v: string | null, fallback: T): T => (list.includes(v as T) ? (v as T) : fallback);
|
|
29
|
+
|
|
30
|
+
export function parseUrl(pathname: string, search: string, extraViews: readonly string[] = []): UrlState {
|
|
31
|
+
const p = new URLSearchParams(search);
|
|
32
|
+
const from = p.get("from") ?? "", to = p.get("to") ?? "";
|
|
33
|
+
const custom = DAY.test(from) && DAY.test(to) && from <= to;
|
|
34
|
+
return {
|
|
35
|
+
view: oneOf([...VIEWS, ...extraViews], pathname.replace(/^\/+|\/+$/g, ""), DEFAULTS.view),
|
|
36
|
+
range: custom ? "" : oneOf(RANGES, p.get("range"), DEFAULTS.range as (typeof RANGES)[number]),
|
|
37
|
+
from: custom ? from : "", to: custom ? to : "",
|
|
38
|
+
provider: p.get("provider") ?? "", project: p.get("project") ?? "", model: p.get("model") ?? "", effort: p.get("effort") ?? "",
|
|
39
|
+
metric: oneOf(["out", "cost", "sess"] as const, p.get("metric"), "out"),
|
|
40
|
+
split: oneOf(["model", "provider", "project", "effort", "kind"] as const, p.get("split"), "model"),
|
|
41
|
+
heat: oneOf(["req", "out"] as const, p.get("heat"), "req"),
|
|
42
|
+
chart: oneOf(["bar", "area", "share"] as const, p.get("chart"), "bar"),
|
|
43
|
+
sort: oneOf(SORTS, p.get("sort"), DEFAULTS.sort),
|
|
44
|
+
dir: p.get("dir") === "asc" ? 1 : -1,
|
|
45
|
+
q: p.get("q") ?? "",
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function toUrl(s: UrlState): string {
|
|
50
|
+
const p = new URLSearchParams();
|
|
51
|
+
if (s.range) { if (s.range !== DEFAULTS.range) p.set("range", s.range); } else { p.set("from", s.from); p.set("to", s.to); }
|
|
52
|
+
for (const k of ["provider", "project", "model", "effort", "q"] as const) if (s[k]) p.set(k, s[k]);
|
|
53
|
+
if (s.metric !== DEFAULTS.metric) p.set("metric", s.metric);
|
|
54
|
+
if (s.split !== DEFAULTS.split) p.set("split", s.split);
|
|
55
|
+
if (s.heat !== DEFAULTS.heat) p.set("heat", s.heat);
|
|
56
|
+
if (s.chart !== DEFAULTS.chart) p.set("chart", s.chart);
|
|
57
|
+
if (s.sort !== DEFAULTS.sort) p.set("sort", s.sort);
|
|
58
|
+
if (s.dir === 1) p.set("dir", "asc");
|
|
59
|
+
const query = p.toString();
|
|
60
|
+
return `/${s.view === DEFAULTS.view ? "" : s.view}${query ? `?${query}` : ""}`;
|
|
61
|
+
}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--brand-ink: #1A1A1A; --brand-paper: #F2F2F2; --brand-white: #FFFFFF; --brand-black: #000000;
|
|
3
|
+
--brand-tile-dark: #1A1A1A; --brand-tile-light: #F2F2F2;
|
|
4
|
+
--brand-donut-1: #1A1A1A; --brand-donut-2: #3F3F3F; --brand-donut-3: #7F7F7F; --brand-donut-4: #D8D8D8;
|
|
5
|
+
--page: var(--brand-paper); --surface: var(--brand-white); --raised: var(--brand-white); --ink: var(--brand-ink); --ink2: #3F3F3F; --muted: #7F7F7F;
|
|
6
|
+
--hair: #E0E0E0; --base: #C8C8C8; --wash: rgba(26,26,26,.05); --accent: #2a78d6; --accent-ink: #1c5cab;
|
|
7
|
+
--s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #0e9aa7; --s7: #8b5cf6; --s8: #6b8e23; --s9: #d946ef; --s10: #0284c7; --s11: #dc2626; --s12: #65a30d; --s13: #ea580c; --s14: #0d9488; --s15: #4f46e5; --s16: #ca8a04; --s0: #b9b8b0; --sub: #6d4fe8; --seq: #2a78d6;
|
|
8
|
+
--v0: #c9c4fb; --v1: #9d93f5; --v2: #6f5ce6; --v3: #4630c0; --v4: #26177a;
|
|
9
|
+
--k0: #D8D8D8; --k1: #888888; --k2: #3F3F3F; --kw: repeating-linear-gradient(135deg, #D8D8D8 0 4px, #BEBEBE 4px 8px);
|
|
10
|
+
--ck0: #3b6fd9; --ck1: #7c5bd1; --ck2: #a8864f;
|
|
11
|
+
--good: #0ca30c; --up: #1c5cab; --neg: #d03b3b; --shadow: 0 8px 28px rgba(0,0,0,.10);
|
|
12
|
+
--sb: rgba(11,11,11,.18); --sb-hover: rgba(11,11,11,.34);
|
|
13
|
+
}
|
|
14
|
+
:root[data-theme="dark"] {
|
|
15
|
+
--brand-donut-1: #FFFFFF; --brand-donut-2: #D8D8D8; --brand-donut-3: #888888; --brand-donut-4: #3F3F3F;
|
|
16
|
+
--page: #111111; --surface: var(--brand-ink); --raised: #242424; --ink: var(--brand-white); --ink2: #D8D8D8; --muted: #888888;
|
|
17
|
+
--hair: #2C2C2C; --base: #3F3F3F; --wash: rgba(255,255,255,.07); --accent: #3987e5; --accent-ink: #86b6ef;
|
|
18
|
+
--s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #18b4c2; --s7: #a27bf8; --s8: #8ab03a; --s9: #e879f9; --s10: #38bdf8; --s11: #f87171; --s12: #a3e635; --s13: #fb923c; --s14: #2dd4bf; --s15: #818cf8; --s16: #facc15; --s0: #5a5a55; --sub: #7b66f0; --seq: #3987e5;
|
|
19
|
+
--v0: #30286a; --v1: #4e42ae; --v2: #7c6ff0; --v3: #b2abff; --v4: #e4e1ff;
|
|
20
|
+
--k0: #3F3F3F; --k1: #888888; --k2: #D8D8D8; --kw: repeating-linear-gradient(135deg, #3F3F3F 0 4px, #555555 4px 8px);
|
|
21
|
+
--ck0: #5b8def; --ck1: #a07eea; --ck2: #c8a878;
|
|
22
|
+
--good: #0ca30c; --up: #86b6ef; --neg: #e66767; --shadow: 0 8px 28px rgba(0,0,0,.5);
|
|
23
|
+
--sb: rgba(255,255,255,.16); --sb-hover: rgba(255,255,255,.32);
|
|
24
|
+
}
|
|
25
|
+
* { box-sizing: border-box; }
|
|
26
|
+
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
|
|
27
|
+
html[data-theme="dark"] { color-scheme: dark; }
|
|
28
|
+
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.45 "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
29
|
+
button, select, input { font: inherit; color: inherit; }
|
|
30
|
+
code { font: 12.5px/1 "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace; }
|
|
31
|
+
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
|
|
32
|
+
|
|
33
|
+
/* sidebar */
|
|
34
|
+
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px; border-right: 1px solid var(--hair); background: var(--surface); }
|
|
35
|
+
.brand { display: flex; align-items: center; padding: 8px 10px 20px; }
|
|
36
|
+
.brand .brand-lockup { display: block; width: 132px; height: auto; flex: none; }
|
|
37
|
+
.navlabel { margin: 14px 10px 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
|
|
38
|
+
.nav { display: flex; flex-direction: column; gap: 2px; }
|
|
39
|
+
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; text-align: left; cursor: pointer; color: var(--ink2); font-weight: 500; }
|
|
40
|
+
.nav button:hover { background: var(--wash); color: var(--ink); }
|
|
41
|
+
.nav button[aria-current="page"] { background: var(--wash); color: var(--ink); font-weight: 600; }
|
|
42
|
+
.nav svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
|
|
43
|
+
.nav.quiet button { font-size: 13px; padding: 6px 10px; }
|
|
44
|
+
.side .foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: auto; padding: 12px 0 0; border-top: 1px solid var(--hair); color: var(--ink2); font-size: 12.5px; }
|
|
45
|
+
.foot .scan { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 10px; } .foot .si { min-width: 0; color: var(--ink2); font-size: 12.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .foot .si span { display: block; overflow: hidden; text-overflow: ellipsis; }
|
|
46
|
+
.foot .scan .icon { background: none; } .foot .scan .icon:hover:not(:disabled) { background: var(--wash); }
|
|
47
|
+
.foot .prefs { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
|
|
48
|
+
.foot .icon { width: 30px; height: 30px; border-radius: 8px; color: var(--ink2); } .foot .icon:hover:not(:disabled) { color: var(--ink); }
|
|
49
|
+
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
50
|
+
.mock { display: inline-block; margin-top: 8px; padding: 2px 8px; border: 1px solid var(--base); border-radius: 999px; font-size: 11.5px; font-weight: 500; }
|
|
51
|
+
|
|
52
|
+
/* main */
|
|
53
|
+
main { min-width: 0; padding: 20px 36px 56px; }
|
|
54
|
+
.wrap { max-width: 1320px; margin: 0 auto; }
|
|
55
|
+
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--wash); }
|
|
56
|
+
.seg button { padding: 5px 11px; border: 0; border-radius: 7px; background: none; cursor: pointer; color: var(--ink2); font-size: 13px; font-weight: 500; white-space: nowrap; }
|
|
57
|
+
.seg button:hover { color: var(--ink); }
|
|
58
|
+
/* the chosen segment takes the accent, as a set filter does, so it reads in both themes */
|
|
59
|
+
.seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--raised)); color: var(--accent-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
|
|
60
|
+
.icon { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--wash); cursor: pointer; }
|
|
61
|
+
.icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
|
|
62
|
+
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 22px; }
|
|
63
|
+
.field { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface); color: var(--ink2); font-size: 13px; }
|
|
64
|
+
.field input { min-width: 0; border: 0; background: none; outline: none; color: var(--ink); font-size: 13px; }
|
|
65
|
+
.clearall { gap: 6px; color: var(--ink); cursor: pointer; }
|
|
66
|
+
.clearall svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
|
|
67
|
+
.clearall:hover { border-color: var(--base); background: var(--wash); }
|
|
68
|
+
.rowlink { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
|
|
69
|
+
.rowlink:focus-visible, .clearall:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
70
|
+
|
|
71
|
+
.grid { display: grid; gap: 20px; }
|
|
72
|
+
.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
73
|
+
.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
|
|
74
|
+
.half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
75
|
+
.stack { display: grid; gap: 20px; }
|
|
76
|
+
.card { min-width: 0; padding: 16px 20px 20px; border: 1px solid var(--hair); border-radius: 14px; background: var(--surface); }
|
|
77
|
+
.card > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 28px; margin-bottom: 14px; }
|
|
78
|
+
.card > header .segs { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
79
|
+
.card > header .seg { padding: 2px; } .card > header .seg button { padding: 3px 10px; line-height: 18px; } .card > header .field { height: 28px; }
|
|
80
|
+
h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
|
|
81
|
+
.hint { color: var(--ink2); font-size: 12.5px; }
|
|
82
|
+
.link { border: 0; background: none; padding: 0; color: var(--accent-ink); cursor: pointer; font-size: 13px; white-space: nowrap; }
|
|
83
|
+
|
|
84
|
+
/* kpi */
|
|
85
|
+
.kpi { padding: 16px 18px 14px; }
|
|
86
|
+
.kpi .l { color: var(--ink2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
87
|
+
.kpi .vr { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 6px; }
|
|
88
|
+
.kpi .v { min-width: 0; font-size: 28px; font-weight: 620; line-height: 1.1; letter-spacing: -.02em; }
|
|
89
|
+
.kpi .v small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink2); white-space: nowrap; }
|
|
90
|
+
.kpi .d { margin-top: 10px; color: var(--ink2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
91
|
+
.kpi .d b { color: var(--ink); font-weight: 600; } .kpi .d b.better { color: var(--good); } .kpi .d b.worse { color: var(--neg); } .kpi .d b.vol { color: var(--up); }
|
|
92
|
+
.spark { width: 72px; height: 24px; flex: none; overflow: visible; margin-bottom: 4px; }
|
|
93
|
+
.spark polyline { fill: none; stroke: var(--base); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
|
|
94
|
+
td .spark { margin: 0; }
|
|
95
|
+
.spark circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
|
|
96
|
+
|
|
97
|
+
/* charts */
|
|
98
|
+
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; padding: 0; list-style: none; color: var(--ink2); font-size: 12.5px; }
|
|
99
|
+
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
|
|
100
|
+
.legend b { margin-left: 5px; color: var(--ink); font-weight: 600; }
|
|
101
|
+
/* effort levels: one violet ramp, low → max; text on a segment follows its lightness; a value outside the five is grey */
|
|
102
|
+
.v0 { background: var(--v0); } .v1 { background: var(--v1); } .v2 { background: var(--v2); } .v3 { background: var(--v3); } .v4 { background: var(--v4); } .v5, .v6, .v7, .v8, .v9 { background: var(--s0); }
|
|
103
|
+
.split i.v0, .split i.v1 { color: #0b0b0b; }
|
|
104
|
+
:root[data-theme="dark"] .split i.v0, :root[data-theme="dark"] .split i.v1 { color: #fff; }
|
|
105
|
+
:root[data-theme="dark"] .split i.v3, :root[data-theme="dark"] .split i.v4 { color: #0b0b0b; }
|
|
106
|
+
.lead { margin: 0 0 16px; font-size: 15.5px; line-height: 1.5; }
|
|
107
|
+
.lead b { font-weight: 650; }
|
|
108
|
+
.lead.accent { padding: 2px 0 2px 12px; border-left: 3px solid; }
|
|
109
|
+
.shares { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 10px 14px; }
|
|
110
|
+
.shares > span { color: var(--ink2); font-size: 12.5px; }
|
|
111
|
+
.shares .split { margin: 0; }
|
|
112
|
+
.lv { display: inline-flex; align-items: center; gap: 7px; }
|
|
113
|
+
.lv i { width: 9px; height: 9px; border-radius: 3px; }
|
|
114
|
+
.price td { padding-top: 12px; padding-bottom: 12px; } .price td[data-tip]:hover { background: var(--wash); } .price .sub.up { color: var(--ink); font-weight: 600; }
|
|
115
|
+
.x1 { color: var(--ink2); }
|
|
116
|
+
.c1 { background: var(--s1); } .c2 { background: var(--s2); } .c3 { background: var(--s3); } .c4 { background: var(--s4); } .c5 { background: var(--s5); } .c6 { background: var(--s6); } .c7 { background: var(--s7); } .c8 { background: var(--s8); } .c9 { background: var(--s9); } .c10 { background: var(--s10); } .c11 { background: var(--s11); } .c12 { background: var(--s12); } .c13 { background: var(--s13); } .c14 { background: var(--s14); } .c15 { background: var(--s15); } .c16 { background: var(--s16); } .c0 { background: var(--s0); } .csub { background: var(--sub); }
|
|
117
|
+
.chart { display: grid; grid-template-columns: 44px minmax(0, 1fr); padding-top: 10px; }
|
|
118
|
+
.axis { position: relative; height: 230px; }
|
|
119
|
+
.axis span { position: absolute; right: 8px; transform: translateY(50%); color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
120
|
+
.plot { position: relative; height: 230px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--base); }
|
|
121
|
+
.plot .gl { position: absolute; left: 0; right: 0; height: 1px; background: var(--hair); }
|
|
122
|
+
.col { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
|
|
123
|
+
.col:hover, .col:focus-visible { background: var(--wash); }
|
|
124
|
+
.bars { width: min(22px, 64%); height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
|
|
125
|
+
.bars i { display: block; min-height: 1px; }
|
|
126
|
+
.bars i:first-child { border-radius: 4px 4px 0 0; }
|
|
127
|
+
.col .x { position: absolute; top: 100%; margin-top: 8px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
|
|
128
|
+
.col .x em { position: absolute; top: 100%; left: 0; margin-top: 1px; color: var(--ink2); font-style: normal; }
|
|
129
|
+
.xpad { height: 44px; }
|
|
130
|
+
|
|
131
|
+
/* lists and tables */
|
|
132
|
+
.rank { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr) auto; align-items: center; gap: 9px 12px; }
|
|
133
|
+
.rank .n { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
|
|
134
|
+
.rank .n i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 3px; }
|
|
135
|
+
.rank .b { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 2px; }
|
|
136
|
+
.rank .t { height: 8px; border-radius: 4px; background: var(--wash); }
|
|
137
|
+
.rank .val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
138
|
+
.rank .val small { margin-left: 6px; color: var(--ink2); font-size: 12px; }
|
|
139
|
+
.rank button.n { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
|
|
140
|
+
.rank button.n:hover { color: var(--accent-ink); }
|
|
141
|
+
/* the scroll box reaches 10px into the card padding, so a highlighted row is inset while its text keeps the card's edge */
|
|
142
|
+
.scroll { overflow-x: auto; margin-inline: -10px; }
|
|
143
|
+
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
|
|
144
|
+
th, td { padding: 10px 14px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hair); font-weight: 400; white-space: nowrap; }
|
|
145
|
+
tr:last-child td, tr:last-child th { border-bottom: 0; }
|
|
146
|
+
th:first-child, td:first-child { padding-left: 10px; }
|
|
147
|
+
th:last-child, td:last-child { padding-right: 10px; }
|
|
148
|
+
thead th { padding-top: 0; padding-bottom: 8px; color: var(--ink2); font-size: 12.5px; font-weight: 500; vertical-align: bottom; border-bottom: 1px solid var(--base) !important; }
|
|
149
|
+
thead th button { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
|
|
150
|
+
thead th[aria-sort] button { color: var(--ink); font-weight: 600; }
|
|
151
|
+
.compare thead th, .wraphead thead th { white-space: normal; text-wrap: balance; min-width: 76px; }
|
|
152
|
+
.flag { margin-left: 2px; color: var(--ink2); font-size: .55em; vertical-align: super; cursor: default; outline-offset: 2px; }
|
|
153
|
+
.num { text-align: right; }
|
|
154
|
+
.name { font-weight: 550; }
|
|
155
|
+
.ph { display: none !important; }
|
|
156
|
+
.sub { display: block; margin-top: 2px; color: var(--ink2); font-size: 12.5px; font-weight: 400; }
|
|
157
|
+
.title { min-width: 140px; max-width: 260px; overflow: hidden; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
|
|
158
|
+
.sesstable .title, .sesstable td .sub { max-width: 460px; white-space: normal; } .sesstable .nw { white-space: nowrap; }
|
|
159
|
+
tbody tr.go { cursor: pointer; }
|
|
160
|
+
tbody tr.go:hover td, tbody tr.go:hover th { background: var(--wash); }
|
|
161
|
+
.mix { display: flex; gap: 2px; width: 84px; height: 8px; margin-top: 5px; }
|
|
162
|
+
.mix i { display: block; height: 100%; min-width: 2px; }
|
|
163
|
+
.mix i:first-child { border-radius: 4px 0 0 4px; } .mix i:last-child { border-radius: 0 4px 4px 0; } .mix i:only-child { border-radius: 4px; }
|
|
164
|
+
|
|
165
|
+
/* heatmap */
|
|
166
|
+
.heat { display: grid; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
|
|
167
|
+
.heat .rl { color: var(--ink2); font-size: 12px; }
|
|
168
|
+
.heat .cl { color: var(--muted); font-size: 11px; text-align: left; padding-top: 4px; }
|
|
169
|
+
.heat .cell { aspect-ratio: 1 / 1; max-height: 26px; width: 100%; border-radius: 3px; background: color-mix(in srgb, var(--seq) var(--m), var(--wash)); }
|
|
170
|
+
.heat .cell:hover { outline: 2px solid var(--ink); outline-offset: -1px; }
|
|
171
|
+
.hstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; }
|
|
172
|
+
.hstats div { display: grid; align-content: start; gap: 2px; min-width: 0; }
|
|
173
|
+
.hstats dt { color: var(--ink2); font-size: 12px; } .hstats dd { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 20px; font-weight: 650; white-space: nowrap; } .hstats .sub { color: var(--muted); font-size: 12px; } .hstats .sub .line { display: block; white-space: nowrap; }
|
|
174
|
+
.hstats dd.err { color: var(--neg); } .hstats + .rank, .hstats + .legend, .hstats + .rows { margin-top: 18px; } .lead + .hstats, header + .hstats { margin-top: 2px; }
|
|
175
|
+
.hstats .gap { display: block; height: 16px; } .hstats .meter { display: block; height: 6px; margin: 6px 0 4px; border-radius: 3px; background: var(--wash); overflow: hidden; } .hstats .meter i { display: block; height: 100%; border-radius: 3px; }
|
|
176
|
+
.hstats .dots { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; height: 7px; margin: 5px 0 4px; } .hstats .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--wash); box-shadow: inset 0 0 0 1px var(--base); } .hstats .dots i.on { background: var(--seq); box-shadow: none; }
|
|
177
|
+
.hstats .hsw { width: 12px; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--seq) var(--m), var(--wash)); } .cseq { background: var(--seq); } .cneg { background: var(--neg); }
|
|
178
|
+
.split { display: flex; gap: 2px; height: 28px; margin: 4px 0 12px; }
|
|
179
|
+
.split i { display: flex; align-items: center; padding: 0 9px; border-radius: 4px; color: #fff; font-size: 12.5px; font-style: normal; font-weight: 600; overflow: hidden; white-space: nowrap; } .split i:empty { padding: 0; }
|
|
180
|
+
.split i.c4, .split i.c12, .split i.c14, .split i.c16 { color: #0b0b0b; } .split i.c0 { color: var(--ink); }
|
|
181
|
+
.money td.wide, .money th.wide { width: 55%; }
|
|
182
|
+
.rank .b.k0 { background: var(--k0); } .rank .b.k1 { background: var(--k1); } .rank .b.k2 { background: var(--k2); } .rank .b.kw { background: var(--kw); } .rank .b.kx { background: transparent; box-shadow: inset 0 0 0 1px var(--base); }
|
|
183
|
+
.split.kinds { height: 24px; min-width: 240px; margin: 0; cursor: default; }
|
|
184
|
+
/* Cost kinds: a neutral ramp, so money reads as neither gained nor lost; web search, a fee rather than tokens, is striped;
|
|
185
|
+
a part that cannot be split is only outlined. */
|
|
186
|
+
.k0 { background: var(--k0); } .k1 { background: var(--k1); } .k2 { background: var(--k2); } .kw { background: var(--kw); } .kx { background: transparent; box-shadow: inset 0 0 0 1px var(--base); }
|
|
187
|
+
.split i.k0, .split i.k1, .split i.kw { color: #0b0b0b; } .split i.k2 { color: #fff; } .split i.kx { color: var(--ink2); }
|
|
188
|
+
:root[data-theme="dark"] .split i.k0, :root[data-theme="dark"] .split i.k1, :root[data-theme="dark"] .split i.kw { color: #fff; } :root[data-theme="dark"] .split i.k2 { color: #0b0b0b; }
|
|
189
|
+
/* Context cost parts: distinct hues of equal weight, none red or green, which mark the difference column. */
|
|
190
|
+
.ck0 { background: var(--ck0); } .ck1 { background: var(--ck1); } .ck2 { background: var(--ck2); }
|
|
191
|
+
.empty { padding: 40px 0; text-align: center; color: var(--ink2); }
|
|
192
|
+
#tip { position: fixed; z-index: 9; display: none; min-width: 150px; max-width: 400px; padding: 10px 12px; border: 1px solid var(--base); border-radius: 10px; background: var(--raised); box-shadow: var(--shadow); font-size: 12.5px; pointer-events: none; }
|
|
193
|
+
#tip .h { margin-bottom: 6px; color: var(--ink2); }
|
|
194
|
+
#tip .h:last-child { margin-bottom: 0; color: var(--ink); }
|
|
195
|
+
#tip .r { display: flex; align-items: center; gap: 8px; } #tip .r span { flex: 1; min-width: 0; } #tip .r b { white-space: nowrap; }
|
|
196
|
+
#tip .r i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
|
|
197
|
+
#tip .r span { color: var(--ink2); }
|
|
198
|
+
#tip .r b { margin-left: auto; padding-left: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
199
|
+
|
|
200
|
+
/* scrollbars: a thin rounded thumb on a clear track, darker under the pointer; Firefox gets the standard thin bar */
|
|
201
|
+
::-webkit-scrollbar { width: 12px; height: 12px; }
|
|
202
|
+
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
|
|
203
|
+
::-webkit-scrollbar-thumb { min-height: 36px; border: 3px solid transparent; border-radius: 999px; background: var(--sb) padding-box; }
|
|
204
|
+
::-webkit-scrollbar-thumb:hover { background-color: var(--sb-hover); }
|
|
205
|
+
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--sb) transparent; } }
|
|
206
|
+
|
|
207
|
+
/* activity: a tool's calls as a bar with its failed part at the end */
|
|
208
|
+
.rank.tools .b { display: flex; justify-content: flex-end; overflow: hidden; }
|
|
209
|
+
.rank.tools .b i { height: 100%; background: var(--neg); }
|
|
210
|
+
.rank .val small.err { color: var(--neg); }
|
|
211
|
+
/* activity: skills grouped by source; a bar splits typed commands from the agent's own calls */
|
|
212
|
+
.rank .grp { grid-column: 1 / -1; margin-top: 6px; color: var(--ink2); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
|
|
213
|
+
.rank .grp:first-child { margin-top: 0; }
|
|
214
|
+
.rank .b.parts { position: relative; justify-content: flex-start; background: none; }
|
|
215
|
+
.rank .b.parts b { flex: none; height: 100%; }
|
|
216
|
+
.rank .b.parts i { position: absolute; top: 0; right: 0; }
|
|
217
|
+
.card > .disc.more { margin-top: 10px; }
|
|
218
|
+
#tip .r i.neg { background: var(--neg); }
|
|
219
|
+
|
|
220
|
+
/* models: shares as bars out of 100%, and one split bar per model */
|
|
221
|
+
.money td { vertical-align: middle; }
|
|
222
|
+
.sharebar { display: grid; grid-template-columns: minmax(80px, 1fr) 44px 64px; align-items: center; gap: 10px; min-width: 220px; padding-right: 12px; }
|
|
223
|
+
.sharebar .t { height: 8px; border-radius: 4px; background: var(--wash); overflow: hidden; }
|
|
224
|
+
.sharebar .t i { display: block; height: 100%; border-radius: 4px; }
|
|
225
|
+
.sharebar b { text-align: right; font-weight: 600; }
|
|
226
|
+
.sharebar small { color: var(--ink2); font-size: 12.5px; text-align: right; }
|
|
227
|
+
.rows { display: grid; grid-template-columns: minmax(64px, auto) minmax(0, 1fr); align-items: center; gap: 10px 14px; }
|
|
228
|
+
.rows.total { grid-template-columns: minmax(64px, auto) minmax(0, 1fr) auto; } .rows .num { color: var(--ink2); font-size: 12.5px; text-align: right; }
|
|
229
|
+
.rows .n { font-weight: 550; white-space: nowrap; }
|
|
230
|
+
/* a subagent share is its model color mixed into the card, so the label inside keeps full contrast */
|
|
231
|
+
|
|
232
|
+
/* projects: each project's share as a treemap, and the table that compares them */
|
|
233
|
+
.tree { position: relative; }
|
|
234
|
+
.tile { position: absolute; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 8px 10px; border: 2px solid var(--surface); border-radius: 10px; color: #fff; font: inherit; text-align: left; overflow: hidden; cursor: pointer; transition: opacity .15s; }
|
|
235
|
+
.tile b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
236
|
+
.tile span { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
237
|
+
.tile.c4 { color: #0b0b0b; } .tile.c0 { color: var(--ink); }
|
|
238
|
+
.tile:hover { filter: brightness(1.08); }
|
|
239
|
+
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
|
|
240
|
+
.compare tfoot th, .compare tfoot td { border-bottom: 0; color: var(--ink2); font-weight: 600; }
|
|
241
|
+
.compare .quiet { color: var(--muted); }
|
|
242
|
+
|
|
243
|
+
/* controls: dropdowns, the date range calendar, search and disclosure, in place of the browser's own */
|
|
244
|
+
.ctl { position: relative; flex: none; }
|
|
245
|
+
.ctl svg, .search svg, .disc svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
|
|
246
|
+
button.field { cursor: pointer; }
|
|
247
|
+
button.field:hover, button.field[aria-expanded="true"], .field.search:focus-within { border-color: var(--base); }
|
|
248
|
+
button.field:focus-visible, .disc:focus-visible, .clear:focus-visible, .cal-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
249
|
+
.field.pick { gap: 8px; color: var(--ink); }
|
|
250
|
+
.pick .pv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
|
|
251
|
+
.pick .chev { color: var(--muted); transition: transform .15s; }
|
|
252
|
+
/* a filter set to anything but its "all" choice is tinted, so the narrowed view is visible at a glance */
|
|
253
|
+
.field.pick.on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--accent-ink); }
|
|
254
|
+
.field.pick.on .chev { color: var(--accent-ink); }
|
|
255
|
+
.pick[aria-expanded="true"] .chev { transform: rotate(180deg); }
|
|
256
|
+
.pick .cal { color: var(--ink2); }
|
|
257
|
+
.pop { position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; min-width: 100%; padding: 6px; border: 1px solid var(--base); border-radius: 12px; background: var(--raised); box-shadow: var(--shadow); outline: none; }
|
|
258
|
+
.ttl { display: flex; align-items: center; gap: 6px; }
|
|
259
|
+
.ib { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; padding: 0; color: var(--muted); cursor: pointer; }
|
|
260
|
+
.ib:hover, .ib[aria-expanded="true"] { background: var(--wash); color: var(--ink); }
|
|
261
|
+
.ib svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
|
|
262
|
+
.pop.note { width: min(340px, calc(100vw - 16px)); padding: 12px 14px; color: var(--ink2); font-size: 13px; line-height: 1.5; white-space: normal; }
|
|
263
|
+
.pop.note p { margin: 0 0 8px; } .pop.note ul { margin: 0; padding-left: 16px; } .pop.note li + li { margin-top: 4px; } .note b { color: var(--ink); font-weight: 600; }
|
|
264
|
+
.list { min-width: 190px; max-height: 340px; overflow-y: auto; }
|
|
265
|
+
.opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 10px; border-radius: 8px; color: var(--ink2); font-size: 13px; white-space: nowrap; cursor: pointer; }
|
|
266
|
+
.opt.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); }
|
|
267
|
+
.opt[aria-selected="true"] { color: var(--accent-ink); font-weight: 600; }
|
|
268
|
+
.opt .tick { color: var(--accent-ink); }
|
|
269
|
+
.cal-pop { padding: 12px 14px 10px; }
|
|
270
|
+
.cal-nav { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
|
|
271
|
+
.cal-step { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--ink2); cursor: pointer; pointer-events: auto; }
|
|
272
|
+
.cal-step:hover:not(:disabled) { background: var(--wash); color: var(--ink); }
|
|
273
|
+
.cal-step:disabled { opacity: .3; cursor: default; }
|
|
274
|
+
.cal-months { display: flex; gap: 28px; }
|
|
275
|
+
.cal-title { height: 28px; margin-bottom: 4px; line-height: 28px; text-align: center; font-size: 13.5px; font-weight: 600; }
|
|
276
|
+
.cal-title::first-letter { text-transform: uppercase; }
|
|
277
|
+
.cal-row { display: grid; grid-template-columns: repeat(7, 36px); }
|
|
278
|
+
.cal-wd { height: 26px; line-height: 26px; text-align: center; color: var(--muted); font-size: 11.5px; }
|
|
279
|
+
.cal-cell { display: grid; place-items: center; height: 34px; margin: 1px 0; }
|
|
280
|
+
.cal-cell.in { background: color-mix(in srgb, var(--accent) 13%, transparent); }
|
|
281
|
+
/* the shaded window rounds at its ends and where a week or a month breaks it */
|
|
282
|
+
.cal-cell.lo, .cal-cell.in:first-child, .blank + .cal-cell.in { border-top-left-radius: 9px; border-bottom-left-radius: 9px; }
|
|
283
|
+
.cal-cell.hi, .cal-cell.in:last-child, .cal-cell.in:has(+ .blank) { border-top-right-radius: 9px; border-bottom-right-radius: 9px; }
|
|
284
|
+
.cal-day { width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
|
|
285
|
+
.cal-day:hover:not(:disabled) { background: var(--wash); }
|
|
286
|
+
.cal-day.today { box-shadow: inset 0 0 0 1px var(--base); }
|
|
287
|
+
.cal-day.end, .cal-day.end:hover { background: var(--accent); color: #fff; font-weight: 600; box-shadow: none; }
|
|
288
|
+
.cal-day:disabled { color: var(--muted); opacity: .45; cursor: default; }
|
|
289
|
+
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
290
|
+
.field.search { gap: 7px; }
|
|
291
|
+
.search .mag { color: var(--muted); }
|
|
292
|
+
.search input { width: 200px; }
|
|
293
|
+
.clear { display: grid; place-items: center; width: 22px; height: 22px; margin-right: -5px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
|
|
294
|
+
.clear:hover { background: var(--wash); color: var(--ink); }
|
|
295
|
+
.disc { display: inline-flex; align-items: center; gap: 6px; margin-left: -6px; padding: 4px 8px 4px 6px; border: 0; border-radius: 7px; background: none; color: var(--ink2); font-size: 12.5px; cursor: pointer; }
|
|
296
|
+
.disc:hover { background: var(--wash); color: var(--ink); }
|
|
297
|
+
.disc svg { transition: transform .15s; }
|
|
298
|
+
.disc[aria-expanded="true"] svg { transform: rotate(90deg); }
|
|
299
|
+
.disclosure .scroll { margin-top: 10px; }
|
|
300
|
+
@media (prefers-reduced-motion: reduce) { .pick .chev, .disc svg { transition: none; } }
|
|
301
|
+
|
|
302
|
+
@media (max-width: 1400px) { .o3 { display: none; } .filters { gap: 8px; } .pick .pv { max-width: 112px; } .range .pv { max-width: none; } .filters .seg button { padding: 5px 7px; } }
|
|
303
|
+
@media (max-width: 1500px) { .wraphead .o3 { display: none; } }
|
|
304
|
+
@media (max-width: 1060px) { .two, .half { grid-template-columns: minmax(0, 1fr); } .o2 { display: none; } }
|
|
305
|
+
@media (max-width: 880px) {
|
|
306
|
+
.app { display: block; }
|
|
307
|
+
.side { position: static; height: auto; flex-direction: row; align-items: center; gap: 4px 6px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; }
|
|
308
|
+
.side::-webkit-scrollbar { display: none; } .nav { flex: none; }
|
|
309
|
+
.brand { padding: 6px 10px 6px 2px; flex: none; } .brand .brand-lockup { width: 120px; } .navlabel, .foot .si { display: none; } .foot .scan { padding: 0; } .foot .scan .icon { background: var(--wash); }
|
|
310
|
+
.side .foot { position: sticky; right: -16px; display: flex; align-self: stretch; align-items: center; gap: 6px; margin: 0 -16px 0 auto; padding: 0 16px 0 10px; border-top: 0; background: var(--surface); }
|
|
311
|
+
.nav { flex-direction: row; } .nav button { white-space: nowrap; } .nav svg { display: none; } .nav.quiet button { font-size: 14px; padding: 8px 10px; }
|
|
312
|
+
main { padding: 20px 20px 48px; } .title { max-width: 200px; } .filters { gap: 8px; } .filters .seg button { padding: 5px 6px; font-size: 12.5px; } .field { padding: 0 8px; }
|
|
313
|
+
}
|
|
314
|
+
@media (max-width: 600px) {
|
|
315
|
+
main { padding: 16px 16px 40px; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid, .stack { gap: 14px; }
|
|
316
|
+
.kpi .spark { display: none; } .kpi .d { white-space: normal; } .kpi .v { font-size: 24px; }
|
|
317
|
+
.card { padding: 16px; } .o1 { display: none; }
|
|
318
|
+
.title { max-width: 160px; } .search input { width: 150px; } .ph { display: block !important; white-space: normal; max-width: 170px; } thead th { white-space: normal; } .mix.wide { width: 84px !important; } th, td { padding-right: 10px; } .axis, .plot { height: 190px; } .chart { grid-template-columns: 38px minmax(0, 1fr); }
|
|
319
|
+
.heat { grid-template-columns: 32px repeat(24, minmax(0, 1fr)); gap: 1px; } .hstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rank .n { max-width: 120px; }
|
|
320
|
+
.price th, .price td { padding-right: 8px; font-size: 13px; } .price .lv { gap: 5px; }
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/* refresh: the button spins while a scan runs */
|
|
324
|
+
.refresh:disabled { cursor: progress; }
|
|
325
|
+
.refresh.busy svg { animation: spin 1s linear infinite; }
|
|
326
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
327
|
+
@media (prefers-reduced-motion: reduce) { .refresh.busy svg { animation-duration: 3s; } }
|
|
328
|
+
.alert { margin: -6px 0 0; color: var(--neg); font-size: 12.5px; }
|
|
329
|
+
.loading { padding: 80px 0; text-align: center; color: var(--ink2); }
|
|
330
|
+
/* before the first rows: what the scan is doing and how far it got */
|
|
331
|
+
.boot { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
|
|
332
|
+
.boot-in { display: grid; gap: 14px; width: min(400px, 100%); margin-top: -8vh; }
|
|
333
|
+
.boot .brand { padding: 8px 0 12px; }
|
|
334
|
+
.boot .brand .brand-lockup { width: 160px; }
|
|
335
|
+
.boot-msg { margin: 0; font-size: 15px; font-weight: 550; }
|
|
336
|
+
.boot-err { margin: 0; color: var(--neg); font-size: 13px; overflow-wrap: anywhere; }
|
|
337
|
+
.boot .clearall { justify-self: start; }
|
|
338
|
+
.boot-bar { height: 6px; overflow: hidden; border-radius: 3px; background: var(--wash); }
|
|
339
|
+
.boot-bar span { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--accent); transition: width .3s; }
|
|
340
|
+
.boot-bar.wait span { width: 30%; animation: boot-wait 1.2s ease-in-out infinite; }
|
|
341
|
+
@keyframes boot-wait { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
|
|
342
|
+
.boot-count { margin: 0; color: var(--ink2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
|
|
343
|
+
@media (prefers-reduced-motion: reduce) { .boot-bar span { transition: none; } .boot-bar.wait span { animation: none; width: 100%; opacity: .35; } }
|
|
344
|
+
|
|
345
|
+
/* Thirty days or more: stacked areas, a column per day still hovered, with a line across the hovered day. */
|
|
346
|
+
.plot .bands, .plot .bands i, .plot .bands svg { position: absolute; inset: 0; pointer-events: none; }
|
|
347
|
+
.plot .bands svg { width: 100%; height: 100%; overflow: visible; }
|
|
348
|
+
/* Each band a light wash of its color fading toward the axis, under a crisp line in the same color along its top. */
|
|
349
|
+
.plot .bands i { opacity: .42; -webkit-mask-image: linear-gradient(to bottom, #000 20%, rgba(0, 0, 0, .15)); mask-image: linear-gradient(to bottom, #000 20%, rgba(0, 0, 0, .15)); }
|
|
350
|
+
:root[data-theme="dark"] .plot .bands i { opacity: .62; }
|
|
351
|
+
.plot .bands polyline { fill: none; stroke: var(--base); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
|
|
352
|
+
.plot .bands polyline.c0 { stroke: var(--s0); } .plot .bands polyline.c1 { stroke: var(--s1); } .plot .bands polyline.c2 { stroke: var(--s2); } .plot .bands polyline.c3 { stroke: var(--s3); } .plot .bands polyline.c4 { stroke: var(--s4); } .plot .bands polyline.c5 { stroke: var(--s5); } .plot .bands polyline.c6 { stroke: var(--s6); } .plot .bands polyline.c7 { stroke: var(--s7); } .plot .bands polyline.c8 { stroke: var(--s8); } .plot .bands polyline.c9 { stroke: var(--s9); } .plot .bands polyline.c10 { stroke: var(--s10); } .plot .bands polyline.c11 { stroke: var(--s11); } .plot .bands polyline.c12 { stroke: var(--s12); } .plot .bands polyline.c13 { stroke: var(--s13); } .plot .bands polyline.c14 { stroke: var(--s14); } .plot .bands polyline.c15 { stroke: var(--s15); } .plot .bands polyline.c16 { stroke: var(--s16); } .plot .bands polyline.csub { stroke: var(--sub); }
|
|
353
|
+
.plot .bands polyline.v0 { stroke: var(--v0); } .plot .bands polyline.v1 { stroke: var(--v1); } .plot .bands polyline.v2 { stroke: var(--v2); } .plot .bands polyline.v3 { stroke: var(--v3); } .plot .bands polyline.v4 { stroke: var(--v4); }
|
|
354
|
+
.plot .bands polyline.k0 { stroke: var(--k0); } .plot .bands polyline.k1 { stroke: var(--k1); } .plot .bands polyline.k2 { stroke: var(--k2); } .plot .bands polyline.kw, .plot .bands polyline.kx { stroke: var(--base); }
|
|
355
|
+
.plot.area .col:hover, .plot.area .col:focus-visible { background: none; }
|
|
356
|
+
.plot.area .col:hover::before, .plot.area .col:focus-visible::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--ink); opacity: .55; }
|
|
357
|
+
.plot.area .col .dot { display: none; position: absolute; left: 50%; z-index: 1; width: 8px; height: 8px; margin: 0 0 -4px -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
|
|
358
|
+
.plot.area .col:hover .dot, .plot.area .col:focus-visible .dot { display: block; }
|
|
359
|
+
.spark polygon { stroke: none; }
|
|
360
|
+
.spark .g0 { stop-color: var(--ink2); stop-opacity: .2; } .spark .g1 { stop-color: var(--ink2); stop-opacity: 0; }
|
|
361
|
+
|
|
362
|
+
/* A table figure with a bar under it, against the largest in its column. */
|
|
363
|
+
.magbar { display: inline-block; position: relative; min-width: 56px; padding-bottom: 6px; }
|
|
364
|
+
.magbar::after { content: ""; position: absolute; right: 0; bottom: 0; height: 3px; width: calc(var(--w) * 56px); border-radius: 2px; background: var(--ink2); opacity: .55; }
|
|
365
|
+
|
|
366
|
+
/* How each model works: ranked panels side by side. */
|
|
367
|
+
.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 32px; }
|
|
368
|
+
.panel h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink2); }
|
|
369
|
+
@media (max-width: 1060px) { .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|
370
|
+
@media (max-width: 640px) { .panels { grid-template-columns: minmax(0, 1fr); } }
|
|
371
|
+
.chartseg button { display: inline-flex; align-items: center; }
|
|
372
|
+
.chartseg svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
|
|
373
|
+
.card > header .segs { align-items: center; }
|
|
374
|
+
|
|
375
|
+
/* context: what each compaction kept and left to work with, the cost of reading the context by size, and the replay */
|
|
376
|
+
.gauge { margin: 2px 0 6px; }
|
|
377
|
+
.gauge .track { display: flex; gap: 2px; height: 14px; }
|
|
378
|
+
.gauge .track i { display: block; height: 100%; }
|
|
379
|
+
.gauge .track i:first-child { border-radius: 4px 0 0 4px; } .gauge .track i:last-child { border-radius: 0 4px 4px 0; }
|
|
380
|
+
.gauge .ticks { position: relative; height: 18px; margin-top: 6px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
|
|
381
|
+
.gauge .ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
|
|
382
|
+
.gauge .ticks span:first-child { transform: none; } .gauge .ticks span:last-child { transform: translateX(-100%); color: var(--ink2); }
|
|
383
|
+
.ctx .hstats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 18px; }
|
|
384
|
+
.ctx .hstats .tipped { cursor: default; text-decoration: underline dotted var(--base); text-underline-offset: 5px; outline-offset: 3px; }
|
|
385
|
+
.ctx td, .ctx th { vertical-align: middle; }
|
|
386
|
+
.ctx td.lbl { font-weight: 550; } .ctx td.lbl .sub { display: inline; margin: 0 0 0 6px; }
|
|
387
|
+
.ctx tfoot td { border-top: 1px solid var(--base); border-bottom: 0; color: var(--ink2); font-weight: 600; }
|
|
388
|
+
.ctx .better { color: var(--good); font-weight: 600; } .ctx .worse { color: var(--neg); font-weight: 600; }
|
|
389
|
+
.cell-bar { width: 42%; }
|
|
390
|
+
td.cell-bar .split.kinds { min-width: 0; height: 20px; margin: 0; }
|
|
391
|
+
.bar1 { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 2px; }
|
|
392
|
+
.est { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border: 1px dashed var(--base); border-radius: 999px; background: none; color: var(--ink2); font: inherit; font-size: 12px; font-weight: 500; cursor: default; }
|
|
393
|
+
.est:hover, .est:focus-visible { color: var(--ink); border-color: var(--ink2); }
|
|
394
|
+
.chip { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, var(--raised)); color: var(--accent-ink); font-size: 11.5px; font-weight: 600; vertical-align: 1px; }
|
|
395
|
+
/* where compaction fires now: the row outlined in the accent */
|
|
396
|
+
.ctx tbody tr.now td { --line: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
|
|
397
|
+
.ctx tbody tr.now td:first-child { border-radius: 8px 0 0 8px; box-shadow: inset 1px 1px 0 var(--line), inset 0 -1px 0 var(--line); }
|
|
398
|
+
.ctx tbody tr.now td:last-child { border-radius: 0 8px 8px 0; box-shadow: inset -1px 1px 0 var(--line), inset 0 -1px 0 var(--line); }
|
|
399
|
+
@media (max-width: 600px) { .ctx .hstats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ctx .hstats dd { font-size: 17px; } }
|
|
400
|
+
.kpi { container-type: inline-size; }
|
|
401
|
+
@container (max-width: 260px) { .kpis:has(.v small) .spark { display: none; } }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// One tooltip for the page: an element with data-tip (see tip() in ui.tsx) shows it on hover or focus.
|
|
2
|
+
// On hover it follows the pointer, so a wide bar keeps it next to the cursor; on focus it sits beside the element.
|
|
3
|
+
export function installTip(el: HTMLElement) {
|
|
4
|
+
let shown: HTMLElement | null = null;
|
|
5
|
+
function fill(target: HTMLElement) {
|
|
6
|
+
const d = JSON.parse(target.dataset.tip!) as { h: string; r: [string, string, string][] };
|
|
7
|
+
// A label-only tip says nothing new when the element already shows that text, as a button does at full width.
|
|
8
|
+
if (!d.r.length && target.innerText.trim() === d.h) return false;
|
|
9
|
+
el.textContent = "";
|
|
10
|
+
const h = document.createElement("div"); h.className = "h"; h.textContent = d.h; el.append(h);
|
|
11
|
+
for (const [cls, name, value] of d.r) {
|
|
12
|
+
const row = document.createElement("div"); row.className = "r";
|
|
13
|
+
const key = document.createElement("i"); key.className = cls;
|
|
14
|
+
const label = document.createElement("span"); label.textContent = name;
|
|
15
|
+
const b = document.createElement("b"); b.textContent = value;
|
|
16
|
+
row.append(key, label, b); el.append(row);
|
|
17
|
+
}
|
|
18
|
+
el.style.display = "block";
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
// Right of and below (x, y) by gap, flipped to the other side when it would leave the window.
|
|
22
|
+
function place(x: number, y: number, gapX: number, gapY: number) {
|
|
23
|
+
const w = el.offsetWidth, hgt = el.offsetHeight;
|
|
24
|
+
const left = x + gapX + w > innerWidth - 8 ? x - gapX - w : x + gapX;
|
|
25
|
+
const top = y + gapY + hgt > innerHeight - 8 ? y - gapY - hgt : y + gapY;
|
|
26
|
+
el.style.left = Math.max(8, left) + "px";
|
|
27
|
+
el.style.top = Math.max(8, top) + "px";
|
|
28
|
+
}
|
|
29
|
+
const hide = () => { el.style.display = "none"; shown = null; };
|
|
30
|
+
const find = (e: Event) => (e.target as Element).closest?.<HTMLElement>("[data-tip]");
|
|
31
|
+
const follow = (e: PointerEvent) => {
|
|
32
|
+
const t = find(e);
|
|
33
|
+
if (!t) return hide();
|
|
34
|
+
if (t !== shown) { if (!fill(t)) return hide(); shown = t; }
|
|
35
|
+
place(e.clientX, e.clientY, 14, 14);
|
|
36
|
+
};
|
|
37
|
+
// pointerover also covers a tap, which moves no pointer.
|
|
38
|
+
document.addEventListener("pointerover", follow);
|
|
39
|
+
document.addEventListener("pointermove", follow, { passive: true });
|
|
40
|
+
document.addEventListener("focusin", (e) => {
|
|
41
|
+
const t = find(e);
|
|
42
|
+
if (!t || !fill(t)) return;
|
|
43
|
+
shown = t;
|
|
44
|
+
const box = t.getBoundingClientRect();
|
|
45
|
+
if (box.right + 10 + el.offsetWidth <= innerWidth - 8) place(box.right, box.top + 8, 10, 0);
|
|
46
|
+
else place(box.left, box.bottom, 0, 8);
|
|
47
|
+
});
|
|
48
|
+
document.addEventListener("focusout", hide);
|
|
49
|
+
document.addEventListener("pointerleave", hide);
|
|
50
|
+
addEventListener("scroll", hide, { passive: true });
|
|
51
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { test } from "node:test";
|
|
3
|
+
import { squarify } from "./treemap.ts";
|
|
4
|
+
|
|
5
|
+
test("areas follow the values and the rectangles tile the box", () => {
|
|
6
|
+
const box = { x: 0, y: 0, w: 600, h: 300 }, values = [50, 25, 12, 8, 3, 2];
|
|
7
|
+
const rects = squarify(values, box);
|
|
8
|
+
assert.equal(rects.length, values.length);
|
|
9
|
+
rects.forEach((r, k) => {
|
|
10
|
+
assert.ok(Math.abs(r.w * r.h - (values[k] / 100) * 600 * 300) < 1e-6);
|
|
11
|
+
assert.ok(r.x >= -1e-9 && r.y >= -1e-9 && r.x + r.w <= 600 + 1e-9 && r.y + r.h <= 300 + 1e-9);
|
|
12
|
+
});
|
|
13
|
+
// No two rectangles overlap.
|
|
14
|
+
for (let a = 0; a < rects.length; a++) for (let b = a + 1; b < rects.length; b++) {
|
|
15
|
+
const p = rects[a], q = rects[b];
|
|
16
|
+
const ox = Math.min(p.x + p.w, q.x + q.w) - Math.max(p.x, q.x), oy = Math.min(p.y + p.h, q.y + q.h) - Math.max(p.y, q.y);
|
|
17
|
+
assert.ok(ox <= 1e-9 || oy <= 1e-9);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test("nothing to lay out gives empty rectangles", () => {
|
|
22
|
+
assert.deepEqual(squarify([0, 0], { x: 0, y: 0, w: 10, h: 10 }).map((r) => r.w * r.h), [0, 0]);
|
|
23
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Squarified treemap layout: splits a box into rectangles with areas in proportion to the values, keeping each
|
|
2
|
+
// as close to square as the order allows. Values are laid out in the order given, largest first reads best.
|
|
3
|
+
export type Rect = { x: number; y: number; w: number; h: number };
|
|
4
|
+
|
|
5
|
+
export function squarify(values: number[], box: Rect): Rect[] {
|
|
6
|
+
const total = values.reduce((a, b) => a + b, 0);
|
|
7
|
+
if (!total || !box.w || !box.h) return values.map(() => ({ x: box.x, y: box.y, w: 0, h: 0 }));
|
|
8
|
+
const areas = values.map((v) => (v / total) * box.w * box.h), out: Rect[] = [];
|
|
9
|
+
let { x, y, w, h } = box, i = 0;
|
|
10
|
+
// The worst aspect ratio of a row of areas laid along a side of this length.
|
|
11
|
+
const worst = (row: number[], side: number) => {
|
|
12
|
+
const s = row.reduce((a, b) => a + b, 0), max = Math.max(...row), min = Math.min(...row);
|
|
13
|
+
return Math.max((side * side * max) / (s * s), (s * s) / (side * side * min));
|
|
14
|
+
};
|
|
15
|
+
while (i < areas.length) {
|
|
16
|
+
const side = Math.min(w, h), row = [areas[i]];
|
|
17
|
+
let j = i + 1;
|
|
18
|
+
while (j < areas.length && worst([...row, areas[j]], side) <= worst(row, side)) row.push(areas[j++]);
|
|
19
|
+
const thick = row.reduce((a, b) => a + b, 0) / side;
|
|
20
|
+
let off = 0;
|
|
21
|
+
for (const a of row) {
|
|
22
|
+
const len = thick ? a / thick : 0;
|
|
23
|
+
out.push(w >= h ? { x, y: y + off, w: thick, h: len } : { x: x + off, y, w: len, h: thick });
|
|
24
|
+
off += len;
|
|
25
|
+
}
|
|
26
|
+
if (w >= h) { x += thick; w -= thick; } else { y += thick; h -= thick; }
|
|
27
|
+
i = j;
|
|
28
|
+
}
|
|
29
|
+
return out;
|
|
30
|
+
}
|