@astryxdesign/lab 0.1.4-canary.f767ee2 → 0.1.4-canary.fd7ab46
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/README.md +2 -0
- package/dist/Chart/Chart.js +14 -14
- package/dist/Chart/ChartArea.js +6 -6
- package/dist/Chart/ChartAxis.js +15 -15
- package/dist/Chart/ChartBar.js +5 -5
- package/dist/Chart/ChartBrush.js +6 -6
- package/dist/Chart/ChartCandlestick.js +15 -15
- package/dist/Chart/ChartDot.js +5 -5
- package/dist/Chart/ChartDotGL.js +3 -3
- package/dist/Chart/ChartDotGLInteractive.js +23 -23
- package/dist/Chart/ChartErrorBar.js +9 -9
- package/dist/Chart/ChartGrid.js +6 -6
- package/dist/Chart/ChartHeatmapGL.js +3 -3
- package/dist/Chart/ChartLegend.js +22 -22
- package/dist/Chart/ChartLine.js +6 -6
- package/dist/Chart/ChartReferenceLine.js +17 -17
- package/dist/Chart/ChartSelect.js +7 -7
- package/dist/Chart/ChartStreamGL.js +3 -3
- package/dist/Chart/ChartTooltip.js +28 -28
- package/dist/Chart/ChartZoom.js +27 -27
- package/dist/Chat/ChatEmojiPicker.d.ts +80 -0
- package/dist/Chat/ChatEmojiPicker.d.ts.map +1 -0
- package/dist/Chat/ChatEmojiPicker.js +201 -0
- package/dist/Chat/ChatReactionBar.d.ts +73 -0
- package/dist/Chat/ChatReactionBar.d.ts.map +1 -0
- package/dist/Chat/ChatReactionBar.js +148 -0
- package/dist/Chat/ChatTypingIndicator.d.ts +30 -0
- package/dist/Chat/ChatTypingIndicator.d.ts.map +1 -0
- package/dist/Chat/ChatTypingIndicator.js +112 -0
- package/dist/Chat/ChatUnreadDivider.d.ts +27 -0
- package/dist/Chat/ChatUnreadDivider.d.ts.map +1 -0
- package/dist/Chat/ChatUnreadDivider.js +83 -0
- package/dist/Chat/index.d.ts +15 -0
- package/dist/Chat/index.d.ts.map +1 -0
- package/dist/Chat/index.js +14 -0
- package/dist/ChatReasoning/ChatReasoning.js +36 -36
- package/dist/CircularProgress/CircularProgress.js +13 -13
- package/dist/CodeEditor/CodeEditor.js +13 -13
- package/dist/Drawer/Drawer.d.ts +135 -0
- package/dist/Drawer/Drawer.d.ts.map +1 -0
- package/dist/Drawer/Drawer.js +503 -0
- package/dist/Drawer/index.d.ts +9 -0
- package/dist/Drawer/index.d.ts.map +1 -0
- package/dist/Drawer/index.js +10 -0
- package/dist/InfoTip/InfoTip.js +7 -7
- package/dist/LogStream/LogStream.d.ts +72 -0
- package/dist/LogStream/LogStream.d.ts.map +1 -0
- package/dist/LogStream/LogStream.js +424 -0
- package/dist/LogStream/index.d.ts +3 -0
- package/dist/LogStream/index.d.ts.map +1 -0
- package/dist/LogStream/index.js +5 -0
- package/dist/Radial/RadialArea.js +6 -6
- package/dist/Radial/RadialAxis.js +5 -5
- package/dist/Radial/RadialChart.js +7 -7
- package/dist/Radial/RadialGrid.js +7 -7
- package/dist/Radial/RadialSlice.js +8 -8
- package/dist/Radial/RadialTooltip.js +23 -23
- package/dist/SVGIcon/SVGIcon.js +26 -26
- package/dist/Sankey/SankeyChart.js +9 -9
- package/dist/Sankey/SankeyGrid.js +8 -8
- package/dist/Sankey/SankeyLabel.js +20 -20
- package/dist/Sankey/SankeyLink.js +16 -16
- package/dist/Sankey/SankeyNode.js +8 -8
- package/dist/Schedule/DayView.js +7 -7
- package/dist/Schedule/ListView.js +22 -22
- package/dist/Schedule/MonthlyView.js +32 -32
- package/dist/Schedule/Schedule.js +13 -13
- package/dist/Schedule/TimeGridView.js +66 -66
- package/dist/Schedule/WeeklyView.js +7 -7
- package/dist/Schedule/plugins/PaginationPlugin.js +16 -16
- package/dist/Schedule/plugins/ViewSelectorPlugin.js +13 -13
- package/dist/Schedule/shared.js +47 -47
- package/dist/Stat/Stat.d.ts +98 -0
- package/dist/Stat/Stat.d.ts.map +1 -0
- package/dist/Stat/Stat.js +219 -0
- package/dist/Stat/index.d.ts +9 -0
- package/dist/Stat/index.d.ts.map +1 -0
- package/dist/Stat/index.js +11 -0
- package/dist/Stepper/Step.js +44 -44
- package/dist/Stepper/Stepper.js +5 -5
- package/dist/ThreeD/ThreeDAxis.js +12 -12
- package/dist/ThreeD/ThreeDBar.js +9 -9
- package/dist/ThreeD/ThreeDChart.js +7 -7
- package/dist/ThreeD/ThreeDGrid.js +5 -5
- package/dist/ThreeD/ThreeDScatter.js +5 -5
- package/dist/ThreeD/ThreeDScatterGL.js +3 -3
- package/dist/ThreeD/ThreeDSurface.js +5 -5
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/lab.css +170 -21
- package/package.json +2 -2
- package/src/Chat/ChatEmojiPicker.doc.mjs +68 -0
- package/src/Chat/ChatEmojiPicker.test.tsx +143 -0
- package/src/Chat/ChatEmojiPicker.tsx +287 -0
- package/src/Chat/ChatReactionBar.doc.mjs +73 -0
- package/src/Chat/ChatReactionBar.test.tsx +124 -0
- package/src/Chat/ChatReactionBar.tsx +290 -0
- package/src/Chat/ChatTypingIndicator.doc.mjs +35 -0
- package/src/Chat/ChatTypingIndicator.test.tsx +48 -0
- package/src/Chat/ChatTypingIndicator.tsx +158 -0
- package/src/Chat/ChatUnreadDivider.doc.mjs +36 -0
- package/src/Chat/ChatUnreadDivider.test.tsx +35 -0
- package/src/Chat/ChatUnreadDivider.tsx +113 -0
- package/src/Chat/index.ts +22 -0
- package/src/Drawer/Drawer.doc.mjs +157 -0
- package/src/Drawer/Drawer.test.tsx +636 -0
- package/src/Drawer/Drawer.tsx +741 -0
- package/src/Drawer/index.ts +11 -0
- package/src/LogStream/LogStream.doc.mjs +17 -0
- package/src/LogStream/LogStream.test.tsx +238 -0
- package/src/LogStream/LogStream.tsx +564 -0
- package/src/LogStream/index.ts +6 -0
- package/src/Stat/Stat.doc.mjs +162 -0
- package/src/Stat/Stat.test.tsx +143 -0
- package/src/Stat/Stat.tsx +298 -0
- package/src/Stat/index.ts +19 -0
- package/src/index.ts +22 -0
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@ Components in lab:
|
|
|
12
12
|
- Compose with `@astryxdesign/core` components (use the theme, follow naming conventions)
|
|
13
13
|
- Graduate to `@astryxdesign/core` after thorough engineering review
|
|
14
14
|
|
|
15
|
+
See the **[Component Lifecycle](https://github.com/facebook/astryx/wiki/Component-Lifecycle)** wiki for how a component moves from lab → core (and the promotion gates), and the **[Component Hardening Protocol](https://github.com/facebook/astryx/wiki/Component-Hardening-Protocol)** for the bar a component must clear to graduate.
|
|
16
|
+
|
|
15
17
|
## What's here vs what's in core
|
|
16
18
|
|
|
17
19
|
**Lab:** Works, has basic props, maybe has stories. API might change. Not accessibility-hardened, not vibe-tested, not fully themed. **Canary-only — no stability promise.**
|
package/dist/Chart/Chart.js
CHANGED
|
@@ -20,7 +20,7 @@ import { ChartProvider } from "./ChartContext.js";
|
|
|
20
20
|
* - `'zero'` — symmetric range centered on 0 (good for +/- data)
|
|
21
21
|
* - `'data'` — tight fit to data extent only (no forced zero)
|
|
22
22
|
*/
|
|
23
|
-
import {
|
|
23
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
24
24
|
const DEFAULT_MARGIN = {
|
|
25
25
|
top: 16,
|
|
26
26
|
right: 16,
|
|
@@ -215,33 +215,33 @@ export function Chart({
|
|
|
215
215
|
touchAction: interactive ? 'none' : undefined,
|
|
216
216
|
userSelect: interactive ? 'none' : undefined
|
|
217
217
|
};
|
|
218
|
-
return /*#__PURE__*/
|
|
218
|
+
return /*#__PURE__*/_jsxDEV("div", {
|
|
219
219
|
ref: containerRef,
|
|
220
220
|
style: containerStyle,
|
|
221
|
-
children: containerWidth > 0 && /*#__PURE__*/
|
|
221
|
+
children: containerWidth > 0 && /*#__PURE__*/_jsxDEV("svg", {
|
|
222
222
|
ref: svgRef,
|
|
223
223
|
width: containerWidth,
|
|
224
224
|
height: height,
|
|
225
225
|
style: interactive ? {
|
|
226
226
|
touchAction: 'none'
|
|
227
227
|
} : undefined,
|
|
228
|
-
children: [/*#__PURE__*/
|
|
229
|
-
children: /*#__PURE__*/
|
|
228
|
+
children: [/*#__PURE__*/_jsxDEV("defs", {
|
|
229
|
+
children: /*#__PURE__*/_jsxDEV("clipPath", {
|
|
230
230
|
id: "astryx-chart-plot",
|
|
231
|
-
children: /*#__PURE__*/
|
|
231
|
+
children: /*#__PURE__*/_jsxDEV("rect", {
|
|
232
232
|
x: 0,
|
|
233
233
|
y: 0,
|
|
234
234
|
width: innerWidth,
|
|
235
235
|
height: innerHeight
|
|
236
|
-
})
|
|
237
|
-
})
|
|
238
|
-
}), /*#__PURE__*/
|
|
236
|
+
}, void 0, false)
|
|
237
|
+
}, void 0, false)
|
|
238
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("g", {
|
|
239
239
|
transform: `translate(${margin.left},${margin.top})`,
|
|
240
|
-
children: /*#__PURE__*/
|
|
240
|
+
children: /*#__PURE__*/_jsxDEV(ChartProvider, {
|
|
241
241
|
value: ctx,
|
|
242
242
|
children: children
|
|
243
|
-
})
|
|
244
|
-
})]
|
|
245
|
-
})
|
|
246
|
-
});
|
|
243
|
+
}, void 0, false)
|
|
244
|
+
}, void 0, false)]
|
|
245
|
+
}, void 0, true)
|
|
246
|
+
}, void 0, false);
|
|
247
247
|
}
|
package/dist/Chart/ChartArea.js
CHANGED
|
@@ -10,7 +10,7 @@ import { useMemo } from 'react';
|
|
|
10
10
|
import { area, curveMonotoneX } from 'd3-shape';
|
|
11
11
|
import { useChart } from "./ChartContext.js";
|
|
12
12
|
import { xPixel } from "./utils.js";
|
|
13
|
-
import {
|
|
13
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
14
14
|
/**
|
|
15
15
|
* Area band between two y-values. Use for confidence intervals, error ranges,
|
|
16
16
|
* or any min/max band around a line.
|
|
@@ -54,18 +54,18 @@ export function ChartArea({
|
|
|
54
54
|
if (!pathD) {
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
children: [/*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
58
|
+
children: [/*#__PURE__*/_jsxDEV("path", {
|
|
59
59
|
d: pathD,
|
|
60
60
|
fill: color,
|
|
61
61
|
fillOpacity: opacity,
|
|
62
62
|
stroke: "none"
|
|
63
|
-
}), stroke && /*#__PURE__*/
|
|
63
|
+
}, void 0, false), stroke && /*#__PURE__*/_jsxDEV("path", {
|
|
64
64
|
d: pathD,
|
|
65
65
|
fill: "none",
|
|
66
66
|
stroke: color,
|
|
67
67
|
strokeWidth: strokeWidth,
|
|
68
68
|
strokeOpacity: opacity * 2
|
|
69
|
-
})]
|
|
70
|
-
});
|
|
69
|
+
}, void 0, false)]
|
|
70
|
+
}, void 0, true);
|
|
71
71
|
}
|
package/dist/Chart/ChartAxis.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { useMemo } from 'react';
|
|
12
12
|
import { useChart } from "./ChartContext.js";
|
|
13
13
|
import { isBandScale } from "./utils.js";
|
|
14
|
-
import {
|
|
14
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
15
15
|
/**
|
|
16
16
|
* Chart axis. Renders tick marks and labels for the x or y dimension.
|
|
17
17
|
* Ticks transition smoothly when the scale domain shifts (e.g. streaming).
|
|
@@ -84,16 +84,16 @@ export function ChartAxis({
|
|
|
84
84
|
|
|
85
85
|
// Transition style for smooth tick movement during streaming
|
|
86
86
|
const tickTransition = animated ? 'transform 150ms linear, opacity 150ms ease' : undefined;
|
|
87
|
-
return /*#__PURE__*/
|
|
87
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
88
88
|
transform: transform,
|
|
89
|
-
children: [/*#__PURE__*/
|
|
89
|
+
children: [/*#__PURE__*/_jsxDEV("line", {
|
|
90
90
|
x1: isHorizontal ? 0 : 0,
|
|
91
91
|
x2: isHorizontal ? width : 0,
|
|
92
92
|
y1: isHorizontal ? axisLineY : 0,
|
|
93
93
|
y2: isHorizontal ? axisLineY : height,
|
|
94
94
|
stroke: "var(--color-border-emphasized)",
|
|
95
95
|
strokeWidth: 1
|
|
96
|
-
}), ticks.map(({
|
|
96
|
+
}, void 0, false), ticks.map(({
|
|
97
97
|
value,
|
|
98
98
|
offset
|
|
99
99
|
}) => {
|
|
@@ -102,46 +102,46 @@ export function ChartAxis({
|
|
|
102
102
|
const isVisible = isHorizontal ? offset >= -10 && offset <= width + 10 : offset >= -10 && offset <= height + 10;
|
|
103
103
|
if (isHorizontal) {
|
|
104
104
|
const y = position === 'bottom' ? tickSize : -tickSize;
|
|
105
|
-
return /*#__PURE__*/
|
|
105
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
106
106
|
style: {
|
|
107
107
|
transform: `translateX(${offset}px)`,
|
|
108
108
|
transition: tickTransition,
|
|
109
109
|
opacity: isVisible ? 1 : 0
|
|
110
110
|
},
|
|
111
|
-
children: [/*#__PURE__*/
|
|
111
|
+
children: [/*#__PURE__*/_jsxDEV("line", {
|
|
112
112
|
y2: y,
|
|
113
113
|
stroke: "var(--color-border-emphasized)",
|
|
114
114
|
strokeWidth: 1
|
|
115
|
-
}), /*#__PURE__*/
|
|
115
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("text", {
|
|
116
116
|
y: position === 'bottom' ? tickSize + 12 : -(tickSize + 4),
|
|
117
117
|
textAnchor: "middle",
|
|
118
118
|
fill: "var(--color-text-secondary)",
|
|
119
119
|
fontSize: 12,
|
|
120
120
|
children: label
|
|
121
|
-
})]
|
|
122
|
-
}, label);
|
|
121
|
+
}, void 0, false)]
|
|
122
|
+
}, label, true);
|
|
123
123
|
}
|
|
124
124
|
// Vertical axis
|
|
125
125
|
const x = position === 'left' ? -tickSize : tickSize;
|
|
126
|
-
return /*#__PURE__*/
|
|
126
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
127
127
|
style: {
|
|
128
128
|
transform: `translateY(${offset}px)`,
|
|
129
129
|
transition: tickTransition,
|
|
130
130
|
opacity: isVisible ? 1 : 0
|
|
131
131
|
},
|
|
132
|
-
children: [/*#__PURE__*/
|
|
132
|
+
children: [/*#__PURE__*/_jsxDEV("line", {
|
|
133
133
|
x2: x,
|
|
134
134
|
stroke: "var(--color-border-emphasized)",
|
|
135
135
|
strokeWidth: 1
|
|
136
|
-
}), /*#__PURE__*/
|
|
136
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("text", {
|
|
137
137
|
x: position === 'left' ? -(tickSize + 4) : tickSize + 4,
|
|
138
138
|
dy: "0.32em",
|
|
139
139
|
textAnchor: position === 'left' ? 'end' : 'start',
|
|
140
140
|
fill: "var(--color-text-secondary)",
|
|
141
141
|
fontSize: 12,
|
|
142
142
|
children: label
|
|
143
|
-
})]
|
|
144
|
-
}, label);
|
|
143
|
+
}, void 0, false)]
|
|
144
|
+
}, label, true);
|
|
145
145
|
})]
|
|
146
|
-
});
|
|
146
|
+
}, void 0, true);
|
|
147
147
|
}
|
package/dist/Chart/ChartBar.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useChart } from "./ChartContext.js";
|
|
10
10
|
import { isBandScale } from "./utils.js";
|
|
11
|
-
import {
|
|
11
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
12
12
|
/**
|
|
13
13
|
* Bar marks. Requires a band xScale (categorical x-axis).
|
|
14
14
|
* Bars grow from the zero line — handles both positive and negative values.
|
|
@@ -35,7 +35,7 @@ export function ChartBar({
|
|
|
35
35
|
|
|
36
36
|
// Zero line position — bars grow from here
|
|
37
37
|
const zeroY = yScale(0);
|
|
38
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
39
39
|
children: data.map((d, i) => {
|
|
40
40
|
const xVal = xScale(String(d[xKey]));
|
|
41
41
|
if (xVal == null) {
|
|
@@ -47,7 +47,7 @@ export function ChartBar({
|
|
|
47
47
|
// Bar grows from zero line toward the value
|
|
48
48
|
const barY = Math.min(yPos, zeroY);
|
|
49
49
|
const barHeight = Math.abs(yPos - zeroY);
|
|
50
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/_jsxDEV("rect", {
|
|
51
51
|
x: xVal,
|
|
52
52
|
y: barY,
|
|
53
53
|
width: xScale.bandwidth(),
|
|
@@ -55,7 +55,7 @@ export function ChartBar({
|
|
|
55
55
|
fill: color,
|
|
56
56
|
rx: radius,
|
|
57
57
|
ry: radius
|
|
58
|
-
}, i);
|
|
58
|
+
}, i, false);
|
|
59
59
|
})
|
|
60
|
-
});
|
|
60
|
+
}, void 0, false);
|
|
61
61
|
}
|
package/dist/Chart/ChartBrush.js
CHANGED
|
@@ -15,7 +15,7 @@ import { isBandScale } from "./utils.js";
|
|
|
15
15
|
* - `'x'` — horizontal range selection (default)
|
|
16
16
|
* - `'xy'` — 2D rectangular selection
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
19
19
|
function localCoords(e) {
|
|
20
20
|
const svg = e.currentTarget.ownerSVGElement;
|
|
21
21
|
if (!svg) {
|
|
@@ -168,8 +168,8 @@ export function ChartBrush({
|
|
|
168
168
|
touchAction: 'none',
|
|
169
169
|
userSelect: 'none'
|
|
170
170
|
};
|
|
171
|
-
return /*#__PURE__*/
|
|
172
|
-
children: [/*#__PURE__*/
|
|
171
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
172
|
+
children: [/*#__PURE__*/_jsxDEV("rect", {
|
|
173
173
|
x: 0,
|
|
174
174
|
y: 0,
|
|
175
175
|
width: width,
|
|
@@ -180,7 +180,7 @@ export function ChartBrush({
|
|
|
180
180
|
onPointerMove: onPointerMove,
|
|
181
181
|
onPointerUp: onPointerUp,
|
|
182
182
|
onPointerCancel: onPointerUp
|
|
183
|
-
}), brush && (rectW > 1 || rectH > 1) && /*#__PURE__*/
|
|
183
|
+
}, void 0, false), brush && (rectW > 1 || rectH > 1) && /*#__PURE__*/_jsxDEV("rect", {
|
|
184
184
|
x: rectX,
|
|
185
185
|
y: rectY,
|
|
186
186
|
width: rectW,
|
|
@@ -192,6 +192,6 @@ export function ChartBrush({
|
|
|
192
192
|
strokeOpacity: 0.4,
|
|
193
193
|
rx: mode === 'xy' ? 2 : 0,
|
|
194
194
|
pointerEvents: "none"
|
|
195
|
-
})]
|
|
196
|
-
});
|
|
195
|
+
}, void 0, false)]
|
|
196
|
+
}, void 0, true);
|
|
197
197
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { useChart } from "./ChartContext.js";
|
|
14
14
|
import { isBandScale } from "./utils.js";
|
|
15
|
-
import {
|
|
15
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
16
16
|
/**
|
|
17
17
|
* Candlestick / box-whisker marks.
|
|
18
18
|
*
|
|
@@ -56,7 +56,7 @@ export function ChartCandlestick({
|
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
58
|
const bw = xScale.bandwidth();
|
|
59
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
60
60
|
children: data.map((d, i) => {
|
|
61
61
|
const xVal = xScale(String(d[xKey]));
|
|
62
62
|
if (xVal == null) {
|
|
@@ -78,52 +78,52 @@ export function ChartCandlestick({
|
|
|
78
78
|
if (variant === 'bar') {
|
|
79
79
|
// OHLC bar: vertical line (high→low), left tick at open, right tick at close
|
|
80
80
|
const tickLen = bw * bodyWidth * 0.4;
|
|
81
|
-
return /*#__PURE__*/
|
|
82
|
-
children: [/*#__PURE__*/
|
|
81
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
82
|
+
children: [/*#__PURE__*/_jsxDEV("line", {
|
|
83
83
|
x1: centerX,
|
|
84
84
|
x2: centerX,
|
|
85
85
|
y1: yHigh,
|
|
86
86
|
y2: yLow,
|
|
87
87
|
stroke: fill,
|
|
88
88
|
strokeWidth: strokeWidth
|
|
89
|
-
}), /*#__PURE__*/
|
|
89
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("line", {
|
|
90
90
|
x1: centerX - tickLen,
|
|
91
91
|
x2: centerX,
|
|
92
92
|
y1: yOpen,
|
|
93
93
|
y2: yOpen,
|
|
94
94
|
stroke: fill,
|
|
95
95
|
strokeWidth: strokeWidth
|
|
96
|
-
}), /*#__PURE__*/
|
|
96
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("line", {
|
|
97
97
|
x1: centerX,
|
|
98
98
|
x2: centerX + tickLen,
|
|
99
99
|
y1: yClose,
|
|
100
100
|
y2: yClose,
|
|
101
101
|
stroke: fill,
|
|
102
102
|
strokeWidth: strokeWidth
|
|
103
|
-
})]
|
|
104
|
-
}, i);
|
|
103
|
+
}, void 0, false)]
|
|
104
|
+
}, i, true);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// Default variant: filled body with whiskers
|
|
108
108
|
const bodyW = bw * bodyWidth;
|
|
109
109
|
const bodyX = centerX - bodyW / 2;
|
|
110
110
|
const bodyH = Math.max(1, bodyBot - bodyTop);
|
|
111
|
-
return /*#__PURE__*/
|
|
112
|
-
children: [/*#__PURE__*/
|
|
111
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
112
|
+
children: [/*#__PURE__*/_jsxDEV("line", {
|
|
113
113
|
x1: centerX,
|
|
114
114
|
x2: centerX,
|
|
115
115
|
y1: yHigh,
|
|
116
116
|
y2: bodyTop,
|
|
117
117
|
stroke: fill,
|
|
118
118
|
strokeWidth: strokeWidth
|
|
119
|
-
}), /*#__PURE__*/
|
|
119
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("line", {
|
|
120
120
|
x1: centerX,
|
|
121
121
|
x2: centerX,
|
|
122
122
|
y1: bodyBot,
|
|
123
123
|
y2: yLow,
|
|
124
124
|
stroke: fill,
|
|
125
125
|
strokeWidth: strokeWidth
|
|
126
|
-
}), /*#__PURE__*/
|
|
126
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("rect", {
|
|
127
127
|
x: bodyX,
|
|
128
128
|
y: bodyTop,
|
|
129
129
|
width: bodyW,
|
|
@@ -131,8 +131,8 @@ export function ChartCandlestick({
|
|
|
131
131
|
fill: fill,
|
|
132
132
|
rx: radius,
|
|
133
133
|
ry: radius
|
|
134
|
-
})]
|
|
135
|
-
}, i);
|
|
134
|
+
}, void 0, false)]
|
|
135
|
+
}, i, true);
|
|
136
136
|
})
|
|
137
|
-
});
|
|
137
|
+
}, void 0, false);
|
|
138
138
|
}
|
package/dist/Chart/ChartDot.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useChart } from "./ChartContext.js";
|
|
10
10
|
import { xPixel } from "./utils.js";
|
|
11
|
-
import {
|
|
11
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
12
12
|
/**
|
|
13
13
|
* Scatter dot marks.
|
|
14
14
|
*
|
|
@@ -28,16 +28,16 @@ export function ChartDot({
|
|
|
28
28
|
xScale,
|
|
29
29
|
yScale
|
|
30
30
|
} = useChart();
|
|
31
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
32
32
|
children: data.map((d, i) => {
|
|
33
33
|
const x = xPixel(d, xKey, xScale);
|
|
34
34
|
const yVal = typeof d[dataKey] === 'number' ? d[dataKey] : 0;
|
|
35
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/_jsxDEV("circle", {
|
|
36
36
|
cx: x,
|
|
37
37
|
cy: yScale(yVal),
|
|
38
38
|
r: radius,
|
|
39
39
|
fill: color
|
|
40
|
-
}, i);
|
|
40
|
+
}, i, false);
|
|
41
41
|
})
|
|
42
|
-
});
|
|
42
|
+
}, void 0, false);
|
|
43
43
|
}
|
package/dist/Chart/ChartDotGL.js
CHANGED
|
@@ -10,7 +10,7 @@ import { useRef, useEffect, useCallback } from 'react';
|
|
|
10
10
|
import { useChart } from "./ChartContext.js";
|
|
11
11
|
import { xPixel } from "./utils.js";
|
|
12
12
|
import { hexToGL, getWebGLContext, setupGLState, sizeCanvas, mountCanvasOverSVG, createProgram, POINT_SIZE_COMPENSATION } from "./webgl.js";
|
|
13
|
-
import {
|
|
13
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
14
14
|
const VERT = `
|
|
15
15
|
attribute vec2 a_position;
|
|
16
16
|
uniform vec2 u_resolution;
|
|
@@ -129,7 +129,7 @@ export function ChartDotGL({
|
|
|
129
129
|
if (width <= 0 || height <= 0) {
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
return /*#__PURE__*/
|
|
132
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
133
133
|
ref: markerRef
|
|
134
|
-
});
|
|
134
|
+
}, void 0, false);
|
|
135
135
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { useRef, useEffect, useCallback, useState, useMemo } from 'react';
|
|
14
14
|
import { useChart } from "./ChartContext.js";
|
|
15
15
|
import { xPixel } from "./utils.js";
|
|
16
|
-
import {
|
|
16
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
17
17
|
function hexToGL(hex) {
|
|
18
18
|
const n = parseInt(hex.replace('#', ''), 16);
|
|
19
19
|
return [(n >> 16) / 255, (n >> 8 & 0xff) / 255, (n & 0xff) / 255];
|
|
@@ -342,38 +342,38 @@ export function ChartDotGLInteractive({
|
|
|
342
342
|
setMousePos(null);
|
|
343
343
|
}, []);
|
|
344
344
|
const datum = hoverIndex >= 0 && hoverIndex < data.length ? data[hoverIndex] : null;
|
|
345
|
-
const defaultTooltip = (d, i) => /*#__PURE__*/
|
|
345
|
+
const defaultTooltip = (d, i) => /*#__PURE__*/_jsxDEV("div", {
|
|
346
346
|
style: {
|
|
347
347
|
display: 'flex',
|
|
348
348
|
flexDirection: 'column',
|
|
349
349
|
gap: 2,
|
|
350
350
|
fontSize: 12
|
|
351
351
|
},
|
|
352
|
-
children: [/*#__PURE__*/
|
|
352
|
+
children: [/*#__PURE__*/_jsxDEV("div", {
|
|
353
353
|
style: {
|
|
354
354
|
fontWeight: 600,
|
|
355
355
|
color: 'var(--color-text-primary)'
|
|
356
356
|
},
|
|
357
357
|
children: ["Point ", i]
|
|
358
|
-
}), Object.entries(d).map(([k, v]) => /*#__PURE__*/
|
|
359
|
-
children: [/*#__PURE__*/
|
|
358
|
+
}, void 0, true), Object.entries(d).map(([k, v]) => /*#__PURE__*/_jsxDEV("div", {
|
|
359
|
+
children: [/*#__PURE__*/_jsxDEV("span", {
|
|
360
360
|
style: {
|
|
361
361
|
color: 'var(--color-text-secondary)'
|
|
362
362
|
},
|
|
363
363
|
children: [k, ":"]
|
|
364
|
-
}), ' ', /*#__PURE__*/
|
|
364
|
+
}, void 0, true), ' ', /*#__PURE__*/_jsxDEV("span", {
|
|
365
365
|
style: {
|
|
366
366
|
fontWeight: 500
|
|
367
367
|
},
|
|
368
368
|
children: String(v)
|
|
369
|
-
})]
|
|
370
|
-
}, k))]
|
|
371
|
-
});
|
|
369
|
+
}, void 0, false)]
|
|
370
|
+
}, k, true))]
|
|
371
|
+
}, void 0, true);
|
|
372
372
|
if (width <= 0 || height <= 0) {
|
|
373
373
|
return null;
|
|
374
374
|
}
|
|
375
|
-
return /*#__PURE__*/
|
|
376
|
-
children: [/*#__PURE__*/
|
|
375
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
376
|
+
children: [/*#__PURE__*/_jsxDEV("foreignObject", {
|
|
377
377
|
x: 0,
|
|
378
378
|
y: 0,
|
|
379
379
|
width: width,
|
|
@@ -381,15 +381,15 @@ export function ChartDotGLInteractive({
|
|
|
381
381
|
style: {
|
|
382
382
|
overflow: 'hidden'
|
|
383
383
|
},
|
|
384
|
-
children: /*#__PURE__*/
|
|
384
|
+
children: /*#__PURE__*/_jsxDEV("canvas", {
|
|
385
385
|
ref: visCanvasRef,
|
|
386
386
|
style: {
|
|
387
387
|
width,
|
|
388
388
|
height,
|
|
389
389
|
pointerEvents: 'none'
|
|
390
390
|
}
|
|
391
|
-
})
|
|
392
|
-
}), /*#__PURE__*/
|
|
391
|
+
}, void 0, false)
|
|
392
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("foreignObject", {
|
|
393
393
|
x: 0,
|
|
394
394
|
y: 0,
|
|
395
395
|
width: 0,
|
|
@@ -397,13 +397,13 @@ export function ChartDotGLInteractive({
|
|
|
397
397
|
style: {
|
|
398
398
|
overflow: 'hidden'
|
|
399
399
|
},
|
|
400
|
-
children: /*#__PURE__*/
|
|
400
|
+
children: /*#__PURE__*/_jsxDEV("canvas", {
|
|
401
401
|
ref: pickCanvasRef,
|
|
402
402
|
style: {
|
|
403
403
|
display: 'none'
|
|
404
404
|
}
|
|
405
|
-
})
|
|
406
|
-
}), /*#__PURE__*/
|
|
405
|
+
}, void 0, false)
|
|
406
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("rect", {
|
|
407
407
|
x: 0,
|
|
408
408
|
y: 0,
|
|
409
409
|
width: width,
|
|
@@ -411,7 +411,7 @@ export function ChartDotGLInteractive({
|
|
|
411
411
|
fill: "transparent",
|
|
412
412
|
onMouseMove: handleMouseMove,
|
|
413
413
|
onMouseLeave: handleMouseLeave
|
|
414
|
-
}), datum && hoverIndex >= 0 && /*#__PURE__*/
|
|
414
|
+
}, void 0, false), datum && hoverIndex >= 0 && /*#__PURE__*/_jsxDEV("circle", {
|
|
415
415
|
cx: positions[hoverIndex * 2],
|
|
416
416
|
cy: positions[hoverIndex * 2 + 1],
|
|
417
417
|
r: size / 2 + 3,
|
|
@@ -420,7 +420,7 @@ export function ChartDotGLInteractive({
|
|
|
420
420
|
strokeWidth: 2,
|
|
421
421
|
strokeOpacity: 0.8,
|
|
422
422
|
pointerEvents: "none"
|
|
423
|
-
}), datum && mousePos && /*#__PURE__*/
|
|
423
|
+
}, void 0, false), datum && mousePos && /*#__PURE__*/_jsxDEV("foreignObject", {
|
|
424
424
|
x: mousePos.x + 12,
|
|
425
425
|
y: Math.max(0, mousePos.y - 40),
|
|
426
426
|
width: 200,
|
|
@@ -429,7 +429,7 @@ export function ChartDotGLInteractive({
|
|
|
429
429
|
style: {
|
|
430
430
|
overflow: 'visible'
|
|
431
431
|
},
|
|
432
|
-
children: /*#__PURE__*/
|
|
432
|
+
children: /*#__PURE__*/_jsxDEV("div", {
|
|
433
433
|
style: {
|
|
434
434
|
background: 'var(--color-background-popover)',
|
|
435
435
|
border: '1px solid var(--color-border)',
|
|
@@ -440,7 +440,7 @@ export function ChartDotGLInteractive({
|
|
|
440
440
|
width: 'fit-content'
|
|
441
441
|
},
|
|
442
442
|
children: renderTooltip ? renderTooltip(datum, hoverIndex) : defaultTooltip(datum, hoverIndex)
|
|
443
|
-
})
|
|
444
|
-
})]
|
|
445
|
-
});
|
|
443
|
+
}, void 0, false)
|
|
444
|
+
}, void 0, false)]
|
|
445
|
+
}, void 0, true);
|
|
446
446
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useChart } from "./ChartContext.js";
|
|
10
10
|
import { xPixel } from "./utils.js";
|
|
11
|
-
import {
|
|
11
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
12
12
|
/**
|
|
13
13
|
* Error bars with whisker caps. Pair with ChartBar or ChartDot.
|
|
14
14
|
*
|
|
@@ -31,7 +31,7 @@ export function ChartErrorBar({
|
|
|
31
31
|
xScale,
|
|
32
32
|
yScale
|
|
33
33
|
} = useChart();
|
|
34
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
35
35
|
children: data.map((d, i) => {
|
|
36
36
|
const x = xPixel(d, xKey, xScale);
|
|
37
37
|
const upper = typeof d[yUpper] === 'number' ? d[yUpper] : 0;
|
|
@@ -39,30 +39,30 @@ export function ChartErrorBar({
|
|
|
39
39
|
const yTop = yScale(upper);
|
|
40
40
|
const yBot = yScale(lower);
|
|
41
41
|
const half = capWidth / 2;
|
|
42
|
-
return /*#__PURE__*/
|
|
43
|
-
children: [/*#__PURE__*/
|
|
42
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
43
|
+
children: [/*#__PURE__*/_jsxDEV("line", {
|
|
44
44
|
x1: x,
|
|
45
45
|
x2: x,
|
|
46
46
|
y1: yTop,
|
|
47
47
|
y2: yBot,
|
|
48
48
|
stroke: color,
|
|
49
49
|
strokeWidth: strokeWidth
|
|
50
|
-
}), /*#__PURE__*/
|
|
50
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("line", {
|
|
51
51
|
x1: x - half,
|
|
52
52
|
x2: x + half,
|
|
53
53
|
y1: yTop,
|
|
54
54
|
y2: yTop,
|
|
55
55
|
stroke: color,
|
|
56
56
|
strokeWidth: strokeWidth
|
|
57
|
-
}), /*#__PURE__*/
|
|
57
|
+
}, void 0, false), /*#__PURE__*/_jsxDEV("line", {
|
|
58
58
|
x1: x - half,
|
|
59
59
|
x2: x + half,
|
|
60
60
|
y1: yBot,
|
|
61
61
|
y2: yBot,
|
|
62
62
|
stroke: color,
|
|
63
63
|
strokeWidth: strokeWidth
|
|
64
|
-
})]
|
|
65
|
-
}, i);
|
|
64
|
+
}, void 0, false)]
|
|
65
|
+
}, i, true);
|
|
66
66
|
})
|
|
67
|
-
});
|
|
67
|
+
}, void 0, false);
|
|
68
68
|
}
|
package/dist/Chart/ChartGrid.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { useMemo } from 'react';
|
|
10
10
|
import { useChart } from "./ChartContext.js";
|
|
11
11
|
import { isBandScale } from "./utils.js";
|
|
12
|
-
import {
|
|
12
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
13
13
|
/**
|
|
14
14
|
* Grid lines behind chart marks.
|
|
15
15
|
*
|
|
@@ -45,8 +45,8 @@ export function ChartGrid({
|
|
|
45
45
|
const linear = xScale;
|
|
46
46
|
return linear.ticks(5).map(d => linear(d));
|
|
47
47
|
}, [vertical, xScale]);
|
|
48
|
-
return /*#__PURE__*/
|
|
49
|
-
children: [hLines.map(y => /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
49
|
+
children: [hLines.map(y => /*#__PURE__*/_jsxDEV("line", {
|
|
50
50
|
x1: 0,
|
|
51
51
|
x2: width,
|
|
52
52
|
y1: y,
|
|
@@ -54,7 +54,7 @@ export function ChartGrid({
|
|
|
54
54
|
stroke: "var(--color-border)",
|
|
55
55
|
strokeOpacity: 0.5,
|
|
56
56
|
strokeDasharray: "4 4"
|
|
57
|
-
}, `h-${y}
|
|
57
|
+
}, `h-${y}`, false)), vLines.map(x => /*#__PURE__*/_jsxDEV("line", {
|
|
58
58
|
x1: x,
|
|
59
59
|
x2: x,
|
|
60
60
|
y1: 0,
|
|
@@ -62,6 +62,6 @@ export function ChartGrid({
|
|
|
62
62
|
stroke: "var(--color-border)",
|
|
63
63
|
strokeOpacity: 0.5,
|
|
64
64
|
strokeDasharray: "4 4"
|
|
65
|
-
}, `v-${x}
|
|
66
|
-
});
|
|
65
|
+
}, `v-${x}`, false))]
|
|
66
|
+
}, void 0, true);
|
|
67
67
|
}
|
|
@@ -11,7 +11,7 @@ import { scaleBand } from 'd3-scale';
|
|
|
11
11
|
import { useChart } from "./ChartContext.js";
|
|
12
12
|
import { isBandScale } from "./utils.js";
|
|
13
13
|
import { hexToGL, getWebGLContext, setupGLState, sizeCanvas, mountCanvasOverSVG, createProgram } from "./webgl.js";
|
|
14
|
-
import {
|
|
14
|
+
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
15
15
|
const VERT = `
|
|
16
16
|
attribute vec2 a_position;
|
|
17
17
|
attribute vec3 a_color;
|
|
@@ -165,7 +165,7 @@ export function ChartHeatmapGL({
|
|
|
165
165
|
if (width <= 0 || height <= 0) {
|
|
166
166
|
return null;
|
|
167
167
|
}
|
|
168
|
-
return /*#__PURE__*/
|
|
168
|
+
return /*#__PURE__*/_jsxDEV("g", {
|
|
169
169
|
ref: markerRef
|
|
170
|
-
});
|
|
170
|
+
}, void 0, false);
|
|
171
171
|
}
|