@octane-xplat/charts 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/core/svg.ts CHANGED
@@ -8,77 +8,79 @@ import type { PlotBox } from './scales'
8
8
  * leaf overlay (.agents/docs/notes/primitive-notes.md). */
9
9
 
10
10
  function num(v: number): string {
11
- if (!Number.isFinite(v)) {
12
- return '0'
13
- }
11
+ if (!Number.isFinite(v)) {
12
+ return '0'
13
+ }
14
14
 
15
- return Number.isInteger(v) ? String(v) : String(+v.toFixed(2))
15
+ return Number.isInteger(v) ? String(v) : String(+v.toFixed(2))
16
16
  }
17
17
 
18
18
  function esc(v: string): string {
19
- return v
20
- .replaceAll('&', '&')
21
- .replaceAll('"', '"')
22
- .replaceAll('<', '&lt;')
23
- .replaceAll('>', '&gt;')
19
+ return v
20
+ .replaceAll('&', '&amp;')
21
+ .replaceAll('"', '&quot;')
22
+ .replaceAll('<', '&lt;')
23
+ .replaceAll('>', '&gt;')
24
24
  }
25
25
 
26
26
  function paintAttrs(m: Mark): string {
27
- let out = ''
28
- if (m.fill !== undefined) {
29
- out += ` fill="${esc(m.fill)}"`
30
- }
27
+ let out = ''
31
28
 
32
- if (m.fillOpacity !== undefined) {
33
- out += ` fill-opacity="${num(m.fillOpacity)}"`
34
- }
29
+ if (m.fill !== undefined) {
30
+ out += ` fill="${esc(m.fill)}"`
31
+ }
35
32
 
36
- if (m.stroke !== undefined) {
37
- out += ` stroke="${esc(m.stroke)}"`
38
- }
33
+ if (m.fillOpacity !== undefined) {
34
+ out += ` fill-opacity="${num(m.fillOpacity)}"`
35
+ }
39
36
 
40
- if (m.strokeOpacity !== undefined) {
41
- out += ` stroke-opacity="${num(m.strokeOpacity)}"`
42
- }
37
+ if (m.stroke !== undefined) {
38
+ out += ` stroke="${esc(m.stroke)}"`
39
+ }
43
40
 
44
- if (m.strokeWidth !== undefined) {
45
- out += ` stroke-width="${num(m.strokeWidth)}"`
46
- }
41
+ if (m.strokeOpacity !== undefined) {
42
+ out += ` stroke-opacity="${num(m.strokeOpacity)}"`
43
+ }
47
44
 
48
- if (m.strokeLinecap !== undefined) {
49
- out += ` stroke-linecap="${m.strokeLinecap}"`
50
- }
45
+ if (m.strokeWidth !== undefined) {
46
+ out += ` stroke-width="${num(m.strokeWidth)}"`
47
+ }
51
48
 
52
- if (m.transform !== undefined) {
53
- out += ` transform="${esc(m.transform)}"`
54
- }
49
+ if (m.strokeLinecap !== undefined) {
50
+ out += ` stroke-linecap="${m.strokeLinecap}"`
51
+ }
55
52
 
56
- return out
53
+ if (m.transform !== undefined) {
54
+ out += ` transform="${esc(m.transform)}"`
55
+ }
56
+
57
+ return out
57
58
  }
58
59
 
59
60
  function markXml(m: Mark): string {
60
- switch (m.kind) {
61
- case 'path':
62
- return `<path d="${esc(m.d)}"${paintAttrs(m)}/>`
63
- case 'rect':
64
- return `<rect x="${num(m.x)}" y="${num(m.y)}" width="${num(m.width)}" height="${num(m.height)}"${paintAttrs(m)}/>`
65
- case 'circle':
66
- return `<circle cx="${num(m.cx)}" cy="${num(m.cy)}" r="${num(m.r)}"${paintAttrs(m)}/>`
67
- case 'line':
68
- return `<line x1="${num(m.x1)}" y1="${num(m.y1)}" x2="${num(m.x2)}" y2="${num(m.y2)}"${paintAttrs(m)}/>`
69
- }
61
+ switch (m.kind) {
62
+ case 'path':
63
+ return `<path d="${esc(m.d)}"${paintAttrs(m)}/>`
64
+ case 'rect':
65
+ return `<rect x="${num(m.x)}" y="${num(m.y)}" width="${num(m.width)}" height="${num(m.height)}"${paintAttrs(m)}/>`
66
+ case 'circle':
67
+ return `<circle cx="${num(m.cx)}" cy="${num(m.cy)}" r="${num(m.r)}"${paintAttrs(m)}/>`
68
+ case 'line':
69
+ return `<line x1="${num(m.x1)}" y1="${num(m.y1)}" x2="${num(m.x2)}" y2="${num(m.y2)}"${paintAttrs(m)}/>`
70
+ }
70
71
  }
