@blueprint-chart/lib 1.8.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/charts/axis/axis-service.d.ts +9 -0
  2. package/dist/charts/axis-options.d.ts +3 -0
  3. package/dist/charts/canvas/canvas.d.ts +2 -5
  4. package/dist/charts/category-label-line.d.ts +16 -0
  5. package/dist/charts/chart-helpers.d.ts +2 -3
  6. package/dist/charts/chart-options.d.ts +2 -0
  7. package/dist/charts/contrast.d.ts +4 -3
  8. package/dist/charts/date-parse.d.ts +6 -0
  9. package/dist/charts/frame/frame.d.ts +6 -0
  10. package/dist/charts/legend/legend-size.d.ts +13 -0
  11. package/dist/charts/parse-data.d.ts +2 -0
  12. package/dist/charts/plugins/annotations/shared.d.ts +13 -2
  13. package/dist/charts/plugins/arc-labels.d.ts +9 -1
  14. package/dist/charts/plugins/highlight.d.ts +9 -3
  15. package/dist/charts/scale-helpers.d.ts +15 -8
  16. package/dist/charts/series-helpers.d.ts +22 -1
  17. package/dist/charts/stack-helpers.d.ts +1 -1
  18. package/dist/charts/text-measure.d.ts +25 -0
  19. package/dist/charts/themes/index.d.ts +6 -0
  20. package/dist/charts/types.d.ts +10 -4
  21. package/dist/charts/value-label-fit.d.ts +31 -0
  22. package/dist/dsl/converter.d.ts +5 -0
  23. package/dist/dsl/quoting.d.ts +16 -0
  24. package/dist/dsl/types.d.ts +42 -0
  25. package/dist/dsl/validate.d.ts +6 -0
  26. package/dist/embed.js +1 -1
  27. package/dist/enums.d.ts +23 -0
  28. package/dist/index.d.ts +9 -1
  29. package/dist/index.js +625 -302
  30. package/dist/lib/lib.iife.js +44 -16
  31. package/dist/node-backend/index.js +3410 -2223
  32. package/dist/render/chart-a11y.d.ts +14 -0
  33. package/dist/render/frame-svg.d.ts +51 -0
  34. package/dist/render/index.d.ts +3 -0
  35. package/dist/render/post-render.d.ts +2 -0
  36. package/dist/{render-bpc-Bgb7rsgM.js → render-bpc-BSt4wOjf.js} +4191 -2972
  37. package/dist/runtime/chart-css.d.ts +1 -1
  38. package/dist/runtime-DDhsXDn5.js +84 -0
  39. package/dist/runtime.js +2 -2
  40. package/dist/transforms/applyFilter.d.ts +2 -0
  41. package/dist/transforms/applyGroupBy.d.ts +2 -0
  42. package/dist/transforms/applyHideColumns.d.ts +2 -0
  43. package/dist/transforms/applyParse.d.ts +3 -0
  44. package/dist/transforms/applyRename.d.ts +2 -0
  45. package/dist/transforms/applySort.d.ts +2 -0
  46. package/dist/transforms/applyTranspose.d.ts +2 -0
  47. package/dist/transforms/index.d.ts +30 -0
  48. package/dist/transforms/parseOperations.d.ts +15 -0
  49. package/dist/transforms/shared.d.ts +4 -0
  50. package/dist/transforms/table.d.ts +22 -0
  51. package/dist/transforms/transformValue.d.ts +1 -0
  52. package/dist/transforms/types.d.ts +13 -0
  53. package/package.json +1 -1
  54. package/src/charts/chart.scss +29 -4
  55. package/dist/runtime-BnrDRLyH.js +0 -84
@@ -0,0 +1,14 @@
1
+ import { ChartData, FrameOptions } from '../charts/types';
2
+ export interface ChartAccessibility {
3
+ /** Accessible name: what a screen reader announces for the graphic. */
4
+ label: string;
5
+ /** Long description: the author's own, then a summary of the plotted data. */
6
+ description: string;
7
+ }
8
+ export declare function buildChartAccessibility(chartType: string, frame: FrameOptions | null | undefined, data: ChartData): ChartAccessibility;
9
+ /**
10
+ * Without this the plot is an unlabelled pile of shapes: assistive technology
11
+ * walks into the marks and announces nothing about the graphic. `role="img"`
12
+ * collapses the subtree to one node, and `aria-label` names it.
13
+ */
14
+ export declare function applyChartAccessibility(svg: SVGSVGElement, a11y: ChartAccessibility): void;
@@ -0,0 +1,51 @@
1
+ import { FrameOptions } from '../charts/types';
2
+ import { ChartAccessibility } from './chart-a11y';
3
+ export interface FrameSvgTextBlock {
4
+ text: string;
5
+ x: number;
6
+ y: number;
7
+ fontSize: number;
8
+ fontWeight?: string;
9
+ fontStyle?: string;
10
+ fontFamily?: string;
11
+ fill?: string;
12
+ anchor?: 'start' | 'middle' | 'end';
13
+ }
14
+ export interface FrameSvgPlot {
15
+ x: number;
16
+ y: number;
17
+ width: number;
18
+ height: number;
19
+ }
20
+ export interface FrameSvgLayout {
21
+ width: number;
22
+ height: number;
23
+ plot: FrameSvgPlot;
24
+ blocks: FrameSvgTextBlock[];
25
+ background: string | null;
26
+ color: string;
27
+ fontFamily: string;
28
+ }
29
+ export interface FrameTheme {
30
+ background: string;
31
+ color: string;
32
+ }
33
+ export interface FrameSvgLayoutOptions {
34
+ width: number;
35
+ height: number;
36
+ frame?: FrameOptions | null;
37
+ theme?: string;
38
+ }
39
+ export declare function resolveFrameTheme(theme?: string): FrameTheme;
40
+ /**
41
+ * Lay the frame chrome out in SVG user units and reserve what is left for the
42
+ * plot. The caller renders the chart at `plot.width` x `plot.height` and hands
43
+ * the markup back to `buildFrameSvg`.
44
+ */
45
+ export declare function layoutFrameSvg(opts: FrameSvgLayoutOptions): FrameSvgLayout;
46
+ /**
47
+ * Compose the frame chrome and a rendered plot into one standalone SVG. The
48
+ * chrome is native `<text>`, so the result survives rasterization and a bare
49
+ * `.svg` file with no stylesheet.
50
+ */
51
+ export declare function buildFrameSvg(layout: FrameSvgLayout, plotSvg: string, a11y: ChartAccessibility): string;
@@ -6,3 +6,6 @@ export type { ChartDefinition, RenderOptions, ResolvedChartState } from './types
6
6
  export { render } from './public-render';
7
7
  export type { ChartHandle, RenderApiOptions, OutputOptions } from './public-render';
8
8
  export { ChartParseError, PngBrowserUnsupportedError, MissingNodeRenderDepsError } from './errors';
9
+ export { buildFrameSvg } from './frame-svg';
10
+ export type { FrameSvgLayout, FrameSvgTextBlock, FrameSvgPlot } from './frame-svg';
11
+ export type { ChartAccessibility } from './chart-a11y';
@@ -1,6 +1,8 @@
1
1
  import { LayoutResult } from './layout-constraints';
2
+ import { ChartAccessibility } from './chart-a11y';
2
3
  interface PostRenderArgs {
3
4
  theme?: string;
5
+ accessibility?: ChartAccessibility;
4
6
  }
5
7
  export declare function applyPostRender(container: HTMLElement, args: PostRenderArgs, layout: LayoutResult): void;
6
8
  export {};