@duskmoon-dev/visualization 0.0.0-stage → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ import type { Pair, Rect, VizAction, VizEvent, VizTarget, VizTooltip, VizViewport } from "@duskmoon-dev/visualization-core";
2
+ import type { Theme } from "@duskmoon-dev/visualization-core";
3
+ export type VizInteractionProps = {
4
+ selection?: readonly VizTarget[];
5
+ defaultSelection?: readonly VizTarget[];
6
+ hiddenSeriesIds?: readonly string[];
7
+ viewport?: VizViewport | null;
8
+ onEvent?: (event: VizEvent) => void;
9
+ };
10
+ type InteractionOptions = VizInteractionProps & {
11
+ targets: ReadonlySet<string>;
12
+ seriesIds?: readonly string[];
13
+ initialHidden?: readonly string[];
14
+ initialViewport?: VizViewport | null;
15
+ selectionMode?: "single" | "multiple";
16
+ };
17
+ export declare function useVizInteraction({ selection, defaultSelection, hiddenSeriesIds, viewport, onEvent, targets, seriesIds, initialHidden, initialViewport, selectionMode, }: InteractionOptions): {
18
+ state: import("@duskmoon-dev/visualization-core").VizState;
19
+ dispatch: (action: VizAction) => void;
20
+ hasViewport: boolean;
21
+ };
22
+ export type PlotItem = {
23
+ tooltip: VizTooltip;
24
+ position: Pair;
25
+ rect?: Rect;
26
+ hitRadius?: number;
27
+ };
28
+ type PlotProps = {
29
+ width: number;
30
+ height: number;
31
+ items: readonly PlotItem[];
32
+ selected: readonly VizTarget[];
33
+ tooltip: VizTooltip | null;
34
+ dispatch: (action: VizAction) => void;
35
+ theme?: Theme;
36
+ zoom?: (x: number, y: number, factor: number) => void;
37
+ brush?: (start: number, end: number) => void;
38
+ brushSelection?: Pair;
39
+ hitTest?: (x: number, y: number) => PlotItem | undefined;
40
+ onDrag?: (start: Pair, end: Pair, target?: VizTarget) => void;
41
+ };
42
+ export declare function PlotInteraction({ width, height, items, selected, tooltip, dispatch, theme, zoom, brush, brushSelection, hitTest, onDrag, }: PlotProps): import("react").JSX.Element;
43
+ export declare function ChartActions({ dispatch, brush, zoom, }: {
44
+ dispatch: (action: VizAction) => void;
45
+ brush?: Pair | null;
46
+ zoom?: (factor: number) => void;
47
+ }): import("react").JSX.Element;
48
+ export {};
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "@duskmoon-dev/visualization",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.3.0",
4
+ "description": "Duskmoon chart components for React",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "build": "bun run build.ts && tsc -p tsconfig.json --emitDeclarationOnly",
20
+ "test": "bun test src"
21
+ },
22
+ "dependencies": {
23
+ "@duskmoon-dev/visualization-core": "2.3.0",
24
+ "@visx/scale": "4.0.0",
25
+ "@visx/shape": "4.0.0"
26
+ },
27
+ "peerDependencies": {
28
+ "react": "^19.0.0",
29
+ "react-dom": "^19.0.0"
30
+ },
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/duskmoon-dev/duskmoon-web.git",
35
+ "directory": "packages/react/visualization"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ }
40
+ }