71
72
 
72
73
  /** Chart marks are plot-space; axis rules are chart-space. Paint order:
73
74
  * gridlines under the translated marks group, frame (spine + stubs) over. */
74
75
  export function svgDocument(
75
- marks: Mark[],
76
- grid: Mark[],
77
- frame: Mark[],
78
- plot: PlotBox,
79
- width: number,
80
- height: number,
76
+ marks: Mark[],
77
+ grid: Mark[],
78
+ frame: Mark[],
79
+ plot: PlotBox,
80
+ width: number,
81
+ height: number,
81
82
  ): string {
82
- const body = `${grid.map(markXml).join('')}<g transform="translate(${num(plot.x)} ${num(plot.y)})">${marks.map(markXml).join('')}</g>${frame.map(markXml).join('')}`
83
- return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${num(width)} ${num(height)}" width="${num(width)}" height="${num(height)}">${body}</svg>`
83
+ const body = `${grid.map(markXml).join('')}<g transform="translate(${num(plot.x)} ${num(plot.y)})">${marks.map(markXml).join('')}</g>${frame.map(markXml).join('')}`
84
+
85
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${num(width)} ${num(height)}" width="${num(width)}" height="${num(height)}">${body}</svg>`
84
86
  }
@@ -2,11 +2,11 @@
2
2
  // reach .tsrx; same convention as @octane-xplat/ui index.*.ts).
3
3
  export { Chart } from './Chart.macos.tsrx'
4
4
  export type {
5
- AxisSpec,
6
- ChartDatum,
7
- ChartHit,
8
- ChartMargin,
9
- ChartProps,
10
- ChartType,
11
- SeriesSpec,
5
+ AxisSpec,
6
+ ChartDatum,
7
+ ChartHit,
8
+ ChartMargin,
9
+ ChartProps,
10
+ ChartType,
11
+ SeriesSpec,
12
12
  } from './props'
package/src/index.ts CHANGED
@@ -2,11 +2,11 @@
2
2
  // reach .tsrx; same convention as @octane-xplat/ui index.*.ts).
3
3
  export { Chart } from './Chart.tsrx'
4
4
  export type {
5
- AxisSpec,
6
- ChartDatum,
7
- ChartHit,
8
- ChartMargin,
9
- ChartProps,
10
- ChartType,
11
- SeriesSpec,
5
+ AxisSpec,
6
+ ChartDatum,
7
+ ChartHit,
8
+ ChartMargin,
9
+ ChartProps,
10
+ ChartType,
11
+ SeriesSpec,
12
12
  } from './props'
package/src/index.web.ts CHANGED
@@ -2,11 +2,11 @@
2
2
  // reach .tsrx; same convention as @octane-xplat/ui index.*.ts).
3
3
  export { Chart } from './Chart.web.tsrx'
4
4
  export type {
5
- AxisSpec,
6
- ChartDatum,
7
- ChartHit,
8
- ChartMargin,
9
- ChartProps,
10
- ChartType,
11
- SeriesSpec,
5
+ AxisSpec,
6
+ ChartDatum,
7
+ ChartHit,
8
+ ChartMargin,
9
+ ChartProps,
10
+ ChartType,
11
+ SeriesSpec,
12
12
  } from './props'
package/src/props.ts CHANGED
@@ -6,112 +6,112 @@ export type ChartType = 'line' | 'area' | 'bar' | 'pie' | 'scatter'
6
6
 
7
7
  /** One plotted value. */
8
8
  export interface ChartDatum {
9
- /** Bar/pie: the category label. Line/area/scatter: number or Date. */
10
- x: number | string | Date
11
- /** Value on the quantitative axis. */
12
- y: number
13
- /** Per-datum color override — wins over the series color (pie slices,
14
- * scatter points, individual bars). */
15
- color?: string
9
+ /** Bar/pie: the category label. Line/area/scatter: number or Date. */
10
+ x: number | string | Date
11
+ /** Value on the quantitative axis. */
12
+ y: number
13
+ /** Per-datum color override — wins over the series color (pie slices,
14
+ * scatter points, individual bars). */
15
+ color?: string
16
16
  }
