@moderneinc/react-charts 1.2.0-next.2d0a72 → 1.2.0-next.32e773
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/components/chrono-chart/chrono-chart.component.d.ts +10 -0
- package/dist/components/chrono-chart/chrono-chart.types.d.ts +114 -0
- package/dist/components/chrono-chart/components/category-table.component.d.ts +13 -0
- package/dist/components/chrono-chart/components/category-table.types.d.ts +42 -0
- package/dist/components/chrono-chart/utils/data-transformer.d.ts +41 -0
- package/dist/components/d3-stacked-area-chart/d3-stacked-area-chart.types.d.ts +21 -1
- package/dist/components/d3-stacked-area-chart/hooks/use-d3-stacked-area.hook.d.ts +7 -2
- package/dist/components/morph-chart/hooks/shared/computations.d.ts +12 -8
- package/dist/components/morph-chart/hooks/shared/types.d.ts +9 -5
- package/dist/components/morph-chart/hooks/use-morph-chart.hook.d.ts +42 -1
- package/dist/components/morph-chart/morph-chart.types.d.ts +12 -0
- package/dist/components/morph-chart/utils/accordion-generator.d.ts +102 -0
- package/dist/components/morph-chart/utils/area-renderer.d.ts +1 -0
- package/dist/components/morph-chart/utils/bar-renderer.d.ts +0 -9
- package/dist/components/morph-chart/utils/gsap-orchestrator.d.ts +55 -16
- package/dist/components/morph-chart/utils/parliament-renderer.d.ts +2 -0
- package/dist/components/morph-chart/utils/slinky-3d-generator.d.ts +35 -0
- package/dist/components/morph-chart/utils/svg-slinky-generator.d.ts +25 -0
- package/dist/components/timeline-chart/timeline-chart.types.d.ts +13 -0
- package/dist/index.cjs +81 -75
- package/dist/index.d.ts +3 -3
- package/dist/index.js +17330 -16237
- package/package.json +3 -1
- package/dist/components/chrono-perspective-chart/chrono-perspective-chart.component.d.ts +0 -3
- package/dist/components/chrono-perspective-chart/chrono-perspective-chart.types.d.ts +0 -62
- package/dist/components/chrono-perspective-chart/components/category-table.component.d.ts +0 -3
- package/dist/components/chrono-perspective-chart/components/category-table.types.d.ts +0 -13
- package/dist/components/chrono-perspective-chart/utils/data-transformer.d.ts +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moderneinc/react-charts",
|
|
3
|
-
"version": "1.2.0-next.
|
|
3
|
+
"version": "1.2.0-next.32e773",
|
|
4
4
|
"description": "Parliament chart visualization library for React",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devEngines": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build-storybook": "storybook build",
|
|
28
28
|
"build": "tsc --noEmit && vite build",
|
|
29
|
+
"build:watch": "vite build --watch",
|
|
29
30
|
"check:all": "npm run format && npm run check:lint:fix && npm run check:lint && npm run check:types && npm run test && npm run check:unused",
|
|
30
31
|
"check:biome:fix": "biome check --write",
|
|
31
32
|
"check:biome": "biome check",
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"d3-array": "^3.2.4",
|
|
58
59
|
"d3-axis": "^3.0.0",
|
|
59
60
|
"d3-brush": "^3.0.0",
|
|
61
|
+
"d3-force": "^3.0.0",
|
|
60
62
|
"d3-selection": "^3.0.0",
|
|
61
63
|
"d3-transition": "^3.0.1",
|
|
62
64
|
"gsap": "^3.13.0",
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { TimelineEvent } from '../timeline-chart/timeline-chart.types';
|
|
2
|
-
export type ChronoPerspectiveMode = 'point-in-time' | 'historical';
|
|
3
|
-
export type ChronoPerspectiveCategory = {
|
|
4
|
-
id: string;
|
|
5
|
-
label: string;
|
|
6
|
-
color: string;
|
|
7
|
-
parliamentMapping?: {
|
|
8
|
-
isSpecialCategory: boolean;
|
|
9
|
-
hatchPattern?: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export type ChronoPerspectiveData = {
|
|
13
|
-
timeSeries: Array<{
|
|
14
|
-
timestamp: number;
|
|
15
|
-
values: Record<string, number>;
|
|
16
|
-
}>;
|
|
17
|
-
categories: ChronoPerspectiveCategory[];
|
|
18
|
-
metadata: {
|
|
19
|
-
totalRepositories: number;
|
|
20
|
-
specialCounts?: {
|
|
21
|
-
notApplicable: number;
|
|
22
|
-
noLst: number;
|
|
23
|
-
unavailable: number;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
events?: TimelineEvent[];
|
|
27
|
-
};
|
|
28
|
-
export type ChronoPerspectiveChartProps = {
|
|
29
|
-
data: ChronoPerspectiveData;
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated Use selectedIndex instead. Will be removed in next major version.
|
|
32
|
-
* Mode prop kept for backward compatibility only.
|
|
33
|
-
*/
|
|
34
|
-
mode?: ChronoPerspectiveMode;
|
|
35
|
-
/**
|
|
36
|
-
* Index of the time series data point to display in point-in-time mode.
|
|
37
|
-
* - If set: Chart shows point-in-time view for data at this index
|
|
38
|
-
* - If undefined: Chart shows historical view
|
|
39
|
-
* - If data.timeSeries.length === 1: Automatically shows point-in-time mode
|
|
40
|
-
*
|
|
41
|
-
* Note: Changing selectedIndex does NOT trigger animation. Animation only
|
|
42
|
-
* plays when toggling between point-in-time and historical modes.
|
|
43
|
-
*/
|
|
44
|
-
selectedIndex?: number;
|
|
45
|
-
title?: string;
|
|
46
|
-
subtitle?: string;
|
|
47
|
-
showHeader?: boolean;
|
|
48
|
-
height?: number;
|
|
49
|
-
timeRange?: [number, number];
|
|
50
|
-
onTimeRangeChange?: (range: [number, number]) => void;
|
|
51
|
-
enableBrush?: boolean;
|
|
52
|
-
showLegend?: boolean;
|
|
53
|
-
showTooltip?: boolean;
|
|
54
|
-
showGrid?: boolean;
|
|
55
|
-
enableAnimation?: boolean;
|
|
56
|
-
animationDuration?: number;
|
|
57
|
-
formatDate?: (timestamp: number) => string;
|
|
58
|
-
formatValue?: (value: number) => string;
|
|
59
|
-
onAnimationStateChange?: (isAnimating: boolean) => void;
|
|
60
|
-
onTimelineReady?: (timeline: unknown) => void;
|
|
61
|
-
onAnimationProgress?: (progress: number, stage: string) => void;
|
|
62
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type CategoryTableItem = {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
value: number;
|
|
5
|
-
percentage: number;
|
|
6
|
-
color: string;
|
|
7
|
-
tooltip?: string;
|
|
8
|
-
};
|
|
9
|
-
export type CategoryTableProps = {
|
|
10
|
-
categories: CategoryTableItem[];
|
|
11
|
-
activeCategory: string | null;
|
|
12
|
-
onCategoryHover: (categoryId: string | null) => void;
|
|
13
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MorphChartCategory, MorphChartDataPoint } from '../../morph-chart/morph-chart.types';
|
|
2
|
-
import { ChronoPerspectiveData } from '../chrono-perspective-chart.types';
|
|
3
|
-
import { CategoryTableItem } from '../components/category-table.types';
|
|
4
|
-
export declare const extractLatestValues: (data: ChronoPerspectiveData) => CategoryTableItem[];
|
|
5
|
-
export declare const transformToMorphChart: (data: ChronoPerspectiveData) => {
|
|
6
|
-
data: MorphChartDataPoint[];
|
|
7
|
-
categories: MorphChartCategory[];
|
|
8
|
-
};
|
|
9
|
-
export declare const validateChronoPerspectiveData: (data: ChronoPerspectiveData) => void;
|