@shohojdhara/atomix 0.5.1 → 0.5.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/atomix.config.ts +12 -0
- package/build-tools/webpack-loader.js +5 -4
- package/dist/atomix.css +138 -17
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +1 -1
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/webpack-loader.js +5 -4
- package/dist/charts.d.ts +23 -23
- package/dist/charts.js +40 -37
- package/dist/charts.js.map +1 -1
- package/dist/config.d.ts +624 -0
- package/dist/config.js +59 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +2 -2
- package/dist/core.js +111 -50
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +3 -6
- package/dist/forms.js +2 -2
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +1 -1
- package/dist/heavy.js +173 -111
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +98 -65
- package/dist/index.esm.js +427 -422
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +394 -391
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.js +59 -60
- package/dist/layout.js.map +1 -1
- package/dist/theme.js +4 -4
- package/dist/theme.js.map +1 -1
- package/package.json +14 -9
- package/scripts/atomix-cli.js +15 -1
- package/scripts/cli/__tests__/complexity-utils.test.js +24 -0
- package/scripts/cli/__tests__/detector.test.js +50 -0
- package/scripts/cli/__tests__/template-engine.test.js +23 -0
- package/scripts/cli/__tests__/test-setup.js +3 -0
- package/scripts/cli/commands/doctor.js +15 -3
- package/scripts/cli/commands/generate.js +113 -51
- package/scripts/cli/internal/ai-engine.js +30 -10
- package/scripts/cli/internal/complexity-utils.js +60 -0
- package/scripts/cli/internal/component-validator.js +49 -16
- package/scripts/cli/internal/generator.js +89 -36
- package/scripts/cli/internal/hook-generator.js +5 -2
- package/scripts/cli/internal/itcss-generator.js +16 -12
- package/scripts/cli/templates/next-templates.js +81 -30
- package/scripts/cli/templates/storybook-templates.js +12 -2
- package/scripts/cli/utils/detector.js +45 -7
- package/scripts/cli/utils/diagnostics.js +78 -0
- package/scripts/cli/utils/telemetry.js +13 -0
- package/src/components/Accordion/Accordion.stories.tsx +4 -0
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +1 -1
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +219 -0
- package/src/components/AtomixGlass/glass-utils.ts +1 -1
- package/src/components/Button/Button.tsx +114 -57
- package/src/components/Callout/Callout.tsx +4 -4
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/DonutChart.tsx +11 -8
- package/src/components/EdgePanel/EdgePanel.tsx +119 -115
- package/src/components/Form/Select.tsx +4 -4
- package/src/components/List/List.tsx +4 -4
- package/src/components/Navigation/SideMenu/SideMenu.tsx +6 -6
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +1 -1
- package/src/components/ProductReview/ProductReview.tsx +4 -2
- package/src/components/Rating/Rating.tsx +4 -2
- package/src/components/SectionIntro/SectionIntro.tsx +4 -2
- package/src/components/Steps/Steps.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +5 -5
- package/src/components/Testimonial/Testimonial.tsx +4 -2
- package/src/components/VideoPlayer/VideoPlayer.tsx +4 -2
- package/src/layouts/CssGrid/CssGrid.stories.tsx +464 -0
- package/src/layouts/CssGrid/CssGrid.tsx +215 -0
- package/src/layouts/CssGrid/index.ts +8 -0
- package/src/layouts/CssGrid/scripts/CssGrid.js +284 -0
- package/src/layouts/CssGrid/scripts/index.js +43 -0
- package/src/layouts/Grid/scripts/Container.js +139 -0
- package/src/layouts/Grid/scripts/Grid.js +184 -0
- package/src/layouts/Grid/scripts/GridCol.js +273 -0
- package/src/layouts/Grid/scripts/Row.js +154 -0
- package/src/layouts/Grid/scripts/index.js +48 -0
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +71 -59
- package/src/lib/composables/atomix-glass/useGlassSize.ts +1 -1
- package/src/lib/composables/useAccordion.ts +5 -5
- package/src/lib/composables/useAtomixGlass.ts +3 -3
- package/src/lib/composables/useBarChart.ts +2 -2
- package/src/lib/composables/useChart.ts +3 -2
- package/src/lib/composables/useChartToolbar.ts +48 -66
- package/src/lib/composables/useDataTable.ts +1 -1
- package/src/lib/composables/useDatePicker.ts +2 -2
- package/src/lib/composables/useEdgePanel.ts +45 -54
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -5
- package/src/lib/composables/usePhotoViewer.ts +2 -3
- package/src/lib/composables/usePieChart.ts +1 -1
- package/src/lib/composables/usePopover.ts +151 -139
- package/src/lib/composables/useSideMenu.ts +28 -41
- package/src/lib/composables/useSlider.ts +2 -6
- package/src/lib/composables/useTooltip.ts +2 -2
- package/src/lib/config/index.ts +39 -0
- package/src/lib/theme/devtools/Comparator.tsx +1 -1
- package/src/lib/theme/devtools/Inspector.tsx +1 -1
- package/src/lib/theme/devtools/LiveEditor.tsx +1 -1
- package/src/lib/theme/runtime/ThemeProvider.tsx +1 -1
- package/src/styles/01-settings/_index.scss +1 -0
- package/src/styles/01-settings/_settings.atomix-glass.scss +174 -0
- package/src/styles/01-settings/_settings.masonry-grid.scss +42 -6
- package/src/styles/02-tools/_tools.glass.scss +6 -0
- package/src/styles/05-objects/_objects.masonry-grid.scss +162 -24
- package/src/styles/06-components/_components.atomix-glass.scss +4 -4
- package/src/lib/composables/useBreadcrumb.ts +0 -81
- package/src/lib/composables/useChartInteractions.ts +0 -123
- package/src/lib/composables/useChartPerformance.ts +0 -347
- package/src/lib/composables/useDropdown.ts +0 -338
- package/src/lib/composables/useModal.ts +0 -110
- package/src/lib/hooks/usePerformanceMonitor.ts +0 -148
- package/src/lib/utils/displacement-generator.ts +0 -92
- package/src/lib/utils/memoryMonitor.ts +0 -191
- package/src/styles/01-settings/_settings.testtypecheck.scss +0 -53
- package/src/styles/01-settings/_settings.typedbutton.scss +0 -53
- package/src/styles/06-components/_components.testbutton.scss +0 -212
- package/src/styles/06-components/_components.testtypecheck.scss +0 -212
- package/src/styles/06-components/_components.typedbutton.scss +0 -212
|
@@ -110,11 +110,12 @@ export function getAtomixConfig(context) {
|
|
|
110
110
|
|
|
111
111
|
return require(configPath);
|
|
112
112
|
} catch {
|
|
113
|
+
// Return default config matching AtomixConfig interface
|
|
113
114
|
return {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
prefix: 'atomix',
|
|
116
|
+
theme: {
|
|
117
|
+
extend: {}
|
|
118
|
+
}
|
|
118
119
|
};
|
|
119
120
|
}
|
|
120
121
|
}
|
package/dist/charts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Displacement mode for glass effect
|
|
@@ -875,10 +875,10 @@ interface ChartHandlers {
|
|
|
875
875
|
onDataPointClick?: (dataPoint: ChartDataPoint, datasetIndex: number, pointIndex: number) => void;
|
|
876
876
|
onPointHover: (datasetIndex: number, pointIndex: number, x: number, y: number, clientX: number, clientY: number) => void;
|
|
877
877
|
onPointLeave: () => void;
|
|
878
|
-
onMouseMove: (event:
|
|
879
|
-
onMouseDown: (event:
|
|
878
|
+
onMouseMove: (event: React__default.MouseEvent<SVGSVGElement>) => void;
|
|
879
|
+
onMouseDown: (event: React__default.MouseEvent<SVGSVGElement>) => void;
|
|
880
880
|
onMouseUp: () => void;
|
|
881
|
-
onWheel: (event:
|
|
881
|
+
onWheel: (event: React__default.WheelEvent<SVGSVGElement>) => void;
|
|
882
882
|
}
|
|
883
883
|
/**
|
|
884
884
|
* Chart accessibility interface
|
|
@@ -937,7 +937,7 @@ interface LineChartProps extends Omit<ChartProps, 'type'> {
|
|
|
937
937
|
*/
|
|
938
938
|
onBrushSelection?: (startIndex: number, endIndex: number) => void;
|
|
939
939
|
}
|
|
940
|
-
declare const LineChart:
|
|
940
|
+
declare const LineChart: React$1.NamedExoticComponent<LineChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
941
941
|
|
|
942
942
|
interface AreaChartProps extends Omit<LineChartProps, 'lineOptions'> {
|
|
943
943
|
/**
|
|
@@ -945,7 +945,7 @@ interface AreaChartProps extends Omit<LineChartProps, 'lineOptions'> {
|
|
|
945
945
|
*/
|
|
946
946
|
areaOptions?: LineChartProps['lineOptions'];
|
|
947
947
|
}
|
|
948
|
-
declare const AreaChart:
|
|
948
|
+
declare const AreaChart: React$1.NamedExoticComponent<AreaChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
949
949
|
|
|
950
950
|
/**
|
|
951
951
|
* Bar chart specific options
|
|
@@ -1023,7 +1023,7 @@ interface BarChartProps extends Omit<ChartProps, 'type'> {
|
|
|
1023
1023
|
*/
|
|
1024
1024
|
horizontal?: boolean;
|
|
1025
1025
|
}
|
|
1026
|
-
declare const BarChart:
|
|
1026
|
+
declare const BarChart: React$1.NamedExoticComponent<BarChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1027
1027
|
|
|
1028
1028
|
interface BubbleDataPoint {
|
|
1029
1029
|
label: string;
|
|
@@ -1089,7 +1089,7 @@ interface BubbleChartProps extends Omit<ChartProps, 'type' | 'datasets'> {
|
|
|
1089
1089
|
sizeBasedColoring?: boolean;
|
|
1090
1090
|
};
|
|
1091
1091
|
}
|
|
1092
|
-
declare const BubbleChart:
|
|
1092
|
+
declare const BubbleChart: React$1.NamedExoticComponent<BubbleChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1093
1093
|
|
|
1094
1094
|
interface CandlestickDataPoint {
|
|
1095
1095
|
/**
|
|
@@ -1188,14 +1188,14 @@ interface CandlestickChartProps extends Omit<ChartProps, 'type' | 'datasets' | '
|
|
|
1188
1188
|
showTooltips?: boolean;
|
|
1189
1189
|
};
|
|
1190
1190
|
}
|
|
1191
|
-
declare const CandlestickChart:
|
|
1191
|
+
declare const CandlestickChart: React$1.NamedExoticComponent<CandlestickChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1192
1192
|
|
|
1193
|
-
declare const Chart:
|
|
1193
|
+
declare const Chart: React$1.NamedExoticComponent<ChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1194
1194
|
|
|
1195
1195
|
/**
|
|
1196
1196
|
* Enhanced chart renderer component with comprehensive functionality
|
|
1197
1197
|
*/
|
|
1198
|
-
declare const ChartRenderer:
|
|
1198
|
+
declare const ChartRenderer: React$1.NamedExoticComponent<{
|
|
1199
1199
|
datasets: ChartProps$1["datasets"];
|
|
1200
1200
|
config?: ChartProps$1["config"];
|
|
1201
1201
|
width?: number;
|
|
@@ -1206,7 +1206,7 @@ declare const ChartRenderer: react.MemoExoticComponent<react.ForwardRefExoticCom
|
|
|
1206
1206
|
enableAccessibility?: boolean;
|
|
1207
1207
|
enablePerformanceOptimization?: boolean;
|
|
1208
1208
|
renderContent: (params: ChartRenderContentParams) => React.ReactNode;
|
|
1209
|
-
} &
|
|
1209
|
+
} & React$1.RefAttributes<SVGSVGElement>>;
|
|
1210
1210
|
|
|
1211
1211
|
/**
|
|
1212
1212
|
* Pie chart specific options
|
|
@@ -1272,7 +1272,7 @@ interface PieChartProps extends Omit<ChartProps, 'type'> {
|
|
|
1272
1272
|
*/
|
|
1273
1273
|
pieOptions?: PieChartOptions;
|
|
1274
1274
|
}
|
|
1275
|
-
declare const PieChart:
|
|
1275
|
+
declare const PieChart: React$1.NamedExoticComponent<PieChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1276
1276
|
|
|
1277
1277
|
interface DonutChartProps extends Omit<PieChartProps, 'type'> {
|
|
1278
1278
|
/**
|
|
@@ -1301,7 +1301,7 @@ interface DonutChartProps extends Omit<PieChartProps, 'type'> {
|
|
|
1301
1301
|
roundedCorners?: boolean;
|
|
1302
1302
|
};
|
|
1303
1303
|
}
|
|
1304
|
-
declare const DonutChart:
|
|
1304
|
+
declare const DonutChart: React$1.NamedExoticComponent<DonutChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1305
1305
|
|
|
1306
1306
|
interface FunnelDataPoint {
|
|
1307
1307
|
label: string;
|
|
@@ -1393,7 +1393,7 @@ interface FunnelChartProps extends Omit<ChartProps, 'type' | 'datasets'> {
|
|
|
1393
1393
|
minSegmentRatio?: number;
|
|
1394
1394
|
};
|
|
1395
1395
|
}
|
|
1396
|
-
declare const FunnelChart:
|
|
1396
|
+
declare const FunnelChart: React$1.NamedExoticComponent<FunnelChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1397
1397
|
|
|
1398
1398
|
interface GaugeChartProps extends Omit<ChartProps, 'type' | 'datasets'> {
|
|
1399
1399
|
/**
|
|
@@ -1491,7 +1491,7 @@ interface GaugeChartProps extends Omit<ChartProps, 'type' | 'datasets'> {
|
|
|
1491
1491
|
labelPosition?: 'top' | 'bottom' | 'center';
|
|
1492
1492
|
};
|
|
1493
1493
|
}
|
|
1494
|
-
declare const GaugeChart:
|
|
1494
|
+
declare const GaugeChart: React$1.NamedExoticComponent<GaugeChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1495
1495
|
|
|
1496
1496
|
interface HeatmapDataPoint {
|
|
1497
1497
|
x: string | number;
|
|
@@ -1564,7 +1564,7 @@ interface HeatmapChartProps extends Omit<ChartProps, 'type' | 'datasets' | 'vari
|
|
|
1564
1564
|
*/
|
|
1565
1565
|
showGrid?: boolean;
|
|
1566
1566
|
}
|
|
1567
|
-
declare const HeatmapChart:
|
|
1567
|
+
declare const HeatmapChart: React$1.NamedExoticComponent<HeatmapChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1568
1568
|
|
|
1569
1569
|
interface AxisConfig {
|
|
1570
1570
|
/**
|
|
@@ -1681,7 +1681,7 @@ interface MultiAxisChartProps extends Omit<ChartProps$1, 'type'> {
|
|
|
1681
1681
|
spanGaps?: boolean;
|
|
1682
1682
|
};
|
|
1683
1683
|
}
|
|
1684
|
-
declare const MultiAxisChart:
|
|
1684
|
+
declare const MultiAxisChart: React$1.NamedExoticComponent<MultiAxisChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1685
1685
|
|
|
1686
1686
|
interface RadarChartProps extends Omit<ChartProps$1, 'type'> {
|
|
1687
1687
|
/**
|
|
@@ -1738,7 +1738,7 @@ interface RadarChartProps extends Omit<ChartProps$1, 'type'> {
|
|
|
1738
1738
|
scaleMax?: number;
|
|
1739
1739
|
};
|
|
1740
1740
|
}
|
|
1741
|
-
declare const RadarChart:
|
|
1741
|
+
declare const RadarChart: React$1.NamedExoticComponent<RadarChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1742
1742
|
|
|
1743
1743
|
interface ScatterChartProps extends Omit<ChartProps, 'type'> {
|
|
1744
1744
|
/**
|
|
@@ -1759,7 +1759,7 @@ interface ScatterChartProps extends Omit<ChartProps, 'type'> {
|
|
|
1759
1759
|
enableHoverEffects?: boolean;
|
|
1760
1760
|
};
|
|
1761
1761
|
}
|
|
1762
|
-
declare const ScatterChart:
|
|
1762
|
+
declare const ScatterChart: React$1.NamedExoticComponent<ScatterChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1763
1763
|
|
|
1764
1764
|
interface TreemapDataPoint {
|
|
1765
1765
|
id: string;
|
|
@@ -1849,7 +1849,7 @@ interface TreemapChartProps extends Omit<ChartProps$1, 'type' | 'datasets'> {
|
|
|
1849
1849
|
enableSelection?: boolean;
|
|
1850
1850
|
};
|
|
1851
1851
|
}
|
|
1852
|
-
declare const TreemapChart:
|
|
1852
|
+
declare const TreemapChart: React$1.NamedExoticComponent<TreemapChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1853
1853
|
|
|
1854
1854
|
interface WaterfallDataPoint {
|
|
1855
1855
|
label: string;
|
|
@@ -1934,7 +1934,7 @@ interface WaterfallChartProps extends Omit<ChartProps$1, 'type' | 'datasets'> {
|
|
|
1934
1934
|
baselineColor?: string;
|
|
1935
1935
|
};
|
|
1936
1936
|
}
|
|
1937
|
-
declare const WaterfallChart:
|
|
1937
|
+
declare const WaterfallChart: React$1.NamedExoticComponent<WaterfallChartProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1938
1938
|
|
|
1939
1939
|
export { AreaChart, BarChart, BubbleChart, CandlestickChart, Chart, ChartRenderer, DonutChart, FunnelChart, GaugeChart, HeatmapChart, LineChart, MultiAxisChart, PieChart, RadarChart, ScatterChart, TreemapChart, WaterfallChart };
|
|
1940
1940
|
export type { AreaChartProps, BarChartProps, BubbleChartProps, BubbleDataPoint, CandlestickChartProps, CandlestickDataPoint, ChartProps$1 as ChartProps, DonutChartProps, FunnelChartProps, FunnelDataPoint, GaugeChartProps, HeatmapChartProps, HeatmapDataPoint, LineChartProps, MultiAxisChartProps, PieChartProps, RadarChartProps, ScatterChartProps, ScatterDataPoint, TreemapChartProps, TreemapDataPoint, TreemapNode, WaterfallChartProps, WaterfallDataPoint };
|
package/dist/charts.js
CHANGED
|
@@ -768,8 +768,11 @@ function useChart(initialProps) {
|
|
|
768
768
|
}), animationFrameRef = useRef(null);
|
|
769
769
|
// Default chart properties
|
|
770
770
|
// Cleanup animation frame on unmount
|
|
771
|
-
useEffect((() =>
|
|
772
|
-
|
|
771
|
+
useEffect((() => {
|
|
772
|
+
const currentRef = animationFrameRef.current;
|
|
773
|
+
return () => {
|
|
774
|
+
currentRef && cancelAnimationFrame(currentRef);
|
|
775
|
+
};
|
|
773
776
|
}), []);
|
|
774
777
|
/**
|
|
775
778
|
* Point interaction handlers
|
|
@@ -4018,8 +4021,8 @@ toolbarConfig: toolbarConfig, customToolbarActions: customToolbarActions, custom
|
|
|
4018
4021
|
}), [ chartType ]), finalDefaults = useMemo((() => ({
|
|
4019
4022
|
...getChartDefaults(),
|
|
4020
4023
|
...defaults
|
|
4021
|
-
})), [ getChartDefaults, defaults ]), enhancedHandlers = {
|
|
4022
|
-
onRefresh:
|
|
4024
|
+
})), [ getChartDefaults, defaults ]), enhancedHandlers = useMemo((() => ({
|
|
4025
|
+
onRefresh: () => {
|
|
4023
4026
|
setState((prev => ({
|
|
4024
4027
|
...prev,
|
|
4025
4028
|
isRefreshing: !0
|
|
@@ -4029,8 +4032,8 @@ toolbarConfig: toolbarConfig, customToolbarActions: customToolbarActions, custom
|
|
|
4029
4032
|
isRefreshing: !1
|
|
4030
4033
|
})));
|
|
4031
4034
|
}), 1e3);
|
|
4032
|
-
}
|
|
4033
|
-
onExport:
|
|
4035
|
+
},
|
|
4036
|
+
onExport: async format => {
|
|
4034
4037
|
setState((prev => ({
|
|
4035
4038
|
...prev,
|
|
4036
4039
|
isExporting: !0
|
|
@@ -4043,70 +4046,70 @@ toolbarConfig: toolbarConfig, customToolbarActions: customToolbarActions, custom
|
|
|
4043
4046
|
isExporting: !1
|
|
4044
4047
|
})));
|
|
4045
4048
|
}
|
|
4046
|
-
}
|
|
4047
|
-
onFullscreen:
|
|
4049
|
+
},
|
|
4050
|
+
onFullscreen: isFullscreen => {
|
|
4048
4051
|
setState((prev => ({
|
|
4049
4052
|
...prev,
|
|
4050
4053
|
isFullscreen: isFullscreen
|
|
4051
4054
|
}))), handlers.onFullscreen?.(isFullscreen);
|
|
4052
|
-
}
|
|
4053
|
-
onZoomIn:
|
|
4055
|
+
},
|
|
4056
|
+
onZoomIn: () => {
|
|
4054
4057
|
setState((prev => ({
|
|
4055
4058
|
...prev,
|
|
4056
4059
|
zoomLevel: Math.min(1.2 * prev.zoomLevel, 5)
|
|
4057
4060
|
}))), handlers.onZoomIn?.();
|
|
4058
|
-
}
|
|
4059
|
-
onZoomOut:
|
|
4061
|
+
},
|
|
4062
|
+
onZoomOut: () => {
|
|
4060
4063
|
setState((prev => ({
|
|
4061
4064
|
...prev,
|
|
4062
4065
|
zoomLevel: Math.max(prev.zoomLevel / 1.2, .2)
|
|
4063
4066
|
}))), handlers.onZoomOut?.();
|
|
4064
|
-
}
|
|
4065
|
-
onZoomReset:
|
|
4067
|
+
},
|
|
4068
|
+
onZoomReset: () => {
|
|
4066
4069
|
setState((prev => ({
|
|
4067
4070
|
...prev,
|
|
4068
4071
|
zoomLevel: 1
|
|
4069
4072
|
}))), handlers.onZoomReset?.();
|
|
4070
|
-
}
|
|
4071
|
-
onPanToggle:
|
|
4073
|
+
},
|
|
4074
|
+
onPanToggle: enabled => {
|
|
4072
4075
|
setState((prev => ({
|
|
4073
4076
|
...prev,
|
|
4074
4077
|
panEnabled: enabled
|
|
4075
4078
|
}))), handlers.onPanToggle?.(enabled);
|
|
4076
|
-
}
|
|
4077
|
-
onReset:
|
|
4079
|
+
},
|
|
4080
|
+
onReset: () => {
|
|
4078
4081
|
setState((prev => ({
|
|
4079
4082
|
...prev,
|
|
4080
4083
|
zoomLevel: 1,
|
|
4081
4084
|
panEnabled: !1
|
|
4082
4085
|
}))), handlers.onReset?.();
|
|
4083
|
-
}
|
|
4084
|
-
onGridToggle:
|
|
4086
|
+
},
|
|
4087
|
+
onGridToggle: show => {
|
|
4085
4088
|
setState((prev => ({
|
|
4086
4089
|
...prev,
|
|
4087
4090
|
showGrid: show
|
|
4088
4091
|
}))), handlers.onGridToggle?.(show);
|
|
4089
|
-
}
|
|
4090
|
-
onLegendToggle:
|
|
4092
|
+
},
|
|
4093
|
+
onLegendToggle: show => {
|
|
4091
4094
|
setState((prev => ({
|
|
4092
4095
|
...prev,
|
|
4093
4096
|
showLegend: show
|
|
4094
4097
|
}))), handlers.onLegendToggle?.(show);
|
|
4095
|
-
}
|
|
4096
|
-
onTooltipsToggle:
|
|
4098
|
+
},
|
|
4099
|
+
onTooltipsToggle: show => {
|
|
4097
4100
|
setState((prev => ({
|
|
4098
4101
|
...prev,
|
|
4099
4102
|
showTooltips: show
|
|
4100
4103
|
}))), handlers.onTooltipsToggle?.(show);
|
|
4101
|
-
}
|
|
4102
|
-
onAnimationsToggle:
|
|
4104
|
+
},
|
|
4105
|
+
onAnimationsToggle: enabled => {
|
|
4103
4106
|
setState((prev => ({
|
|
4104
4107
|
...prev,
|
|
4105
4108
|
animationsEnabled: enabled
|
|
4106
4109
|
}))), handlers.onAnimationsToggle?.(enabled);
|
|
4107
|
-
}
|
|
4108
|
-
onSettings:
|
|
4109
|
-
}, generateToolbarGroups = useCallback((() => {
|
|
4110
|
+
},
|
|
4111
|
+
onSettings: () => {}
|
|
4112
|
+
})), [ handlers ]), generateToolbarGroups = useCallback((() => {
|
|
4110
4113
|
const groups = [], dataActions = [];
|
|
4111
4114
|
// Data actions group
|
|
4112
4115
|
finalDefaults.refresh && dataActions.push({
|
|
@@ -4231,7 +4234,7 @@ toolbarConfig: toolbarConfig, customToolbarActions: customToolbarActions, custom
|
|
|
4231
4234
|
actions: customActions
|
|
4232
4235
|
});
|
|
4233
4236
|
return groups;
|
|
4234
|
-
}), [
|
|
4237
|
+
}), [ finalDefaults, state, enhancedHandlers, customActions, customGroups ]);
|
|
4235
4238
|
// Keyboard shortcuts
|
|
4236
4239
|
return useEffect((() => {
|
|
4237
4240
|
const handleKeyDown = event => {
|
|
@@ -4823,7 +4826,7 @@ const ChartRenderer = memo( forwardRef((({datasets: datasets = [], config: conf
|
|
|
4823
4826
|
announcement: announcement,
|
|
4824
4827
|
focusedPoint: focusedPoint,
|
|
4825
4828
|
getAccessibleDescription: () => "Chart description"
|
|
4826
|
-
})), [ announcement, focusedPoint ]), transform = useMemo((() => chartContext ? `translate(${chartContext.panOffset.x}px, ${chartContext.panOffset.y}px) scale(${chartContext.zoomLevel})` : ""), [ chartContext
|
|
4829
|
+
})), [ announcement, focusedPoint ]), transform = useMemo((() => chartContext ? `translate(${chartContext.panOffset.x}px, ${chartContext.panOffset.y}px) scale(${chartContext.zoomLevel})` : ""), [ chartContext ]), chartData = useMemo((() => {
|
|
4827
4830
|
// Return null if dimensions not ready to prevent calculation with invalid dimensions
|
|
4828
4831
|
if (!isInitialized || 0 === dimensions.width || 0 === dimensions.height) return null;
|
|
4829
4832
|
const scales = calculateScales(processedData, dimensions.width, dimensions.height, void 0, config);
|
|
@@ -5240,7 +5243,7 @@ const BarChart = memo( forwardRef((({datasets: datasets = [], config: config =
|
|
|
5240
5243
|
opacity: .4
|
|
5241
5244
|
} ]
|
|
5242
5245
|
};
|
|
5243
|
-
})) : []), [ options.useGradients ]), formatValue = useCallback((value => options.valueFormatter ? options.valueFormatter(value) : value.toString()), [ options
|
|
5246
|
+
})) : []), [ options.useGradients ]), formatValue = useCallback((value => options.valueFormatter ? options.valueFormatter(value) : value.toString()), [ options ]);
|
|
5244
5247
|
return {
|
|
5245
5248
|
// State
|
|
5246
5249
|
hoveredBar: hoveredBar,
|
|
@@ -5266,7 +5269,7 @@ const BarChart = memo( forwardRef((({datasets: datasets = [], config: config =
|
|
|
5266
5269
|
y: horizontal ? y + height / 2 : y - 5
|
|
5267
5270
|
};
|
|
5268
5271
|
}
|
|
5269
|
-
}), [ options
|
|
5272
|
+
}), [ options ]),
|
|
5270
5273
|
// Handlers
|
|
5271
5274
|
handleBarHover: handleBarHover,
|
|
5272
5275
|
handleBarLeave: handleBarLeave,
|
|
@@ -5570,13 +5573,13 @@ const DonutChart = memo( forwardRef((({datasets: datasets = [], config: config
|
|
|
5570
5573
|
roundedCorners: !0
|
|
5571
5574
|
}, onDataPointClick: onDataPointClick, ...props}, ref) => {
|
|
5572
5575
|
// Use the first dataset for donut chart
|
|
5573
|
-
const dataset = datasets.length > 0 ? datasets[0] : {
|
|
5576
|
+
const dataset = useMemo((() => datasets.length > 0 ? datasets[0] : {
|
|
5574
5577
|
label: "",
|
|
5575
5578
|
data: []
|
|
5576
|
-
}, chartData = useMemo((() => {
|
|
5579
|
+
}), [ datasets ]), chartData = useMemo((() => {
|
|
5577
5580
|
if (!dataset?.data?.length) return null;
|
|
5578
5581
|
// Filter out invalid data points
|
|
5579
|
-
const validDataPoints = dataset?.data
|
|
5582
|
+
const validDataPoints = (dataset?.data || []).filter((point => "number" == typeof point.value && !isNaN(point.value) && isFinite(point.value) && point.value > 0));
|
|
5580
5583
|
return validDataPoints.length ? {
|
|
5581
5584
|
validDataPoints: validDataPoints
|
|
5582
5585
|
} : null;
|
|
@@ -6535,7 +6538,7 @@ const PieChart = memo( forwardRef((({datasets: datasets = [], config: config =
|
|
|
6535
6538
|
const parts = [];
|
|
6536
6539
|
return !1 !== options.showLabels && parts.push(slice.label), options.showPercentages && parts.push(`${Math.round(slice.percentage)}%`),
|
|
6537
6540
|
options.showValues && parts.push(slice.value.toString()), parts.join(" - ");
|
|
6538
|
-
}), [ options
|
|
6541
|
+
}), [ options ]), getSliceTransform = useCallback(((slice, isHovered) => isHovered && options.enableHoverEffects && options.hoverOffset ? `translate(${Math.cos(slice.midAngle) * options.hoverOffset}, ${Math.sin(slice.midAngle) * options.hoverOffset})` : ""), [ options.enableHoverEffects, options.hoverOffset ]), isSliceSelected = useCallback((index => selectedSlices.has(index)), [ selectedSlices ]);
|
|
6539
6542
|
return {
|
|
6540
6543
|
// Data
|
|
6541
6544
|
processedData: processedData,
|