17
17
 
18
18
  /** One named data series. */
19
19
  export interface SeriesSpec {
20
- /** Legend/tooltip name for the series. */
21
- name: string
22
- /** Series color — stroke for line/scatter, fill for area/bar. Falls back
23
- * to the built-in palette by series index. */
24
- color?: string
25
- /** The plotted values. */
26
- values: ChartDatum[]
20
+ /** Legend/tooltip name for the series. */
21
+ name: string
22
+ /** Series color — stroke for line/scatter, fill for area/bar. Falls back
23
+ * to the built-in palette by series index. */
24
+ color?: string
25
+ /** The plotted values. */
26
+ values: ChartDatum[]
27
27
  }
28
28
 
29
29
  /** Per-edge space inside the chart box reserved for axis labels — the
30
30
  * plot area occupies the remainder. */
31
31
  export interface ChartMargin {
32
- /** Top margin in px/dips. */
33
- top?: number
34
- /** Right margin in px/dips. */
35
- right?: number
36
- /** Bottom margin in px/dips — x-axis labels live here by default. */
37
- bottom?: number
38
- /** Left margin in px/dips — y-axis labels live here by default. */
39
- left?: number
32
+ /** Top margin in px/dips. */
33
+ top?: number
34
+ /** Right margin in px/dips. */
35
+ right?: number
36
+ /** Bottom margin in px/dips — x-axis labels live here by default. */
37
+ bottom?: number
38
+ /** Left margin in px/dips — y-axis labels live here by default. */
39
+ left?: number
40
40
  }
41
41
 
42
42
  /** Axis decomposition — gridline, tick stub, and label toggle independently
43
43
  * (Swift Charts `AxisMarks` shape). Labels render as real positioned
44
44
  * elements in the overlay, never `<text>` in markup. */
45
45
  export interface AxisSpec {
46
- /** Tick labels in the margin. Default true. */
47
- labels?: boolean
48
- /** Tick stubs on the axis spine. Default true. */
49
- ticks?: boolean
50
- /** Gridlines across the plot area. Default false. */
51
- grid?: boolean
52
- /** Desired tick count hint — a hint, not a guarantee. */
53
- tickCount?: number
54
- /** Tick label formatter; receives the domain value. */
55
- format?: (value: number | string | Date) => string
46
+ /** Tick labels in the margin. Default true. */
47
+ labels?: boolean
48
+ /** Tick stubs on the axis spine. Default true. */
49
+ ticks?: boolean
50
+ /** Gridlines across the plot area. Default false. */
51
+ grid?: boolean
52
+ /** Desired tick count hint — a hint, not a guarantee. */
53
+ tickCount?: number
54
+ /** Tick label formatter; receives the domain value. */
55
+ format?: (value: number | string | Date) => string
56
56
  }
57
57
 
58
58
  /** A resolved datum reference — `x`/`y` are the datum's values, not pixels. */
59
59
  /** A resolved datum reference — `x`/`y` are the datum's values, not pixels. */
60
60
  export interface ChartHit {
61
- /** Series index into `data`. */
62
- series: number
63
- /** Datum index within the series. */
64
- index: number
65
- /** The datum's x value. */
66
- x: number | string | Date
67
- /** Value on the quantitative axis. */
68
- y: number
61
+ /** Series index into `data`. */
62
+ series: number
63
+ /** Datum index within the series. */
64
+ index: number
65
+ /** The datum's x value. */
66
+ x: number | string | Date
67
+ /** Value on the quantitative axis. */
68
+ y: number
69
69
  }
70
70
 
71
71
  /** Props for the `<Chart>` element — one component for every chart kind,
72
72
  * each platform leaf rendering natively. */
