@blueprint-chart/lib 1.8.2 → 2.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 (51) hide show
  1. package/dist/charts/axis-options.d.ts +3 -0
  2. package/dist/charts/canvas/canvas.d.ts +2 -5
  3. package/dist/charts/category-label-line.d.ts +16 -0
  4. package/dist/charts/chart-helpers.d.ts +2 -3
  5. package/dist/charts/chart-options.d.ts +2 -0
  6. package/dist/charts/contrast.d.ts +4 -3
  7. package/dist/charts/date-parse.d.ts +6 -0
  8. package/dist/charts/frame/frame.d.ts +6 -0
  9. package/dist/charts/parse-data.d.ts +2 -0
  10. package/dist/charts/plugins/annotations/position-helpers.d.ts +7 -0
  11. package/dist/charts/plugins/highlight.d.ts +9 -3
  12. package/dist/charts/scale-helpers.d.ts +15 -8
  13. package/dist/charts/series-helpers.d.ts +22 -1
  14. package/dist/charts/stack-helpers.d.ts +1 -1
  15. package/dist/charts/themes/index.d.ts +6 -0
  16. package/dist/charts/types.d.ts +10 -4
  17. package/dist/charts/value-label-fit.d.ts +31 -0
  18. package/dist/dsl/converter.d.ts +5 -0
  19. package/dist/dsl/quoting.d.ts +16 -0
  20. package/dist/dsl/types.d.ts +42 -0
  21. package/dist/dsl/validate.d.ts +6 -0
  22. package/dist/embed.js +1 -1
  23. package/dist/enums.d.ts +23 -0
  24. package/dist/index.d.ts +9 -1
  25. package/dist/index.js +615 -296
  26. package/dist/lib/lib.iife.js +44 -15
  27. package/dist/node-backend/index.js +3192 -2108
  28. package/dist/render/chart-a11y.d.ts +14 -0
  29. package/dist/render/frame-svg.d.ts +51 -0
  30. package/dist/render/index.d.ts +3 -0
  31. package/dist/render/post-render.d.ts +2 -0
  32. package/dist/{render-bpc-By-iMMKD.js → render-bpc-BWiUALXY.js} +3976 -2860
  33. package/dist/runtime/chart-css.d.ts +1 -1
  34. package/dist/runtime-DDhsXDn5.js +84 -0
  35. package/dist/runtime.js +2 -2
  36. package/dist/transforms/applyFilter.d.ts +2 -0
  37. package/dist/transforms/applyGroupBy.d.ts +2 -0
  38. package/dist/transforms/applyHideColumns.d.ts +2 -0
  39. package/dist/transforms/applyParse.d.ts +3 -0
  40. package/dist/transforms/applyRename.d.ts +2 -0
  41. package/dist/transforms/applySort.d.ts +2 -0
  42. package/dist/transforms/applyTranspose.d.ts +2 -0
  43. package/dist/transforms/index.d.ts +30 -0
  44. package/dist/transforms/parseOperations.d.ts +15 -0
  45. package/dist/transforms/shared.d.ts +4 -0
  46. package/dist/transforms/table.d.ts +22 -0
  47. package/dist/transforms/transformValue.d.ts +1 -0
  48. package/dist/transforms/types.d.ts +13 -0
  49. package/package.json +1 -1
  50. package/src/charts/chart.scss +29 -4
  51. package/dist/runtime-BnrDRLyH.js +0 -84
