@canplot/react 0.1.0 → 0.1.2
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 +37 -5
- package/dist/CanPlot.d.ts +9 -0
- package/dist/CanPlot.d.ts.map +1 -0
- package/dist/axes.d.ts +18 -0
- package/dist/axes.d.ts.map +1 -0
- package/dist/defaults.d.ts +12 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/frameContext.d.ts +18 -0
- package/dist/frameContext.d.ts.map +1 -0
- package/dist/helpers.d.ts +14 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/interactions/AxisOverlay.d.ts +5 -0
- package/dist/interactions/AxisOverlay.d.ts.map +1 -0
- package/dist/interactions/ChartAreaInteractions.d.ts +22 -0
- package/dist/interactions/ChartAreaInteractions.d.ts.map +1 -0
- package/dist/interactions/CrossHair.d.ts +9 -0
- package/dist/interactions/CrossHair.d.ts.map +1 -0
- package/dist/interactions/SelectBox.d.ts +7 -0
- package/dist/interactions/SelectBox.d.ts.map +1 -0
- package/dist/interactions/TooltipsX.d.ts +23 -0
- package/dist/interactions/TooltipsX.d.ts.map +1 -0
- package/dist/interactions/TooltipsXY.d.ts +23 -0
- package/dist/interactions/TooltipsXY.d.ts.map +1 -0
- package/dist/interactions/interactionsBus.d.ts +73 -0
- package/dist/interactions/interactionsBus.d.ts.map +1 -0
- package/dist/interactions/positioning.d.ts +14 -0
- package/dist/interactions/positioning.d.ts.map +1 -0
- package/dist/interactions/types.d.ts +118 -0
- package/dist/interactions/types.d.ts.map +1 -0
- package/dist/plot/AnnotationX.d.ts +6 -0
- package/dist/plot/AnnotationX.d.ts.map +1 -0
- package/dist/plot/AreaPlot.d.ts +13 -0
- package/dist/plot/AreaPlot.d.ts.map +1 -0
- package/dist/plot/BarPlot.d.ts +16 -0
- package/dist/plot/BarPlot.d.ts.map +1 -0
- package/dist/plot/LinePlot.d.ts +13 -0
- package/dist/plot/LinePlot.d.ts.map +1 -0
- package/dist/plot/ScatterPlot.d.ts +14 -0
- package/dist/plot/ScatterPlot.d.ts.map +1 -0
- package/dist/plot/SparklinePlot.d.ts +14 -0
- package/dist/plot/SparklinePlot.d.ts.map +1 -0
- package/dist/time.d.ts +14 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/types.d.ts +86 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
A high-performance React charting library built on Canvas.
|
|
4
4
|
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
📚 [View live examples and documentation](https://jedzej.github.io/canplot/)
|
|
8
|
+
|
|
5
9
|
## Features
|
|
6
10
|
|
|
7
11
|
- 🚀 **High Performance**: Built on Canvas for smooth rendering of large datasets
|
|
@@ -15,19 +19,19 @@ A high-performance React charting library built on Canvas.
|
|
|
15
19
|
## Installation
|
|
16
20
|
|
|
17
21
|
```bash
|
|
18
|
-
npm install canplot
|
|
22
|
+
npm install @canplot/react
|
|
19
23
|
# or
|
|
20
|
-
yarn add canplot
|
|
24
|
+
yarn add @canplot/react
|
|
21
25
|
# or
|
|
22
|
-
pnpm add canplot
|
|
26
|
+
pnpm add @canplot/react
|
|
23
27
|
# or
|
|
24
|
-
bun add canplot
|
|
28
|
+
bun add @canplot/react
|
|
25
29
|
```
|
|
26
30
|
|
|
27
31
|
## Quick Start
|
|
28
32
|
|
|
29
33
|
```tsx
|
|
30
|
-
import { CanPlot, LinePlot } from 'canplot';
|
|
34
|
+
import { CanPlot, LinePlot } from '@canplot/react';
|
|
31
35
|
|
|
32
36
|
function MyChart() {
|
|
33
37
|
const data = [
|
|
@@ -226,6 +230,34 @@ const data = Array.from({ length: 30 }, (_, i) => ({
|
|
|
226
230
|
|
|
227
231
|
Full TypeScript type definitions are included.
|
|
228
232
|
|
|
233
|
+
## Troubleshooting
|
|
234
|
+
|
|
235
|
+
### "Could not find a declaration file for module" error
|
|
236
|
+
|
|
237
|
+
If you encounter this error:
|
|
238
|
+
|
|
239
|
+
1. **Install React type definitions**:
|
|
240
|
+
```bash
|
|
241
|
+
npm install --save-dev @types/react @types/react-dom
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
2. **Check your tsconfig.json**:
|
|
245
|
+
```json
|
|
246
|
+
{
|
|
247
|
+
"compilerOptions": {
|
|
248
|
+
"moduleResolution": "bundler", // or "node16", "nodenext"
|
|
249
|
+
"esModuleInterop": true,
|
|
250
|
+
"skipLibCheck": false
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
3. **Clear cache and reinstall**:
|
|
256
|
+
```bash
|
|
257
|
+
rm -rf node_modules/.cache
|
|
258
|
+
npm install
|
|
259
|
+
```
|
|
260
|
+
|
|
229
261
|
## License
|
|
230
262
|
|
|
231
263
|
MIT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { PlotConfiguration } from "./types";
|
|
3
|
+
export declare const CanPlot: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
configuration: PlotConfiguration;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
className?: string;
|
|
8
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
//# sourceMappingURL=CanPlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanPlot.d.ts","sourceRoot":"","sources":["../src/lib/CanPlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,iBAAiB,EAAiC,MAAM,SAAS,CAAC;AAUhF,eAAO,MAAM,OAAO;mBAGD,iBAAiB;eACrB,SAAS;YACZ,KAAK,CAAC,aAAa;gBACf,MAAM;kDAmDpB,CAAC"}
|
package/dist/axes.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PlotDrawFrame } from "./types";
|
|
2
|
+
export declare const drawAxes: (plotDrawFrame: PlotDrawFrame) => void;
|
|
3
|
+
export type PlotAxisGenTicksOpts = {
|
|
4
|
+
frame: PlotDrawFrame;
|
|
5
|
+
scaleId: string;
|
|
6
|
+
};
|
|
7
|
+
export type PlotAxisTickFormatOpts = {
|
|
8
|
+
frame: PlotDrawFrame;
|
|
9
|
+
scaleId: string;
|
|
10
|
+
ticks: number[];
|
|
11
|
+
};
|
|
12
|
+
export type PlotAxisGenTicks = (opts: PlotAxisGenTicksOpts) => number[];
|
|
13
|
+
export type PlotAxisTickFormat = (opts: PlotAxisTickFormatOpts) => string[];
|
|
14
|
+
export declare const makeGenTicksDefault: ({ space, }?: {
|
|
15
|
+
space?: number;
|
|
16
|
+
}) => PlotAxisGenTicks;
|
|
17
|
+
export declare const formatTicksDefault: PlotAxisTickFormat;
|
|
18
|
+
//# sourceMappingURL=axes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axes.d.ts","sourceRoot":"","sources":["../src/lib/axes.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAS7C,eAAO,MAAM,QAAQ,GAAI,eAAe,aAAa,SA8DpD,CAAC;AA8GF,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,oBAAoB,KAAK,MAAM,EAAE,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,sBAAsB,KAAK,MAAM,EAAE,CAAC;AAE5E,eAAO,MAAM,mBAAmB,GAAI,aAEjC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,KAAG,gBA4B5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,kBAGhC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const DEFAULT_AXIS_SIZE = 50;
|
|
2
|
+
export declare const DEFAULT_POSITION = "primary";
|
|
3
|
+
export declare const DEFAULT_LABEL_ALIGN = "center";
|
|
4
|
+
export declare const DEFAULT_TICK_SIZE = 5;
|
|
5
|
+
export declare const DEFAULT_MULTILINE_GAP = 10;
|
|
6
|
+
export declare const DEFAULT_X_SPLIT_SPACE = 60;
|
|
7
|
+
export declare const DEFAULT_Y_SPLIT_SPACE = 30;
|
|
8
|
+
export declare const DEFAULT_TIMEZONE = "UTC";
|
|
9
|
+
export declare const DEFAULT_LOCALE = "en-GB";
|
|
10
|
+
export declare const DEFAULT_LABEL_OFFSET = 25;
|
|
11
|
+
export declare const DEFAULT_PADDING = 10;
|
|
12
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/lib/defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,gBAAgB,QAAQ,CAAC;AACtC,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PlotDrawFrame } from "./types";
|
|
2
|
+
export interface FrameStoreState {
|
|
3
|
+
_frame: PlotDrawFrame | null;
|
|
4
|
+
clampXPosToChartArea: (x: number, space?: "canvas" | "css") => number;
|
|
5
|
+
clampYPosToChartArea: (y: number, space?: "canvas" | "css") => number;
|
|
6
|
+
getFrame: () => PlotDrawFrame;
|
|
7
|
+
getCtx: () => CanvasRenderingContext2D;
|
|
8
|
+
valToPos: (value: number, scaleId: string, space?: "canvas" | "css") => number;
|
|
9
|
+
valToPxDistance: (value: number, scaleId: string, space?: "canvas" | "css") => number;
|
|
10
|
+
valFits: (value: number, scaleId: string) => boolean;
|
|
11
|
+
getScale: (scaleId: string) => PlotDrawFrame["scales"][number] | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare const createFrameStore: () => import("zustand").StoreApi<FrameStoreState>;
|
|
14
|
+
export type FrameStoreType = ReturnType<typeof createFrameStore>;
|
|
15
|
+
export declare const FrameContext: import("react").Context<import("zustand").StoreApi<FrameStoreState> | null>;
|
|
16
|
+
export declare const useDrawEffect: (runner: (params: Omit<FrameStoreState, "_frame">) => void, deps: ReadonlyArray<any>) => void;
|
|
17
|
+
export declare const useFrameState: <T = PlotDrawFrame>(selector?: (state: FrameStoreState) => T) => T;
|
|
18
|
+
//# sourceMappingURL=frameContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameContext.d.ts","sourceRoot":"","sources":["../src/lib/frameContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAW7C,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,oBAAoB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,KAAK,KAAK,MAAM,CAAC;IACtE,oBAAoB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,KAAK,KAAK,MAAM,CAAC;IACtE,QAAQ,EAAE,MAAM,aAAa,CAAC;IAC9B,MAAM,EAAE,MAAM,wBAAwB,CAAC;IACvC,QAAQ,EAAE,CACR,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,QAAQ,GAAG,KAAK,KACrB,MAAM,CAAC;IACZ,eAAe,EAAE,CACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,QAAQ,GAAG,KAAK,KACrB,MAAM,CAAC;IACZ,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACrD,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,aAAa,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CAC5E;AAED,eAAO,MAAM,gBAAgB,mDAqCzB,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEjE,eAAO,MAAM,YAAY,6EAA6C,CAAC;AAEvE,eAAO,MAAM,aAAa,GACxB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,KAAK,IAAI,EAEzD,MAAM,aAAa,CAAC,GAAG,CAAC,SAsBzB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,GAAG,aAAa,EAC7C,WAAW,CAAC,KAAK,EAAE,eAAe,KAAK,CAAC,MAUzC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PlotDrawFrame, Style } from "./types";
|
|
2
|
+
export declare const pxToValDistance: (frame: PlotDrawFrame, pxDistance: number, scaleId: string, space: "css" | "canvas") => number;
|
|
3
|
+
export declare const getScale: (frame: PlotDrawFrame, scaleId: string) => import("./types").PlotDrawScaleConfig;
|
|
4
|
+
export declare const isXScale: (frame: PlotDrawFrame, scaleId: string) => boolean;
|
|
5
|
+
export declare const isYScale: (frame: PlotDrawFrame, scaleId: string) => boolean;
|
|
6
|
+
export declare const applyStyles: (ctx: CanvasRenderingContext2D, style?: Style) => void;
|
|
7
|
+
export declare const valToPxDistance: (frame: PlotDrawFrame, val: number, scaleId: string, space: "css" | "canvas") => number;
|
|
8
|
+
export declare const valToPos: (frame: PlotDrawFrame, val: number, scaleId: string, space: "css" | "canvas") => number;
|
|
9
|
+
export declare const clampUnfit: (frame: PlotDrawFrame, value: number, scaleId: string) => number;
|
|
10
|
+
export declare const clampXPosToChartArea: (frame: PlotDrawFrame, value: number, space: "css" | "canvas") => number;
|
|
11
|
+
export declare const clampYPosToChartArea: (frame: PlotDrawFrame, value: number, space: "css" | "canvas") => number;
|
|
12
|
+
export declare const valFits: (frame: PlotDrawFrame, value: number, scaleId: string) => boolean;
|
|
13
|
+
export declare const posToVal: (frame: PlotDrawFrame, pos: number, scaleId: string, space: "css" | "canvas") => number;
|
|
14
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/lib/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGpD,eAAO,MAAM,eAAe,GAC1B,OAAO,aAAa,EACpB,YAAY,MAAM,EAClB,SAAS,MAAM,EACf,OAAO,KAAK,GAAG,QAAQ,WASxB,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,EAAE,SAAS,MAAM,0CAM7D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,EAAE,SAAS,MAAM,YACF,CAAC;AAE7D,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,EAAE,SAAS,MAAM,YACF,CAAC;AAE7D,eAAO,MAAM,WAAW,GAAI,KAAK,wBAAwB,EAAE,QAAQ,KAAK,SAcvE,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,OAAO,aAAa,EACpB,KAAK,MAAM,EACX,SAAS,MAAM,EACf,OAAO,KAAK,GAAG,QAAQ,WASxB,CAAC;AAEF,eAAO,MAAM,QAAQ,GACnB,OAAO,aAAa,EACpB,KAAK,MAAM,EACX,SAAS,MAAM,EACf,OAAO,KAAK,GAAG,QAAQ,WAkBxB,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,OAAO,aAAa,EACpB,OAAO,MAAM,EACb,SAAS,MAAM,WAIhB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,aAAa,EACpB,OAAO,MAAM,EACb,OAAO,KAAK,GAAG,QAAQ,WAMxB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,aAAa,EACpB,OAAO,MAAM,EACb,OAAO,KAAK,GAAG,QAAQ,WAKxB,CAAC;AAEF,eAAO,MAAM,OAAO,GAClB,OAAO,aAAa,EACpB,OAAO,MAAM,EACb,SAAS,MAAM,KACd,OAGF,CAAC;AAEF,eAAO,MAAM,QAAQ,GACnB,OAAO,aAAa,EACpB,KAAK,MAAM,EACX,SAAS,MAAM,EACf,OAAO,KAAK,GAAG,QAAQ,WAUxB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { CanPlot } from './CanPlot';
|
|
2
|
+
export { LinePlot } from './plot/LinePlot';
|
|
3
|
+
export { ScatterPlot } from './plot/ScatterPlot';
|
|
4
|
+
export { BarPlot } from './plot/BarPlot';
|
|
5
|
+
export { AreaPlot } from './plot/AreaPlot';
|
|
6
|
+
export { SparklinePlot } from './plot/SparklinePlot';
|
|
7
|
+
export { usePositioned } from './plot/AnnotationX';
|
|
8
|
+
export { ChartAreaInteractions } from './interactions/ChartAreaInteractions';
|
|
9
|
+
export { TooltipsX } from './interactions/TooltipsX';
|
|
10
|
+
export { Crosshair } from './interactions/CrossHair';
|
|
11
|
+
export { SelectBox } from './interactions/SelectBox';
|
|
12
|
+
export { AxisOverlay } from './interactions/AxisOverlay';
|
|
13
|
+
export type { PlotScaleConfig, PlotScaleLinearConfig, PlotScaleTimeConfig, PlotConfiguration, PlotDrawFrame, PlotDrawScaleConfig, PlotDrawScaleLinearConfig, PlotDrawScaleTimeConfig, PlotPadding, PlotSize, Rect, Style, } from './types';
|
|
14
|
+
export { valToPos, valToPxDistance, valFits, getScale, isXScale, isYScale, applyStyles, pxToValDistance, clampXPosToChartArea, clampYPosToChartArea, posToVal, } from './helpers';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,KAAK,GACN,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,QAAQ,GACT,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AxisOverlay.d.ts","sourceRoot":"","sources":["../../src/lib/interactions/AxisOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAChC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;CACjB,CAwBF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ClickEvent, DblClickEvent, DocumentMouseUpEvent, MouseDownEvent, MouseUpEvent, MoveEvent, SpanSelectEvent } from "./types";
|
|
2
|
+
type ChartAreaInteractionsProps = {
|
|
3
|
+
onDblClick?: (event: DblClickEvent) => void;
|
|
4
|
+
onClick?: (event: ClickEvent) => void;
|
|
5
|
+
onMouseMove?: (event: MoveEvent) => void;
|
|
6
|
+
onMouseDown?: (event: MouseDownEvent) => void;
|
|
7
|
+
onMouseUp?: (event: MouseUpEvent) => void;
|
|
8
|
+
onDocumentMouseUp?: (event: DocumentMouseUpEvent) => void;
|
|
9
|
+
onSpanSelect?: (event: SpanSelectEvent) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
id?: string;
|
|
13
|
+
sync?: {
|
|
14
|
+
key: string;
|
|
15
|
+
xViaScaleId?: string;
|
|
16
|
+
yViaScaleId?: string;
|
|
17
|
+
};
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export declare const ChartAreaInteractions: React.FC<ChartAreaInteractionsProps>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=ChartAreaInteractions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartAreaInteractions.d.ts","sourceRoot":"","sources":["../../src/lib/interactions/ChartAreaInteractions.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,SAAS,EAET,eAAe,EAGhB,MAAM,SAAS,CAAC;AAOjB,KAAK,0BAA0B,GAAG;IAChC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAgDtE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { MoveEvent } from "./types";
|
|
3
|
+
export declare const Crosshair: React.FC<{
|
|
4
|
+
makeXStyle?: (moveEvent: MoveEvent) => React.CSSProperties | undefined;
|
|
5
|
+
makeXClassName?: (moveEvent: MoveEvent) => string;
|
|
6
|
+
makeYStyle?: (moveEvent: MoveEvent) => React.CSSProperties | undefined;
|
|
7
|
+
makeYClassName?: (moveEvent: MoveEvent) => string;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=CrossHair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrossHair.d.ts","sourceRoot":"","sources":["../../src/lib/interactions/CrossHair.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IACvE,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC;IAClD,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IACvE,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC;CACnD,CAuDA,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SpanSelectEvent } from "./types";
|
|
3
|
+
export declare const SelectBox: React.FC<{
|
|
4
|
+
makeClassName?: (selectState: SpanSelectEvent) => string;
|
|
5
|
+
makeStyle?: (selectState: SpanSelectEvent) => React.CSSProperties | undefined;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=SelectBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectBox.d.ts","sourceRoot":"","sources":["../../src/lib/interactions/SelectBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,eAAe,KAAK,MAAM,CAAC;IACzD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,eAAe,KAAK,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;CAC/E,CAoDA,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PlotDrawFrame } from "../types";
|
|
2
|
+
type TooltipState = {
|
|
3
|
+
frame: PlotDrawFrame;
|
|
4
|
+
x: number;
|
|
5
|
+
points: {
|
|
6
|
+
seriesId: string;
|
|
7
|
+
y: number | null;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
export declare const TooltipsX: React.FC<{
|
|
11
|
+
xScaleId: string;
|
|
12
|
+
data: {
|
|
13
|
+
seriesId: string;
|
|
14
|
+
yScaleId: string;
|
|
15
|
+
points: Array<{
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}>;
|
|
19
|
+
}[];
|
|
20
|
+
renderTooltip: (params: TooltipState | null) => React.ReactNode;
|
|
21
|
+
}>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=TooltipsX.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipsX.d.ts","sourceRoot":"","sources":["../../src/lib/interactions/TooltipsX.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,aAAa,CAAC;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAClB,EAAE,CAAC;CACL,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,KAAK,CAAC;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACzC,EAAE,CAAC;IACJ,aAAa,EAAE,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,KAAK,KAAK,CAAC,SAAS,CAAC;CACjE,CA2DA,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PlotDrawFrame } from "../types";
|
|
2
|
+
type TooltipState = {
|
|
3
|
+
frame: PlotDrawFrame;
|
|
4
|
+
points: {
|
|
5
|
+
seriesId: string;
|
|
6
|
+
x: number | null;
|
|
7
|
+
y: number | null;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
export declare const TooltipsX: React.FC<{
|
|
11
|
+
data: {
|
|
12
|
+
seriesId: string;
|
|
13
|
+
xScaleId: string;
|
|
14
|
+
yScaleId: string;
|
|
15
|
+
points: Array<{
|
|
16
|
+
x: number | null;
|
|
17
|
+
y: number | null;
|
|
18
|
+
}>;
|
|
19
|
+
}[];
|
|
20
|
+
renderTooltip: (params: TooltipState | null) => React.ReactNode;
|
|
21
|
+
}>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=TooltipsXY.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipsXY.d.ts","sourceRoot":"","sources":["../../src/lib/interactions/TooltipsXY.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACjB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAClB,EAAE,CAAC;CACL,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,KAAK,CAAC;YAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC,CAAC;KACvD,EAAE,CAAC;IACJ,aAAa,EAAE,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,KAAK,KAAK,CAAC,SAAS,CAAC;CACjE,CA6EA,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ClickEvent, DblClickEvent, MouseDownEvent, MouseUpEvent, MoveEvent, SpanSelectEvent, PressAndWheelEvent, SyncEvent_Click, SyncEvent_DblClick, SyncEvent_MouseDown, SyncEvent_MouseUp, SyncEvent_Move, SyncEvent_SpanSelect, SyncEvent_PressAndWheel } from "./types";
|
|
3
|
+
export declare const makeInteractionsBus: <T>() => {
|
|
4
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: T) => void) => () => void;
|
|
5
|
+
dispatchEvent: (syncKey: string, payload: T) => void;
|
|
6
|
+
};
|
|
7
|
+
export type InteractionsBus<T> = ReturnType<typeof makeInteractionsBus<T>>;
|
|
8
|
+
export declare const InteractionsBus: {
|
|
9
|
+
dblclick: {
|
|
10
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: DblClickEvent) => void) => () => void;
|
|
11
|
+
dispatchEvent: (syncKey: string, payload: DblClickEvent) => void;
|
|
12
|
+
};
|
|
13
|
+
click: {
|
|
14
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: ClickEvent) => void) => () => void;
|
|
15
|
+
dispatchEvent: (syncKey: string, payload: ClickEvent) => void;
|
|
16
|
+
};
|
|
17
|
+
move: {
|
|
18
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: MoveEvent) => void) => () => void;
|
|
19
|
+
dispatchEvent: (syncKey: string, payload: MoveEvent) => void;
|
|
20
|
+
};
|
|
21
|
+
mousedown: {
|
|
22
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: MouseDownEvent) => void) => () => void;
|
|
23
|
+
dispatchEvent: (syncKey: string, payload: MouseDownEvent) => void;
|
|
24
|
+
};
|
|
25
|
+
mouseup: {
|
|
26
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: MouseUpEvent) => void) => () => void;
|
|
27
|
+
dispatchEvent: (syncKey: string, payload: MouseUpEvent) => void;
|
|
28
|
+
};
|
|
29
|
+
spanselect: {
|
|
30
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: SpanSelectEvent) => void) => () => void;
|
|
31
|
+
dispatchEvent: (syncKey: string, payload: SpanSelectEvent) => void;
|
|
32
|
+
};
|
|
33
|
+
documentmouseup: {
|
|
34
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: import("./types").InteractionsEvent) => void) => () => void;
|
|
35
|
+
dispatchEvent: (syncKey: string, payload: import("./types").InteractionsEvent) => void;
|
|
36
|
+
};
|
|
37
|
+
pressandwheel: {
|
|
38
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: PressAndWheelEvent) => void) => () => void;
|
|
39
|
+
dispatchEvent: (syncKey: string, payload: PressAndWheelEvent) => void;
|
|
40
|
+
};
|
|
41
|
+
sync_dblclick: {
|
|
42
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: SyncEvent_DblClick) => void) => () => void;
|
|
43
|
+
dispatchEvent: (syncKey: string, payload: SyncEvent_DblClick) => void;
|
|
44
|
+
};
|
|
45
|
+
sync_click: {
|
|
46
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: SyncEvent_Click) => void) => () => void;
|
|
47
|
+
dispatchEvent: (syncKey: string, payload: SyncEvent_Click) => void;
|
|
48
|
+
};
|
|
49
|
+
sync_move: {
|
|
50
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: SyncEvent_Move) => void) => () => void;
|
|
51
|
+
dispatchEvent: (syncKey: string, payload: SyncEvent_Move) => void;
|
|
52
|
+
};
|
|
53
|
+
sync_mousedown: {
|
|
54
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: SyncEvent_MouseDown) => void) => () => void;
|
|
55
|
+
dispatchEvent: (syncKey: string, payload: SyncEvent_MouseDown) => void;
|
|
56
|
+
};
|
|
57
|
+
sync_mouseup: {
|
|
58
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: SyncEvent_MouseUp) => void) => () => void;
|
|
59
|
+
dispatchEvent: (syncKey: string, payload: SyncEvent_MouseUp) => void;
|
|
60
|
+
};
|
|
61
|
+
sync_spanselect: {
|
|
62
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: SyncEvent_SpanSelect) => void) => () => void;
|
|
63
|
+
dispatchEvent: (syncKey: string, payload: SyncEvent_SpanSelect) => void;
|
|
64
|
+
};
|
|
65
|
+
sync_pressandwheel: {
|
|
66
|
+
addEventListener: (syncKey: string, callback: (syncKey: string, payload: SyncEvent_PressAndWheel) => void) => () => void;
|
|
67
|
+
dispatchEvent: (syncKey: string, payload: SyncEvent_PressAndWheel) => void;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export declare const useGenericInteractionsEvent: <K extends keyof typeof InteractionsBus>(eventName: K, syncKey: string, callback: (payload: Parameters<(typeof InteractionsBus)[K]["dispatchEvent"]>[1], syncKey: string) => void) => void;
|
|
71
|
+
export declare const InteractionsIdContext: React.Context<string>;
|
|
72
|
+
export declare const useInteractionsEvent: <K extends keyof typeof InteractionsBus>(eventName: K, callback: (payload: Parameters<(typeof InteractionsBus)[K]["dispatchEvent"]>[1], syncKey: string) => void) => void;
|
|
73
|
+
//# sourceMappingURL=interactionsBus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionsBus.d.ts","sourceRoot":"","sources":["../../src/lib/interactions/interactionsBus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EAEb,cAAc,EACd,YAAY,EACZ,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,mBAAmB,GAAI,CAAC;gCAOtB,MAAM,YACL,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,IAAI;6BAaxB,MAAM,WAAW,CAAC;CAQ9C,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3E,eAAO,MAAM,eAAe;;oCA1Bb,MAAM,sBACK,MAAM,6BAAiB,IAAI;iCAaxB,MAAM;;;oCAdpB,MAAM,sBACK,MAAM,0BAAiB,IAAI;iCAaxB,MAAM;;;oCAdpB,MAAM,sBACK,MAAM,yBAAiB,IAAI;iCAaxB,MAAM;;;oCAdpB,MAAM,sBACK,MAAM,8BAAiB,IAAI;iCAaxB,MAAM;;;oCAdpB,MAAM,sBACK,MAAM,4BAAiB,I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aleConfig } from "../types";
|
|
2
|
+
import type { InteractionsEventPointerPosition, PointerSyncPosition, ScaledSelectionRange } from "./types";
|
|
3
|
+
export declare const makePointerSyncPosition: (event: Pick<MouseEvent, "clientX" | "clientY">, rect: DOMRect | undefined, frame: PlotDrawFrame, xViaScaleId: string | undefined, yViaScaleId: string | undefined) => {
|
|
4
|
+
pointerSyncPosition: PointerSyncPosition;
|
|
5
|
+
cssX: number;
|
|
6
|
+
cssY: number;
|
|
7
|
+
} | undefined;
|
|
8
|
+
export declare const pointerSyncPositionToInteractionsPosition: (pointerSyncPosition: PointerSyncPosition, frame: PlotDrawFrame) => InteractionsEventPointerPosition | undefined;
|
|
9
|
+
export declare const extrapolateScaledSelectionRange: (origin: PlotDrawScaleConfig["origin"], selectionRange: ScaledSelectionRange | undefined, frame: PlotDrawFrame) => {
|
|
10
|
+
fromCSS: number;
|
|
11
|
+
toCSS: number;
|
|
12
|
+
scaled: ScaledSelectionRange[];
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=positioning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positioning.d.ts","sourceRoot":"","sources":["../../src/lib/interactions/positioning.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,KAAK,EACV,gCAAgC,EAChC,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,uBAAuB,GAClC,OAAO,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC,EAC9C,MAAM,OAAO,GAAG,SAAS,EACzB,OAAO,aAAa,EACpB,aAAa,MAAM,GAAG,SAAS,EAC/B,aAAa,MAAM,GAAG,SAAS,KAE7B;IAAE,mBAAmB,EAAE,mBAAmB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACxE,SAwBH,CAAC;AAEF,eAAO,MAAM,yCAAyC,GACpD,qBAAqB,mBAAmB,EACxC,OAAO,aAAa,KACnB,gCAAgC,GAAG,SA4BrC,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAC1C,QAAQ,mBAAmB,CAAC,QAAQ,CAAC,EACrC,gBAAgB,oBAAoB,GAAG,SAAS,EAChD,OAAO,aAAa,KACnB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,oBAAoB,EAAE,CAAA;CAsDlE,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { PlotDrawFrame } from "../types";
|
|
2
|
+
type ModifiersKeys = {
|
|
3
|
+
ctrlKey: boolean;
|
|
4
|
+
altKey: boolean;
|
|
5
|
+
shiftKey: boolean;
|
|
6
|
+
metaKey: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type PointerSyncPosition = {
|
|
9
|
+
x: {
|
|
10
|
+
scaleId: string;
|
|
11
|
+
value: number;
|
|
12
|
+
} | null;
|
|
13
|
+
y: {
|
|
14
|
+
scaleId: string;
|
|
15
|
+
value: number;
|
|
16
|
+
} | null;
|
|
17
|
+
};
|
|
18
|
+
export type SyncEvent_Move = {
|
|
19
|
+
positions: PointerSyncPosition | null;
|
|
20
|
+
keys: ModifiersKeys;
|
|
21
|
+
};
|
|
22
|
+
export type SyncEvent_DblClick = {
|
|
23
|
+
positions: PointerSyncPosition;
|
|
24
|
+
keys: ModifiersKeys;
|
|
25
|
+
};
|
|
26
|
+
export type SyncEvent_Click = {
|
|
27
|
+
positions: PointerSyncPosition;
|
|
28
|
+
keys: ModifiersKeys;
|
|
29
|
+
};
|
|
30
|
+
export type SyncEvent_MouseDown = {
|
|
31
|
+
positions: PointerSyncPosition;
|
|
32
|
+
keys: ModifiersKeys;
|
|
33
|
+
};
|
|
34
|
+
export type SyncEvent_MouseUp = {
|
|
35
|
+
positions: PointerSyncPosition;
|
|
36
|
+
keys: ModifiersKeys;
|
|
37
|
+
};
|
|
38
|
+
export type SyncEvent_PressAndWheel = {
|
|
39
|
+
positions: PointerSyncPosition;
|
|
40
|
+
keys: ModifiersKeys;
|
|
41
|
+
deltaX: number;
|
|
42
|
+
deltaY: number;
|
|
43
|
+
deltaAbs: number;
|
|
44
|
+
};
|
|
45
|
+
export type SyncEvent_SpanSelect = {
|
|
46
|
+
mode: "x" | "y" | "box" | "none";
|
|
47
|
+
xRange?: ScaledSelectionRange;
|
|
48
|
+
yRange?: ScaledSelectionRange;
|
|
49
|
+
completed: boolean;
|
|
50
|
+
keys: ModifiersKeys;
|
|
51
|
+
};
|
|
52
|
+
export type PointerSyncEvent = {
|
|
53
|
+
type: "dblclick" | "click" | "move" | "mousedown" | "mouseup" | "documentmouseup";
|
|
54
|
+
x: {
|
|
55
|
+
scaleId: string;
|
|
56
|
+
value: number;
|
|
57
|
+
} | null;
|
|
58
|
+
y: {
|
|
59
|
+
scaleId: string;
|
|
60
|
+
value: number;
|
|
61
|
+
} | null;
|
|
62
|
+
} | {
|
|
63
|
+
type: "spanselect";
|
|
64
|
+
};
|
|
65
|
+
export type InteractionsEventPointerPosition = {
|
|
66
|
+
cssX: number;
|
|
67
|
+
cssY: number;
|
|
68
|
+
scaled: Record<string, number>;
|
|
69
|
+
};
|
|
70
|
+
export type InteractionsEvent = {
|
|
71
|
+
frame: PlotDrawFrame;
|
|
72
|
+
keys: ModifiersKeys;
|
|
73
|
+
};
|
|
74
|
+
export type DblClickEvent = InteractionsEvent & {
|
|
75
|
+
pointer: InteractionsEventPointerPosition;
|
|
76
|
+
};
|
|
77
|
+
export type ClickEvent = InteractionsEvent & {
|
|
78
|
+
pointer: InteractionsEventPointerPosition;
|
|
79
|
+
};
|
|
80
|
+
export type MoveEvent = InteractionsEvent & {
|
|
81
|
+
pointer: InteractionsEventPointerPosition | null;
|
|
82
|
+
};
|
|
83
|
+
export type MouseDownEvent = InteractionsEvent & {
|
|
84
|
+
pointer: InteractionsEventPointerPosition;
|
|
85
|
+
};
|
|
86
|
+
export type MouseUpEvent = InteractionsEvent & {
|
|
87
|
+
pointer: InteractionsEventPointerPosition;
|
|
88
|
+
};
|
|
89
|
+
export type ScaledSelectionRange = {
|
|
90
|
+
scaleId: string;
|
|
91
|
+
from: number;
|
|
92
|
+
to: number;
|
|
93
|
+
};
|
|
94
|
+
export type SpanSelectEvent = {
|
|
95
|
+
frame: PlotDrawFrame;
|
|
96
|
+
mode: "x" | "y" | "box" | "none";
|
|
97
|
+
x: {
|
|
98
|
+
fromCSS: number;
|
|
99
|
+
toCSS: number;
|
|
100
|
+
};
|
|
101
|
+
y: {
|
|
102
|
+
fromCSS: number;
|
|
103
|
+
toCSS: number;
|
|
104
|
+
};
|
|
105
|
+
xRanges: ScaledSelectionRange[];
|
|
106
|
+
yRanges: ScaledSelectionRange[];
|
|
107
|
+
completed: boolean;
|
|
108
|
+
keys: ModifiersKeys;
|
|
109
|
+
};
|
|
110
|
+
export type PressAndWheelEvent = InteractionsEvent & {
|
|
111
|
+
pointer: InteractionsEventPointerPosition;
|
|
112
|
+
deltaX: number;
|
|
113
|
+
deltaY: number;
|
|
114
|
+
deltaAbs: number;
|
|
115
|
+
};
|
|
116
|
+
export type DocumentMouseUpEvent = InteractionsEvent;
|
|
117
|
+
export {};
|
|
118
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/interactions/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAIF,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;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B,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,GAAG,MAAM,CAAC;IACjC,CAAC,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,CAAC,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG;IACnD,OAAO,EAAE,gCAAgC,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationX.d.ts","sourceRoot":"","sources":["../../src/lib/plot/AnnotationX.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,GACxB,CAAC,SAAS,MAAM,CACd,MAAM,EACN;IACE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CACF,EAED,QAAQ,CAAC,EACT,OAAO,QAAQ,GAAG,KAAK,QAUE,CAAC,oCAwB3B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const AreaPlot: React.FC<{
|
|
2
|
+
data: Array<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: [number, number];
|
|
5
|
+
}>;
|
|
6
|
+
xScaleId: string;
|
|
7
|
+
yScaleId: string;
|
|
8
|
+
style?: Partial<{
|
|
9
|
+
fillStyle: CanvasFillStrokeStyles["fillStyle"];
|
|
10
|
+
strokeStyle: CanvasFillStrokeStyles["strokeStyle"];
|
|
11
|
+
} & Pick<CanvasPathDrawingStyles, "lineCap" | "lineDashOffset" | "lineJoin" | "lineWidth" | "miterLimit">>;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=AreaPlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AreaPlot.d.ts","sourceRoot":"","sources":["../../src/lib/plot/AreaPlot.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,IAAI,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC,CAAC;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CACb;QACE,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAC/C,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;KACpD,GAAG,IAAI,CACN,uBAAuB,EACvB,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CACvE,CACF,CAAC;CACH,CA0BA,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const BarPlot: React.FC<{
|
|
2
|
+
data: Array<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}>;
|
|
6
|
+
xPositionOffset: number;
|
|
7
|
+
xScaleId: string;
|
|
8
|
+
yScaleId: string;
|
|
9
|
+
barWidth: number;
|
|
10
|
+
radius?: number;
|
|
11
|
+
style?: Partial<{
|
|
12
|
+
fillStyle: CanvasFillStrokeStyles["fillStyle"];
|
|
13
|
+
strokeStyle: CanvasFillStrokeStyles["strokeStyle"];
|
|
14
|
+
} & Pick<CanvasPathDrawingStyles, "lineCap" | "lineDashOffset" | "lineJoin" | "lineWidth" | "miterLimit">>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=BarPlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarPlot.d.ts","sourceRoot":"","sources":["../../src/lib/plot/BarPlot.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;IAC7B,IAAI,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CACb;QACE,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAC/C,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;KACpD,GAAG,IAAI,CACN,uBAAuB,EACvB,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CACvE,CACF,CAAC;CACH,CA+DA,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const LinePlot: React.FC<{
|
|
2
|
+
data: Array<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}>;
|
|
6
|
+
xScaleId: string;
|
|
7
|
+
yScaleId: string;
|
|
8
|
+
style?: Partial<{
|
|
9
|
+
fillStyle: CanvasFillStrokeStyles["fillStyle"];
|
|
10
|
+
strokeStyle: CanvasFillStrokeStyles["strokeStyle"];
|
|
11
|
+
} & Pick<CanvasPathDrawingStyles, "lineCap" | "lineDashOffset" | "lineJoin" | "lineWidth" | "miterLimit">>;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=LinePlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinePlot.d.ts","sourceRoot":"","sources":["../../src/lib/plot/LinePlot.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,IAAI,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CACb;QACE,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAC/C,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;KACpD,GAAG,IAAI,CACN,uBAAuB,EACvB,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CACvE,CACF,CAAC;CACH,CAkBA,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const ScatterPlot: React.FC<{
|
|
2
|
+
data: Array<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}>;
|
|
6
|
+
xScaleId: string;
|
|
7
|
+
yScaleId: string;
|
|
8
|
+
radius?: number;
|
|
9
|
+
style?: Partial<{
|
|
10
|
+
fillStyle: CanvasFillStrokeStyles["fillStyle"];
|
|
11
|
+
strokeStyle: CanvasFillStrokeStyles["strokeStyle"];
|
|
12
|
+
} & Pick<CanvasPathDrawingStyles, "lineCap" | "lineDashOffset" | "lineJoin" | "lineWidth" | "miterLimit">>;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=ScatterPlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScatterPlot.d.ts","sourceRoot":"","sources":["../../src/lib/plot/ScatterPlot.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IACjC,IAAI,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CACb;QACE,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAC/C,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;KACpD,GAAG,IAAI,CACN,uBAAuB,EACvB,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CACvE,CACF,CAAC;CACH,CAoBA,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const SparklinePlot: React.FC<{
|
|
2
|
+
data: Array<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}>;
|
|
6
|
+
xScaleId: string;
|
|
7
|
+
yScaleId: string;
|
|
8
|
+
stroked?: boolean;
|
|
9
|
+
style?: Partial<{
|
|
10
|
+
fillStyle: CanvasFillStrokeStyles["fillStyle"];
|
|
11
|
+
strokeStyle: CanvasFillStrokeStyles["strokeStyle"];
|
|
12
|
+
} & Pick<CanvasPathDrawingStyles, "lineCap" | "lineDashOffset" | "lineJoin" | "lineWidth" | "miterLimit">>;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=SparklinePlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SparklinePlot.d.ts","sourceRoot":"","sources":["../../src/lib/plot/SparklinePlot.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC;IACnC,IAAI,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CACb;QACE,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAC/C,WAAW,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;KACpD,GAAG,IAAI,CACN,uBAAuB,EACvB,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CACvE,CACF,CAAC;CACH,CA0CA,CAAC"}
|
package/dist/time.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PlotAxisGenTicks, PlotAxisTickFormat } from "./axes";
|
|
2
|
+
type GenTimeTicksOpts = {
|
|
3
|
+
timeZone?: string;
|
|
4
|
+
space?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const genTimeTicks: ({ timeZone, space, }: GenTimeTicksOpts) => PlotAxisGenTicks;
|
|
7
|
+
type MakeTimeTickFormatOpts = {
|
|
8
|
+
timeZone?: string;
|
|
9
|
+
locale?: string;
|
|
10
|
+
showTimezone?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const makeTimeTickFormat: ({ timeZone, locale, showTimezone, }: MakeTimeTickFormatOpts) => PlotAxisTickFormat;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../src/lib/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AA0NnE,KAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,sBAG1B,gBAAgB,KAAG,gBA4DrB,CAAC;AAaF,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,qCAIhC,sBAAsB,KAAG,kBAmF3B,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export type PlotConfiguration = {
|
|
2
|
+
padding: PlotPadding;
|
|
3
|
+
scales: PlotScaleConfig[];
|
|
4
|
+
};
|
|
5
|
+
export type PlotDrawFrame = {
|
|
6
|
+
ctx: CanvasRenderingContext2D;
|
|
7
|
+
dpr: number;
|
|
8
|
+
chartAreaCanvasPX: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
chartAreaCSS: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
20
|
+
padding: PlotPadding;
|
|
21
|
+
scales: PlotDrawScaleConfig[];
|
|
22
|
+
};
|
|
23
|
+
export type PlotPadding = {
|
|
24
|
+
top: number;
|
|
25
|
+
bottom: number;
|
|
26
|
+
left: number;
|
|
27
|
+
right: number;
|
|
28
|
+
};
|
|
29
|
+
export type PlotScaleLinearConfig = {
|
|
30
|
+
type: "linear";
|
|
31
|
+
id: string;
|
|
32
|
+
min: number;
|
|
33
|
+
max: number;
|
|
34
|
+
origin: "x" | "y";
|
|
35
|
+
axis: null | PlotAxisLinear;
|
|
36
|
+
};
|
|
37
|
+
export type PlotScaleTimeConfig = {
|
|
38
|
+
type: "time";
|
|
39
|
+
id: string;
|
|
40
|
+
min: number;
|
|
41
|
+
max: number;
|
|
42
|
+
origin: "x" | "y";
|
|
43
|
+
axis: null | PlotAxisTime;
|
|
44
|
+
timeZone: string;
|
|
45
|
+
locale?: string;
|
|
46
|
+
};
|
|
47
|
+
export type PlotScaleConfig = PlotScaleLinearConfig | PlotScaleTimeConfig;
|
|
48
|
+
export type Rect = {
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
53
|
+
};
|
|
54
|
+
export type PlotDrawScaleLinearConfig = PlotScaleLinearConfig & {
|
|
55
|
+
axis: null | (PlotAxisLinear & {
|
|
56
|
+
cssRect: Rect;
|
|
57
|
+
canvasRect: Rect;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
export type PlotDrawScaleTimeConfig = PlotScaleTimeConfig & {
|
|
61
|
+
axis: null | (PlotAxisTime & {
|
|
62
|
+
cssRect: Rect;
|
|
63
|
+
canvasRect: Rect;
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
export type PlotDrawScaleConfig = PlotDrawScaleLinearConfig | PlotDrawScaleTimeConfig;
|
|
67
|
+
export type PlotAxisLinear = {
|
|
68
|
+
position: "left" | "right" | "top" | "bottom";
|
|
69
|
+
size: number;
|
|
70
|
+
tickSpace?: number;
|
|
71
|
+
};
|
|
72
|
+
export type PlotAxisTime = {
|
|
73
|
+
position: "left" | "right" | "top" | "bottom";
|
|
74
|
+
size: number;
|
|
75
|
+
tickSpace?: number;
|
|
76
|
+
showTimezone?: boolean;
|
|
77
|
+
};
|
|
78
|
+
export type PlotSize = {
|
|
79
|
+
width: number;
|
|
80
|
+
height: number;
|
|
81
|
+
};
|
|
82
|
+
export type Style = {
|
|
83
|
+
fillStyle?: CanvasFillStrokeStyles["fillStyle"];
|
|
84
|
+
strokeStyle?: CanvasFillStrokeStyles["strokeStyle"];
|
|
85
|
+
} & Partial<Pick<CanvasPathDrawingStyles, "lineCap" | "lineDashOffset" | "lineJoin" | "lineWidth" | "miterLimit">> & Partial<CanvasTextDrawingStyles>;
|
|
86
|
+
//# sourceM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AAC;CACxB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,CAAC,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAChD,WAAW,CAAC,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;CACrD,GAAG,OAAO,CACT,IAAI,CACF,uBAAuB,EACvB,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CACvE,CACF,GACC,OAAO,CAAC,uBAAuB,CAAC,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const clamp: (val: number, min: number, max: number) => number;
|
|
2
|
+
export type DeepPartial<T> = {
|
|
3
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial<U>[] : T[P] extends Readonly<infer U>[] ? Readonly<DeepPartial<U>>[] : DeepPartial<T[P]>;
|
|
4
|
+
};
|
|
5
|
+
export declare const sum: (input: (number | undefined)[]) => number;
|
|
6
|
+
export declare const findClosestIndex: (arr: number[], val: number) => number;
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/lib/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,WAE1D,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACrC,WAAW,CAAC,CAAC,CAAC,EAAE,GAChB,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,GAChC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,GAC1B,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,KAAG,MAEnD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,EAAE,EAAE,KAAK,MAAM,WAS1D,CAAC"}
|