73
73
  export interface ChartProps {
74
- /** Which chart kind to render. */
75
- type: ChartType
76
- /** Plotted series; most types read `values`, pie reads slice x/y. */
77
- data: SeriesSpec[]
78
- /** Explicit size in px (web) / dips (native). Without `height`, the leaf
79
- * fills its parent or derives height from `aspectRatio`. */
80
- width?: number
81
- /** Explicit height — same units as `width`. */
82
- height?: number
83
- /** width/height ratio used when `height` is unset. */
84
- aspectRatio?: number
85
- /** Space reserved inside the chart box for axis labels — labels live in
86
- * the margin band, the plot in the remainder. Defaults reserve room for
87
- * x labels (bottom) and y labels (left) when those axes show labels. */
88
- margin?: ChartMargin
89
- /** Bar only: stack series instead of grouping side by side. */
90
- stacked?: boolean
91
- /** Pie only: 0–<1 inner-radius fraction — any positive value renders a
92
- * donut. */
93
- innerRadiusRatio?: number
94
- /** X-axis presentation options. */
95
- xAxis?: AxisSpec
96
- /** Y-axis presentation options. */
97
- yAxis?: AxisSpec
98
- /** Legend row of series swatches. `true` = 'bottom'. Pie legends list
99
- * slices, not series. */
100
- legend?: boolean | 'top' | 'bottom'
101
- /** Show a value callout at the scrub/hover cursor. */
102
- tooltip?: boolean
103
- /** Show a snap-to-x cursor rule while scrubbing. */
104
- crosshair?: boolean
105
- /** Tap/click a datum. */
106
- onPress?: (hit: ChartHit) => void
107
- /** Scrub position changes — `null` when the gesture ends or leaves. */
108
- onScrub?: (hit: ChartHit | null) => void
109
- /** Accessible description of the chart for assistive tech. */
110
- accessibilityLabel?: string
111
- /** Class list applied to the chart element. */
112
- className?: any
113
- /** Inline style (string CSS or object). */
114
- style?: any
115
- /** Element id passed through to the host element. */
116
- id?: string
74
+ /** Which chart kind to render. */
75
+ type: ChartType
76
+ /** Plotted series; most types read `values`, pie reads slice x/y. */
77
+ data: SeriesSpec[]
78
+ /** Explicit size in px (web) / dips (native). Without `height`, the leaf
79
+ * fills its parent or derives height from `aspectRatio`. */
80
+ width?: number
81
+ /** Explicit height — same units as `width`. */
82
+ height?: number
83
+ /** width/height ratio used when `height` is unset. */
84
+ aspectRatio?: number
85
+ /** Space reserved inside the chart box for axis labels — labels live in
86
+ * the margin band, the plot in the remainder. Defaults reserve room for
87
+ * x labels (bottom) and y labels (left) when those axes show labels. */
88
+ margin?: ChartMargin
89
+ /** Bar only: stack series instead of grouping side by side. */
90
+ stacked?: boolean
91
+ /** Pie only: 0–<1 inner-radius fraction — any positive value renders a
92
+ * donut. */
93
+ innerRadiusRatio?: number
94
+ /** X-axis presentation options. */
95
+ xAxis?: AxisSpec
96
+ /** Y-axis presentation options. */
97
+ yAxis?: AxisSpec
98
+ /** Legend row of series swatches. `true` = 'bottom'. Pie legends list
99
+ * slices, not series. */
100
+ legend?: boolean | 'top' | 'bottom'
101
+ /** Show a value callout at the scrub/hover cursor. */
102
+ tooltip?: boolean
103
+ /** Show a snap-to-x cursor rule while scrubbing. */
104
+ crosshair?: boolean
105
+ /** Tap/click a datum. */
106
+ onPress?: (hit: ChartHit) => void
107
+ /** Scrub position changes — `null` when the gesture ends or leaves. */
108
+ onScrub?: (hit: ChartHit | null) => void
109
+ /** Accessible description of the chart for assistive tech. */
110
+ accessibilityLabel?: string
111
+ /** Class list applied to the chart element. */
112
+ className?: any
113
+ /** Inline style (string CSS or object). */
114
+ style?: any
115
+ /** Element id passed through to the host element. */
116
+ id?: string
117
117
  }
@@ -7,50 +7,53 @@ export type StyleInput = string | Record<string, any> | null | undefined | reado
7
7
  * Authored keys win; array styles fold in order; a string style is appended
8
8
  * after the serialized defaults so its declarations override them too. */
9
9
  export function mergeStyle(
10
- base: Record<string, any>,
11
- style?: Record<string, any> | readonly (Record<string, any> | null | undefined)[] | null,
10
+ base: Record<string, any>,
11
+ style?: Record<string, any> | readonly (Record<string, any> | null | undefined)[] | null,
12
12
  ): Record<string, any>
13
13
 
14
14
  export function mergeStyle(
15
- base: Record<string, any>,
16
- style?: StyleInput,
15
+ base: Record<string, any>,
16
+ style?: StyleInput,
17
17
  ): string | Record<string, any>
18
18
 
