@littlepress/renderer-web 0.0.0-stage → 1.0.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.
Files changed (187) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +20 -0
  3. package/README.md +229 -2
  4. package/dist/answer/answerComponents.d.ts +107 -0
  5. package/dist/answer/answerComponents.js +637 -0
  6. package/dist/answer/download.d.ts +63 -0
  7. package/dist/answer/download.js +109 -0
  8. package/dist/answer/downloadExport.d.ts +44 -0
  9. package/dist/answer/downloadExport.js +266 -0
  10. package/dist/answer/hostValues.d.ts +28 -0
  11. package/dist/answer/hostValues.js +379 -0
  12. package/dist/answer/mapComponent.d.ts +6 -0
  13. package/dist/answer/mapComponent.js +213 -0
  14. package/dist/answer/math.d.ts +57 -0
  15. package/dist/answer/math.js +168 -0
  16. package/dist/answer/surfaceStream.d.ts +51 -0
  17. package/dist/answer/surfaceStream.js +260 -0
  18. package/dist/answer/tableLayout.d.ts +42 -0
  19. package/dist/answer/tableLayout.js +89 -0
  20. package/dist/controls/ActionFeedback.d.ts +5 -0
  21. package/dist/controls/ActionFeedback.js +43 -0
  22. package/dist/controls/actionDispatch.d.ts +51 -0
  23. package/dist/controls/actionDispatch.js +211 -0
  24. package/dist/controls/actionOutcome.generated.d.ts +64 -0
  25. package/dist/controls/actionOutcome.generated.js +64 -0
  26. package/dist/controls/calculationPublisher.d.ts +14 -0
  27. package/dist/controls/calculationPublisher.js +6 -0
  28. package/dist/controls/calculations.d.ts +20 -0
  29. package/dist/controls/calculations.generated.d.ts +73 -0
  30. package/dist/controls/calculations.generated.js +85 -0
  31. package/dist/controls/calculations.js +208 -0
  32. package/dist/controls/controlState.d.ts +84 -0
  33. package/dist/controls/controlState.js +256 -0
  34. package/dist/controls/fieldMessages.d.ts +41 -0
  35. package/dist/controls/fieldMessages.js +81 -0
  36. package/dist/controls/fieldValidation.d.ts +19 -0
  37. package/dist/controls/fieldValidation.js +98 -0
  38. package/dist/controls/formComponents.d.ts +23 -0
  39. package/dist/controls/formComponents.js +738 -0
  40. package/dist/controls/formProgress.d.ts +63 -0
  41. package/dist/controls/formProgress.js +122 -0
  42. package/dist/controls/inputDrafts.d.ts +55 -0
  43. package/dist/controls/inputDrafts.js +183 -0
  44. package/dist/controls/inputValidation.d.ts +33 -0
  45. package/dist/controls/inputValidation.js +119 -0
  46. package/dist/controls/localWrites.d.ts +9 -0
  47. package/dist/controls/localWrites.js +29 -0
  48. package/dist/core/A2uiSurface.d.ts +13 -0
  49. package/dist/core/A2uiSurface.js +15 -0
  50. package/dist/core/AtlasIcon.d.ts +18 -0
  51. package/dist/core/AtlasIcon.js +22 -0
  52. package/dist/core/AtlasMedia.d.ts +22 -0
  53. package/dist/core/AtlasMedia.js +45 -0
  54. package/dist/core/Carousel.d.ts +61 -0
  55. package/dist/core/Carousel.js +183 -0
  56. package/dist/core/CoreMedia.d.ts +19 -0
  57. package/dist/core/CoreMedia.js +25 -0
  58. package/dist/core/FoundationA2uiSurface.d.ts +86 -0
  59. package/dist/core/FoundationA2uiSurface.js +440 -0
  60. package/dist/core/ImagePreview.d.ts +42 -0
  61. package/dist/core/ImagePreview.js +73 -0
  62. package/dist/core/LucideIcon.d.ts +19 -0
  63. package/dist/core/LucideIcon.js +42 -0
  64. package/dist/core/SurfaceLink.d.ts +35 -0
  65. package/dist/core/SurfaceLink.js +60 -0
  66. package/dist/core/appearance/aegis.d.ts +49 -0
  67. package/dist/core/appearance/aegis.js +34 -0
  68. package/dist/core/appearance/colour.d.ts +24 -0
  69. package/dist/core/appearance/colour.js +103 -0
  70. package/dist/core/appearance/css.d.ts +17 -0
  71. package/dist/core/appearance/css.js +153 -0
  72. package/dist/core/appearance/presets.generated.d.ts +4 -0
  73. package/dist/core/appearance/presets.generated.js +1184 -0
  74. package/dist/core/appearance/react.d.ts +29 -0
  75. package/dist/core/appearance/react.js +110 -0
  76. package/dist/core/appearance/resolve.d.ts +76 -0
  77. package/dist/core/appearance/resolve.js +127 -0
  78. package/dist/core/appearance/textScale.d.ts +11 -0
  79. package/dist/core/appearance/textScale.js +51 -0
  80. package/dist/core/appearance/theme.d.ts +138 -0
  81. package/dist/core/appearance/theme.js +274 -0
  82. package/dist/core/baseComponents.d.ts +53 -0
  83. package/dist/core/baseComponents.js +480 -0
  84. package/dist/core/binding.d.ts +46 -0
  85. package/dist/core/binding.js +118 -0
  86. package/dist/core/bundle.d.ts +23 -0
  87. package/dist/core/bundle.js +75 -0
  88. package/dist/core/catalog/catalog-index.generated.d.ts +44 -0
  89. package/dist/core/catalog/catalog-index.generated.js +79 -0
  90. package/dist/core/catalog/icons.generated.d.ts +6 -0
  91. package/dist/core/catalog/icons.generated.js +1788 -0
  92. package/dist/core/catalog.d.ts +6 -0
  93. package/dist/core/catalog.generated.d.ts +50 -0
  94. package/dist/core/catalog.generated.js +2174 -0
  95. package/dist/core/catalog.js +8 -0
  96. package/dist/core/chartRows.d.ts +7 -0
  97. package/dist/core/chartRows.js +38 -0
  98. package/dist/core/component-support.d.ts +39 -0
  99. package/dist/core/component-support.js +127 -0
  100. package/dist/core/components/actions.d.ts +4 -0
  101. package/dist/core/components/actions.js +21 -0
  102. package/dist/core/components/cards.d.ts +9 -0
  103. package/dist/core/components/cards.js +227 -0
  104. package/dist/core/components/charts.d.ts +18 -0
  105. package/dist/core/components/charts.js +412 -0
  106. package/dist/core/components/comparisonTable.d.ts +50 -0
  107. package/dist/core/components/comparisonTable.js +89 -0
  108. package/dist/core/components/content.d.ts +13 -0
  109. package/dist/core/components/content.js +108 -0
  110. package/dist/core/components/seriesCharts.d.ts +531 -0
  111. package/dist/core/components/seriesCharts.js +1053 -0
  112. package/dist/core/components/stepFlow.d.ts +7 -0
  113. package/dist/core/components/stepFlow.js +13 -0
  114. package/dist/core/components.full.d.ts +10 -0
  115. package/dist/core/components.full.js +41 -0
  116. package/dist/core/context.d.ts +207 -0
  117. package/dist/core/context.js +172 -0
  118. package/dist/core/coverage.d.ts +30 -0
  119. package/dist/core/coverage.js +93 -0
  120. package/dist/core/foundation.d.ts +21 -0
  121. package/dist/core/foundation.js +22 -0
  122. package/dist/core/fullTheme.d.ts +5 -0
  123. package/dist/core/fullTheme.js +9 -0
  124. package/dist/core/iconNodes.generated.d.ts +7 -0
  125. package/dist/core/iconNodes.generated.js +5 -0
  126. package/dist/core/lucideIcons.d.ts +5 -0
  127. package/dist/core/lucideIcons.js +7 -0
  128. package/dist/core/messages.d.ts +111 -0
  129. package/dist/core/messages.js +134 -0
  130. package/dist/core/pointer.d.ts +17 -0
  131. package/dist/core/pointer.js +104 -0
  132. package/dist/core/registry.d.ts +12 -0
  133. package/dist/core/registry.js +114 -0
  134. package/dist/core/runtime.d.ts +8 -0
  135. package/dist/core/runtime.js +6 -0
  136. package/dist/core/state.d.ts +73 -0
  137. package/dist/core/state.js +274 -0
  138. package/dist/core/surfaceMotion.d.ts +5 -0
  139. package/dist/core/surfaceMotion.js +46 -0
  140. package/dist/core/theme.d.ts +5 -0
  141. package/dist/core/theme.js +7 -0
  142. package/dist/core/useSurfaceImage.d.ts +20 -0
  143. package/dist/core/useSurfaceImage.js +65 -0
  144. package/dist/graph/RelationshipGraph.d.ts +14 -0
  145. package/dist/graph/RelationshipGraph.js +206 -0
  146. package/dist/graph/model.d.ts +20 -0
  147. package/dist/graph/model.js +36 -0
  148. package/dist/graph/program/assets.d.ts +3 -0
  149. package/dist/graph/program/assets.js +3 -0
  150. package/dist/graph/program/bridge.d.ts +6 -0
  151. package/dist/graph/program/bridge.generated.d.ts +136 -0
  152. package/dist/graph/program/bridge.generated.js +1 -0
  153. package/dist/graph/program/bridge.js +24 -0
  154. package/dist/graph/program/bridge.schema.json +717 -0
  155. package/dist/graph/program/bridgeValidator.cjs +2 -0
  156. package/dist/graph/program/bridgeValidator.d.cts +4 -0
  157. package/dist/graph/program/runner.d.ts +1 -0
  158. package/dist/graph/program/runner.html +2193 -0
  159. package/dist/graph/program/runner.js +157 -0
  160. package/dist/graph/program/runtime-manifest.json +1 -0
  161. package/dist/graph/program/view.d.ts +11 -0
  162. package/dist/graph/program/view.js +210 -0
  163. package/dist/graph/program/worker.d.ts +1 -0
  164. package/dist/graph/program/worker.js +2186 -0
  165. package/dist/index.d.ts +20 -0
  166. package/dist/index.js +45 -0
  167. package/dist/internal/dsh.d.ts +4 -0
  168. package/dist/internal/dsh.js +3 -0
  169. package/dist/internal/relationship-graph.d.ts +4 -0
  170. package/dist/internal/relationship-graph.js +7202 -0
  171. package/dist/page/layoutComponents.d.ts +6 -0
  172. package/dist/page/layoutComponents.js +123 -0
  173. package/dist/page/layoutGeometry.d.ts +68 -0
  174. package/dist/page/layoutGeometry.js +174 -0
  175. package/dist/page/pageFormat.d.ts +34 -0
  176. package/dist/page/pageFormat.js +119 -0
  177. package/dist/page/printFit.d.ts +81 -0
  178. package/dist/page/printFit.js +338 -0
  179. package/dist/react/index.d.ts +5 -0
  180. package/dist/react/index.js +2 -0
  181. package/dist/report/locate.d.ts +42 -0
  182. package/dist/report/locate.js +34 -0
  183. package/dist/styles/renderer.css +4580 -0
  184. package/licenses/LUCIDE-LICENSE.txt +43 -0
  185. package/licenses/QUICKJS-EMSCRIPTEN-LICENSE.txt +21 -0
  186. package/licenses/QUICKJS-VARIANT-LICENSE.txt +47 -0
  187. package/package.json +68 -3
