react-semaphor 0.1.605 → 0.1.607

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.
Files changed (151) hide show
  1. package/dist/analytics-protocol/index.js +1 -1
  2. package/dist/appearance-runtime/index.js +1 -1
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/assistant-protocol/index.js +1 -1
  5. package/dist/brand-studio/index.js +2 -2
  6. package/dist/briefings/index.js +1 -1
  7. package/dist/chunks/add-to-dashboard-Bu3M9DpP.js +12 -0
  8. package/dist/chunks/appearance-provider-C4lPZcaN.js +613 -0
  9. package/dist/chunks/appearance-runtime-provider-De2VZS4F.js +1 -0
  10. package/dist/chunks/assistant-chat-B7Fngg8U.js +53 -0
  11. package/dist/chunks/attachment-filter-line-wJRB0GSP.js +1 -0
  12. package/dist/chunks/{bookmark-impact-BAtemeyK.js → bookmark-impact-DjrrJomS.js} +1 -1
  13. package/dist/chunks/bookmark-state-x9hJS83D.js +1 -0
  14. package/dist/chunks/{brand-C9APUFaP.js → brand-DgFcvKJI.js} +1 -1
  15. package/dist/chunks/{card-filter-builder-ClWrXB7P.js → card-filter-builder-CvxygmsE.js} +8 -3
  16. package/dist/chunks/check-input-7DVPUuco.js +1 -0
  17. package/dist/chunks/{comparison-window-caption-tguyN24S.js → comparison-window-caption-zUZDe4tL.js} +1 -1
  18. package/dist/chunks/compiler-XErOfUUx.js +1 -0
  19. package/dist/chunks/context-Cwj8Axgd.js +2 -0
  20. package/dist/chunks/currency-presentation-binding-w9WDUk3b.js +1 -0
  21. package/dist/chunks/custom-visual-inputs-D8U98aBz.js +1 -0
  22. package/dist/chunks/{dashboard-ChIcbVTx.js → dashboard-BEd6i29E.js} +1 -1
  23. package/dist/chunks/{dashboard-briefing-launcher-CwMlhkxV.js → dashboard-briefing-launcher-DMDYM9IA.js} +9 -14
  24. package/dist/chunks/{dashboard-controls-UCSAFCGA.js → dashboard-controls-5B2vCIjJ.js} +8 -8
  25. package/dist/chunks/{dashboard-json-B120hYDa.js → dashboard-json-C6r30x-5.js} +1 -1
  26. package/dist/chunks/dashboard-temporal-snapshot-Wki-YACw.js +1 -0
  27. package/dist/chunks/edit-dashboard-visual-F2w7v4iB.js +83 -0
  28. package/dist/chunks/{filter-line-WwUV5JzN.js → filter-line-COFQaF4_.js} +1 -1
  29. package/dist/chunks/filter-reach-preview-BWRGfSmb.js +1 -0
  30. package/dist/chunks/filter-value-text-BSAMEgve.js +1 -0
  31. package/dist/chunks/kpi-trend-rule-BcnKbY7d.js +1 -0
  32. package/dist/chunks/{layout-grid-CFzqJ7GC.js → layout-grid-DahW4ClC.js} +1 -1
  33. package/dist/chunks/matrix-analytical-definition-Bd-dXB8q.js +1 -0
  34. package/dist/chunks/{matrix-member-presentation-vVAv-aqg.js → matrix-member-presentation-CfvxPV-i.js} +1 -1
  35. package/dist/chunks/matrix-operation-contract-Cw7U53Ao.js +1 -0
  36. package/dist/chunks/metric-formatting-QDqXfQGY.js +1 -0
  37. package/dist/chunks/{numeric-range-options-C8tr-Bls.js → numeric-range-options-s6i_nDXg.js} +1 -1
  38. package/dist/chunks/{palette-NvEIuXHN.js → palette-CYvJHSqP.js} +1 -1
  39. package/dist/chunks/pivot-result-contract-expectations-BX5gLcze.js +1 -0
  40. package/dist/chunks/{pivot-result-identity-B0eWVMXg.js → pivot-result-identity-DOISzHU4.js} +1 -1
  41. package/dist/chunks/{raw-temporal-value-BHQ-ldpW.js → raw-temporal-value-Cssny3RJ.js} +1 -1
  42. package/dist/chunks/report-preferences-dialog-BNpB9byP.js +1 -0
  43. package/dist/chunks/{report-runtime-context-Cd1b5pku.js → report-runtime-context-B8HuY0bu.js} +1 -1
  44. package/dist/chunks/resolve-dashboard-input-context-B-0tONJg.js +8 -0
  45. package/dist/chunks/sandbox-host-Drf58_oU.js +197 -0
  46. package/dist/chunks/saved-dashboard-context-dbdbQ5bB.js +1 -0
  47. package/dist/chunks/{selection-filter-compiler-kYsRugss.js → selection-filter-compiler-DK8KkS9g.js} +1 -1
  48. package/dist/chunks/semaphor-ready-indicator-BSFsqsBJ.js +617 -0
  49. package/dist/chunks/set-oJDaJdtI.js +1 -0
  50. package/dist/chunks/slider-DAvAdfMC.js +599 -0
  51. package/dist/chunks/stored-dashboard-DmgJQcyZ.js +1 -0
  52. package/dist/chunks/table-cell-text-2x6r_oHO.js +1 -0
  53. package/dist/chunks/{table-export-sheet-xaczzWZF.js → table-export-sheet-CWqKiQu4.js} +1 -1
  54. package/dist/chunks/{token-types-1vzMWjI-.js → token-types-BSyWn2pb.js} +1 -1
  55. package/dist/chunks/{validators-Dg2kyF4_.js → validators-BPGmPz8-.js} +1 -1
  56. package/dist/chunks/{variable-draft-B4_xqr4Y.js → variable-draft-DGA22H2g.js} +1 -1
  57. package/dist/chunks/visual-contract-DQPKg5QW.js +143 -0
  58. package/dist/dashboard/index.js +1 -1
  59. package/dist/dashboard-authoring/index.js +1 -1
  60. package/dist/extensions/index.js +1 -0
  61. package/dist/format-utils/index.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/report-runtime-context/index.js +1 -1
  64. package/dist/style.css +1 -1
  65. package/dist/surfboard/index.js +1 -1
  66. package/dist/types/components/assistant/assistant-store.d.ts +19 -0
  67. package/dist/types/components/assistant/use-assistant.d.ts +4 -0
  68. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +2 -3
  69. package/dist/types/components/visual/data-table/table-cell-text.d.ts +93 -0
  70. package/dist/types/components/visual/data-table/types/data-table.d.ts +0 -1
  71. package/dist/types/extensions.d.ts +2 -0
  72. package/dist/types/index.js +1 -1
  73. package/dist/types/lib/charts/types.d.ts +3 -1
  74. package/dist/types/lib/dashboard/semantic-dataset-references.d.ts +0 -2
  75. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +12 -12
  76. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +25 -25
  77. package/dist/types/lib/stores/dashboard-store.d.ts +33 -2
  78. package/dist/types/lib/stores/editor-store.d.ts +8 -0
  79. package/dist/types/lib/types/common-types.d.ts +3 -0
  80. package/dist/types/lib/utils/card-definition.d.ts +12 -12
  81. package/dist/types/lib/utils/card-type-change.d.ts +9 -0
  82. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +6 -6
  83. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +10 -10
  84. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +248 -248
  85. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  86. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  87. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +2 -2
  88. package/dist/types/shared/assistant-protocol/context.d.ts +26 -26
  89. package/dist/types/shared/assistant-protocol/parts.d.ts +4 -0
  90. package/dist/types/shared/assistant-protocol/request.d.ts +2 -1
  91. package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +16 -6
  92. package/dist/types/shared/dashboard-authoring/card-settings/custom-visual-write.d.ts +44 -0
  93. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -0
  94. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  95. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +2 -2
  96. package/dist/types/shared/dashboard-authoring/changes/custom-visual-change.d.ts +57 -0
  97. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +61 -54
  98. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +5 -1
  99. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +5 -1
  100. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +10 -0
  101. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +60 -60
  102. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +4 -4
  103. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +48 -48
  104. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +1 -1
  105. package/dist/types/shared/dashboard-authoring/measure-calculations/window-transforms.d.ts +2 -0
  106. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +8 -2
  107. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +11 -0
  108. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +7 -0
  109. package/dist/types/shared/extensions/check-audits.d.ts +30 -0
  110. package/dist/types/shared/extensions/check-findings.d.ts +46 -0
  111. package/dist/types/shared/extensions/check-input.d.ts +23 -0
  112. package/dist/types/shared/extensions/check-renders.d.ts +44 -0
  113. package/dist/types/shared/extensions/check-runner.d.ts +19 -0
  114. package/dist/types/shared/extensions/index.d.ts +17 -0
  115. package/dist/types/shared/extensions/read-document.d.ts +18 -0
  116. package/dist/types/shared/extensions/sandbox-host.d.ts +63 -0
  117. package/dist/types/shared/extensions/saved-refs.d.ts +33 -0
  118. package/dist/types/shared/extensions/script-policy.d.ts +11 -0
  119. package/dist/types/shared/extensions/types.d.ts +186 -0
  120. package/dist/types/shared/extensions/visual-contract.d.ts +36 -0
  121. package/dist/types/shared/extensions/visual-payload.d.ts +75 -0
  122. package/dist/types/shared/extensions/visual-theme.d.ts +21 -0
  123. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +13 -6
  124. package/dist/types/shared/format-utils/matrix-continuation.d.ts +2 -2
  125. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +24 -24
  126. package/dist/types/shared/usage-events/details.d.ts +4 -4
  127. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  128. package/dist/usage-events/index.js +1 -1
  129. package/package.json +7 -2
  130. package/dist/chunks/add-to-dashboard-CEmZUf9o.js +0 -12
  131. package/dist/chunks/appearance-provider-CfoAVQuG.js +0 -608
  132. package/dist/chunks/appearance-runtime-provider-Bx8H-moR.js +0 -1
  133. package/dist/chunks/assistant-chat-DgUaCE9k.js +0 -51
  134. package/dist/chunks/attachment-filter-line-C_zHMhGh.js +0 -1
  135. package/dist/chunks/bookmark-state-DScd31KT.js +0 -1
  136. package/dist/chunks/context-CntvtZwC.js +0 -2
  137. package/dist/chunks/dashboard-temporal-snapshot-BFJKbp_6.js +0 -1
  138. package/dist/chunks/edit-dashboard-visual-DvHp03h_.js +0 -73
  139. package/dist/chunks/filter-reach-preview-C5M5_hf_.js +0 -1
  140. package/dist/chunks/filter-value-text-DqTHe_vu.js +0 -1
  141. package/dist/chunks/kpi-trend-rule-B87LNzcz.js +0 -1
  142. package/dist/chunks/matrix-analytical-definition-5T-2euHZ.js +0 -1
  143. package/dist/chunks/matrix-operation-contract-CWvcEsQ0.js +0 -1
  144. package/dist/chunks/pivot-result-contract-expectations-BNWhS8mv.js +0 -1
  145. package/dist/chunks/report-preferences-dialog-Bseb2Rlg.js +0 -1
  146. package/dist/chunks/resolve-dashboard-input-context-BDY7KwRe.js +0 -8
  147. package/dist/chunks/saved-dashboard-context-C3lWc4Dx.js +0 -1
  148. package/dist/chunks/semaphor-ready-indicator-BQarSo6S.js +0 -612
  149. package/dist/chunks/set-6mOnfQeH.js +0 -1
  150. package/dist/chunks/slider-BPnHdMGq.js +0 -4
  151. package/dist/chunks/stored-dashboard-DfrxDLhR.js +0 -1