19
19
  export function mergeStyle(
20
- base: Record<string, any>,
21
- style?: StyleInput,
20
+ base: Record<string, any>,
21
+ style?: StyleInput,
22
22
  ): string | Record<string, any> {
23
- if (style == null) {
24
- return base
25
- }
26
-
27
- let obj: Record<string, any> = { ...base }
28
- const strings: string[] = []
29
- const add = (s: StyleInput) => {
30
- if (s == null) {
31
- return
32
- }
33
- if (typeof s === 'string') {
34
- strings.push(s)
35
- } else if (Array.isArray(s)) {
36
- for (const part of s) {
37
- add(part)
38
- }
39
- } else {
40
- obj = { ...obj, ...s }
41
- }
42
- }
43
- add(style)
44
-
45
- if (strings.length === 0) {
46
- return obj
47
- }
48
-
49
- const prefix = Object.entries(obj)
50
- .filter(([, v]) => v != null)
51
- .map(([k, v]) => `${kebab(k)}:${v}`)
52
- .join(';')
53
- return [prefix, ...strings].filter(Boolean).join(';')
23
+ if (style == null) {
24
+ return base
25
+ }
26
+
27
+ let obj: Record<string, any> = { ...base }
28
+ const strings: string[] = []
29
+ const add = (s: StyleInput) => {
30
+ if (s == null) {
31
+ return
32
+ }
33
+
34
+ if (typeof s === 'string') {
35
+ strings.push(s)
36
+ } else if (Array.isArray(s)) {
37
+ for (const part of s) {
38
+ add(part)
39
+ }
40
+ } else {
41
+ obj = { ...obj, ...s }
42
+ }
43
+ }
44
+
45
+ add(style)
46
+
47
+ if (strings.length === 0) {
48
+ return obj
49
+ }
50
+
51
+ const prefix = Object.entries(obj)
52
+ .filter(([, v]) => v != null)
53
+ .map(([k, v]) => `${kebab(k)}:${v}`)
54
+ .join(';')
55
+
56
+ return [prefix, ...strings].filter(Boolean).join(';')
54
57
  }
55
58
 
56
59
  export type StyleProp = string | Record<string, any> | readonly StyleProp[] | null | undefined
@@ -1,34 +1,35 @@
1
1
  // Kept local to avoid coupling the charts leaf to private UI helpers.
2
2
  // Foundation's public ObjC API is available through the AppKit metadata bridge.
3
3
  declare const NSString: {
4
- stringWithString(value: string): {
5
- dataUsingEncoding(encoding: number): {
6
- base64EncodedStringWithOptions(options: number): string
7
- } | null
8
- }
4
+ stringWithString(value: string): {
5
+ dataUsingEncoding(encoding: number): {
6
+ base64EncodedStringWithOptions(options: number): string
7
+ } | null
8
+ }
9
9
  }
10
10
 
11
11
  export function svgDataUri(markup: string): string {
12
- const data = NSString.stringWithString(markup).dataUsingEncoding(4) // NSUTF8StringEncoding
13
- if (!data) {
14
- throw new Error('Unable to encode SVG as UTF-8')
15
- }
12
+ const data = NSString.stringWithString(markup).dataUsingEncoding(4) // NSUTF8StringEncoding
16
13
 
17
- return `data:image/svg+xml;base64,${data.base64EncodedStringWithOptions(0)}`
14
+ if (!data) {
15
+ throw new Error('Unable to encode SVG as UTF-8')
16
+ }
17
+
18
+ return `data:image/svg+xml;base64,${data.base64EncodedStringWithOptions(0)}`
18
19
  }
19
20
 
20
21
  /** Normalize bundled markup and SVG data URIs for AppKit's image host. */
21
22
  export function appKitImageSource(src: string): string {
22
- if (src.trimStart().startsWith('<svg') || src.trimStart().startsWith('<?xml')) {
23
- return svgDataUri(src)
24
- }
23
+ if (src.trimStart().startsWith('<svg') || src.trimStart().startsWith('<?xml')) {
24
+ return svgDataUri(src)
25
+ }
25
26
 
26
- if (
27
- /^data:image\/svg\+xml[;,]/i.test(src) &&
28
- !src.slice(0, src.indexOf(',')).endsWith(';base64')
29
- ) {
30
- return svgDataUri(decodeURIComponent(src.slice(src.indexOf(',') + 1)))
31
- }
27
+ if (
28
+ /^data:image\/svg\+xml[;,]/i.test(src) &&
29
+ !src.slice(0, src.indexOf(',')).endsWith(';base64')
30
+ ) {
31
+ return svgDataUri(decodeURIComponent(src.slice(src.indexOf(',') + 1)))
32
+ }
32
33
 
33
- return src
34
+ return src
34
35
  }
