@astryxdesign/lab 0.1.4-canary.37c19d3 → 0.1.4-canary.39ffd21
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/dist/ChartV2/Chart.d.ts +32 -0
- package/dist/ChartV2/Chart.d.ts.map +1 -0
- package/dist/ChartV2/Chart.js +281 -0
- package/dist/ChartV2/ChartAxis.d.ts +36 -0
- package/dist/ChartV2/ChartAxis.d.ts.map +1 -0
- package/dist/ChartV2/ChartAxis.js +161 -0
- package/dist/ChartV2/ChartGrid.d.ts +20 -0
- package/dist/ChartV2/ChartGrid.d.ts.map +1 -0
- package/dist/ChartV2/ChartGrid.js +76 -0
- package/dist/ChartV2/ChartLegend.d.ts +14 -0
- package/dist/ChartV2/ChartLegend.d.ts.map +1 -0
- package/dist/ChartV2/ChartLegend.js +54 -0
- package/dist/ChartV2/ChartSwatch.d.ts +36 -0
- package/dist/ChartV2/ChartSwatch.d.ts.map +1 -0
- package/dist/ChartV2/ChartSwatch.js +82 -0
- package/dist/ChartV2/ChartTooltip.d.ts +46 -0
- package/dist/ChartV2/ChartTooltip.d.ts.map +1 -0
- package/dist/ChartV2/ChartTooltip.js +267 -0
- package/dist/ChartV2/ChartV2Context.d.ts +4 -0
- package/dist/ChartV2/ChartV2Context.d.ts.map +1 -0
- package/dist/ChartV2/ChartV2Context.js +12 -0
- package/dist/ChartV2/index.d.ts +13 -0
- package/dist/ChartV2/index.d.ts.map +1 -0
- package/dist/ChartV2/index.js +10 -0
- package/dist/ChartV2/layout.d.ts +25 -0
- package/dist/ChartV2/layout.d.ts.map +1 -0
- package/dist/ChartV2/layout.js +195 -0
- package/dist/ChartV2/legend.d.ts +18 -0
- package/dist/ChartV2/legend.d.ts.map +1 -0
- package/dist/ChartV2/legend.js +24 -0
- package/dist/ChartV2/marks/area.d.ts +19 -0
- package/dist/ChartV2/marks/area.d.ts.map +1 -0
- package/dist/ChartV2/marks/area.js +109 -0
- package/dist/ChartV2/marks/band.d.ts +9 -0
- package/dist/ChartV2/marks/band.d.ts.map +1 -0
- package/dist/ChartV2/marks/band.js +59 -0
- package/dist/ChartV2/marks/bar.d.ts +17 -0
- package/dist/ChartV2/marks/bar.d.ts.map +1 -0
- package/dist/ChartV2/marks/bar.js +120 -0
- package/dist/ChartV2/marks/candlestick.d.ts +15 -0
- package/dist/ChartV2/marks/candlestick.d.ts.map +1 -0
- package/dist/ChartV2/marks/candlestick.js +83 -0
- package/dist/ChartV2/marks/dot.d.ts +15 -0
- package/dist/ChartV2/marks/dot.d.ts.map +1 -0
- package/dist/ChartV2/marks/dot.js +65 -0
- package/dist/ChartV2/marks/dotGL.d.ts +16 -0
- package/dist/ChartV2/marks/dotGL.d.ts.map +1 -0
- package/dist/ChartV2/marks/dotGL.js +178 -0
- package/dist/ChartV2/marks/dotGLInteractive.d.ts +30 -0
- package/dist/ChartV2/marks/dotGLInteractive.d.ts.map +1 -0
- package/dist/ChartV2/marks/dotGLInteractive.js +464 -0
- package/dist/ChartV2/marks/errorBar.d.ts +27 -0
- package/dist/ChartV2/marks/errorBar.d.ts.map +1 -0
- package/dist/ChartV2/marks/errorBar.js +87 -0
- package/dist/ChartV2/marks/heatmapGL.d.ts +23 -0
- package/dist/ChartV2/marks/heatmapGL.d.ts.map +1 -0
- package/dist/ChartV2/marks/heatmapGL.js +242 -0
- package/dist/ChartV2/marks/index.d.ts +13 -0
- package/dist/ChartV2/marks/index.d.ts.map +1 -0
- package/dist/ChartV2/marks/index.js +14 -0
- package/dist/ChartV2/marks/line.d.ts +18 -0
- package/dist/ChartV2/marks/line.d.ts.map +1 -0
- package/dist/ChartV2/marks/line.js +76 -0
- package/dist/ChartV2/marks/referenceLine.d.ts +35 -0
- package/dist/ChartV2/marks/referenceLine.d.ts.map +1 -0
- package/dist/ChartV2/marks/referenceLine.js +186 -0
- package/dist/ChartV2/marks/streamGL.d.ts +36 -0
- package/dist/ChartV2/marks/streamGL.d.ts.map +1 -0
- package/dist/ChartV2/marks/streamGL.js +204 -0
- package/dist/ChartV2/tooltip.d.ts +38 -0
- package/dist/ChartV2/tooltip.d.ts.map +1 -0
- package/dist/ChartV2/tooltip.js +54 -0
- package/dist/ChartV2/types.d.ts +115 -0
- package/dist/ChartV2/types.d.ts.map +1 -0
- package/dist/ChartV2/types.js +35 -0
- package/dist/CodeEditor/CodeEditor.d.ts +1 -4
- package/dist/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/CodeEditor/CodeEditor.js +0 -3
- package/dist/Sankey/SankeyChart.d.ts.map +1 -1
- package/dist/Sankey/SankeyChart.js +0 -3
- package/dist/Schedule/ListView.d.ts.map +1 -1
- package/dist/Schedule/ListView.js +4 -7
- package/dist/Schedule/MonthlyView.js +2 -3
- package/dist/Schedule/Schedule.d.ts +1 -3
- package/dist/Schedule/Schedule.d.ts.map +1 -1
- package/dist/Schedule/Schedule.js +4 -9
- package/dist/Schedule/TimeGridView.js +2 -3
- package/dist/Schedule/context.d.ts +0 -2
- package/dist/Schedule/context.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/lab.css +15 -6
- package/package.json +2 -2
- package/src/ChartV2/Chart.tsx +348 -0
- package/src/ChartV2/ChartAxis.tsx +209 -0
- package/src/ChartV2/ChartGrid.tsx +99 -0
- package/src/ChartV2/ChartLegend.tsx +69 -0
- package/src/ChartV2/ChartSwatch.doc.mjs +17 -0
- package/src/ChartV2/ChartSwatch.tsx +86 -0
- package/src/ChartV2/ChartTooltip.tsx +382 -0
- package/src/ChartV2/ChartV2.doc.mjs +16 -0
- package/src/ChartV2/ChartV2Context.ts +15 -0
- package/src/ChartV2/index.ts +62 -0
- package/src/ChartV2/layout.ts +223 -0
- package/src/ChartV2/legend.ts +32 -0
- package/src/ChartV2/marks/area.tsx +122 -0
- package/src/ChartV2/marks/band.tsx +70 -0
- package/src/ChartV2/marks/bar.tsx +159 -0
- package/src/ChartV2/marks/candlestick.tsx +106 -0
- package/src/ChartV2/marks/dot.tsx +64 -0
- package/src/ChartV2/marks/dotGL.tsx +202 -0
- package/src/ChartV2/marks/dotGLInteractive.tsx +546 -0
- package/src/ChartV2/marks/errorBar.tsx +89 -0
- package/src/ChartV2/marks/heatmapGL.tsx +299 -0
- package/src/ChartV2/marks/index.ts +14 -0
- package/src/ChartV2/marks/line.tsx +94 -0
- package/src/ChartV2/marks/referenceLine.tsx +224 -0
- package/src/ChartV2/marks/streamGL.tsx +251 -0
- package/src/ChartV2/tooltip.ts +70 -0
- package/src/ChartV2/types.ts +129 -0
- package/src/CodeEditor/CodeEditor.tsx +0 -5
- package/src/Sankey/SankeyChart.tsx +0 -3
- package/src/Schedule/ListView.tsx +2 -5
- package/src/Schedule/MonthlyView.tsx +2 -2
- package/src/Schedule/Schedule.test.tsx +0 -39
- package/src/Schedule/Schedule.tsx +0 -8
- package/src/Schedule/TimeGridView.tsx +2 -2
- package/src/Schedule/context.tsx +0 -2
- package/src/index.ts +46 -5
- package/dist/InfoTip/InfoTip.d.ts +0 -58
- package/dist/InfoTip/InfoTip.d.ts.map +0 -1
- package/dist/InfoTip/InfoTip.js +0 -91
- package/dist/InfoTip/index.d.ts +0 -6
- package/dist/InfoTip/index.d.ts.map +0 -1
- package/dist/InfoTip/index.js +0 -8
- package/src/CodeEditor/CodeEditor.test.tsx +0 -21
- package/src/InfoTip/InfoTip.doc.mjs +0 -97
- package/src/InfoTip/InfoTip.test.tsx +0 -169
- package/src/InfoTip/InfoTip.tsx +0 -155
- package/src/InfoTip/index.ts +0 -10
- package/src/Sankey/SankeyChart.test.tsx +0 -77
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file marks/streamGL.tsx
|
|
5
|
+
* @output WebGL streaming time-series line — ring buffer, canvas outside SVG
|
|
6
|
+
*
|
|
7
|
+
* Data is pushed imperatively via the returned handle, not from the static dataset.
|
|
8
|
+
* The chart's xScale/yScale map pushed values to pixel coordinates.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useRef, useEffect, useImperativeHandle, useCallback } from 'react';
|
|
12
|
+
import { useChartV2 } from "../ChartV2Context.js";
|
|
13
|
+
import { hexToGL, getWebGLContext, setupGLState, sizeCanvas, mountCanvasOverSVG, createProgram } from "../../Chart/webgl.js";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
const VERT = `
|
|
16
|
+
attribute vec2 a_position;
|
|
17
|
+
uniform vec2 u_resolution;
|
|
18
|
+
void main() {
|
|
19
|
+
vec2 clip = (a_position / u_resolution) * 2.0 - 1.0;
|
|
20
|
+
gl_Position = vec4(clip.x, -clip.y, 0.0, 1.0);
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
const FRAG = `
|
|
24
|
+
precision mediump float;
|
|
25
|
+
uniform vec3 u_color;
|
|
26
|
+
uniform float u_opacity;
|
|
27
|
+
void main() {
|
|
28
|
+
float a = u_opacity;
|
|
29
|
+
gl_FragColor = vec4(u_color * a, a);
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Inline component — manages the ring buffer, canvas, and rAF draw loop.
|
|
35
|
+
*/
|
|
36
|
+
function StreamGLCanvas({
|
|
37
|
+
color,
|
|
38
|
+
bufferSize,
|
|
39
|
+
lineWidth,
|
|
40
|
+
opacity,
|
|
41
|
+
width,
|
|
42
|
+
height,
|
|
43
|
+
handleRef
|
|
44
|
+
}) {
|
|
45
|
+
const {
|
|
46
|
+
xScale,
|
|
47
|
+
yScale
|
|
48
|
+
} = useChartV2();
|
|
49
|
+
const canvasRef = useRef(null);
|
|
50
|
+
const glRef = useRef(null);
|
|
51
|
+
const programRef = useRef(null);
|
|
52
|
+
const bufRef = useRef(null);
|
|
53
|
+
const markerRef = useRef(null);
|
|
54
|
+
const ring = useRef({
|
|
55
|
+
data: new Float32Array(bufferSize * 2),
|
|
56
|
+
head: 0,
|
|
57
|
+
count: 0
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Mount canvas outside SVG
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const marker = markerRef.current;
|
|
63
|
+
if (!marker) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!canvasRef.current) {
|
|
67
|
+
canvasRef.current = document.createElement('canvas');
|
|
68
|
+
}
|
|
69
|
+
return mountCanvasOverSVG(marker, canvasRef.current, width, height);
|
|
70
|
+
}, [width, height]);
|
|
71
|
+
|
|
72
|
+
// Size canvas
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const canvas = canvasRef.current;
|
|
75
|
+
if (!canvas || width <= 0 || height <= 0) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
sizeCanvas(canvas, width, height);
|
|
79
|
+
}, [width, height]);
|
|
80
|
+
const draw = useCallback(() => {
|
|
81
|
+
const canvas = canvasRef.current;
|
|
82
|
+
if (!canvas) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (!glRef.current) {
|
|
86
|
+
glRef.current = getWebGLContext(canvas);
|
|
87
|
+
}
|
|
88
|
+
const gl = glRef.current;
|
|
89
|
+
if (!gl) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (!programRef.current) {
|
|
93
|
+
programRef.current = createProgram(gl, VERT, FRAG);
|
|
94
|
+
}
|
|
95
|
+
const program = programRef.current;
|
|
96
|
+
if (!program) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (!bufRef.current) {
|
|
100
|
+
bufRef.current = gl.createBuffer();
|
|
101
|
+
}
|
|
102
|
+
const {
|
|
103
|
+
data: ringData,
|
|
104
|
+
head,
|
|
105
|
+
count
|
|
106
|
+
} = ring.current;
|
|
107
|
+
if (count < 2) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const linearX = xScale;
|
|
111
|
+
const drawBuf = new Float32Array(count * 2);
|
|
112
|
+
for (let i = 0; i < count; i++) {
|
|
113
|
+
const idx = (head - count + i + bufferSize) % bufferSize * 2;
|
|
114
|
+
drawBuf[i * 2] = linearX(ringData[idx]);
|
|
115
|
+
drawBuf[i * 2 + 1] = yScale(ringData[idx + 1]);
|
|
116
|
+
}
|
|
117
|
+
gl.viewport(0, 0, canvas.width, canvas.height);
|
|
118
|
+
setupGLState(gl);
|
|
119
|
+
gl.useProgram(program);
|
|
120
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, bufRef.current);
|
|
121
|
+
gl.bufferData(gl.ARRAY_BUFFER, drawBuf, gl.DYNAMIC_DRAW);
|
|
122
|
+
const aPos = gl.getAttribLocation(program, 'a_position');
|
|
123
|
+
gl.enableVertexAttribArray(aPos);
|
|
124
|
+
gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);
|
|
125
|
+
const [r, g, b] = hexToGL(color);
|
|
126
|
+
gl.uniform2f(gl.getUniformLocation(program, 'u_resolution'), width, height);
|
|
127
|
+
gl.uniform3f(gl.getUniformLocation(program, 'u_color'), r, g, b);
|
|
128
|
+
gl.uniform1f(gl.getUniformLocation(program, 'u_opacity'), opacity);
|
|
129
|
+
gl.lineWidth(lineWidth);
|
|
130
|
+
gl.drawArrays(gl.LINE_STRIP, 0, count);
|
|
131
|
+
}, [width, height, color, lineWidth, opacity, bufferSize, xScale, yScale]);
|
|
132
|
+
|
|
133
|
+
// Expose push/clear handle via ref
|
|
134
|
+
useImperativeHandle(handleRef, () => ({
|
|
135
|
+
push(x, y) {
|
|
136
|
+
const r = ring.current;
|
|
137
|
+
const idx = r.head * 2;
|
|
138
|
+
r.data[idx] = x;
|
|
139
|
+
r.data[idx + 1] = y;
|
|
140
|
+
r.head = (r.head + 1) % bufferSize;
|
|
141
|
+
r.count = Math.min(r.count + 1, bufferSize);
|
|
142
|
+
draw();
|
|
143
|
+
},
|
|
144
|
+
clear() {
|
|
145
|
+
ring.current.head = 0;
|
|
146
|
+
ring.current.count = 0;
|
|
147
|
+
const gl = glRef.current;
|
|
148
|
+
if (gl) {
|
|
149
|
+
gl.clearColor(0, 0, 0, 0);
|
|
150
|
+
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}), [bufferSize, draw]);
|
|
154
|
+
if (width <= 0 || height <= 0) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
return /*#__PURE__*/_jsx("g", {
|
|
158
|
+
ref: markerRef
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* WebGL streaming line. Data is pushed imperatively via handleRef,
|
|
164
|
+
* not from the chart's static dataset. Internally uses a ring buffer.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```
|
|
168
|
+
* const streamRef = useRef<StreamGLHandle>(null);
|
|
169
|
+
* // Push data points in a rAF loop or event handler:
|
|
170
|
+
* streamRef.current?.push(Date.now(), value);
|
|
171
|
+
*
|
|
172
|
+
* <Chart series={[streamGL({color: '#10b981', handleRef: streamRef})]} />
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
export function streamGL(options) {
|
|
176
|
+
const {
|
|
177
|
+
color
|
|
178
|
+
} = options;
|
|
179
|
+
const bufferSize = options.bufferSize ?? 500;
|
|
180
|
+
const lineWidth = options.lineWidth ?? 2;
|
|
181
|
+
const opacity = options.opacity ?? 1;
|
|
182
|
+
const handleRef = options.handleRef;
|
|
183
|
+
return {
|
|
184
|
+
type: 'streamGL',
|
|
185
|
+
key: 'stream',
|
|
186
|
+
dataKeys: [],
|
|
187
|
+
layout: {},
|
|
188
|
+
// Streaming data is pushed, not in the static dataset
|
|
189
|
+
resolve() {
|
|
190
|
+
return [];
|
|
191
|
+
},
|
|
192
|
+
render(_resolved, ctx) {
|
|
193
|
+
return /*#__PURE__*/_jsx(StreamGLCanvas, {
|
|
194
|
+
color: color,
|
|
195
|
+
bufferSize: bufferSize,
|
|
196
|
+
lineWidth: lineWidth,
|
|
197
|
+
opacity: opacity,
|
|
198
|
+
width: ctx.width,
|
|
199
|
+
height: ctx.height,
|
|
200
|
+
handleRef: handleRef
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file tooltip.ts
|
|
3
|
+
* @output Tooltip types + series-value derivation
|
|
4
|
+
* @position Used by Chart to bridge series + hovered datum → tooltip rows.
|
|
5
|
+
* Mirrors the legend.ts split: data shaping lives here, presentation
|
|
6
|
+
* lives in ChartTooltip.tsx.
|
|
7
|
+
*/
|
|
8
|
+
import { type SeriesDef } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* One row of tooltip data — represents a single series' value at the
|
|
11
|
+
* hovered x-position. Stable shape so custom `render` functions can rely on it.
|
|
12
|
+
*/
|
|
13
|
+
export interface TooltipSeriesValue {
|
|
14
|
+
/** Series key (matches SeriesDef.key) */
|
|
15
|
+
key: string;
|
|
16
|
+
/** Display label — falls back to key when not set on the series */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Series color token */
|
|
19
|
+
color: string;
|
|
20
|
+
/** Mark type — drives swatch variant in the default render */
|
|
21
|
+
type: string;
|
|
22
|
+
/** Raw value at the hovered x for this series */
|
|
23
|
+
value: unknown;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build the ordered list of tooltip rows for a given hovered datum.
|
|
27
|
+
* Skips utility marks and any series the layout couldn't resolve.
|
|
28
|
+
*
|
|
29
|
+
* Pure / synchronous — safe to memoize on the caller.
|
|
30
|
+
*/
|
|
31
|
+
export declare function deriveTooltipSeriesValues(series: readonly SeriesDef[], datum: Record<string, unknown> | undefined, resolvedKeys: ReadonlySet<string>): TooltipSeriesValue[];
|
|
32
|
+
/**
|
|
33
|
+
* Whether a series should render a hover dot at the focused index.
|
|
34
|
+
* Bars get a band-highlight rect instead, and utility marks have no
|
|
35
|
+
* data point to highlight.
|
|
36
|
+
*/
|
|
37
|
+
export declare function shouldRenderHoverDot(seriesType: string): boolean;
|
|
38
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/ChartV2/tooltip.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,SAAS,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC1C,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,GAChC,kBAAkB,EAAE,CAqBtB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEhE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file tooltip.ts
|
|
5
|
+
* @output Tooltip types + series-value derivation
|
|
6
|
+
* @position Used by Chart to bridge series + hovered datum → tooltip rows.
|
|
7
|
+
* Mirrors the legend.ts split: data shaping lives here, presentation
|
|
8
|
+
* lives in ChartTooltip.tsx.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { isUtilityMarkType } from "./types.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* One row of tooltip data — represents a single series' value at the
|
|
15
|
+
* hovered x-position. Stable shape so custom `render` functions can rely on it.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Build the ordered list of tooltip rows for a given hovered datum.
|
|
20
|
+
* Skips utility marks and any series the layout couldn't resolve.
|
|
21
|
+
*
|
|
22
|
+
* Pure / synchronous — safe to memoize on the caller.
|
|
23
|
+
*/
|
|
24
|
+
export function deriveTooltipSeriesValues(series, datum, resolvedKeys) {
|
|
25
|
+
if (!datum) {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
const out = [];
|
|
29
|
+
for (const s of series) {
|
|
30
|
+
if (isUtilityMarkType(s.type)) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (!resolvedKeys.has(s.key)) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
out.push({
|
|
37
|
+
key: s.key,
|
|
38
|
+
label: s.label ?? s.key,
|
|
39
|
+
color: s.color ?? 'var(--color-text-primary)',
|
|
40
|
+
type: s.type,
|
|
41
|
+
value: datum[s.dataKeys[0]]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Whether a series should render a hover dot at the focused index.
|
|
49
|
+
* Bars get a band-highlight rect instead, and utility marks have no
|
|
50
|
+
* data point to highlight.
|
|
51
|
+
*/
|
|
52
|
+
export function shouldRenderHoverDot(seriesType) {
|
|
53
|
+
return seriesType !== 'bar' && !isUtilityMarkType(seriesType);
|
|
54
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types.ts
|
|
3
|
+
* @output Core types for the v2 chart architecture
|
|
4
|
+
* @position Foundation — consumed by layout, renderers, and interactions
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactNode } from 'react';
|
|
7
|
+
import type { ScaleLinear, ScaleBand } from 'd3-scale';
|
|
8
|
+
export type ChartScale = ScaleLinear<number, number> | ScaleBand<string>;
|
|
9
|
+
export interface ChartMargin {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
}
|
|
15
|
+
/** Resolved pixel position for a single data point in a series */
|
|
16
|
+
export interface ResolvedPoint {
|
|
17
|
+
/** Pixel x in plot area coordinates */
|
|
18
|
+
px: number;
|
|
19
|
+
/** Pixel y in plot area coordinates (top of mark) */
|
|
20
|
+
py: number;
|
|
21
|
+
/** Pixel y baseline (bottom of mark) — differs from py when stacked */
|
|
22
|
+
py0: number;
|
|
23
|
+
/** Index into the data array */
|
|
24
|
+
dataIndex: number;
|
|
25
|
+
}
|
|
26
|
+
/** Context passed to resolve() and render() on each series */
|
|
27
|
+
export interface SeriesContext {
|
|
28
|
+
data: Record<string, unknown>[];
|
|
29
|
+
xKey: string;
|
|
30
|
+
xScale: ChartScale;
|
|
31
|
+
yScale: ScaleLinear<number, number>;
|
|
32
|
+
/** Width of the plot area */
|
|
33
|
+
width: number;
|
|
34
|
+
/** Height of the plot area */
|
|
35
|
+
height: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The standardized shape every mark helper returns.
|
|
39
|
+
* Each mark type is self-contained: it knows how to resolve positions
|
|
40
|
+
* and how to render itself. The chart root just iterates and calls.
|
|
41
|
+
*/
|
|
42
|
+
export interface SeriesDef {
|
|
43
|
+
/** Mark type identifier */
|
|
44
|
+
readonly type: string;
|
|
45
|
+
/** Unique key for this series (typically the dataKey) */
|
|
46
|
+
readonly key: string;
|
|
47
|
+
/** Data keys this series reads from — used to compute y domain */
|
|
48
|
+
readonly dataKeys: string[];
|
|
49
|
+
/** Whether this series is the topmost in its stack (set during layout) */
|
|
50
|
+
_isTopOfStack?: boolean;
|
|
51
|
+
/** Static color for legend display. Undefined if color is dynamic (accessor function). */
|
|
52
|
+
readonly color?: string;
|
|
53
|
+
/** Human-readable label for legend. Falls back to key if not provided. */
|
|
54
|
+
readonly label?: string;
|
|
55
|
+
/** Layout hints the chart root uses for cross-series coordination */
|
|
56
|
+
readonly layout: {
|
|
57
|
+
/** Stack group — series with same stack accumulate */
|
|
58
|
+
stack?: string;
|
|
59
|
+
/** Bar group — series with same group subdivide bandwidth */
|
|
60
|
+
group?: string;
|
|
61
|
+
/** Whether this series contributes to y-domain zero inclusion */
|
|
62
|
+
includeZero?: boolean;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Resolve pixel positions for each data point.
|
|
66
|
+
* Called by the chart root during the layout pass.
|
|
67
|
+
* Receives pre-computed stack offsets if stacked.
|
|
68
|
+
*/
|
|
69
|
+
resolve(ctx: SeriesContext, stackOffsets?: {
|
|
70
|
+
y0: number;
|
|
71
|
+
y1: number;
|
|
72
|
+
}[], groupInfo?: {
|
|
73
|
+
index: number;
|
|
74
|
+
count: number;
|
|
75
|
+
}): ResolvedPoint[];
|
|
76
|
+
/**
|
|
77
|
+
* Render the mark given resolved positions.
|
|
78
|
+
* Called by the chart root during the render pass.
|
|
79
|
+
* Returns SVG elements (or manages its own canvas for WebGL).
|
|
80
|
+
*/
|
|
81
|
+
render(resolved: ResolvedPoint[], ctx: SeriesContext): ReactNode;
|
|
82
|
+
}
|
|
83
|
+
/** Resolved positions for all series */
|
|
84
|
+
export type ResolvedPositions = Map<string, ResolvedPoint[]>;
|
|
85
|
+
/** Pointer event normalized to plot-area coordinates */
|
|
86
|
+
export interface ChartPointerEvent {
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
89
|
+
nearest: (ResolvedPoint & {
|
|
90
|
+
seriesKey: string;
|
|
91
|
+
}) | null;
|
|
92
|
+
active: boolean;
|
|
93
|
+
}
|
|
94
|
+
/** Context provided by Chart to interaction children */
|
|
95
|
+
export interface ChartV2Context {
|
|
96
|
+
width: number;
|
|
97
|
+
height: number;
|
|
98
|
+
margin: ChartMargin;
|
|
99
|
+
data: Record<string, unknown>[];
|
|
100
|
+
xKey: string;
|
|
101
|
+
xScale: ChartScale;
|
|
102
|
+
yScale: ScaleLinear<number, number>;
|
|
103
|
+
resolved: Map<string, ResolvedPoint[]>;
|
|
104
|
+
onPointer: (handler: (e: ChartPointerEvent) => void) => () => void;
|
|
105
|
+
svgRef: React.RefObject<SVGSVGElement | null>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Series mark types that are utility / annotation marks rather than primary
|
|
109
|
+
* data. They're skipped from chrome surfaces (legend, tooltip rows) since
|
|
110
|
+
* they don't represent values the user is comparing.
|
|
111
|
+
*/
|
|
112
|
+
export declare const UTILITY_MARK_TYPES: ReadonlySet<string>;
|
|
113
|
+
/** True if the series type is a utility / annotation mark. */
|
|
114
|
+
export declare function isUtilityMarkType(type: string): boolean;
|
|
115
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ChartV2/types.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kEAAkE;AAClE,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,gCA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
|
3
|
+
/**
|
|
4
|
+
* @file types.ts
|
|
5
|
+
* @output Core types for the v2 chart architecture
|
|
6
|
+
* @position Foundation — consumed by layout, renderers, and interactions
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** Resolved pixel position for a single data point in a series */
|
|
10
|
+
|
|
11
|
+
/** Context passed to resolve() and render() on each series */
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The standardized shape every mark helper returns.
|
|
15
|
+
* Each mark type is self-contained: it knows how to resolve positions
|
|
16
|
+
* and how to render itself. The chart root just iterates and calls.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** Resolved positions for all series */
|
|
20
|
+
|
|
21
|
+
/** Pointer event normalized to plot-area coordinates */
|
|
22
|
+
|
|
23
|
+
/** Context provided by Chart to interaction children */
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Series mark types that are utility / annotation marks rather than primary
|
|
27
|
+
* data. They're skipped from chrome surfaces (legend, tooltip rows) since
|
|
28
|
+
* they don't represent values the user is comparing.
|
|
29
|
+
*/
|
|
30
|
+
export const UTILITY_MARK_TYPES = new Set(['referenceLine', 'errorBar', 'band']);
|
|
31
|
+
|
|
32
|
+
/** True if the series type is a utility / annotation mark. */
|
|
33
|
+
export function isUtilityMarkType(type) {
|
|
34
|
+
return UTILITY_MARK_TYPES.has(type);
|
|
35
|
+
}
|
|
@@ -9,8 +9,6 @@ export interface CodeEditorProps extends Omit<BaseProps<HTMLDivElement>, 'onChan
|
|
|
9
9
|
onChange: (value: string) => void;
|
|
10
10
|
/** Language for highlighting. @default "plaintext" */
|
|
11
11
|
language?: string;
|
|
12
|
-
/** Label for the code editor — used as the accessible name of the editable region. */
|
|
13
|
-
label: string;
|
|
14
12
|
/** Show line numbers. @default false */
|
|
15
13
|
hasLineNumbers?: boolean;
|
|
16
14
|
/** Read-only mode. @default false */
|
|
@@ -34,7 +32,6 @@ export interface CodeEditorProps extends Omit<BaseProps<HTMLDivElement>, 'onChan
|
|
|
34
32
|
* ```tsx
|
|
35
33
|
* const [code, setCode] = useState('');
|
|
36
34
|
* <CodeEditor
|
|
37
|
-
* label="Source code"
|
|
38
35
|
* value={code}
|
|
39
36
|
* onChange={setCode}
|
|
40
37
|
* language="typescript"
|
|
@@ -42,7 +39,7 @@ export interface CodeEditorProps extends Omit<BaseProps<HTMLDivElement>, 'onChan
|
|
|
42
39
|
* />
|
|
43
40
|
* ```
|
|
44
41
|
*/
|
|
45
|
-
export declare function CodeEditor({ value, onChange, language, hasLineNumbers, isReadOnly, placeholder, maxHeight, size, tokenizer: customTokenizer,
|
|
42
|
+
export declare function CodeEditor({ value, onChange, language, hasLineNumbers, isReadOnly, placeholder, maxHeight, size, tokenizer: customTokenizer, xstyle, className, style, ref, ...props }: CodeEditorProps): import("react").JSX.Element;
|
|
46
43
|
export declare namespace CodeEditor {
|
|
47
44
|
var displayName: string;
|
|
48
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../src/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAiBlD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AAuF5D,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,CACX;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../src/CodeEditor/CodeEditor.tsx"],"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, setCode] = useState('');
|
|
134
134
|
* <CodeEditor
|
|
135
|
-
* label="Source code"
|
|
136
135
|
* value={code}
|
|
137
136
|
* onChange={setCode}
|
|
138
137
|
* language="typescript"
|
|
@@ -150,7 +149,6 @@ export function CodeEditor({
|
|
|
150
149
|
maxHeight,
|
|
151
150
|
size = 'md',
|
|
152
151
|
tokenizer: customTokenizer,
|
|
153
|
-
label,
|
|
154
152
|
xstyle,
|
|
155
153
|
className,
|
|
156
154
|
style,
|
|
@@ -381,7 +379,6 @@ export function CodeEditor({
|
|
|
381
379
|
contentEditable: isReadOnly ? false : 'plaintext-only',
|
|
382
380
|
role: "textbox",
|
|
383
381
|
"aria-multiline": "true",
|
|
384
|
-
"aria-label": label,
|
|
385
382
|
"aria-readonly": isReadOnly,
|
|
386
383
|
spellCheck: false,
|
|
387
384
|
onInput: handleInput,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SankeyChart.d.ts","sourceRoot":"","sources":["../../src/Sankey/SankeyChart.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,eAAe,EAAE,eAAe,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,uBAAuB;IACvB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AA+CD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,OAAO,EACP,MAAY,EACZ,SAAc,EACd,OAAY,EACZ,SAAS,EACT,cAAoB,EACpB,QAAQ,GACT,EAAE,gBAAgB,+
|
|
1
|
+
{"version":3,"file":"SankeyChart.d.ts","sourceRoot":"","sources":["../../src/Sankey/SankeyChart.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAC,eAAe,EAAE,eAAe,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,uBAAuB;IACvB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AA+CD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,OAAO,EACP,MAAY,EACZ,SAAc,EACd,OAAY,EACZ,SAAS,EACT,cAAoB,EACpB,QAAQ,GACT,EAAE,gBAAgB,+BAkFlB;yBA5Fe,WAAW"}
|
|
@@ -140,9 +140,6 @@ export function SankeyChart({
|
|
|
140
140
|
width: '100%'
|
|
141
141
|
},
|
|
142
142
|
children: ctx && /*#__PURE__*/_jsx("div", {
|
|
143
|
-
role: needsScroll ? 'group' : undefined,
|
|
144
|
-
"aria-label": needsScroll ? 'Sankey chart' : undefined,
|
|
145
|
-
tabIndex: needsScroll ? 0 : undefined,
|
|
146
143
|
style: needsScroll ? {
|
|
147
144
|
overflowX: 'auto',
|
|
148
145
|
overflowY: 'hidden'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../src/Schedule/ListView.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAGV,YAAY,EAEb,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../src/Schedule/ListView.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAGV,YAAY,EAEb,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAqID,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EAAE,QAAY,GACnB,GAAE,uBAA4B,GAAG,YAAY,CAAC,uBAAuB,CAAC,CAmCtE"}
|
|
@@ -22,8 +22,7 @@ function ScheduleListView(_props) {
|
|
|
22
22
|
events,
|
|
23
23
|
timezoneID,
|
|
24
24
|
range,
|
|
25
|
-
isLoading
|
|
26
|
-
headingLevel
|
|
25
|
+
isLoading
|
|
27
26
|
} = useScheduleContext();
|
|
28
27
|
const days = enumerateDates(range.startDate, range.endDate);
|
|
29
28
|
const currentTime = useCurrentTime();
|
|
@@ -60,8 +59,7 @@ function ScheduleListView(_props) {
|
|
|
60
59
|
children: [/*#__PURE__*/_jsx(ListDayHeading, {
|
|
61
60
|
day: day,
|
|
62
61
|
isCurrentDay: isCurrentDay,
|
|
63
|
-
timezoneID: timezoneID
|
|
64
|
-
headingLevel: headingLevel
|
|
62
|
+
timezoneID: timezoneID
|
|
65
63
|
}), /*#__PURE__*/_jsx("div", {
|
|
66
64
|
...stylex.props(styles.listEvents),
|
|
67
65
|
children: renderListRows({
|
|
@@ -78,11 +76,10 @@ function ScheduleListView(_props) {
|
|
|
78
76
|
function ListDayHeading({
|
|
79
77
|
day,
|
|
80
78
|
isCurrentDay,
|
|
81
|
-
timezoneID
|
|
82
|
-
headingLevel
|
|
79
|
+
timezoneID
|
|
83
80
|
}) {
|
|
84
81
|
return /*#__PURE__*/_jsxs(Heading, {
|
|
85
|
-
level:
|
|
82
|
+
level: 4,
|
|
86
83
|
color: "secondary",
|
|
87
84
|
display: "block",
|
|
88
85
|
"aria-label": formatFullDate(day, timezoneID),
|
|
@@ -25,8 +25,7 @@ function ScheduleMonthlyView(_props) {
|
|
|
25
25
|
focusDate,
|
|
26
26
|
timezoneID,
|
|
27
27
|
range,
|
|
28
|
-
isLoading
|
|
29
|
-
headingLevel
|
|
28
|
+
isLoading
|
|
30
29
|
} = useScheduleContext();
|
|
31
30
|
const rangeDate = date.toPlainDate();
|
|
32
31
|
const highlightedDate = focusDate.toPlainDate();
|
|
@@ -56,7 +55,7 @@ function ScheduleMonthlyView(_props) {
|
|
|
56
55
|
"aria-colindex": index + 1,
|
|
57
56
|
...stylex.props(styles.weekdayLabel),
|
|
58
57
|
children: /*#__PURE__*/_jsx(Heading, {
|
|
59
|
-
level:
|
|
58
|
+
level: 4,
|
|
60
59
|
color: "secondary",
|
|
61
60
|
display: "block",
|
|
62
61
|
xstyle: styles.weekdayHeading,
|
|
@@ -17,8 +17,6 @@ export interface ScheduleProps<Options extends ScheduleViewOptions = ScheduleVie
|
|
|
17
17
|
timezoneID?: string;
|
|
18
18
|
/** Header/rendering plugins. Defaults to pagination controls. */
|
|
19
19
|
plugins?: ReadonlyArray<SchedulePlugin>;
|
|
20
|
-
/** Heading level for sub-headings (day labels, weekday headers) within the schedule. @default 3 */
|
|
21
|
-
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
22
20
|
}
|
|
23
|
-
export declare function Schedule({ view, events, categories, date, focusDate: focusDateProp, onChangeDate, timezoneID: timezoneIDProp, plugins,
|
|
21
|
+
export declare function Schedule({ view, events, categories, date, focusDate: focusDateProp, onChangeDate, timezoneID: timezoneIDProp, plugins, xstyle, className, style, ...rest }: ScheduleProps): import("react").JSX.Element;
|
|
24
22
|
//# sourceMappingURL=Schedule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schedule.d.ts","sourceRoot":"","sources":["../../src/Schedule/Schedule.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAQlD,OAAO,KAAK,EAEV,OAAO,EAEP,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,mBAAmB,EAGpB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,aAAa,CAC5B,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,CACzD,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjC,iEAAiE;IACjE,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC5B,sFAAsF;IACtF,MAAM,EAAE,mBAAmB,CAAC;IAC5B,qFAAqF;IACrF,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC7C,mEAAmE;IACnE,IAAI,EAAE,OAAO,CAAC;IACd,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,iGAAiG;IACjG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,OAAO,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Schedule.d.ts","sourceRoot":"","sources":["../../src/Schedule/Schedule.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAQlD,OAAO,KAAK,EAEV,OAAO,EAEP,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,mBAAmB,EAGpB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,aAAa,CAC5B,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,CACzD,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjC,iEAAiE;IACjE,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC5B,sFAAsF;IACtF,MAAM,EAAE,mBAAmB,CAAC;IAC5B,qFAAqF;IACrF,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC7C,mEAAmE;IACnE,IAAI,EAAE,OAAO,CAAC;IACd,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,iGAAiG;IACjG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,OAAO,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACzC;AAiJD,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,MAAM,EACN,UAAe,EACf,IAAI,EACJ,SAAS,EAAE,aAAa,EACxB,YAAY,EACZ,UAAU,EAAE,cAAc,EAC1B,OAAgC,EAChC,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,aAAa,+BA0Ff"}
|
|
@@ -84,8 +84,7 @@ function ScheduleViewContent({
|
|
|
84
84
|
onToday,
|
|
85
85
|
onNextDate,
|
|
86
86
|
nextDateLabel,
|
|
87
|
-
plugins
|
|
88
|
-
headingLevel
|
|
87
|
+
plugins
|
|
89
88
|
}) {
|
|
90
89
|
const Component = view.component;
|
|
91
90
|
const range = getRange(view, date);
|
|
@@ -105,8 +104,7 @@ function ScheduleViewContent({
|
|
|
105
104
|
onNextDate,
|
|
106
105
|
nextDateLabel,
|
|
107
106
|
view,
|
|
108
|
-
plugins
|
|
109
|
-
headingLevel
|
|
107
|
+
plugins
|
|
110
108
|
},
|
|
111
109
|
children: /*#__PURE__*/_jsx(Component, {
|
|
112
110
|
options: view.options
|
|
@@ -122,7 +120,6 @@ export function Schedule({
|
|
|
122
120
|
onChangeDate,
|
|
123
121
|
timezoneID: timezoneIDProp,
|
|
124
122
|
plugins = defaultSchedulePlugins,
|
|
125
|
-
headingLevel = 3,
|
|
126
123
|
xstyle,
|
|
127
124
|
className,
|
|
128
125
|
style,
|
|
@@ -167,8 +164,7 @@ export function Schedule({
|
|
|
167
164
|
onToday: onToday,
|
|
168
165
|
onNextDate: onNextDate,
|
|
169
166
|
nextDateLabel: nextDateRange.label,
|
|
170
|
-
plugins: plugins
|
|
171
|
-
headingLevel: headingLevel
|
|
167
|
+
plugins: plugins
|
|
172
168
|
}),
|
|
173
169
|
children: /*#__PURE__*/_jsx(ScheduleViewContent, {
|
|
174
170
|
view: view,
|
|
@@ -182,8 +178,7 @@ export function Schedule({
|
|
|
182
178
|
onToday: onToday,
|
|
183
179
|
onNextDate: onNextDate,
|
|
184
180
|
nextDateLabel: nextDateRange.label,
|
|
185
|
-
plugins: plugins
|
|
186
|
-
headingLevel: headingLevel
|
|
181
|
+
plugins: plugins
|
|
187
182
|
})
|
|
188
183
|
})
|
|
189
184
|
});
|