@@ -0,0 +1,143 @@
1
+ import{j as n}from"./validators-BPGmPz8-.js";import{k as i}from"./resolve-dashboard-input-context-B-0tONJg.js";function m(a){const r=a!=null&&a.fields.length?`
2
+ ## Your card's fields
3
+
4
+ The card this visual draws has these fields, in order. Dimension slots take its dimensions in order, measure slots its measures; the author can reassign them.
5
+
6
+ ${a.fields.map(s=>`- ${s.name} (${s.kind}, ${s.type})`).join(`
7
+ `)}
8
+ `:"";return`${l}${r}`;}function u(a){var t;if((t=a.sql)!=null&&t.trim()||!a.config)return[];const r=e=>{const o=n(e);return o==="number"?"number":o==="date"||o==="datetime"?"date":o==="boolean"?"boolean":"string";},s=e=>e.label||e.name||"";return[...(a.config.groupByColumns??[]).map(e=>({name:s(e),kind:"dimension",type:r(e.dataType)})),...(a.config.metricColumns??[]).map(e=>({name:s(e),kind:"measure",type:"number"}))].filter(e=>e.name);}function c(a){const r=(s,t)=>{switch(s.type){case"number":{const e=[1200,860,410][t];return{value:e,text:e.toLocaleString("en-US")};}case"date":return{value:["2026-01-01","2026-02-01","2026-03-01"][t],text:["Jan 2026","Feb 2026","Mar 2026"][t]};case"boolean":return{value:t!==1,text:t!==1?"true":"false"};default:return{value:`${s.name} ${String.fromCharCode(65+t)}`,text:`${s.name} ${String.fromCharCode(65+t)}`};}};return[0,1,2].map(s=>Object.fromEntries(a.map(t=>[t.name,r(t,s)])));}const l=`# Custom visual contract (version 2)
9
+
10
+ You are writing a custom visual for a card on an analytics dashboard. Return **one self-contained HTML document** and nothing else.
11
+
12
+ ## Where it runs
13
+
14
+ - The dashboard runs your HTML in a sandboxed iframe sized to the card. You can't reach the page, its cookies or its APIs.
15
+ - **You never fetch data.** The dashboard runs the card's query, with its filters and permissions, and hands you the finished rows.
16
+ - No network access. Scripts may load only from ${i(a=>"`https://"+a+"`")}, with an exact version in the URL (for example \`https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js\`). No other external files: no web fonts, no remote images.
17
+ - The whole document is at most 256 KB.
18
+ - A global \`semaphor\` object exists before your scripts run. Don't define it.
19
+
20
+ ## 1. Declare your manifest
21
+
22
+ The first element in \`<head>\` must be your manifest:
23
+
24
+ \`\`\`html
25
+ <script type="application/json" id="semaphor-visual">
26
+ {
27
+ "name": "Bullet chart",
28
+ "contract": 2,
29
+ "minSize": { "width": 200, "height": 120 },
30
+ "slots": [
31
+ { "id": "category", "label": "Category", "kind": "dimension" },
32
+ { "id": "value", "label": "Value", "kind": "measure" },
33
+ { "id": "target", "label": "Target", "kind": "measure", "optional": true }
34
+ ],
35
+ "settings": {
36
+ "showLabels": { "label": "Show labels", "type": "boolean", "default": true },
37
+ "onTarget": { "label": "On target", "type": "color", "default": "positive" }
38
+ }
39
+ }
40
+ <\/script>
41
+ \`\`\`
42
+
43
+ - \`slots\` are what your visual draws. The card's dimensions fill your dimension slots and its measures fill your measure slots, in order; the author can reassign them. Your code reads only your slot ids, never column names.
44
+ - \`kind\` is \`dimension\` (something to group by: a name, a date) or \`measure\` (a number).
45
+ - An \`optional\` slot may be empty: it is then absent from \`fields\` and from every row.
46
+ - One slot of each kind may set \`"many": true\` to take every remaining field of that kind, for example a table's columns. Its fields arrive as \`id\`, \`id_2\`, \`id_3\`…
47
+ - Slot and setting ids start with a lowercase letter and use letters, digits or \`_\`.
48
+ - \`settings\` types: \`boolean\`, \`number\` (with \`min\`, \`max\`, \`step\`), \`string\`, \`select\` with \`"options": [{ "value": "a", "label": "A" }]\`, or \`color\`. Every setting has a \`default\`.
49
+ - A \`color\` setting's \`default\` is a theme colour name: \`palette-1\` … \`palette-8\`, \`primary\`, \`accent\`, \`positive\`, \`negative\`, \`warning\`, \`selection\`, \`fg\`, \`muted-fg\`. Use a \`#rrggbb\` default only when the author asked for that exact colour. The dashboard sends the setting to you as \`#rrggbb\`, resolved for the current brand and light or dark mode.
50
+ - \`minSize\` is the smallest size at which your visual is still useful.
51
+
52
+ ## 2. Draw from the data you're given
53
+
54
+ \`\`\`js
55
+ semaphor.onData((payload) => { draw(payload); semaphor.ready(); });
56
+ \`\`\`
57
+
58
+ \`onData\` calls you now, and again whenever the data, settings, theme or size change. The payload:
59
+
60
+ \`\`\`json
61
+ {
62
+ "contract": 2,
63
+ "kind": "visual",
64
+ "fields": [
65
+ { "id": "category", "slot": "category", "label": "Region", "type": "string", "kind": "dimension" },
66
+ { "id": "value", "slot": "value", "label": "Revenue", "type": "number", "kind": "measure", "adds": true }
67
+ ],
68
+ "rows": [
69
+ { "category": { "value": "West", "text": "West" },
70
+ "value": { "value": 1234567, "text": "$1.23M" } }
71
+ ],
72
+ "totals": {},
73
+ "truncated": false,
74
+ "settings": { "showLabels": true, "onTarget": "#16a34a" },
75
+ "size": { "width": 520, "height": 300 },
76
+ "locale": "en-US",
77
+ "printing": false
78
+ }
79
+ \`\`\`
80
+
81
+ - A measure's \`adds\` says whether its rows add up: \`true\` for a sum or a count, \`false\` for an average, a ratio, a distinct count or a running total, absent when unknown. **Never add rows of a measure whose \`adds\` is \`false\`**: show a message instead (for example "This visual adds the rows: use a sum or a count"), and use \`totals\` for an overall value.
82
+ - Every cell is \`{ value, text }\`. **Show \`text\` whenever a reader sees a value**: it is already formatted (currency, units, dates). Use \`value\` only to compute positions, sizes and order. Never format numbers or dates yourself.
83
+ - **Numbers you compute yourself** (a total, a share, an axis tick) are formatted by the dashboard too:
84
+ - \`semaphor.format("<fieldId>", number)\` formats a number the way that field is formatted, for example an axis tick \`semaphor.format("value", 2000000)\` → \`"$2M"\`.
85
+ - \`semaphor.formatPercent(0.256)\` → \`"25.6%"\`, written as the card's own numbers are.
86
+ - \`semaphor.formatDate(value, part)\` gives one part of a date: \`"month"\` (\`"Jan"\`), \`"monthLong"\` (\`"January"\`), \`"weekday"\` (\`"Mon"\`), \`"day"\` (\`"14"\`), \`"year"\` (\`"2026"\`) or \`"monthYear"\` (\`"Jan 2026"\`).
87
+ - These are synchronous; call them as often as you need.
88
+ - \`totals\` holds a measure's total when the card's result has one; it is often empty, so compute what you need and format it with \`semaphor.format\`.
89
+ - Use \`fields[i].label\` for axis titles, legends and tooltips.
90
+ - Rows arrive in the query's order; date dimensions arrive oldest first.
91
+ - A cell can be \`{ "value": null, "text": "" }\` (no value). Treat it as a gap.
92
+ - \`text\` is plain text, never HTML: insert it as text.
93
+ - \`type\` is \`string\`, \`number\`, \`date\` or \`boolean\`.
94
+ - \`rows\` may be empty: show a short, neutral empty message.
95
+ - \`truncated: true\` means the dashboard capped the rows. Say so in small text.
96
+
97
+ ## 3. Use the theme, never your own colours
98
+
99
+ The dashboard's brand arrives as CSS variables on \`:root\`, updated live (for example when the reader switches to dark mode):
100
+
101
+ | Variable | Use |
102
+ | --- | --- |
103
+ | \`--sv-fg\`, \`--sv-muted-fg\` | Text, secondary text |
104
+ | \`--sv-bg\`, \`--sv-muted\`, \`--sv-border\` | Card surface, subtle fills, lines |
105
+ | \`--sv-primary\`, \`--sv-primary-fg\`, \`--sv-accent\` | Emphasis, text on emphasis, soft highlight |
106
+ | \`--sv-primary-text\` | Text in the primary colour (links) |
107
+ | \`--sv-positive\`, \`--sv-negative\`, \`--sv-warning\` | Good, bad, caution, as fills: marks, bars, dots |
108
+ | \`--sv-positive-text\`, \`--sv-negative-text\`, \`--sv-warning-text\` | The same as text |
109
+ | \`--sv-selection\` | A highlighted mark |
110
+ | \`--sv-palette-1\` … \`--sv-palette-8\`, \`--sv-palette-N-fg\` | Series colours, in order, and the text that reads on each |
111
+ | \`--sv-seq-1\` … \`--sv-seq-5\`, \`--sv-seq-N-fg\` | A sequential scale, light to strong, and the text that reads on each step |
112
+ | \`--sv-grid\`, \`--sv-axis\` | Gridlines, axis lines and ticks (lines only, never text) |
113
+ | \`--sv-axis-label\`, \`--sv-legend\` | Axis labels and tick text, legend text |
114
+ | \`--sv-halo\` | Outline behind text drawn over marks |
115
+ | \`--sv-font\`, \`--sv-font-size\` | Font family, base size |
116
+ | \`--sv-radius\`, \`--sv-bar-radius\` | Corner radius for surfaces, for bars |
117
+
118
+ - Every text variable is readable on the surface it names. Don't lower text opacity: use \`--sv-muted-fg\` for secondary text.
119
+ - Use these for **every** colour, font and radius. Series take the palette in order. Shade by amount with the sequential scale only.
120
+ - **Never write a colour into your code.** When the author wants a specific colour, add a \`color\` setting and draw with \`payload.settings.<id>\`.
121
+ - The body is transparent over the card's own surface. Don't paint a background on \`body\`.
122
+ - For a JavaScript or canvas library, read the same values from \`semaphor.theme\`: \`{ mode, palette, paletteFg, sequential, sequentialFg, font: { family, size }, colors: { fg, mutedFg, bg, muted, border, primary, primaryFg, accent, positive, negative, warning, selection }, grid, axis, axisLabel, legend, halo, radius }\`. Ready-made themes: \`semaphor.theme.echarts()\`, \`semaphor.theme.vegaLite()\` and \`semaphor.theme.chartjs()\`.
123
+ - \`semaphor.onTheme((theme) => …)\` fires when the theme changes; \`onData\` also fires then, so redrawing in \`onData\` is enough.
124
+
125
+ ## 4. Fit the card at any size
126
+
127
+ The author resizes the card freely. Each resize sends a new payload with the new \`size\`.
128
+
129
+ - Fill the iframe: \`html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }\`. Redraw from \`payload.size\` on every payload.
130
+ - **Never overflow.** No scrollbars, nothing cut off at an edge, no text on top of other text.
131
+ - **As space shrinks, simplify in this order:** tighten padding; use fewer axis ticks and shorter labels (end long names with "…"); move the legend, then hide it; hide value labels; show only the rows that fit plus a small "+N more"; at the very smallest, show only the headline.
132
+ - **As space grows, use it.** Scale marks to fill the card.
133
+ - Keep text at \`--sv-font-size\`, or a little smaller in tight spots, and never below 10px.
134
+ - When \`semaphor.printing\` is \`true\`, the card prints at its size and nothing can scroll; turn animations off.
135
+
136
+ ## 5. Tell the dashboard what happened
137
+
138
+ - \`semaphor.ready()\`: call it after each payload has fully rendered, the empty state included. Exports and PDFs wait for it. With a canvas library, call it from the library's "render finished" event as \`semaphor.ready(payload)\`, passing the payload that render drew, so an earlier render finishing late never counts for a newer one.
139
+ - \`semaphor.error("message")\`: only for problems you can't draw around. The card then shows its data as a table.
140
+ - If the visual throws, never calls \`ready\`, or draws nothing, the card shows its data as a table instead.
141
+ - Give an SVG a \`role="img"\` and an \`aria-label\`.
142
+ - Show no product names, logos or AI wording.
143
+ `;export{u as c,c as s,m as v};
@@ -1 +1 @@
1
- import{D as o}from"../chunks/dashboard-ChIcbVTx.js";import{C as s,E as C}from"../chunks/bookmark-state-DScd31KT.js";export{s as CONTROL_CARD_DEFAULT_VALUE,o as Dashboard,C as EMPTY_SELECTION};
1
+ import{D as o}from"../chunks/dashboard-BEd6i29E.js";import{C as s,E as C}from"../chunks/bookmark-state-x9hJS83D.js";export{s as CONTROL_CARD_DEFAULT_VALUE,o as Dashboard,C as EMPTY_SELECTION};