@@ -0,0 +1,108 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { resolveStringList, resolveValue, } from "../foundation.js";
3
+ import { actionHandler } from "../runtime.js";
4
+ import { AtlasMedia, readMediaValue } from "../AtlasMedia.js";
5
+ import { ActionButton, EmptyComponent, accessibilityLabel, flag, printPart, records, stringFromRecord, text, withFallback, } from "../component-support.js";
6
+ const renderArticleHeader = (component, context) => {
7
+ const title = text(component, "title", context);
8
+ const kicker = text(component, "kicker", context);
9
+ const dek = text(component, "dek", context);
10
+ const byline = text(component, "byline", context);
11
+ const audioLabel = text(component, "audioLabel", context);
12
+ const media = readMediaValue(resolveValue(component.media, context.binding, context.valueFunctions));
13
+ const play = actionHandler(component.playAction, component, context);
14
+ const share = actionHandler(component.shareAction, component, context);
15
+ return withFallback(component, Boolean(title), _jsxs("header", { className: "lp-hero lp-hero-masthead", "aria-label": accessibilityLabel(component, context), children: [kicker ? _jsx("p", { className: "lp-kicker", ...printPart(component, "kicker", "clamp"), children: kicker }) : null, _jsx("div", { className: "lp-hero-rules", "aria-hidden": "true" }), _jsx("h1", { className: "lp-display", ...printPart(component, "title", "clamp"), children: title }), dek ? _jsx("p", { className: "lp-dek", ...printPart(component, "dek", "clamp"), children: dek }) : null, byline || audioLabel ? (_jsxs("div", { className: "lp-hero-byline", children: [byline ? _jsx("span", { className: "lp-meta", ...printPart(component, "byline"), children: byline }) : null, audioLabel ? (_jsxs("span", { className: "lp-audio-pill", children: [_jsx("i", { "aria-hidden": "true", children: "\u25B6" }), audioLabel] })) : null] })) : null, media ? _jsx(AtlasMedia, { media: media, ratio: "feature", className: "lp-hero-media", context: context }) : null, play || share ? (_jsxs("div", { className: "lp-action-row", children: [play ? _jsx(ActionButton, { label: "Play episode", onClick: play, "aria-disabled": play?.disabled, "aria-busy": play?.pending, intent: "accent" }) : null, share ? _jsx(ActionButton, { label: "Share", onClick: share, "aria-disabled": share?.disabled, "aria-busy": share?.pending, intent: "ghost" }) : null] })) : null] }));
16
+ };
17
+ const renderStoryCover = (component, context) => {
18
+ const title = text(component, "title", context);
19
+ const kicker = text(component, "kicker", context);
20
+ const dek = text(component, "dek", context);
21
+ const cta = text(component, "cta", context) ?? "Start reading";
22
+ const media = readMediaValue(resolveValue(component.art ?? component.media, context.binding, context.valueFunctions));
23
+ // `primaryAction` is the catalog contract's start action; `startAction` and
24
+ // `action` are older spellings kept for stored surfaces.
25
+ const start = actionHandler(component.startAction ?? component.primaryAction ?? component.action, component, context);
26
+ const share = actionHandler(component.shareAction, component, context);
27
+ // Atlas three-second rule: name, one line, one action. The action is whichever
28
+ // the surface actually declared — a dead button would break the rule.
29
+ return withFallback(component, Boolean(title), _jsxs("header", { className: "lp-hero lp-hero-cover", "aria-label": accessibilityLabel(component, context), children: [media ? _jsx(AtlasMedia, { media: media, ratio: "portrait", className: "lp-hero-art", context: context }) : null, kicker ? _jsx("p", { className: "lp-kicker", ...printPart(component, "kicker", "clamp"), children: kicker }) : null, _jsx("h1", { className: "lp-display", ...printPart(component, "title", "clamp"), children: title }), dek ? _jsx("p", { className: "lp-dek", ...printPart(component, "sub", "clamp"), children: dek }) : null, start || share ? (_jsxs("div", { className: "lp-action-row", children: [start ? (_jsx(ActionButton, { label: cta, onClick: start, "aria-disabled": start?.disabled, "aria-busy": start?.pending, intent: "accent", block: true, printAttributes: printPart(component, "cta", "clamp") })) : null, share ? _jsx(ActionButton, { label: "Share", onClick: share, "aria-disabled": share?.disabled, "aria-busy": share?.pending, intent: start ? "ghost" : "accent" }) : null] })) : null] }));
30
+ };
31
+ /* ------------------------------------------------------------------- text */
32
+ const renderLede = (component, context) => {
33
+ const value = text(component, "text", context);
34
+ // A drop cap on a digit or punctuation reads as a typo ("2026年" becomes a
35
+ // giant 2 over "026年"); only a letter or CJK ideograph may drop.
36
+ const dropcapWorthy = typeof value === "string" && /^[\p{L}\p{Script=Han}]/u.test(value);
37
+ const dropcap = (flag(component, "dropcap", context) ?? false) && dropcapWorthy;
38
+ return withFallback(component, Boolean(value), _jsx("p", { className: `lp-body lp-lede ${dropcap ? "lp-dropcap" : ""}`.trim(), ...printPart(component, "text"), children: value }));
39
+ };
40
+ const renderBodyProse = (component, context) => {
41
+ // Defensive decoding (ADR 0004, N1 disposition 3): the catalog describes prose
42
+ // as `paragraphs[]` with an optional `crosshead`, but the compiler also emits a
43
+ // single `body`/`text` string with the crosshead under `heading`/`title`.
44
+ // Accept both rather than drop the content.
45
+ const heading = text(component, "crosshead", context) ??
46
+ text(component, "heading", context) ??
47
+ text(component, "title", context);
48
+ const paragraphs = resolveStringList(component.paragraphs, context.binding, context.valueFunctions);
49
+ const single = text(component, "text", context) ?? text(component, "body", context);
50
+ const blocks = paragraphs.length > 0 ? paragraphs : single ? [single] : [];
51
+ return withFallback(component, blocks.length > 0, _jsxs("section", { className: "lp-section", children: [heading ? (_jsx("p", { className: "lp-crosshead", ...printPart(component, "heading", "clamp"), children: _jsx("em", { children: heading }) })) : null, blocks.map((paragraph, index) => (_jsx("p", { className: "lp-body", ...printPart(component, `paragraph-${index}`), children: paragraph }, `p-${index}`)))] }));
52
+ };
53
+ const renderPullQuote = (component, context) => {
54
+ const quote = text(component, "text", context);
55
+ const attribution = text(component, "attribution", context);
56
+ const share = actionHandler(component.shareAction, component, context);
57
+ return withFallback(component, Boolean(quote), _jsxs("figure", { className: "lp-pullquote", children: [_jsx("blockquote", { ...printPart(component, "quote", "clamp"), children: quote }), attribution ? _jsx("cite", { ...printPart(component, "attribution", "clamp"), children: attribution }) : null, share ? (_jsx("div", { className: "lp-action-row", children: _jsx(ActionButton, { label: "Share quote", onClick: share, "aria-disabled": share?.disabled, "aria-busy": share?.pending, intent: "ghost" }) })) : null] }));
58
+ };
59
+ /* ------------------------------------------------------------------ media */
60
+ const renderFeatureImage = (component, context) => {
61
+ const bound = readMediaValue(resolveValue(component.media ?? component.src, context.binding, context.valueFunctions));
62
+ // The component-level `alt` covers a bare image URL; `media.alt` stays the more
63
+ // specific text when both are present.
64
+ const alt = text(component, "alt", context);
65
+ const media = bound && !bound.alt && alt ? { ...bound, alt } : bound;
66
+ const caption = text(component, "caption", context) ?? media?.caption ?? null;
67
+ const credit = text(component, "credit", context) ?? media?.credit ?? null;
68
+ return withFallback(component, Boolean(media), _jsxs("figure", { className: "lp-figure lp-figure-feature", children: [media ? _jsx(AtlasMedia, { media: media, ratio: "feature", context: context }) : null, caption || credit ? (_jsxs("figcaption", { className: "lp-caption", children: [caption ? _jsx("span", { ...printPart(component, "caption", "clamp"), children: caption }) : null, credit ? _jsx("b", { className: "lp-meta", ...printPart(component, "credit", "clamp"), children: credit }) : null] })) : null] }));
69
+ };
70
+ const renderNumberedSection = (component, context) => {
71
+ const number = text(component, "number", context);
72
+ const kicker = text(component, "kicker", context);
73
+ const title = text(component, "title", context);
74
+ const body = text(component, "body", context);
75
+ if (!title && !body)
76
+ return _jsx(EmptyComponent, { component: component });
77
+ return (_jsxs("section", { className: "lp-numbered-section", "aria-label": accessibilityLabel(component, context), children: [_jsxs("header", { className: "lp-numbered-head", children: [number ? _jsx("span", { className: "lp-numbered-index", children: number }) : null, _jsxs("div", { children: [kicker ? _jsx("p", { className: "lp-kicker", ...printPart(component, "kicker", "clamp"), children: kicker }) : null, title ? _jsx("h3", { className: "lp-title", ...printPart(component, "heading", "clamp"), children: title }) : null] })] }), body ? _jsx("p", { className: "lp-body", ...printPart(component, "body"), children: body }) : null] }));
78
+ };
79
+ /** card_group: term cards with kicker, heading, and items[{title, body}]. */
80
+ const renderQuoteWall = (component, context) => {
81
+ const items = records(component, context, "items", "quotes");
82
+ return withFallback(component, items.length > 0, _jsx("section", { className: "lp-quote-wall", "aria-label": accessibilityLabel(component, context), children: items.map((item, index) => {
83
+ const quote = stringFromRecord(item, "text", "quote");
84
+ const source = stringFromRecord(item, "source", "attribution", "speaker");
85
+ const timestamp = stringFromRecord(item, "timestamp");
86
+ const play = actionHandler(component.itemAction ?? component.playAction, component, context, { index });
87
+ return (_jsxs("figure", { className: "lp-card lp-quote-tile", children: [quote ? _jsx("blockquote", { ...printPart(component, "text", "clamp"), children: quote }) : null, _jsxs("figcaption", { children: [source ? _jsx("span", { className: "lp-meta", ...printPart(component, "source", "clamp"), children: source }) : null, timestamp ? (_jsx("button", { type: "button", className: "lp-link-button", onClick: play, "aria-disabled": play?.disabled, "aria-busy": play?.pending, disabled: !play || play.disabled, children: timestamp })) : null] })] }, `quote-${index}`));
88
+ }) }));
89
+ };
90
+ const renderMediaGallery = (component, context) => {
91
+ const items = records(component, context, "items", "images", "media");
92
+ return withFallback(component, items.length > 0, _jsxs("figure", { className: "lp-gallery", "aria-label": accessibilityLabel(component, context), children: [_jsx("div", { className: "lp-gallery-track", children: items.slice(0, 4).map((item, index) => {
93
+ const media = readMediaValue(item.media ?? item.image ?? item.src ?? item);
94
+ const caption = stringFromRecord(item, "caption");
95
+ return (_jsxs("div", { className: "lp-gallery-item", children: [media ? _jsx(AtlasMedia, { media: media, ratio: "feature", context: context }) : null, caption ? _jsx("p", { className: "lp-caption", ...printPart(component, "caption", "clamp"), children: caption }) : null] }, `gallery-${index}`));
96
+ }) }), _jsxs("figcaption", { className: "lp-meta", ...printPart(component, "counter", "clamp"), children: ["1 / ", items.length] })] }));
97
+ };
98
+ const renderTranscriptExcerpt = (component, context) => {
99
+ const turns = records(component, context, "items", "turns");
100
+ return withFallback(component, turns.length > 0, _jsx("section", { className: "lp-transcript", "aria-label": accessibilityLabel(component, context), children: turns.map((turn, index) => {
101
+ const timestamp = stringFromRecord(turn, "timestamp", "time");
102
+ const speaker = stringFromRecord(turn, "speaker", "author");
103
+ const body = stringFromRecord(turn, "text", "body");
104
+ const play = actionHandler(component.itemAction ?? component.playAction, component, context, { index });
105
+ return (_jsxs("article", { className: "lp-transcript-turn", children: [_jsxs("header", { children: [timestamp ? (_jsx("button", { type: "button", className: "lp-link-button lp-meta", onClick: play, "aria-disabled": play?.disabled, "aria-busy": play?.pending, disabled: !play || play.disabled, ...printPart(component, "timestamp", "clamp"), children: timestamp })) : null, speaker ? _jsx("span", { className: "lp-heading", ...printPart(component, "speaker", "clamp"), children: speaker }) : null] }), body ? _jsx("p", { className: "lp-body", ...printPart(component, "text", "clamp"), children: body }) : null] }, `turn-${index}`));
106
+ }) }));
107
+ };
108
+ export { renderArticleHeader, renderStoryCover, renderLede, renderBodyProse, renderPullQuote, renderFeatureImage, renderNumberedSection, renderQuoteWall, renderMediaGallery, renderTranscriptExcerpt, };
@@ -0,0 +1,531 @@
1
+ /**
2
+ * Geometry and text for the multi-series charts.
3
+ *
4
+ * The renderer only ever receives records plus the field names to read; it
5
+ * never reshapes or pads the data. Everything that can be decided without JSX
6
+ * lives here so it stays testable and so `charts.tsx` keeps no numbers of its
7
+ * own. Colour is chosen by series index through the `--series-1..4` tokens, so
8
+ * this module returns indices, never colour values.
9
+ */
10
+ export type ChartRecord = Readonly<Record<string, unknown>>;
11
+ /** How many series one chart may draw; the compiler rejects more upstream. */
12
+ export declare const MAX_SERIES = 4;
13
+ /** Stroke patterns per series index, so a line is identifiable without colour. */
14
+ export declare const SERIES_DASH: readonly (string | undefined)[];
15
+ export type SeriesChartOptions = {
16
+ labelField?: string | null;
17
+ seriesFields?: readonly string[] | null;
18
+ seriesLabels?: readonly string[] | null;
19
+ };
20
+ export type ChartSeries = {
21
+ /** Record field this series reads. */
22
+ field: string;
23
+ /** Legend text: the author's label when given, otherwise the field name. */
24
+ label: string;
25
+ /** 0-based; picks the colour token and the dash pattern. */
26
+ index: number;
27
+ /** One entry per row, in row order. `null` means the row had no number. */
28
+ values: (number | null)[];
29
+ };
30
+ export type SeriesChartModel = {
31
+ labels: string[];
32
+ series: ChartSeries[];
33
+ /** Lower end of the drawn value axis (never above zero). */
34
+ min: number;
35
+ /** Upper end of the drawn value axis. */
36
+ max: number;
37
+ ticks: number[];
38
+ };
39
+ /** U+2212, the minus sign report text is written with ("−620"), not the hyphen `String()` prints. */
40
+ export declare const MINUS_SIGN = "\u2212";
41
+ /**
42
+ * A chart value as it is printed on the card, on its axis and in its text
43
+ * alternative: the integer digits grouped in threes with a comma, and a true
44
+ * minus sign, so 2320 reads "2,320" and -620 reads "−620" — the way the numbers
45
+ * in a report's tables and sentences are written. Nothing is rounded: every
46
+ * digit `String()` prints is kept (1234.5678 → "1,234.5678"). A number that only
47
+ * prints in exponent form (1e21, 1e-7) keeps that form apart from its sign.
48
+ *
49
+ * Only values go through here. A category name that happens to be a number,
50
+ * such as the year 2024, is a label and is printed as sent.
51
+ */
52
+ export declare function formatChartNumber(value: number): string;
53
+ /**
54
+ * Rounded axis bounds and tick values. The axis always contains zero so bar
55
+ * lengths stay proportional to the numbers they show.
56
+ */
57
+ export declare function valueAxis(values: readonly number[], targetTicks?: number, includeZero?: boolean): {
58
+ min: number;
59
+ max: number;
60
+ ticks: number[];
61
+ };
62
+ /**
63
+ * Normalizes the bound rows into a drawable model, or `null` when there is
64
+ * nothing honest to draw. `null` is what sends the component to its catalog
65
+ * fallback; the renderer never draws half a chart.
66
+ *
67
+ * `seriesFields` is required. Without it there is no chart: JSON object key
68
+ * order is not reliable across platforms and storage, so working the series
69
+ * out from the rows would colour and order them differently on each client.
70
+ */
71
+ export declare function readSeriesChart(rows: readonly ChartRecord[], options?: SeriesChartOptions): SeriesChartModel | null;
72
+ /**
73
+ * A line is read for its shape, so it fills the plot between its own extremes
74
+ * instead of being pinned to zero.
75
+ */
76
+ export declare function lineChartModel(model: SeriesChartModel): SeriesChartModel;
77
+ /** Where a value sits on the axis, as a percentage from the axis minimum. */
78
+ export declare function axisPercent(model: Pick<SeriesChartModel, "min" | "max">, value: number): number;
79
+ export type BarSegment = {
80
+ seriesIndex: number;
81
+ /** Percentage of the axis this segment covers. */
82
+ sizePercent: number;
83
+ /** Percentage from the axis minimum to where the segment begins. */
84
+ startPercent: number;
85
+ value: number;
86
+ };
87
+ export type BarRow = {
88
+ label: string;
89
+ segments: BarSegment[];
90
+ };
91
+ export type BarVariant = "grouped" | "stacked";
92
+ /**
93
+ * A stacked chart is measured against its row totals, not its single values;
94
+ * scaling it like a grouped chart would push the top of every stack off the plot.
95
+ */
96
+ export declare function barChartModel(model: SeriesChartModel, variant: BarVariant): SeriesChartModel;
97
+ /**
98
+ * Bar rectangles per row. Grouped bars all grow from the zero line; stacked
99
+ * bars sit on top of each other in series order. Rows with a missing value
100
+ * simply have one fewer segment — nothing is padded to zero.
101
+ */
102
+ /**
103
+ * The longest value label an upright bar chart prints, in characters. Grouped
104
+ * labels sit centred over bars 18px wide, so a label wider than the gap to the
105
+ * next bar ran into its neighbour ("2,1002,320"); the stylesheet widens the gap
106
+ * between the bars of one category by this many digit widths.
107
+ */
108
+ export declare function widestValueLabel(rows: readonly BarRow[]): number;
109
+ export declare function barRows(model: SeriesChartModel, variant: BarVariant): BarRow[];
110
+ /**
111
+ * The end of an upright column that is rounded. The end on the zero line is
112
+ * always square and only the free end, away from zero, is rounded: the top of
113
+ * a positive column, the bottom of a negative one. In a stack only the outermost
114
+ * segment on each side of zero has a free end; every other segment touches a
115
+ * neighbour at both ends. A segment with no length draws nothing, so it has no
116
+ * end to round. Horizontal rows are an 8px track and stay square at
117
+ * both ends, so they never ask.
118
+ */
119
+ export type RoundedBarEnd = "top" | "bottom" | null;
120
+ export declare function roundedBarEnd(row: BarRow, segment: BarSegment, variant: BarVariant): RoundedBarEnd;
121
+ export type BarLayout = {
122
+ variant: BarVariant;
123
+ horizontal: boolean;
124
+ /** Author-supplied series names; an unnamed single series needs no legend. */
125
+ named: boolean;
126
+ };
127
+ /**
128
+ * Whether every bar can carry its own value beside or above it.
129
+ * Horizontal rows always have room beside the track; a vertical group only has
130
+ * room while the labels stay wider apart than they are long, which is eight
131
+ * bars across a 390px card. Stacked segments never do: their end is a running
132
+ * total the renderer is not allowed to compute.
133
+ */
134
+ export declare function showsValueLabels(model: SeriesChartModel, layout: BarLayout): boolean;
135
+ /** A value axis only appears when the bars could not be labelled directly. */
136
+ export declare function showsValueAxis(model: SeriesChartModel, layout: BarLayout): boolean;
137
+ /**
138
+ * One unnamed series needs nothing to tell it apart from another, so it
139
+ * draws without a legend.
140
+ */
141
+ export declare function showsLegend(model: SeriesChartModel, named: boolean): boolean;
142
+ /**
143
+ * Whether every point on a line or an area gets its own marker.
144
+ *
145
+ * A month of daily points is 31 markers across 275px: 9px apart, drawn 5.5px
146
+ * wide, which turns the line into a chain of beads and hides the shape the chart
147
+ * exists to show. Past that only the two endpoints keep a marker, because those
148
+ * are the points the endpoint values name. Nothing is dropped from the data or
149
+ * the text table — this is the marker layer only, and a chart inside the old
150
+ * twelve-point limit is unchanged.
151
+ */
152
+ export declare function showsPointMarkers(model: SeriesChartModel): boolean;
153
+ /**
154
+ * Which series get their first and last value called out on a line. Three or
155
+ * more sets of endpoint labels collide at 390px, so past two only the lead
156
+ * series is labelled; the rest stay in the legend and in the text table.
157
+ */
158
+ export declare function endpointSeries(model: SeriesChartModel): ChartSeries[];
159
+ /**
160
+ * Ticks a narrow horizontal scale can label without crowding: the ends, plus
161
+ * the middle one only when the tick count actually has a middle.
162
+ */
163
+ export declare function edgeTicks(model: SeriesChartModel): number[];
164
+ export type LinePoint = {
165
+ x: number;
166
+ y: number;
167
+ value: number;
168
+ };
169
+ /**
170
+ * Point coordinates inside `plot`, plus the SVG path for each series. A run of
171
+ * points breaks wherever a row has no number, so a gap reads as a gap.
172
+ */
173
+ export declare function linePaths(model: SeriesChartModel, plot: {
174
+ x: number;
175
+ y: number;
176
+ width: number;
177
+ height: number;
178
+ }): {
179
+ seriesIndex: number;
180
+ path: string;
181
+ points: LinePoint[];
182
+ }[];
183
+ export type AreaVariant = "overlay" | "stacked";
184
+ export type AreaBand = {
185
+ seriesIndex: number;
186
+ /** Filled shapes, one per unbroken run of values. */
187
+ areas: string[];
188
+ /** The top edge of the same runs: the 2px stroke and the stacked seam. */
189
+ lines: string[];
190
+ points: LinePoint[];
191
+ };
192
+ /**
193
+ * Stacked areas are measured against row totals, the way stacked bars are; an
194
+ * overlay keeps the shared axis so the two shapes can be compared directly.
195
+ * Either way the axis contains zero, because an area is read from its baseline.
196
+ */
197
+ export declare function areaChartModel(model: SeriesChartModel, variant: AreaVariant): SeriesChartModel;
198
+ /**
199
+ * The filled shapes and their top edges. A row with no number ends the run, so
200
+ * a gap in the data is a gap in the area rather than a silent zero; the shape
201
+ * always closes on the baseline, never on a rounded cap.
202
+ */
203
+ export declare function areaBands(model: SeriesChartModel, variant: AreaVariant, plot: {
204
+ x: number;
205
+ y: number;
206
+ width: number;
207
+ height: number;
208
+ }): AreaBand[];
209
+ export type PieSlice = {
210
+ label: string;
211
+ value: number;
212
+ /** 0-based slice order; picks the colour token, cycling past four. */
213
+ index: number;
214
+ /** Outline of the slice, with the hole already cut for a donut. */
215
+ path: string;
216
+ };
217
+ /**
218
+ * Slices in the order the rows arrived, sized by their share of the total.
219
+ *
220
+ * The share is geometry, not a number the card shows: the renderer never writes
221
+ * a percentage or a total, because neither is a value the author bound. Rows
222
+ * with no number, or a total of zero, produce nothing so the fallback runs.
223
+ */
224
+ export declare function pieSlices(model: SeriesChartModel, donut: boolean, size?: number): PieSlice[];
225
+ /**
226
+ * Colour token for an ordered shape. There are four series colours, so a fifth
227
+ * or sixth slice reuses the first two at a lower opacity; the name and value
228
+ * next to every slice are what actually tells them apart.
229
+ */
230
+ export declare function orderedTone(index: number): {
231
+ series: number;
232
+ dim: boolean;
233
+ };
234
+ export type RadialTrack = {
235
+ label: string;
236
+ value: number;
237
+ /** 0-based track order, outside in; picks the colour token. */
238
+ index: number;
239
+ radius: number;
240
+ /** Full circle in the track colour's groove. */
241
+ path: string;
242
+ };
243
+ /**
244
+ * One track per row, outside in, scaled against the largest value in the set.
245
+ *
246
+ * The scale is the renderer's own reading of the bound numbers, the way the
247
+ * bar chart already sizes its bars; the card still shows only the values
248
+ * the author bound, never a share or a total.
249
+ */
250
+ export declare function radialTracks(model: SeriesChartModel, size?: number): RadialTrack[];
251
+ export type ScatterPoint = {
252
+ label: string;
253
+ index: number;
254
+ /** Plot coordinates. */
255
+ x: number;
256
+ y: number;
257
+ /** Marker radius; constant unless a third field carries a weight. */
258
+ radius: number;
259
+ /** Bound values in series order, for the text alternative and the labels. */
260
+ values: number[];
261
+ };
262
+ /** Points drawn with their names beside them; past this only the table names them. */
263
+ export declare const SCATTER_LABEL_LIMIT = 8;
264
+ /**
265
+ * Points placed inside `plot` from the first two named fields, with an optional
266
+ * third read as the marker weight. Each axis is scaled against its own range,
267
+ * so the cloud fills the plot instead of hugging a corner. A row missing either
268
+ * coordinate is dropped rather than placed at a guessed zero.
269
+ */
270
+ export declare function scatterPoints(model: SeriesChartModel, plot: {
271
+ x: number;
272
+ y: number;
273
+ width: number;
274
+ height: number;
275
+ }): ScatterPoint[];
276
+ export type ScatterLabel = {
277
+ index: number;
278
+ label: string;
279
+ /** The name sits under its point instead of above it. */
280
+ below: boolean;
281
+ /** How the name lines up with its point when an edge is in the way. */
282
+ align: "center" | "start" | "end";
283
+ /** Clearance between the point's centre and the near edge of the name, in px. */
284
+ gap: number;
285
+ };
286
+ /**
287
+ * Where each point's name goes, or nothing when it cannot go anywhere.
288
+ *
289
+ * A name is never cut and never hangs outside the plot: it starts above its
290
+ * point and flips below, then to one side, until it fits the box without
291
+ * touching a name already placed. A point that still has nowhere to put its
292
+ * name keeps it in the hidden table only — dropping the label is honest, a
293
+ * clipped or overlapping one is not.
294
+ */
295
+ export declare function scatterLabels(points: readonly ScatterPoint[], box?: {
296
+ width: number;
297
+ height: number;
298
+ }): ScatterLabel[];
299
+ /**
300
+ * How the category labels under a vertical bar chart are laid out.
301
+ *
302
+ * A label is never cut, never broken inside a word and never rotated, so the
303
+ * layout follows the text instead of the number of categories: a label that fits
304
+ * its own column keeps one line, a longer one wraps onto at most two lines, each
305
+ * centred under its own category, and a label that even two lines cannot hold
306
+ * turns the whole chart on its side, where every category has a row of its own.
307
+ *
308
+ * Every label stays over its own bars. The previous rule staggered alternate
309
+ * labels onto a second row, which moved them away from the categories they
310
+ * name — at 390px "PAID SEARCH" sat left-aligned under the axis and "ORGANIC"
311
+ * dropped between two groups. Rotating the labels 45 degrees was considered and
312
+ * rejected: tilted text reads worse, it has no sensible form for CJK, and none
313
+ * of the five reference design languages rotates a category label.
314
+ */
315
+ export type RowLabelLayout = "flat" | "wrapped" | "horizontal";
316
+ /** Lines a wrapped label may take before the chart is turned sideways instead. */
317
+ export declare const MAX_LABEL_LINES = 2;
318
+ /**
319
+ * Categories an upright bar chart can hold before it turns sideways whatever its
320
+ * labels say.
321
+ *
322
+ * The label rule alone is not enough once a report binds sixteen channels: short
323
+ * names such as "W1".."W16" fit their own column, but that column is 17px wide and
324
+ * four grouped bars inside it are 4px each. Eight is the width this chart was
325
+ * measured at, so nothing drawn today changes; past it every category gets a row of
326
+ * its own on the sideways skeleton, where the number of rows costs no width at all.
327
+ */
328
+ export declare const MAX_UPRIGHT_CATEGORIES = 8;
329
+ /**
330
+ * The lines a label takes in a column this wide, greedily filled the way a
331
+ * renderer wraps it, or `null` when one of its unbreakable runs is wider than
332
+ * the column and the label can only be drawn on a sideways chart.
333
+ */
334
+ export declare function labelLines(label: string, column: number): string[] | null;
335
+ /** The layout the labels need at the narrowest width the chart has to survive. */
336
+ export declare function rowLabelLayout(labels: readonly string[]): RowLabelLayout;
337
+ /**
338
+ * Where a radar axis name goes, and how big the polygon has to be to leave room
339
+ * for it.
340
+ *
341
+ * The drawing is a fixed box, laid out once for the narrowest card the Widget
342
+ * supports, exactly the way the share and ring charts keep one drawn size at
343
+ * every width: a radar is read for the shape of its polygon, and the shape does
344
+ * not get clearer by being stretched across a wide card. Everything below is
345
+ * plain arithmetic on that box so the Kotlin and Swift twins can hold the same
346
+ * numbers and the same tests.
347
+ */
348
+ export type PlotPoint = {
349
+ x: number;
350
+ y: number;
351
+ };
352
+ /** How a name lines up with the point it is anchored to, across and down. */
353
+ export type RadarAnchor = "start" | "middle" | "end";
354
+ export type RadarRise = "above" | "middle" | "below";
355
+ export type RadarAxisLabel = {
356
+ /** Axis index, clockwise from twelve o'clock. */
357
+ index: number;
358
+ /** One or two lines from `labelLines`: never cut, never broken inside a word. */
359
+ lines: string[];
360
+ /** Horizontal alignment of the text block at `x`. */
361
+ anchor: RadarAnchor;
362
+ /** Which side of its vertex the block sits on; `middle` centres it on the vertex. */
363
+ rise: RadarRise;
364
+ /** The anchor point, in the radar box. */
365
+ x: number;
366
+ /** Top edge of the text block, in the radar box. */
367
+ top: number;
368
+ };
369
+ export type RadarLayout = {
370
+ width: number;
371
+ height: number;
372
+ centre: PlotPoint;
373
+ /** Radius the outermost ring and a 1.0 score reach. */
374
+ radius: number;
375
+ /** Placed names in axis order; empty when `row` is true. */
376
+ labels: RadarAxisLabel[];
377
+ /** True when no radius could hold every name and they all drop to one row under the chart. */
378
+ row: boolean;
379
+ };
380
+ /** The radar box is as wide as the chart inside the narrowest card. */
381
+ export declare const RADAR_BOX_WIDTH = 310;
382
+ export declare const RADAR_LABEL_LINE = 14;
383
+ /**
384
+ * Height of the box at a given radius: the polygon plus the tallest name it can
385
+ * carry, on both sides. The room is always reserved for the tallest name a rule
386
+ * allows, so the vertical always fits and the fit test below only ever has to
387
+ * measure width — and a polygon that shrank to make room takes a shorter box
388
+ * with it instead of leaving a band of nothing.
389
+ */
390
+ export declare function radarBoxHeight(radius: number): number;
391
+ /**
392
+ * Guide rings, as fractions of the declared 0-1 range. Two is what the reading
393
+ * needs — "past halfway" and "at the top" — and the spokes already say how many
394
+ * axes there are; a quarter ring is 22px across at the narrowest card and only
395
+ * adds clutter at the centre, where every polygon is at its busiest.
396
+ */
397
+ export declare const RADAR_RINGS: readonly number[];
398
+ /** Angle of one axis in radians, starting at twelve o'clock and running clockwise. */
399
+ export declare function radarAngle(index: number, count: number): number;
400
+ /**
401
+ * Vertex coordinates of one radar face. Values outside 0-1 are clamped, because
402
+ * an axis only reaches the outer ring; a row with no number sits at the centre
403
+ * rather than breaking the closed shape.
404
+ */
405
+ export declare function radarPoints(values: readonly (number | null)[], radius: number, centre: PlotPoint): PlotPoint[];
406
+ /**
407
+ * The grid behind the faces: one hairline polygon per ring and one spoke from
408
+ * the centre to each vertex.
409
+ *
410
+ * The rings are polygons, not circles, because the data is a polygon: a circle
411
+ * only touches the axes it happens to cross, so it cannot tell a reader where
412
+ * "half" is on the axis they are looking at. The spokes are what tie a vertex to
413
+ * the name printed outside it, and they make the number of axes countable even
414
+ * where a face covers the outer ring.
415
+ */
416
+ export declare function radarGrid(count: number, radius: number, centre: PlotPoint): {
417
+ rings: PlotPoint[][];
418
+ spokes: PlotPoint[];
419
+ };
420
+ /**
421
+ * Where every axis name goes, and how large the polygon may be.
422
+ *
423
+ * Each name sits outside its own vertex, lined up by the side of the chart it is
424
+ * on: a vertex on the right starts its name there and runs outwards, one on the
425
+ * left ends it there, and one straight above or below the centre gets a centred
426
+ * name. Nothing is rotated and nothing is cut. A name that does not fit on one
427
+ * line wraps onto a second with the same `labelLines` rule the bar chart uses,
428
+ * and if two lines still do not fit, the polygon shrinks — a smaller polygon
429
+ * moves its side vertices inwards, which is exactly the room a side name needs.
430
+ * Only when the smallest polygon still cannot hold every name do all the names
431
+ * drop to one row under the chart, the way S16 drew them before. It is all or
432
+ * nothing: half the names beside their vertices and half in a row below would be
433
+ * read as two different things.
434
+ */
435
+ export declare function radarLayout(labels: readonly string[], width?: number): RadarLayout;
436
+ export type ChartTable = {
437
+ /** Row-label column header first, then one header per series. */
438
+ columns: string[];
439
+ rows: {
440
+ label: string;
441
+ cells: string[];
442
+ }[];
443
+ };
444
+ /**
445
+ * The text alternative. It carries every row and every series, and the unit
446
+ * rides in the column header instead of being glued onto each number.
447
+ */
448
+ export declare function chartTable(model: SeriesChartModel, unit?: string | null): ChartTable;
449
+ export declare function radarValueColumn(model: SeriesChartModel): number;
450
+ /** Marker shape per series index, so a series is identifiable without colour. */
451
+ export declare const SCATTER_MARKS: readonly ["circle", "square", "triangle", "diamond"];
452
+ export type ScatterMark = (typeof SCATTER_MARKS)[number];
453
+ /**
454
+ * Marker outlines around (0, 0), in px. Each covers about the area of the 8px
455
+ * circle, so no series looks heavier than another; the box they share is 12px,
456
+ * which leaves room for the 1px surface ring.
457
+ */
458
+ export declare const SCATTER_MARK_PATHS: Readonly<Record<ScatterMark, string>>;
459
+ /** Half the side of the box every marker is drawn in. */
460
+ export declare const SCATTER_MARK_BOX = 6;
461
+ export declare function scatterMark(seriesIndex: number): ScatterMark;
462
+ export type ScatterAxis = {
463
+ min: number;
464
+ max: number;
465
+ ticks: number[];
466
+ };
467
+ export type ScatterChartPoint = {
468
+ seriesIndex: number;
469
+ rowIndex: number;
470
+ /** The bound values. */
471
+ x: number;
472
+ y: number;
473
+ /** Where the point sits, as percentages from the plot's left and bottom edges. */
474
+ left: number;
475
+ bottom: number;
476
+ };
477
+ export type ScatterChartModel = {
478
+ /** One entry per row: its x value, or `null` when the row has none. */
479
+ xs: (number | null)[];
480
+ series: ChartSeries[];
481
+ x: ScatterAxis;
482
+ y: ScatterAxis;
483
+ /** Every drawable point, series by series in row order. */
484
+ points: ScatterChartPoint[];
485
+ };
486
+ /**
487
+ * The largest magnitude a scatter value may have. Below it every span, step, tick and bound the
488
+ * axes are built from is a finite number; -1e308 and 1e308 are each finite, but the span between
489
+ * them is not, and a plot built on it would put both points in the middle. The LP-MDX compiler
490
+ * refuses such rows with `invalid_chart_data`; a renderer given them anyway draws the fallback.
491
+ */
492
+ export declare const SCATTER_MAX_MAGNITUDE = 1e+300;
493
+ /**
494
+ * Rounded bounds and ticks for one axis, hugging the data like the line chart's value axis.
495
+ *
496
+ * The step comes from the span, never from the size of the values: thirteen-digit millisecond
497
+ * timestamps 12 ms apart get ticks 5 ms apart. The ticks are counted before they are built and
498
+ * there are never more than `SCATTER_MAX_STEPS + 1`, so no loop runs on a float counter. When
499
+ * the step cannot be told apart from the values (it underflows, adding it changes nothing, or
500
+ * the ticks it gives are not strictly increasing and around the data), the axis is just the two
501
+ * true endpoints. The bounds always hold every tick and every value. A flat axis keeps its one
502
+ * value as its only tick, in the middle of a reach of a tenth of it either side (at least 1).
503
+ */
504
+ export declare function scatterAxis(values: readonly number[]): ScatterAxis;
505
+ export declare function scatterAxisPercent(axis: ScatterAxis, value: number): number;
506
+ /**
507
+ * The drawable scatter, or `null` when there is no point to draw. As for the
508
+ * other charts, `seriesFields` is required and `labelField` defaults to
509
+ * `"label"`; a row whose x is not a number has no point in any series.
510
+ */
511
+ export declare function readScatterChart(rows: readonly ChartRecord[], options?: SeriesChartOptions): ScatterChartModel | null;
512
+ export type ScatterTickAlign = "start" | "center" | "end";
513
+ export type ScatterTick = {
514
+ value: number;
515
+ label: string;
516
+ align: ScatterTickAlign;
517
+ };
518
+ /**
519
+ * The x ticks that are labelled, and how. Every tick while the labels fit side by side in the
520
+ * narrowest card; past that, the ends and the middle tick, the way the horizontal bar scale thins
521
+ * its own. When even those do not fit — large values a short span apart, such as timestamps —
522
+ * the first keeps its full value and the others are written as offsets from it ("+5"), so
523
+ * neighbouring labels never collide or read the same. The first label starts at its tick and
524
+ * the last ends at its tick, so neither hangs past the plot; a lone tick is centred.
525
+ */
526
+ export declare function scatterXTicks(axis: ScatterAxis): ScatterTick[];
527
+ /**
528
+ * The text alternative: one row per record, its x value first and then every
529
+ * series, so each point is read with both of its numbers.
530
+ */
531
+ export declare function scatterTable(model: ScatterChartModel, xName: string, unit?: string | null): ChartTable;