@@ -1 +1 @@
1
- export declare const CHART_CSS = "\n/* Blueprint Chart \u2014 Runtime Embed Styles\n CSS custom properties with baked-in defaults for standalone iframe usage. */\n\n.bc-frame {\n --bc-frame-font-family: system-ui, -apple-system, sans-serif;\n --bc-frame-padding: 0;\n --bc-frame-bg: #fff;\n --bc-text-color: #333;\n font-family: var(--bc-frame-font-family);\n background: var(--bc-frame-bg);\n /* currentColor marks (e.g. above-bar value labels) follow the theme text\n colour, not the ambient document colour. */\n color: var(--bc-text-color, #333);\n}\n\n/* Keeps the SVG's baked-in background rect (applyCanvasBackground) in sync\n with the frame background; transparentBackground sets the var to\n transparent at runtime. */\n.bc-frame .bc-canvas-bg {\n fill: var(--bc-frame-bg, #fff);\n}\n\n.bc-frame-header {\n padding: var(--bc-frame-padding) var(--bc-frame-padding) 0;\n background: var(--bc-frame-header-bg, transparent);\n border-bottom: var(--bc-frame-header-border-bottom, none);\n margin-bottom: var(--bc-frame-header-margin-bottom, 0);\n}\n\n.bc-frame-body {\n padding: 0 var(--bc-frame-padding);\n}\n\n.bc-frame-title {\n --bc-frame-title-color: var(--bc-text-color, #333);\n --bc-frame-title-font-size: 1.25rem;\n color: var(--bc-frame-title-color);\n font-size: var(--bc-frame-title-font-size);\n font-weight: bold;\n margin: 0;\n}\n\n.bc-frame-description {\n --bc-frame-description-color: var(--bc-text-color, #555);\n --bc-frame-description-font-size: 0.875rem;\n color: var(--bc-frame-description-color);\n font-size: var(--bc-frame-description-font-size);\n margin: 0.25rem 0 0;\n}\n\n.bc-frame-footer {\n margin-top: 0.5rem;\n gap: 0.25rem 1rem;\n padding: var(--bc-frame-footer-padding-top, 0) var(--bc-frame-padding) var(--bc-frame-padding);\n background: var(--bc-frame-footer-bg, transparent);\n border-top: var(--bc-frame-footer-border-top, none);\n}\n\n.bc-frame-footer-left {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: 0.25rem 0.75rem;\n}\n\n.bc-frame-footer-left > :not(:first-child)::before {\n content: \"\\00B7\";\n margin-right: 0.5rem;\n color: var(--bc-text-color, #888);\n}\n\n.bc-frame-footer-right {\n display: flex;\n align-items: center;\n}\n\n.bc-frame-note {\n --bc-frame-note-color: var(--bc-text-color, #888);\n --bc-frame-note-font-size: 0.75rem;\n font-style: italic;\n color: var(--bc-frame-note-color);\n font-size: var(--bc-frame-note-font-size);\n margin: 0;\n padding: 0 var(--bc-frame-padding);\n}\n\n.bc-frame-byline,\n.bc-frame-source {\n --bc-frame-meta-color: var(--bc-text-color, #888);\n --bc-frame-meta-font-size: 0.75rem;\n color: var(--bc-frame-meta-color);\n font-size: var(--bc-frame-meta-font-size);\n}\n\n.bc-frame-credit {\n --bc-frame-credit-color: var(--bc-text-color, #666);\n --bc-frame-credit-font-size: 0.75rem;\n color: var(--bc-frame-credit-color);\n font-size: var(--bc-frame-credit-font-size);\n font-weight: 600;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n}\n\n.bc-frame-source-link {\n color: inherit;\n text-decoration: underline;\n}\n\n.bc-axis .domain {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-axis .tick text {\n fill: var(--bc-axis-color, #333);\n font-size: 10px;\n}\n\n.bc-axis .tick line {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-grid-line {\n stroke: var(--bc-grid-color, #e0e0e0);\n stroke-width: 1;\n}\n\n.bc-zero-baseline {\n stroke: #666;\n stroke-width: 1;\n}\n\n.bc-bar {\n /* fill is set via D3 .attr() from data-bound colors \u2014 do not override */\n}\n\n.bc-line {\n fill: none;\n stroke-width: 2;\n}\n\n.bc-value-label {\n font-size: 11px;\n /* fill is set via D3 .attr() \u2014 do not override */\n}\n\n.bc-direct-label {\n font-size: 12px;\n font-weight: 600;\n}\n\n.bc-tooltip {\n position: absolute;\n pointer-events: none;\n background: var(--bc-tooltip-bg, #fff);\n color: var(--bc-tooltip-color, #212529);\n border: 1px solid var(--bc-tooltip-border-color, #dee2e6);\n border-radius: 4px;\n padding: 6px 10px;\n font-size: 13px;\n box-shadow: 0 2px 8px rgba(0,0,0,0.12);\n z-index: 9999;\n display: none;\n}\n\n.bc-crosshair {\n stroke: #999;\n stroke-width: 1;\n pointer-events: none;\n}\n\n.bc-arc-label-line {\n fill: none;\n stroke: #999;\n stroke-width: 1;\n}\n\n.bc-theme-blueprint-framed {\n --bc-frame-header-border-bottom: 1px solid #e0e0e0;\n --bc-frame-header-margin-bottom: 0.5rem;\n --bc-frame-footer-bg: #f8f8f8;\n --bc-frame-footer-border-top: 1px solid #e0e0e0;\n --bc-frame-footer-padding-top: 0.625rem;\n}\n\n[data-bs-theme=\"dark\"] .bc-frame.bc-theme-blueprint-bold {\n --bc-frame-bg: #000000;\n --bc-text-color: rgba(255, 255, 255, 0.95);\n --bc-axis-color: rgba(255, 255, 255, 0.7);\n --bc-grid-color: rgba(255, 255, 255, 0.12);\n}\n\n.blueprint-chart-error {\n color: red;\n padding: 1em;\n border: 1px solid red;\n}\n\nbody {\n margin: 0;\n overflow: hidden;\n}\n\n/* Dark theme: activated by data-bs-theme=\"dark\" on the document (matching the\n editor's convention). The chart owns these colors; the dark frame background\n also drives the renderer's resolveBackgroundColor, so data-mark colors and\n contrast labels adapt at render time. Scoped to .bc-frame so these override\n the frame's own light --bc-frame-bg / --bc-text-color declarations (which are\n set on .bc-frame and would otherwise shadow a document-level override). */\n[data-bs-theme=\"dark\"] body {\n /* color themes above-bar value labels (fill: currentColor). */\n background: #1c1c1c;\n color: rgba(255, 255, 255, 0.9);\n}\n\n[data-bs-theme=\"dark\"] .bc-frame {\n --bc-frame-bg: #1c1c1c;\n --bc-text-color: rgba(255, 255, 255, 0.9);\n --bc-axis-color: rgba(255, 255, 255, 0.6);\n --bc-grid-color: #333;\n\n color: rgba(255, 255, 255, 0.9);\n}\n";
1
+ export declare const CHART_CSS = "\n/* Blueprint Chart \u2014 Runtime Embed Styles\n CSS custom properties with baked-in defaults for standalone iframe usage. */\n\n.bc-frame {\n --bc-frame-font-family: system-ui, -apple-system, sans-serif;\n --bc-frame-padding: 0;\n /* Per-side properties so a multi-value `padding` shorthand never lands in a\n single-value shorthand slot, which would invalidate the whole declaration. */\n --bc-frame-padding-top: var(--bc-frame-padding);\n --bc-frame-padding-right: var(--bc-frame-padding);\n --bc-frame-padding-bottom: var(--bc-frame-padding);\n --bc-frame-padding-left: var(--bc-frame-padding);\n --bc-frame-bg: #fff;\n --bc-text-color: #333;\n font-family: var(--bc-frame-font-family);\n background: var(--bc-frame-bg);\n /* currentColor marks (e.g. above-bar value labels) follow the theme text\n colour, not the ambient document colour. */\n color: var(--bc-text-color, #333);\n}\n\n/* Keeps the SVG's baked-in background rect (applyCanvasBackground) in sync\n with the frame background; transparentBackground sets the var to\n transparent at runtime. */\n.bc-frame .bc-canvas-bg {\n fill: var(--bc-frame-bg, #fff);\n}\n\n/* `theme = \"dark\"` emits this class on the frame, so it carries the same\n surface the document-level dark mode does, without depending on an ambient\n data-bs-theme. Keep in sync with DARK_THEME in render/frame-svg.ts. */\n.bc-frame.bc-theme-dark {\n --bc-frame-bg: #1c1c1c;\n --bc-text-color: rgba(255, 255, 255, 0.9);\n --bc-axis-color: rgba(255, 255, 255, 0.6);\n --bc-grid-color: #333;\n\n color: rgba(255, 255, 255, 0.9);\n}\n\n.bc-frame-header {\n padding: var(--bc-frame-padding-top) var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);\n background: var(--bc-frame-header-bg, transparent);\n border-bottom: var(--bc-frame-header-border-bottom, none);\n margin-bottom: var(--bc-frame-header-margin-bottom, 0);\n}\n\n.bc-frame-body {\n padding: 0 var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);\n}\n\n.bc-frame-title {\n --bc-frame-title-color: var(--bc-text-color, #333);\n --bc-frame-title-font-size: 1.25rem;\n color: var(--bc-frame-title-color);\n font-size: var(--bc-frame-title-font-size);\n font-weight: bold;\n margin: 0;\n white-space: pre-line;\n}\n\n.bc-frame-description {\n --bc-frame-description-color: var(--bc-text-color, #555);\n --bc-frame-description-font-size: 0.875rem;\n color: var(--bc-frame-description-color);\n font-size: var(--bc-frame-description-font-size);\n margin: 0.25rem 0 0;\n white-space: pre-line;\n}\n\n.bc-frame-footer {\n margin-top: 0.5rem;\n gap: 0.25rem 1rem;\n padding: var(--bc-frame-footer-padding-top, 0) var(--bc-frame-padding-right) var(--bc-frame-padding-bottom) var(--bc-frame-padding-left);\n background: var(--bc-frame-footer-bg, transparent);\n border-top: var(--bc-frame-footer-border-top, none);\n}\n\n.bc-frame-footer-left {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: 0.25rem 0.75rem;\n}\n\n.bc-frame-footer-left > :not(:first-child)::before {\n content: \"\\00B7\";\n margin-right: 0.5rem;\n color: var(--bc-text-color, #888);\n}\n\n.bc-frame-footer-right {\n display: flex;\n align-items: center;\n}\n\n.bc-frame-note {\n --bc-frame-note-color: var(--bc-text-color, #888);\n --bc-frame-note-font-size: 0.75rem;\n font-style: italic;\n color: var(--bc-frame-note-color);\n font-size: var(--bc-frame-note-font-size);\n margin: 0;\n padding: 0 var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);\n}\n\n.bc-frame-byline,\n.bc-frame-source {\n --bc-frame-meta-color: var(--bc-text-color, #888);\n --bc-frame-meta-font-size: 0.75rem;\n color: var(--bc-frame-meta-color);\n font-size: var(--bc-frame-meta-font-size);\n}\n\n.bc-frame-byline {\n white-space: pre-line;\n}\n\n.bc-frame-credit {\n --bc-frame-credit-color: var(--bc-text-color, #666);\n --bc-frame-credit-font-size: 0.75rem;\n color: var(--bc-frame-credit-color);\n font-size: var(--bc-frame-credit-font-size);\n font-weight: 600;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n}\n\n.bc-frame-source-link {\n color: inherit;\n text-decoration: underline;\n}\n\n.bc-axis .domain {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-axis .tick text {\n fill: var(--bc-axis-color, #333);\n font-size: 10px;\n}\n\n.bc-axis .tick line {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-grid-line {\n stroke: var(--bc-grid-color, #e0e0e0);\n stroke-width: 1;\n}\n\n.bc-zero-baseline {\n stroke: #666;\n stroke-width: 1;\n}\n\n.bc-bar {\n /* fill is set via D3 .attr() from data-bound colors \u2014 do not override */\n}\n\n.bc-line {\n fill: none;\n stroke-width: 2;\n}\n\n.bc-value-label {\n font-size: 11px;\n /* fill is set via D3 .attr() \u2014 do not override */\n}\n\n.bc-direct-label {\n font-size: 12px;\n font-weight: 600;\n}\n\n.bc-tooltip {\n position: absolute;\n pointer-events: none;\n background: var(--bc-tooltip-bg, #fff);\n color: var(--bc-tooltip-color, #212529);\n border: 1px solid var(--bc-tooltip-border-color, #dee2e6);\n border-radius: 4px;\n padding: 6px 10px;\n font-size: 13px;\n box-shadow: 0 2px 8px rgba(0,0,0,0.12);\n z-index: 9999;\n display: none;\n}\n\n.bc-crosshair {\n stroke: #999;\n stroke-width: 1;\n pointer-events: none;\n}\n\n.bc-arc-label-line {\n fill: none;\n stroke: #999;\n stroke-width: 1;\n}\n\n.bc-theme-blueprint-framed {\n --bc-frame-header-border-bottom: 1px solid #e0e0e0;\n --bc-frame-header-margin-bottom: 0.5rem;\n --bc-frame-footer-bg: #f8f8f8;\n --bc-frame-footer-border-top: 1px solid #e0e0e0;\n --bc-frame-footer-padding-top: 0.625rem;\n}\n\n[data-bs-theme=\"dark\"] .bc-frame.bc-theme-blueprint-bold {\n --bc-frame-bg: #000000;\n --bc-text-color: rgba(255, 255, 255, 0.95);\n --bc-axis-color: rgba(255, 255, 255, 0.7);\n --bc-grid-color: rgba(255, 255, 255, 0.12);\n}\n\n.blueprint-chart-error {\n color: red;\n padding: 1em;\n border: 1px solid red;\n}\n\nbody {\n margin: 0;\n overflow: hidden;\n}\n\n/* Dark theme: activated by data-bs-theme=\"dark\" on the document (matching the\n editor's convention). The chart owns these colors; the dark frame background\n also drives the renderer's resolveBackgroundColor, so data-mark colors and\n contrast labels adapt at render time. Scoped to .bc-frame so these override\n the frame's own light --bc-frame-bg / --bc-text-color declarations (which are\n set on .bc-frame and would otherwise shadow a document-level override). */\n[data-bs-theme=\"dark\"] body {\n /* color themes above-bar value labels (fill: currentColor). */\n background: #1c1c1c;\n color: rgba(255, 255, 255, 0.9);\n}\n\n[data-bs-theme=\"dark\"] .bc-frame {\n --bc-frame-bg: #1c1c1c;\n --bc-text-color: rgba(255, 255, 255, 0.9);\n --bc-axis-color: rgba(255, 255, 255, 0.6);\n --bc-grid-color: #333;\n\n color: rgba(255, 255, 255, 0.9);\n}\n";
@@ -0,0 +1,84 @@
1
+ //#region src/runtime/chart-css.ts
2
+ var e = "blueprint-chart-resize", t = "blueprint-chart-error";
3
+ function n(e) {
4
+ return typeof e == "object" && e && e.type === "blueprint-chart-resize" && typeof e.height == "number" ? e.height : null;
5
+ }
6
+ function r(e) {
7
+ return typeof e == "object" && !!e && e.type === "blueprint-chart-error";
8
+ }
9
+ //#endregion
10
+ //#region src/runtime/runtime.ts
11
+ var i = a();
12
+ function a() {
13
+ try {
14
+ if (typeof globalThis < "u") {
15
+ let e = globalThis.BLUEPRINT_CHART_RUNTIME_URL;
16
+ if (typeof e == "string" && e) return e;
17
+ }
18
+ return typeof document > "u" ? "" : document.currentScript?.src ?? "";
19
+ } catch {
20
+ return "";
21
+ }
22
+ }
23
+ var o = /* @__PURE__ */ new Map(), s = null;
24
+ function c() {
25
+ s || (s = (e) => {
26
+ for (let [t, n] of o) if (e.source === t.contentWindow) {
27
+ n(e);
28
+ return;
29
+ }
30
+ }, window.addEventListener("message", s));
31
+ }
32
+ function l() {
33
+ c(), document.querySelectorAll("script[type=\"application/blueprint-chart\"]").forEach(u);
34
+ }
35
+ function u(e) {
36
+ let t = e.textContent?.trim();
37
+ if (!t) return;
38
+ let a = document.createElement("iframe");
39
+ a.className = "blueprint-chart-iframe", a.style.cssText = "border: none; width: 100%; display: block;", a.setAttribute("sandbox", "allow-scripts"), a.setAttribute("title", "Blueprint Chart"), e.parentNode?.insertBefore(a, e), a.srcdoc = d(t, i), o.set(a, (e) => {
40
+ let t = n(e.data);
41
+ if (t !== null) {
42
+ a.style.height = `${t}px`;
43
+ return;
44
+ }
45
+ r(e.data) && console.warn("Blueprint Chart: could not render embed.", e.data.message);
46
+ });
47
+ }
48
+ function d(n, r, i) {
49
+ let a = r ? `<script src="${p(r)}"><\/script>` : "", o = i === "dark" ? "<html data-bs-theme=\"dark\">" : "<html>", s = r ? [
50
+ "try {",
51
+ " window.BlueprintChart.renderBpc(document.getElementById(\"chart\"), __BPC_SRC__);",
52
+ "}",
53
+ "catch (e) {",
54
+ ` parent.postMessage({ type: "${t}", message: String(e) }, "*");`,
55
+ "}"
56
+ ] : [`parent.postMessage({ type: "${t}", message: "Blueprint Chart runtime URL unavailable" }, "*");`];
57
+ return [
58
+ "<!DOCTYPE html>",
59
+ `${o}<head>`,
60
+ "<style>\n/* Blueprint Chart — Runtime Embed Styles\n CSS custom properties with baked-in defaults for standalone iframe usage. */\n\n.bc-frame {\n --bc-frame-font-family: system-ui, -apple-system, sans-serif;\n --bc-frame-padding: 0;\n /* Per-side properties so a multi-value `padding` shorthand never lands in a\n single-value shorthand slot, which would invalidate the whole declaration. */\n --bc-frame-padding-top: var(--bc-frame-padding);\n --bc-frame-padding-right: var(--bc-frame-padding);\n --bc-frame-padding-bottom: var(--bc-frame-padding);\n --bc-frame-padding-left: var(--bc-frame-padding);\n --bc-frame-bg: #fff;\n --bc-text-color: #333;\n font-family: var(--bc-frame-font-family);\n background: var(--bc-frame-bg);\n /* currentColor marks (e.g. above-bar value labels) follow the theme text\n colour, not the ambient document colour. */\n color: var(--bc-text-color, #333);\n}\n\n/* Keeps the SVG's baked-in background rect (applyCanvasBackground) in sync\n with the frame background; transparentBackground sets the var to\n transparent at runtime. */\n.bc-frame .bc-canvas-bg {\n fill: var(--bc-frame-bg, #fff);\n}\n\n/* `theme = \"dark\"` emits this class on the frame, so it carries the same\n surface the document-level dark mode does, without depending on an ambient\n data-bs-theme. Keep in sync with DARK_THEME in render/frame-svg.ts. */\n.bc-frame.bc-theme-dark {\n --bc-frame-bg: #1c1c1c;\n --bc-text-color: rgba(255, 255, 255, 0.9);\n --bc-axis-color: rgba(255, 255, 255, 0.6);\n --bc-grid-color: #333;\n\n color: rgba(255, 255, 255, 0.9);\n}\n\n.bc-frame-header {\n padding: var(--bc-frame-padding-top) var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);\n background: var(--bc-frame-header-bg, transparent);\n border-bottom: var(--bc-frame-header-border-bottom, none);\n margin-bottom: var(--bc-frame-header-margin-bottom, 0);\n}\n\n.bc-frame-body {\n padding: 0 var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);\n}\n\n.bc-frame-title {\n --bc-frame-title-color: var(--bc-text-color, #333);\n --bc-frame-title-font-size: 1.25rem;\n color: var(--bc-frame-title-color);\n font-size: var(--bc-frame-title-font-size);\n font-weight: bold;\n margin: 0;\n white-space: pre-line;\n}\n\n.bc-frame-description {\n --bc-frame-description-color: var(--bc-text-color, #555);\n --bc-frame-description-font-size: 0.875rem;\n color: var(--bc-frame-description-color);\n font-size: var(--bc-frame-description-font-size);\n margin: 0.25rem 0 0;\n white-space: pre-line;\n}\n\n.bc-frame-footer {\n margin-top: 0.5rem;\n gap: 0.25rem 1rem;\n padding: var(--bc-frame-footer-padding-top, 0) var(--bc-frame-padding-right) var(--bc-frame-padding-bottom) var(--bc-frame-padding-left);\n background: var(--bc-frame-footer-bg, transparent);\n border-top: var(--bc-frame-footer-border-top, none);\n}\n\n.bc-frame-footer-left {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: 0.25rem 0.75rem;\n}\n\n.bc-frame-footer-left > :not(:first-child)::before {\n content: \"\\00B7\";\n margin-right: 0.5rem;\n color: var(--bc-text-color, #888);\n}\n\n.bc-frame-footer-right {\n display: flex;\n align-items: center;\n}\n\n.bc-frame-note {\n --bc-frame-note-color: var(--bc-text-color, #888);\n --bc-frame-note-font-size: 0.75rem;\n font-style: italic;\n color: var(--bc-frame-note-color);\n font-size: var(--bc-frame-note-font-size);\n margin: 0;\n padding: 0 var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);\n}\n\n.bc-frame-byline,\n.bc-frame-source {\n --bc-frame-meta-color: var(--bc-text-color, #888);\n --bc-frame-meta-font-size: 0.75rem;\n color: var(--bc-frame-meta-color);\n font-size: var(--bc-frame-meta-font-size);\n}\n\n.bc-frame-byline {\n white-space: pre-line;\n}\n\n.bc-frame-credit {\n --bc-frame-credit-color: var(--bc-text-color, #666);\n --bc-frame-credit-font-size: 0.75rem;\n color: var(--bc-frame-credit-color);\n font-size: var(--bc-frame-credit-font-size);\n font-weight: 600;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n}\n\n.bc-frame-source-link {\n color: inherit;\n text-decoration: underline;\n}\n\n.bc-axis .domain {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-axis .tick text {\n fill: var(--bc-axis-color, #333);\n font-size: 10px;\n}\n\n.bc-axis .tick line {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-grid-line {\n stroke: var(--bc-grid-color, #e0e0e0);\n stroke-width: 1;\n}\n\n.bc-zero-baseline {\n stroke: #666;\n stroke-width: 1;\n}\n\n.bc-bar {\n /* fill is set via D3 .attr() from data-bound colors — do not override */\n}\n\n.bc-line {\n fill: none;\n stroke-width: 2;\n}\n\n.bc-value-label {\n font-size: 11px;\n /* fill is set via D3 .attr() — do not override */\n}\n\n.bc-direct-label {\n font-size: 12px;\n font-weight: 600;\n}\n\n.bc-tooltip {\n position: absolute;\n pointer-events: none;\n background: var(--bc-tooltip-bg, #fff);\n color: var(--bc-tooltip-color, #212529);\n border: 1px solid var(--bc-tooltip-border-color, #dee2e6);\n border-radius: 4px;\n padding: 6px 10px;\n font-size: 13px;\n box-shadow: 0 2px 8px rgba(0,0,0,0.12);\n z-index: 9999;\n display: none;\n}\n\n.bc-crosshair {\n stroke: #999;\n stroke-width: 1;\n pointer-events: none;\n}\n\n.bc-arc-label-line {\n fill: none;\n stroke: #999;\n stroke-width: 1;\n}\n\n.bc-theme-blueprint-framed {\n --bc-frame-header-border-bottom: 1px solid #e0e0e0;\n --bc-frame-header-margin-bottom: 0.5rem;\n --bc-frame-footer-bg: #f8f8f8;\n --bc-frame-footer-border-top: 1px solid #e0e0e0;\n --bc-frame-footer-padding-top: 0.625rem;\n}\n\n[data-bs-theme=\"dark\"] .bc-frame.bc-theme-blueprint-bold {\n --bc-frame-bg: #000000;\n --bc-text-color: rgba(255, 255, 255, 0.95);\n --bc-axis-color: rgba(255, 255, 255, 0.7);\n --bc-grid-color: rgba(255, 255, 255, 0.12);\n}\n\n.blueprint-chart-error {\n color: red;\n padding: 1em;\n border: 1px solid red;\n}\n\nbody {\n margin: 0;\n overflow: hidden;\n}\n\n/* Dark theme: activated by data-bs-theme=\"dark\" on the document (matching the\n editor's convention). The chart owns these colors; the dark frame background\n also drives the renderer's resolveBackgroundColor, so data-mark colors and\n contrast labels adapt at render time. Scoped to .bc-frame so these override\n the frame's own light --bc-frame-bg / --bc-text-color declarations (which are\n set on .bc-frame and would otherwise shadow a document-level override). */\n[data-bs-theme=\"dark\"] body {\n /* color themes above-bar value labels (fill: currentColor). */\n background: #1c1c1c;\n color: rgba(255, 255, 255, 0.9);\n}\n\n[data-bs-theme=\"dark\"] .bc-frame {\n --bc-frame-bg: #1c1c1c;\n --bc-text-color: rgba(255, 255, 255, 0.9);\n --bc-axis-color: rgba(255, 255, 255, 0.6);\n --bc-grid-color: #333;\n\n color: rgba(255, 255, 255, 0.9);\n}\n</style>",
61
+ "</head><body>",
62
+ "<div id=\"chart\" class=\"blueprint-chart-container\"></div>",
63
+ a,
64
+ "<script>",
65
+ `var __BPC_SRC__ = ${f(n)};`,
66
+ "function notifySize() {",
67
+ " var h = document.documentElement.scrollHeight;",
68
+ ` parent.postMessage({ type: "${e}", height: h }, "*");`,
69
+ "}",
70
+ ...s,
71
+ "notifySize();",
72
+ "new ResizeObserver(notifySize).observe(document.body);",
73
+ "<\/script>",
74
+ "</body></html>"
75
+ ].filter(Boolean).join("\n");
76
+ }
77
+ function f(e) {
78
+ return JSON.stringify(e).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
79
+ }
80
+ function p(e) {
81
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
82
+ }
83
+ //#endregion
84
+ export { r as a, e as i, l as n, n as o, t as r, d as t };
package/dist/runtime.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as e } from "./render-bpc-By-iMMKD.js";
2
- import { n as t } from "./runtime-BnrDRLyH.js";
1
+ import { t as e } from "./render-bpc-BWiUALXY.js";
2
+ import { n as t } from "./runtime-DDhsXDn5.js";
3
3
  //#region src/runtime/scenes.ts