@@ -2,9 +2,6 @@
2
2
  "version": 1,
3
3
  "files": [
4
4
  "Chart.d.ts",
5
- "Chart.macos.d.ts",
6
- "Chart.web.d.ts",
7
- "appkit-pointer.macos.d.ts",
8
5
  "core/axes.d.ts",
9
6
  "core/hit.d.ts",
10
7
  "core/marks.d.ts",
@@ -12,10 +9,7 @@
12
9
  "core/scene.d.ts",
13
10
  "core/svg.d.ts",
14
11
  "index.d.ts",
15
- "index.macos.d.ts",
16
- "index.web.d.ts",
17
12
  "props.d.ts",
18
- "style-merge.d.ts",
19
- "svg-image.macos.d.ts"
13
+ "style-merge.d.ts"
20
14
  ]
21
15
  }
@@ -1,7 +0,0 @@
1
- import type { ChartProps } from './props.js';
2
- /** AppKit leaf: one NSImage plus native label and cursor overlays.
3
- * Hover/drag/click coordinates come from renderer tracking areas, pan
4
- * recognizer location and the current mouse event; native delivery is
5
- * unqualified. AppKit does not deliver onTouch, so touch scrubbing is
6
- * unavailable. */
7
- export declare function Chart(props: ChartProps): unknown;
@@ -1,10 +0,0 @@
1
- /** @jsxImportSource @octane-xplat/jsx/dom */
2
- import type { JSX } from 'octane/jsx-runtime';
3
- import type { ChartProps } from './props.js';
4
- /** Chart — web leaf. The core's Mark[] serialize to one svg markup string,
5
- * inlined as `innerHTML` (Icon.web precedent — the same bytes feed
6
- * `<svgview>` on native). Axis labels, legend, tooltip, and crosshair are
7
- * real absolutely-positioned elements in the overlay — never `<text>` in
8
- * the markup. Pointer handlers attach to the plot host so chart coords are
9
- * client-minus-rect, matching the markup's coordinate space. */
10
- export declare function Chart(props: ChartProps): JSX.Element;
@@ -1,37 +0,0 @@
1
- import type { ScrubPhase } from './core/hit.js';
2
- export interface AppKitChartPointerBridge {
3
- observePointerMotion?(view: unknown, handlers: {
4
- move(x: number, y: number): void;
5
- exit(): void;
6
- }): () => void;
7
- locatePointer?(view: unknown): {
8
- x: number;
9
- y: number;
10
- } | null;
11
- }
12
- /** Raw renderer onPan event — top-left x/y and the NSPanGestureRecognizer
13
- * state (1 began / 2 changed / 3 ended / anything else cancelled). */
14
- export interface AppKitPanEvent {
15
- x: number;
16
- y: number;
17
- deltaX: number;
18
- deltaY: number;
19
- state: number;
20
- }
21
- /** Normalizes the AppKit pointer sources — pan recognizer deltas, tracking-
22
- * area motion and the current mouse event — onto the shared scrub phases,
23
- * mirroring the DOM listeners in Chart.web. */
24
- export declare function createAppKitChartPointer(scrub: (phase: ScrubPhase, x: number, y: number) => void, size: () => {
25
- width: number;
26
- height: number;
27
- }, bridge?: () => AppKitChartPointerBridge | undefined): {
28
- pan(event: {
29
- deltaX?: unknown;
30
- deltaY?: unknown;
31
- state?: unknown;
32
- x?: number;
33
- y?: number;
34
- }): void;
35
- tap(view: unknown): void;
36
- observe(view: unknown): () => void;
37
- };
@@ -1,2 +0,0 @@
1
- export { Chart } from './Chart.macos.js';
2
- export type { AxisSpec, ChartDatum, ChartHit, ChartMargin, ChartProps, ChartType, SeriesSpec, } from './props.js';
@@ -1,2 +0,0 @@
1
- export { Chart } from './Chart.web.js';
2
- export type { AxisSpec, ChartDatum, ChartHit, ChartMargin, ChartProps, ChartType, SeriesSpec, } from './props.js';
@@ -1,3 +0,0 @@
1
- export declare function svgDataUri(markup: string): string;
2
- /** Normalize bundled markup and SVG data URIs for AppKit's image host. */
3
- export declare function appKitImageSource(src: string): string;