4
4
  function n(e, t, n) {
5
5
  let r = 0, i = !1, a = document.createElement("nav");
@@ -0,0 +1,2 @@
1
+ import { TransformResult } from './types';
2
+ export declare function applyFilter(data: TransformResult, config: Record<string, string>): TransformResult;
@@ -0,0 +1,2 @@
1
+ import { TransformResult } from './types';
2
+ export declare function applyGroupBy(data: TransformResult, config: Record<string, string>): TransformResult;
@@ -0,0 +1,2 @@
1
+ import { TransformResult } from './types';
2
+ export declare function applyHideColumns(data: TransformResult, config: Record<string, string>): TransformResult;
@@ -0,0 +1,3 @@
1
+ import { TransformResult } from './types';
2
+ export declare const NULL_VALUE = "";
3
+ export declare function applyParse(data: TransformResult, config: Record<string, string>): TransformResult;
@@ -0,0 +1,2 @@
1
+ import { TransformResult } from './types';
2
+ export declare function applyRename(data: TransformResult, config: Record<string, string>): TransformResult;
@@ -0,0 +1,2 @@
1
+ import { TransformResult } from './types';
2
+ export declare function applySort(data: TransformResult, config: Record<string, string>): TransformResult;
@@ -0,0 +1,2 @@
1
+ import { TransformResult } from './types';
2
+ export declare function applyTranspose(data: TransformResult): TransformResult;
@@ -0,0 +1,30 @@
1
+ import { ChartData } from '../charts/types';
2
+ import { ColumnType } from '../recommendations/types';
3
+ import { TransformNode } from '../dsl/types';
4
+ import { TransformResult, TransformStep } from './types';
5
+ import { applyFilter } from './applyFilter';
6
+ import { applyGroupBy } from './applyGroupBy';
7
+ import { applyHideColumns } from './applyHideColumns';
8
+ import { applyParse } from './applyParse';
9
+ import { applyRename } from './applyRename';
10
+ import { applySort } from './applySort';
11
+ import { applyTranspose } from './applyTranspose';
12
+ export type { TransformResult, TransformStep } from './types';
13
+ export type { ParseOperation } from './parseOperations';
14
+ export { parseOperations, parseOperationMap, isTypeCompatible, getOutputType } from './parseOperations';
15
+ export { NULL_VALUE } from './applyParse';
16
+ export { transformValue } from './transformValue';
17
+ export { applyFilter, applyGroupBy, applyHideColumns, applyParse, applyRename, applySort, applyTranspose };
18
+ export { chartDataToTable, cleanNumericValue, detectColumnTypes, isDateValue, isNumberValue, parseBpcData, serializeTableData, } from './table';
19
+ /**
20
+ * The transform types the pipeline knows. `computed` is reserved: it carries
21
+ * through the DSL and the editor's step list but applies nothing yet.
22
+ */
23
+ export declare const TRANSFORM_TYPES: ReadonlySet<string>;
24
+ export declare function applyTransformSteps(steps: TransformStep[], columns: string[], rows: string[][], columnTypes: ColumnType[]): TransformResult;
25
+ /** Read `transform <type> { … }` nodes as pipeline steps, dropping unknown types. */
26
+ export declare function transformNodesToSteps(nodes: TransformNode[]): TransformStep[];
27
+ /** Run the pipeline over a `data { … }` body, returning the body the chart renders. */
28
+ export declare function applyTransformNodes(dataStr: string, nodes: TransformNode[]): string;
29
+ /** Run the pipeline over already-parsed chart data, for a scene's own steps. */
30
+ export declare function applyTransformNodesToChartData(data: ChartData, nodes: TransformNode[]): ChartData;
@@ -0,0 +1,15 @@
1
+ import { ColumnType } from '../recommendations/types';
2
+ import { ParseOperationCategory } from '../enums';
3
+ export interface ParseOperation {
4
+ id: string;
5
+ label: string;
6
+ description: string;
7
+ category: ParseOperationCategory;
8
+ accepts: ColumnType[];
9
+ outputType: ColumnType;
10
+ params?: string[];
11
+ }
12
+ export declare const parseOperations: ParseOperation[];
13
+ export declare const parseOperationMap: Map<string, ParseOperation>;
14
+ export declare function isTypeCompatible(operation: string, columnType: ColumnType): boolean;
15
+ export declare function getOutputType(operation: string): ColumnType;
@@ -0,0 +1,4 @@
1
+ import { ColumnType } from '../recommendations/types';
2
+ export declare function parseNumeric(v: string): number;
3
+ export declare function compareValues(a: string, b: string, type: ColumnType): number;
4
+ export declare function resolveColumns(config: Record<string, string>): string[];
@@ -0,0 +1,22 @@
1
+ import { ColumnType } from '../recommendations/types';
2
+ import { ChartData } from '../charts/types';
3
+ import { TransformResult } from './types';
4
+ export declare function isDateValue(value: string): boolean;
5
+ /**
6
+ * Strip comparison/approximation prefixes (<, >, ≤, ≥, ~) from numeric values.
7
+ * Returns the cleaned string (e.g. "<1" → "1", "~50" → "50").
8
+ * Non-numeric strings are returned unchanged.
9
+ */
10
+ export declare function cleanNumericValue(value: string): string;
11
+ export declare function isNumberValue(value: string): boolean;
12
+ export declare function detectColumnTypes(columns: string[], rows: string[][]): ColumnType[];
13
+ /** Read a `data { … }` body into the table the pipeline operates on. */
14
+ export declare function parseBpcData(raw: string): TransformResult;
15
+ /** Write a table back as a `data { … }` body. */
16
+ export declare function serializeTableData(cols: string[], rows: string[][]): string;
17
+ /**
18
+ * Rebuild a table from parsed chart data, for the steps that run on top of an
19
+ * already-resolved chart (a scene's own transforms). Missing cells come back
20
+ * empty so a hole stays a hole instead of reading as the string "undefined".
21
+ */
22
+ export declare function chartDataToTable(data: ChartData): TransformResult;
@@ -0,0 +1 @@
1
+ export declare function transformValue(value: string, operation: string, config: Record<string, string>): string;
@@ -0,0 +1,13 @@
1
+ import { ColumnType } from '../recommendations/types';
2
+ import { TransformType } from '../enums';
3
+ /** The value flowing through the pipeline: one tabular snapshot. */
4
+ export interface TransformResult {
5
+ columns: string[];
6
+ rows: string[][];
7
+ columnTypes: ColumnType[];
8
+ }
9
+ /** One step in the pipeline. Config keys are the ones the `apply*` functions read. */
10
+ export interface TransformStep {
11
+ type: TransformType;
12
+ config: Record<string, string>;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueprint-chart/lib",
3
- "version": "1.8.2",
3
+ "version": "2.0.0",
4
4
  "description": "DSL-driven charting library built on D3. Define charts as text, render them anywhere.",
5
5
  "keywords": [
6
6
  "chart",
@@ -30,6 +30,12 @@
30
30
  .bc-frame {
31
31
  --bc-frame-font-family: system-ui, -apple-system, sans-serif;
32
32
  --bc-frame-padding: 0;
33
+ // Per-side properties so a multi-value `padding` shorthand never lands in a
34
+ // single-value shorthand slot, which would invalidate the whole declaration.
35
+ --bc-frame-padding-top: var(--bc-frame-padding);
36
+ --bc-frame-padding-right: var(--bc-frame-padding);
37
+ --bc-frame-padding-bottom: var(--bc-frame-padding);
38
+ --bc-frame-padding-left: var(--bc-frame-padding);
33
39
  --bc-frame-bg: var(--bs-card-bg, #fff);
34
40
 
35
41
  font-family: var(--bc-frame-font-family);
@@ -47,6 +53,19 @@
47
53
  fill: var(--bc-frame-bg, var(--bs-card-bg, #fff));
48
54
  }
49
55
 
56
+ // `theme = "dark"` emits this class on the frame, so it carries the same
57
+ // surface the document-level dark mode does, without depending on an ambient
58
+ // data-bs-theme. Keep in sync with DARK_THEME in render/frame-svg.ts, which
59
+ // bakes the same colours into a rasterised export.
60
+ .bc-frame.bc-theme-dark {
61
+ --bc-frame-bg: #1c1c1c;
62
+ --bc-text-color: rgba(255, 255, 255, 0.9);
63
+ --bc-axis-color: rgba(255, 255, 255, 0.6);
64
+ --bc-grid-color: #333;
65
+
66
+ color: rgba(255, 255, 255, 0.9);
67
+ }
68
+
50
69
  // During a cross-type scene transition, `snapshotForFadeOut()` in motion.ts
51
70
  // renames `.bc-frame` -> `.bc-frame--fade-snapshot` on the overlay clone so
52
71
  // selectors targeting `.bc-frame` don't double-match the live + fading
@@ -124,7 +143,7 @@
124
143
  // -- Header elements --------------------------------------------------------
125
144
 
126
145
  .bc-frame-header {
127
- padding: var(--bc-frame-padding) var(--bc-frame-padding) var(--bc-frame-header-padding-bottom, 0.5rem);
146
+ padding: var(--bc-frame-padding-top) var(--bc-frame-padding-right) var(--bc-frame-header-padding-bottom, 0.5rem) var(--bc-frame-padding-left);
128
147
  background: var(--bc-frame-header-bg, transparent);
129
148
  border-bottom: var(--bc-frame-header-border-bottom, none);
130
149
  margin-bottom: var(--bc-frame-header-margin-bottom, 0);
@@ -139,6 +158,7 @@
139
158
  font-size: var(--bc-frame-title-font-size);
140
159
  font-weight: var(--bc-frame-title-font-weight);
141
160
  margin: 0;
161
+ white-space: pre-line;
142
162
  }
143
163
 
144
164
  .bc-frame-description {
@@ -148,12 +168,13 @@
148
168
  color: var(--bc-frame-description-color);
149
169
  font-size: var(--bc-frame-description-font-size);
150
170
  margin: 0.25rem 0 0;
171
+ white-space: pre-line;
151
172
  }
152
173
 
153
174
  // -- Body -------------------------------------------------------------------
154
175
 
155
176
  .bc-frame-body {
156
- padding: 0 var(--bc-frame-padding);
177
+ padding: 0 var(--bc-frame-padding-right) 0 var(--bc-frame-padding-left);
157
178
  }
158
179
 
159
180
  // -- Note -------------------------------------------------------------------
@@ -166,7 +187,7 @@
166
187
  color: var(--bc-frame-note-color);
167
188
  font-size: var(--bc-frame-note-font-size);
168
189
  margin: 0;
169
- padding: 0 var(--bc-frame-padding) var(--bc-frame-padding);
190
+ padding: 0 var(--bc-frame-padding-right) var(--bc-frame-padding-bottom) var(--bc-frame-padding-left);
170
191
  }
171
192
 
172
193
  // -- Footer -----------------------------------------------------------------
@@ -175,7 +196,7 @@
175
196
  --bc-frame-footer-gap: 0.25rem 1rem;
176
197
 
177
198
  gap: var(--bc-frame-footer-gap);
178
- padding: var(--bc-frame-footer-padding-top, var(--bc-frame-padding)) var(--bc-frame-padding) var(--bc-frame-padding);
199
+ padding: var(--bc-frame-footer-padding-top, var(--bc-frame-padding-top)) var(--bc-frame-padding-right) var(--bc-frame-padding-bottom) var(--bc-frame-padding-left);
179
200
  background: var(--bc-frame-footer-bg, transparent);
180
201
  border-top: var(--bc-frame-footer-border-top, none);
181
202
  }
@@ -212,6 +233,10 @@
212
233
  font-size: var(--bc-frame-meta-font-size);
213
234
  }
214
235
 
236
+ .bc-frame-byline {
237
+ white-space: pre-line;
238
+ }
239
+
215
240
  .bc-frame-source-prefix {
216
241
  // Inherits color/size from .bc-frame-source.
217
242
  }
@@ -1,84 +0,0 @@
1
- //#region src/runtime/chart-css.ts
2
- var e = "blueprint-chart-resize", t = "blueprint-chart-error";
3
- function n(e) {
4
- return typeof e == "object" && e && e.type === "blueprint-chart-resize" && typeof e.height == "number" ? e.height : null;
5
- }
6
- function r(e) {
7
- return typeof e == "object" && !!e && e.type === "blueprint-chart-error";
8
- }
9
- //#endregion
10
- //#region src/runtime/runtime.ts
11
- var i = a();
12
- function a() {
13
- try {
14
- if (typeof globalThis < "u") {
15
- let e = globalThis.BLUEPRINT_CHART_RUNTIME_URL;
16
- if (typeof e == "string" && e) return e;
17
- }
18
- return typeof document > "u" ? "" : document.currentScript?.src ?? "";
19
- } catch {
20
- return "";
21
- }
22
- }
23
- var o = /* @__PURE__ */ new Map(), s = null;
24
- function c() {
25
- s || (s = (e) => {
26
- for (let [t, n] of o) if (e.source === t.contentWindow) {
27
- n(e);
28
- return;
29
- }
30
- }, window.addEventListener("message", s));
31
- }
32
- function l() {
33
- c(), document.querySelectorAll("script[type=\"application/blueprint-chart\"]").forEach(u);
34
- }
35
- function u(e) {
36
- let t = e.textContent?.trim();
37
- if (!t) return;
38
- let a = document.createElement("iframe");
39
- a.className = "blueprint-chart-iframe", a.style.cssText = "border: none; width: 100%; display: block;", a.setAttribute("sandbox", "allow-scripts"), a.setAttribute("title", "Blueprint Chart"), e.parentNode?.insertBefore(a, e), a.srcdoc = d(t, i), o.set(a, (e) => {
40
- let t = n(e.data);
41
- if (t !== null) {
42
- a.style.height = `${t}px`;
43
- return;
44
- }
45
- r(e.data) && console.warn("Blueprint Chart: could not render embed.", e.data.message);
46
- });
47
- }
48
- function d(n, r, i) {
49
- let a = r ? `<script src="${p(r)}"><\/script>` : "", o = i === "dark" ? "<html data-bs-theme=\"dark\">" : "<html>", s = r ? [
50
- "try {",
51
- " window.BlueprintChart.renderBpc(document.getElementById(\"chart\"), __BPC_SRC__);",
52
- "}",
53
- "catch (e) {",
54
- ` parent.postMessage({ type: "${t}", message: String(e) }, "*");`,
55
- "}"
56
- ] : [`parent.postMessage({ type: "${t}", message: "Blueprint Chart runtime URL unavailable" }, "*");`];
57
- return [
58
- "<!DOCTYPE html>",
59
- `${o}<head>`,
60
- "<style>\n/* Blueprint Chart — Runtime Embed Styles\n CSS custom properties with baked-in defaults for standalone iframe usage. */\n\n.bc-frame {\n --bc-frame-font-family: system-ui, -apple-system, sans-serif;\n --bc-frame-padding: 0;\n --bc-frame-bg: #fff;\n --bc-text-color: #333;\n font-family: var(--bc-frame-font-family);\n background: var(--bc-frame-bg);\n /* currentColor marks (e.g. above-bar value labels) follow the theme text\n colour, not the ambient document colour. */\n color: var(--bc-text-color, #333);\n}\n\n/* Keeps the SVG's baked-in background rect (applyCanvasBackground) in sync\n with the frame background; transparentBackground sets the var to\n transparent at runtime. */\n.bc-frame .bc-canvas-bg {\n fill: var(--bc-frame-bg, #fff);\n}\n\n.bc-frame-header {\n padding: var(--bc-frame-padding) var(--bc-frame-padding) 0;\n background: var(--bc-frame-header-bg, transparent);\n border-bottom: var(--bc-frame-header-border-bottom, none);\n margin-bottom: var(--bc-frame-header-margin-bottom, 0);\n}\n\n.bc-frame-body {\n padding: 0 var(--bc-frame-padding);\n}\n\n.bc-frame-title {\n --bc-frame-title-color: var(--bc-text-color, #333);\n --bc-frame-title-font-size: 1.25rem;\n color: var(--bc-frame-title-color);\n font-size: var(--bc-frame-title-font-size);\n font-weight: bold;\n margin: 0;\n}\n\n.bc-frame-description {\n --bc-frame-description-color: var(--bc-text-color, #555);\n --bc-frame-description-font-size: 0.875rem;\n color: var(--bc-frame-description-color);\n font-size: var(--bc-frame-description-font-size);\n margin: 0.25rem 0 0;\n}\n\n.bc-frame-footer {\n margin-top: 0.5rem;\n gap: 0.25rem 1rem;\n padding: var(--bc-frame-footer-padding-top, 0) var(--bc-frame-padding) var(--bc-frame-padding);\n background: var(--bc-frame-footer-bg, transparent);\n border-top: var(--bc-frame-footer-border-top, none);\n}\n\n.bc-frame-footer-left {\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n gap: 0.25rem 0.75rem;\n}\n\n.bc-frame-footer-left > :not(:first-child)::before {\n content: \"\\00B7\";\n margin-right: 0.5rem;\n color: var(--bc-text-color, #888);\n}\n\n.bc-frame-footer-right {\n display: flex;\n align-items: center;\n}\n\n.bc-frame-note {\n --bc-frame-note-color: var(--bc-text-color, #888);\n --bc-frame-note-font-size: 0.75rem;\n font-style: italic;\n color: var(--bc-frame-note-color);\n font-size: var(--bc-frame-note-font-size);\n margin: 0;\n padding: 0 var(--bc-frame-padding);\n}\n\n.bc-frame-byline,\n.bc-frame-source {\n --bc-frame-meta-color: var(--bc-text-color, #888);\n --bc-frame-meta-font-size: 0.75rem;\n color: var(--bc-frame-meta-color);\n font-size: var(--bc-frame-meta-font-size);\n}\n\n.bc-frame-credit {\n --bc-frame-credit-color: var(--bc-text-color, #666);\n --bc-frame-credit-font-size: 0.75rem;\n color: var(--bc-frame-credit-color);\n font-size: var(--bc-frame-credit-font-size);\n font-weight: 600;\n display: inline-flex;\n align-items: center;\n text-decoration: none;\n}\n\n.bc-frame-source-link {\n color: inherit;\n text-decoration: underline;\n}\n\n.bc-axis .domain {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-axis .tick text {\n fill: var(--bc-axis-color, #333);\n font-size: 10px;\n}\n\n.bc-axis .tick line {\n stroke: var(--bc-axis-color, #333);\n}\n\n.bc-grid-line {\n stroke: var(--bc-grid-color, #e0e0e0);\n stroke-width: 1;\n}\n\n.bc-zero-baseline {\n stroke: #666;\n stroke-width: 1;\n}\n\n.bc-bar {\n /* fill is set via D3 .attr() from data-bound colors — do not override */\n}\n\n.bc-line {\n fill: none;\n stroke-width: 2;\n}\n\n.bc-value-label {\n font-size: 11px;\n /* fill is set via D3 .attr() — do not override */\n}\n\n.bc-direct-label {\n font-size: 12px;\n font-weight: 600;\n}\n\n.bc-tooltip {\n position: absolute;\n pointer-events: none;\n background: var(--bc-tooltip-bg, #fff);\n color: var(--bc-tooltip-color, #212529);\n border: 1px solid var(--bc-tooltip-border-color, #dee2e6);\n border-radius: 4px;\n padding: 6px 10px;\n font-size: 13px;\n box-shadow: 0 2px 8px rgba(0,0,0,0.12);\n z-index: 9999;\n display: none;\n}\n\n.bc-crosshair {\n stroke: #999;\n stroke-width: 1;\n pointer-events: none;\n}\n\n.bc-arc-label-line {\n fill: none;\n stroke: #999;\n stroke-width: 1;\n}\n\n.bc-theme-blueprint-framed {\n --bc-frame-header-border-bottom: 1px solid #e0e0e0;\n --bc-frame-header-margin-bottom: 0.5rem;\n --bc-frame-footer-bg: #f8f8f8;\n --bc-frame-footer-border-top: 1px solid #e0e0e0;\n --bc-frame-footer-padding-top: 0.625rem;\n}\n\n[data-bs-theme=\"dark\"] .bc-frame.bc-theme-blueprint-bold {\n --bc-frame-bg: #000000;\n --bc-text-color: rgba(255, 255, 255, 0.95);\n --bc-axis-color: rgba(255, 255, 255, 0.7);\n --bc-grid-color: rgba(255, 255, 255, 0.12);\n}\n\n.blueprint-chart-error {\n color: red;\n padding: 1em;\n border: 1px solid red;\n}\n\nbody {\n margin: 0;\n overflow: hidden;\n}\n\n/* Dark theme: activated by data-bs-theme=\"dark\" on the document (matching the\n editor's convention). The chart owns these colors; the dark frame background\n also drives the renderer's resolveBackgroundColor, so data-mark colors and\n contrast labels adapt at render time. Scoped to .bc-frame so these override\n the frame's own light --bc-frame-bg / --bc-text-color declarations (which are\n set on .bc-frame and would otherwise shadow a document-level override). */\n[data-bs-theme=\"dark\"] body {\n /* color themes above-bar value labels (fill: currentColor). */\n background: #1c1c1c;\n color: rgba(255, 255, 255, 0.9);\n}\n\n[data-bs-theme=\"dark\"] .bc-frame {\n --bc-frame-bg: #1c1c1c;\n --bc-text-color: rgba(255, 255, 255, 0.9);\n --bc-axis-color: rgba(255, 255, 255, 0.6);\n --bc-grid-color: #333;\n\n color: rgba(255, 255, 255, 0.9);\n}\n</style>",
61
- "</head><body>",
62
- "<div id=\"chart\" class=\"blueprint-chart-container\"></div>",
63
- a,
64
- "<script>",
65
- `var __BPC_SRC__ = ${f(n)};`,
66
- "function notifySize() {",
67
- " var h = document.documentElement.scrollHeight;",
68
- ` parent.postMessage({ type: "${e}", height: h }, "*");`,
69
- "}",
70
- ...s,
71
- "notifySize();",
72
- "new ResizeObserver(notifySize).observe(document.body);",
73
- "<\/script>",
74
- "</body></html>"
75
- ].filter(Boolean).join("\n");
76
- }
77
- function f(e) {
78
- return JSON.stringify(e).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
79
- }
80
- function p(e) {
81
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
82
- }
83
- //#endregion
84
- export { r as a, e as i, l as n, n as o, t as r, d as t };