@shohojdhara/atomix 0.4.6 → 0.4.8
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/atomix.css +61 -56
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +4 -4
- package/dist/atomix.min.css.map +1 -1
- package/dist/charts.d.ts +93 -109
- package/dist/charts.js +141 -233
- package/dist/charts.js.map +1 -1
- package/dist/core.js +51 -46
- package/dist/core.js.map +1 -1
- package/dist/forms.js +51 -46
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js +51 -46
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +6 -22
- package/dist/index.esm.js +141 -234
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +144 -237
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/scripts/atomix-cli.js +40 -1875
- package/scripts/cli/commands/build-theme.js +112 -0
- package/scripts/cli/commands/generate.js +97 -0
- package/scripts/cli/commands/init.js +46 -0
- package/scripts/cli/internal/compiler.js +114 -0
- package/scripts/cli/internal/filesystem.js +58 -0
- package/scripts/cli/internal/generator.js +110 -0
- package/scripts/cli/internal/wizard.js +61 -0
- package/scripts/cli/utils/error.js +47 -0
- package/scripts/cli/utils/helpers.js +43 -0
- package/scripts/cli/utils/logger.js +75 -0
- package/scripts/cli/utils/validation.js +71 -0
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +37 -3
- package/src/components/AtomixGlass/AtomixGlass.tsx +41 -29
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +4 -19
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +216 -0
- package/src/components/Chart/BubbleChart.tsx +6 -2
- package/src/components/Chart/Chart.stories.tsx +108 -96
- package/src/components/Chart/ChartToolbar.tsx +6 -4
- package/src/components/Chart/ChartTooltip.tsx +5 -4
- package/src/components/Chart/GaugeChart.tsx +20 -12
- package/src/components/Chart/HeatmapChart.tsx +53 -23
- package/src/components/Chart/TreemapChart.tsx +44 -15
- package/src/components/Chart/index.ts +0 -2
- package/src/components/Chart/types.ts +4 -4
- package/src/components/index.ts +0 -1
- package/src/lib/composables/useAtomixGlass.ts +4 -1
- package/src/lib/composables/useAtomixGlassStyles.ts +9 -7
- package/src/lib/constants/components.ts +7 -7
- package/src/styles/01-settings/_settings.chart.scss +13 -13
- package/src/styles/06-components/_components.atomix-glass.scss +17 -21
- package/src/styles/06-components/_components.chart.scss +23 -5
- package/src/styles/06-components/_components.edge-panel.scss +1 -5
- package/src/styles/06-components/_components.modal.scss +1 -4
- package/src/styles/06-components/_components.navbar.scss +1 -1
- package/src/styles/06-components/_components.tooltip.scss +9 -5
- package/scripts/cli/component-generator.js +0 -564
- package/scripts/cli/interactive-init.js +0 -357
- package/scripts/cli/utils.js +0 -359
- package/src/components/Chart/AnimatedChart.tsx +0 -230
package/dist/index.esm.js
CHANGED
|
@@ -1717,20 +1717,20 @@ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
|
|
|
1717
1717
|
SHADER: "c-atomix-glass--shader"
|
|
1718
1718
|
},
|
|
1719
1719
|
DEFAULTS: {
|
|
1720
|
-
DISPLACEMENT_SCALE:
|
|
1721
|
-
BLUR_AMOUNT:
|
|
1720
|
+
DISPLACEMENT_SCALE: 70,
|
|
1721
|
+
BLUR_AMOUNT: 0,
|
|
1722
1722
|
SATURATION: 140,
|
|
1723
|
-
ABERRATION_INTENSITY: 2
|
|
1724
|
-
ELASTICITY: .
|
|
1725
|
-
CORNER_RADIUS:
|
|
1723
|
+
ABERRATION_INTENSITY: 2,
|
|
1724
|
+
ELASTICITY: .15,
|
|
1725
|
+
CORNER_RADIUS: 20,
|
|
1726
1726
|
// Default border-radius matching design system
|
|
1727
|
-
PADDING: "0
|
|
1727
|
+
PADDING: "0",
|
|
1728
1728
|
MODE: "standard",
|
|
1729
1729
|
OVER_LIGHT: !1,
|
|
1730
1730
|
ENABLE_OVER_LIGHT_LAYERS: !0
|
|
1731
1731
|
},
|
|
1732
1732
|
CONSTANTS: {
|
|
1733
|
-
ACTIVATION_ZONE:
|
|
1733
|
+
ACTIVATION_ZONE: 200,
|
|
1734
1734
|
LERP_FACTOR: .08,
|
|
1735
1735
|
SMOOTHSTEP_POWER: 2.5,
|
|
1736
1736
|
MIN_BLUR: .1,
|
|
@@ -2194,10 +2194,7 @@ let idCounter = 0;
|
|
|
2194
2194
|
const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({children: children, className: className = "", style: style, displacementScale: displacementScale = 25, blurAmount: blurAmount = .0625, saturation: saturation = 180, aberrationIntensity: aberrationIntensity = 2, mouseOffset: mouseOffset = {
|
|
2195
2195
|
x: 0,
|
|
2196
2196
|
y: 0
|
|
2197
|
-
},
|
|
2198
|
-
x: 0,
|
|
2199
|
-
y: 0
|
|
2200
|
-
}, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp, isHovered: isHovered = !1, isActive: isActive = !1, overLight: overLight = !1, overLightConfig: overLightConfig = {}, borderRadius: borderRadius = 0, padding: padding = "0 0", glassSize: glassSize = {
|
|
2197
|
+
}, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp, isActive: isActive = !1, overLight: overLight = !1, overLightConfig: overLightConfig = {}, borderRadius: borderRadius = 0, padding: padding = "0 0", glassSize: glassSize = {
|
|
2201
2198
|
width: 0,
|
|
2202
2199
|
height: 0
|
|
2203
2200
|
}, onClick: onClick, mode: mode = "standard", effectiveWithoutEffects: effectiveWithoutEffects = !1, effectiveReducedMotion: effectiveReducedMotion = !1, shaderVariant: shaderVariant = "liquidGlass", withLiquidBlur: withLiquidBlur = !1, contentRef: contentRef}, ref) => {
|
|
@@ -2341,21 +2338,18 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
|
|
|
2341
2338
|
backdropFilter: `blur(${blurAmount}px) saturate(${saturation}%) contrast(1.05) brightness(1.05)`
|
|
2342
2339
|
};
|
|
2343
2340
|
}
|
|
2344
|
-
}), [ liquidBlur, saturation, blurAmount, rectCache, effectiveReducedMotion, effectiveWithoutEffects, withLiquidBlur ]), containerVars = useMemo((() => {
|
|
2341
|
+
}), [ liquidBlur, saturation, blurAmount, rectCache, effectiveReducedMotion, effectiveWithoutEffects, withLiquidBlur, overLightConfig ]), containerVars = useMemo((() => {
|
|
2345
2342
|
try {
|
|
2346
2343
|
// Safe extraction of mouse offset values
|
|
2347
2344
|
const mx = mouseOffset && "number" == typeof mouseOffset.x && !isNaN(mouseOffset.x) ? mouseOffset.x : 0, my = mouseOffset && "number" == typeof mouseOffset.y && !isNaN(mouseOffset.y) ? mouseOffset.y : 0;
|
|
2348
2345
|
return {
|
|
2349
|
-
"--atomix-glass-container-width": `${glassSize?.width}`,
|
|
2350
|
-
"--atomix-glass-container-height": `${glassSize?.height}`,
|
|
2351
|
-
"--atomix-glass-container-padding": padding || "0 0",
|
|
2352
2346
|
"--atomix-glass-container-radius": `${"number" != typeof borderRadius || isNaN(borderRadius) ? 0 : borderRadius}px`,
|
|
2353
2347
|
"--atomix-glass-container-backdrop": backdropStyle?.backdropFilter || "none",
|
|
2354
2348
|
"--atomix-glass-container-shadow": overLight ? [ `inset 0 1px 0 rgba(255, 255, 255, ${(.4 + .002 * mx) * (overLightConfig?.shadowIntensity || 1)})`, `inset 0 -1px 0 rgba(0, 0, 0, ${(.2 + .001 * Math.abs(my)) * (overLightConfig?.shadowIntensity || 1)})`, `inset 0 0 20px rgba(0, 0, 0, ${(.08 + .001 * Math.abs(mx + my)) * (overLightConfig?.shadowIntensity || 1)})`, `0 2px 12px rgba(0, 0, 0, ${(.12 + .002 * Math.abs(my)) * (overLightConfig?.shadowIntensity || 1)})` ].join(", ") : "0 0 20px rgba(0, 0, 0, 0.15) inset, 0 4px 8px rgba(0, 0, 0, 0.08) inset",
|
|
2355
2349
|
"--atomix-glass-container-shadow-opacity": effectiveWithoutEffects ? 0 : 1,
|
|
2356
2350
|
// Background and shadow values use design token-aligned RGB values
|
|
2357
2351
|
"--atomix-glass-container-bg": overLight ? `linear-gradient(${180 + .5 * mx}deg, rgba(255, 255, 255, 0.1) 0%, transparent 20%, transparent 80%, rgba(0, 0, 0, 0.05) 100%)` : "none",
|
|
2358
|
-
"--atomix-glass-container-text-shadow": overLight ? "0px 2px
|
|
2352
|
+
"--atomix-glass-container-text-shadow": overLight ? "0px 1px 2px rgba(255, 255, 255, 0.15)" : "0px 2px 12px rgba(0, 0, 0, 0.4)",
|
|
2359
2353
|
"--atomix-glass-container-box-shadow": overLight ? "0px 16px 70px rgba(0, 0, 0, 0.75)" : "0px 12px 40px rgba(0, 0, 0, 0.25)"
|
|
2360
2354
|
};
|
|
2361
2355
|
} catch (error) {
|
|
@@ -2370,7 +2364,7 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
|
|
|
2370
2364
|
"--atomix-glass-container-text-shadow": "none"
|
|
2371
2365
|
};
|
|
2372
2366
|
}
|
|
2373
|
-
}), [
|
|
2367
|
+
}), [ borderRadius, backdropStyle, mouseOffset, overLight, effectiveWithoutEffects, overLightConfig ]);
|
|
2374
2368
|
return jsx("div", {
|
|
2375
2369
|
ref: el => {
|
|
2376
2370
|
// Apply force no-transition
|
|
@@ -2399,10 +2393,6 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
|
|
|
2399
2393
|
aberrationIntensity: "number" != typeof aberrationIntensity || isNaN(aberrationIntensity) ? 0 : aberrationIntensity,
|
|
2400
2394
|
shaderMapUrl: shaderMapUrl
|
|
2401
2395
|
}), jsx("div", {
|
|
2402
|
-
ref: el => {
|
|
2403
|
-
el && (el.style.setProperty("transition-duration", "0s", "important"), el.style.setProperty("animation-duration", "0s", "important"),
|
|
2404
|
-
el.style.setProperty("transition-delay", "0s", "important"));
|
|
2405
|
-
},
|
|
2406
2396
|
className: ATOMIX_GLASS.FILTER_OVERLAY_CLASS,
|
|
2407
2397
|
style: {
|
|
2408
2398
|
filter: `url(#${filterId})`
|
|
@@ -2507,7 +2497,7 @@ class {
|
|
|
2507
2497
|
}
|
|
2508
2498
|
}, updateAtomixGlassStyles = (wrapperElement, containerElement, params) => {
|
|
2509
2499
|
if (!wrapperElement && !containerElement) return;
|
|
2510
|
-
const {mouseOffset: mouseOffset, globalMousePosition: globalMousePosition, glassSize: glassSize, isHovered: isHovered, isActive: isActive, isOverLight: isOverLight, baseOverLightConfig: baseOverLightConfig, effectiveBorderRadius: effectiveBorderRadius, effectiveWithoutEffects: effectiveWithoutEffects, effectiveReducedMotion: effectiveReducedMotion, elasticity: elasticity, directionalScale: directionalScale, onClick: onClick, withLiquidBlur: withLiquidBlur, blurAmount: blurAmount = ATOMIX_GLASS.DEFAULTS.BLUR_AMOUNT, saturation: saturation = ATOMIX_GLASS.DEFAULTS.SATURATION, padding: padding = ATOMIX_GLASS.DEFAULTS.PADDING} = params, mouseInfluence = calculateMouseInfluence(mouseOffset), hoverIntensity = isHovered ? 1.4 : 1, activeIntensity = isActive ? 1.6 : 1, overLightConfig = {
|
|
2500
|
+
const {mouseOffset: mouseOffset, globalMousePosition: globalMousePosition, glassSize: glassSize, isHovered: isHovered, isActive: isActive, isOverLight: isOverLight, baseOverLightConfig: baseOverLightConfig, effectiveBorderRadius: effectiveBorderRadius, effectiveWithoutEffects: effectiveWithoutEffects, effectiveReducedMotion: effectiveReducedMotion, elasticity: elasticity, directionalScale: directionalScale, onClick: onClick, withLiquidBlur: withLiquidBlur, blurAmount: blurAmount = ATOMIX_GLASS.DEFAULTS.BLUR_AMOUNT, saturation: saturation = ATOMIX_GLASS.DEFAULTS.SATURATION, padding: padding = ATOMIX_GLASS.DEFAULTS.PADDING, isFixedOrSticky: isFixedOrSticky = !1} = params, mouseInfluence = calculateMouseInfluence(mouseOffset), hoverIntensity = isHovered ? 1.4 : 1, activeIntensity = isActive ? 1.6 : 1, overLightConfig = {
|
|
2511
2501
|
opacity: baseOverLightConfig.opacity * hoverIntensity * activeIntensity,
|
|
2512
2502
|
contrast: Math.min(1.6, baseOverLightConfig.contrast + .1 * mouseInfluence),
|
|
2513
2503
|
brightness: Math.min(1.1, baseOverLightConfig.brightness + .05 * mouseInfluence),
|
|
@@ -2597,7 +2587,7 @@ class {
|
|
|
2597
2587
|
}
|
|
2598
2588
|
// Update Container Styles (containerVars)
|
|
2599
2589
|
if (containerElement) {
|
|
2600
|
-
const mx = mouseOffset.x, my = mouseOffset.y, EDGE_BLUR_MULTIPLIER =
|
|
2590
|
+
const mx = mouseOffset.x, my = mouseOffset.y, EDGE_BLUR_MULTIPLIER = .5, CENTER_BLUR_MULTIPLIER = .2, FLOW_BLUR_MULTIPLIER = .3, MOUSE_INFLUENCE_BLUR_FACTOR = .4, EDGE_INTENSITY_MOUSE_FACTOR = .15, CENTER_INTENSITY_MOUSE_FACTOR = .1, MAX_BLUR_RELATIVE = 2, rect = containerElement.getBoundingClientRect();
|
|
2601
2591
|
let liquidBlur = {
|
|
2602
2592
|
baseBlur: blurAmount,
|
|
2603
2593
|
edgeBlur: blurAmount * EDGE_BLUR_MULTIPLIER,
|
|
@@ -2619,14 +2609,15 @@ class {
|
|
|
2619
2609
|
backdropFilterString = !withLiquidBlur || effectiveReducedMotion || effectiveWithoutEffects || area > 18e4 ? `blur(${clampBlur(Math.max(liquidBlur.baseBlur, .8 * liquidBlur.edgeBlur, 1.1 * liquidBlur.centerBlur, .9 * liquidBlur.flowBlur))}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(${overLightConfig.contrast}) brightness(${overLightConfig.brightness})` : `blur(${clampBlur(.4 * liquidBlur.baseBlur + .25 * liquidBlur.edgeBlur + .15 * liquidBlur.centerBlur + .2 * liquidBlur.flowBlur)}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(${overLightConfig.contrast}) brightness(${overLightConfig.brightness})`;
|
|
2620
2610
|
// Container variables
|
|
2621
2611
|
const style = containerElement.style;
|
|
2622
|
-
style.setProperty("--atomix-glass-container-width", `${glassSize.width}`
|
|
2612
|
+
style.setProperty("--atomix-glass-container-width", isFixedOrSticky ? `${glassSize.width}` : "100%"),
|
|
2613
|
+
style.setProperty("--atomix-glass-container-height", isFixedOrSticky ? `${glassSize.height}` : "100%"),
|
|
2623
2614
|
style.setProperty("--atomix-glass-container-padding", padding), style.setProperty("--atomix-glass-container-radius", `${effectiveBorderRadius}px`),
|
|
2624
2615
|
style.setProperty("--atomix-glass-container-backdrop", backdropFilterString),
|
|
2625
2616
|
// Shadows
|
|
2626
2617
|
style.setProperty("--atomix-glass-container-shadow", isOverLight ? [ `inset 0 1px 0 rgba(255, 255, 255, ${(.4 + .002 * mx) * (overLightConfig.shadowIntensity || 1)})`, `inset 0 -1px 0 rgba(0, 0, 0, ${(.2 + .001 * Math.abs(my)) * (overLightConfig.shadowIntensity || 1)})`, `inset 0 0 20px rgba(0, 0, 0, ${(.08 + .001 * Math.abs(mx + my)) * (overLightConfig.shadowIntensity || 1)})`, `0 2px 12px rgba(0, 0, 0, ${(.12 + .002 * Math.abs(my)) * (overLightConfig.shadowIntensity || 1)})` ].join(", ") : "0 0 20px rgba(0, 0, 0, 0.15) inset, 0 4px 8px rgba(0, 0, 0, 0.08) inset"),
|
|
2627
2618
|
style.setProperty("--atomix-glass-container-shadow-opacity", effectiveWithoutEffects ? "0" : "1"),
|
|
2628
2619
|
style.setProperty("--atomix-glass-container-bg", isOverLight ? `linear-gradient(${180 + .5 * mx}deg, rgba(255, 255, 255, 0.1) 0%, transparent 20%, transparent 80%, rgba(0, 0, 0, 0.05) 100%)` : "none"),
|
|
2629
|
-
style.setProperty("--atomix-glass-container-text-shadow", isOverLight ? "0px 2px
|
|
2620
|
+
style.setProperty("--atomix-glass-container-text-shadow", isOverLight ? "0px 1px 2px rgba(255, 255, 255, 0.15)" : "0px 2px 12px rgba(0, 0, 0, 0.4)"),
|
|
2630
2621
|
style.setProperty("--atomix-glass-container-box-shadow", isOverLight ? "0px 16px 70px rgba(0, 0, 0, 0.75)" : "0px 12px 40px rgba(0, 0, 0, 0.25)");
|
|
2631
2622
|
}
|
|
2632
2623
|
}, {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS;
|
|
@@ -2647,7 +2638,7 @@ class {
|
|
|
2647
2638
|
* Composable hook for AtomixGlass component logic
|
|
2648
2639
|
* Manages all state, calculations, and event handlers
|
|
2649
2640
|
*/
|
|
2650
|
-
function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef: wrapperRef, borderRadius: borderRadius, globalMousePosition: externalGlobalMousePosition, mouseOffset: externalMouseOffset, mouseContainer: mouseContainer, overLight: overLight = ATOMIX_GLASS.DEFAULTS.OVER_LIGHT, reducedMotion: reducedMotion = !1, highContrast: highContrast = !1, withoutEffects: withoutEffects = !1, elasticity: elasticity = .05, onClick: onClick, debugBorderRadius: debugBorderRadius = !1, debugOverLight: debugOverLight = !1,
|
|
2641
|
+
function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef: wrapperRef, borderRadius: borderRadius, globalMousePosition: externalGlobalMousePosition, mouseOffset: externalMouseOffset, mouseContainer: mouseContainer, overLight: overLight = ATOMIX_GLASS.DEFAULTS.OVER_LIGHT, reducedMotion: reducedMotion = !1, highContrast: highContrast = !1, withoutEffects: withoutEffects = !1, elasticity: elasticity = .05, onClick: onClick, debugBorderRadius: debugBorderRadius = !1, debugOverLight: debugOverLight = !1, children: children, blurAmount: blurAmount, saturation: saturation, padding: padding, withLiquidBlur: withLiquidBlur, isFixedOrSticky: isFixedOrSticky = !1}) {
|
|
2651
2642
|
// State
|
|
2652
2643
|
const [isHovered, setIsHovered] = useState(!1), [isActive, setIsActive] = useState(!1), cachedRectRef = useRef(null), internalGlobalMousePositionRef = useRef({
|
|
2653
2644
|
x: 0,
|
|
@@ -2958,12 +2949,13 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
|
|
|
2958
2949
|
withLiquidBlur: withLiquidBlur,
|
|
2959
2950
|
blurAmount: blurAmount,
|
|
2960
2951
|
saturation: saturation,
|
|
2961
|
-
padding: padding
|
|
2952
|
+
padding: padding,
|
|
2953
|
+
isFixedOrSticky: isFixedOrSticky
|
|
2962
2954
|
}), lerpRafRef.current = requestAnimationFrame(tick);
|
|
2963
2955
|
};
|
|
2964
2956
|
// 0.08 – lower = more viscous
|
|
2965
2957
|
lerpRafRef.current = requestAnimationFrame(tick);
|
|
2966
|
-
}), [ glassRef, wrapperRef, glassSize, isHovered, isActive, overLightConfig, effectiveBorderRadius, effectiveWithoutEffects, effectiveReducedMotion, elasticity, onClick, withLiquidBlur, blurAmount, saturation, padding ]), stopLerpLoop = useCallback((() => {
|
|
2958
|
+
}), [ glassRef, wrapperRef, glassSize, isHovered, isActive, overLightConfig, effectiveBorderRadius, effectiveWithoutEffects, effectiveReducedMotion, elasticity, onClick, withLiquidBlur, blurAmount, saturation, padding, isFixedOrSticky ]), stopLerpLoop = useCallback((() => {
|
|
2967
2959
|
lerpActiveRef.current = !1, null !== lerpRafRef.current && (cancelAnimationFrame(lerpRafRef.current),
|
|
2968
2960
|
lerpRafRef.current = null);
|
|
2969
2961
|
}), []);
|
|
@@ -3110,7 +3102,7 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
|
|
|
3110
3102
|
* <div>Content with debug logging enabled</div>
|
|
3111
3103
|
* </AtomixGlass>
|
|
3112
3104
|
*/ function AtomixGlass({children: children, displacementScale: displacementScale = ATOMIX_GLASS.DEFAULTS.DISPLACEMENT_SCALE, blurAmount: blurAmount = ATOMIX_GLASS.DEFAULTS.BLUR_AMOUNT, saturation: saturation = ATOMIX_GLASS.DEFAULTS.SATURATION, aberrationIntensity: aberrationIntensity = ATOMIX_GLASS.DEFAULTS.ABERRATION_INTENSITY, elasticity: elasticity = ATOMIX_GLASS.DEFAULTS.ELASTICITY, borderRadius: borderRadius, globalMousePosition: externalGlobalMousePosition, mouseOffset: externalMouseOffset, mouseContainer: mouseContainer = null, className: className = "", padding: padding = ATOMIX_GLASS.DEFAULTS.PADDING, overLight: overLight = ATOMIX_GLASS.DEFAULTS.OVER_LIGHT, style: style = {}, mode: mode = ATOMIX_GLASS.DEFAULTS.MODE, onClick: onClick, shaderVariant: shaderVariant = "liquidGlass", "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, role: role, tabIndex: tabIndex, reducedMotion: reducedMotion = !1, highContrast: highContrast = !1, withoutEffects: withoutEffects = !1, withLiquidBlur: withLiquidBlur = !1, withBorder: withBorder = !0, withOverLightLayers: withOverLightLayers = ATOMIX_GLASS.DEFAULTS.ENABLE_OVER_LIGHT_LAYERS, debugPerformance: debugPerformance = !1, debugBorderRadius: debugBorderRadius = !1, debugOverLight: debugOverLight = !1, height: height, width: width, ...rest}) {
|
|
3113
|
-
const glassRef = useRef(null), contentRef = useRef(null), {isHovered: isHovered, isActive: isActive, glassSize: glassSize, effectiveBorderRadius: effectiveBorderRadius, effectiveReducedMotion: effectiveReducedMotion, effectiveHighContrast: effectiveHighContrast, effectiveWithoutEffects: effectiveWithoutEffects, overLightConfig: overLightConfig, globalMousePosition: globalMousePosition, mouseOffset: mouseOffset, transformStyle: transformStyle, handleMouseEnter: handleMouseEnter, handleMouseLeave: handleMouseLeave, handleMouseDown: handleMouseDown, handleMouseUp: handleMouseUp, handleKeyDown: handleKeyDown} = useAtomixGlass({
|
|
3105
|
+
const glassRef = useRef(null), contentRef = useRef(null), {zIndex: customZIndex, ...restStyle} = style, isFixedOrSticky = "fixed" === restStyle.position || "sticky" === restStyle.position, {isHovered: isHovered, isActive: isActive, glassSize: glassSize, effectiveBorderRadius: effectiveBorderRadius, effectiveReducedMotion: effectiveReducedMotion, effectiveHighContrast: effectiveHighContrast, effectiveWithoutEffects: effectiveWithoutEffects, overLightConfig: overLightConfig, globalMousePosition: globalMousePosition, mouseOffset: mouseOffset, transformStyle: transformStyle, handleMouseEnter: handleMouseEnter, handleMouseLeave: handleMouseLeave, handleMouseDown: handleMouseDown, handleMouseUp: handleMouseUp, handleKeyDown: handleKeyDown} = useAtomixGlass({
|
|
3114
3106
|
glassRef: glassRef,
|
|
3115
3107
|
contentRef: contentRef,
|
|
3116
3108
|
borderRadius: borderRadius,
|
|
@@ -3131,8 +3123,9 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
|
|
|
3131
3123
|
saturation: saturation,
|
|
3132
3124
|
withLiquidBlur: withLiquidBlur,
|
|
3133
3125
|
padding: padding,
|
|
3134
|
-
style: style
|
|
3135
|
-
|
|
3126
|
+
style: style,
|
|
3127
|
+
isFixedOrSticky: isFixedOrSticky
|
|
3128
|
+
}), isOverLight = useMemo((() => overLightConfig.isOverLight), [ overLightConfig.isOverLight ]), shouldRenderOverLightLayers = withOverLightLayers && isOverLight, rootLayoutStyle = useMemo((() => {
|
|
3136
3129
|
if (!isFixedOrSticky) return {};
|
|
3137
3130
|
const {position: p, top: t, left: l, right: r, bottom: b} = restStyle;
|
|
3138
3131
|
return {
|
|
@@ -3152,7 +3145,10 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
|
|
|
3152
3145
|
bottom: b
|
|
3153
3146
|
}
|
|
3154
3147
|
};
|
|
3155
|
-
}), [ isFixedOrSticky, restStyle ])
|
|
3148
|
+
}), [ isFixedOrSticky, restStyle ]);
|
|
3149
|
+
// Calculate base style with transforms
|
|
3150
|
+
// When layout is hoisted to the root, strip those props from the container
|
|
3151
|
+
useMemo((() => {
|
|
3156
3152
|
if (isFixedOrSticky) {
|
|
3157
3153
|
const {position: _p, top: _t, left: _l, right: _r, bottom: _b, ...visualStyle} = restStyle;
|
|
3158
3154
|
return {
|
|
@@ -3168,18 +3164,20 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
|
|
|
3168
3164
|
transform: transformStyle
|
|
3169
3165
|
}
|
|
3170
3166
|
};
|
|
3171
|
-
}), [ isFixedOrSticky, restStyle, effectiveWithoutEffects, transformStyle ])
|
|
3167
|
+
}), [ isFixedOrSticky, restStyle, effectiveWithoutEffects, transformStyle ]);
|
|
3168
|
+
// Build className with state modifiers
|
|
3169
|
+
const componentClassName = [ ATOMIX_GLASS.BASE_CLASS, effectiveReducedMotion && `${ATOMIX_GLASS.BASE_CLASS}--reduced-motion`, effectiveHighContrast && `${ATOMIX_GLASS.BASE_CLASS}--high-contrast`, effectiveWithoutEffects && `${ATOMIX_GLASS.BASE_CLASS}--disabled-effects`, className ].filter(Boolean).join(" "), positionStyles = useMemo((() => ({
|
|
3172
3170
|
position: isFixedOrSticky ? "absolute" : restStyle.position || "absolute",
|
|
3173
3171
|
top: isFixedOrSticky ? 0 : restStyle.top || 0,
|
|
3174
3172
|
left: isFixedOrSticky ? 0 : restStyle.left || 0
|
|
3175
3173
|
})), [ isFixedOrSticky, restStyle.position, restStyle.top, restStyle.left ]), adjustedSize = useMemo((() => {
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
};
|
|
3174
|
+
// Keep a reference to positionStyles to avoid unused-variable lint,
|
|
3175
|
+
// but sizing is driven by explicit width/height or measured size.
|
|
3176
|
+
positionStyles.position;
|
|
3177
|
+
const resolveLength = (value, measured) => void 0 !== value ? "number" == typeof value ? `${value}px` : value : measured > 0 ? `${measured}px` : "100%", effectiveWidth = width ?? restStyle.width, effectiveHeight = height ?? restStyle.height;
|
|
3180
3178
|
return {
|
|
3181
|
-
width:
|
|
3182
|
-
height:
|
|
3179
|
+
width: resolveLength(effectiveWidth, glassSize.width),
|
|
3180
|
+
height: resolveLength(effectiveHeight, glassSize.height)
|
|
3183
3181
|
};
|
|
3184
3182
|
}), [ width, height, restStyle.width, restStyle.height, positionStyles.position, glassSize.width, glassSize.height ]), gradientValues = useMemo((() => {
|
|
3185
3183
|
const mx = mouseOffset.x, my = mouseOffset.y, absMx = Math.abs(mx), absMy = Math.abs(my), GRADIENT = ATOMIX_GLASS.CONSTANTS.GRADIENT;
|
|
@@ -3228,9 +3226,10 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
|
|
|
3228
3226
|
},
|
|
3229
3227
|
"--atomix-glass-radius": `${effectiveBorderRadius}px`,
|
|
3230
3228
|
"--atomix-glass-transform": transformStyle || "none",
|
|
3231
|
-
|
|
3232
|
-
"--atomix-glass-
|
|
3233
|
-
"--atomix-glass-
|
|
3229
|
+
// Internal decorative layers are positioned relative to the root;
|
|
3230
|
+
"--atomix-glass-position": rootLayoutStyle.position,
|
|
3231
|
+
"--atomix-glass-top": `${isFixedOrSticky ? rootLayoutStyle.top : 0}px`,
|
|
3232
|
+
"--atomix-glass-left": `${isFixedOrSticky ? rootLayoutStyle.left : 0}px`,
|
|
3234
3233
|
"--atomix-glass-width": adjustedSize.width,
|
|
3235
3234
|
"--atomix-glass-height": adjustedSize.height,
|
|
3236
3235
|
"--atomix-glass-border-width": "var(--atomix-spacing-0-5, 0.09375rem)",
|
|
@@ -3250,10 +3249,12 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
|
|
|
3250
3249
|
"--atomix-glass-overlay-highlight-opacity": opacityValues.over * ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.OPACITY_MULTIPLIER,
|
|
3251
3250
|
"--atomix-glass-overlay-highlight-bg": `radial-gradient(circle at ${ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.POSITION_X}% ${ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.POSITION_Y}%, rgba(255, 255, 255, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.WHITE_OPACITY}) 0%, transparent ${ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.STOP}%)`
|
|
3252
3251
|
};
|
|
3253
|
-
}), [ gradientValues, opacityValues, effectiveBorderRadius, transformStyle,
|
|
3252
|
+
}), [ gradientValues, opacityValues, effectiveBorderRadius, transformStyle, adjustedSize, isOverLight, overLightConfig.borderOpacity, customZIndex, rootLayoutStyle, isFixedOrSticky ]), renderBackgroundLayer = layerType => jsx("div", {
|
|
3254
3253
|
className: [ ATOMIX_GLASS.BACKGROUND_LAYER_CLASS, "dark" === layerType ? ATOMIX_GLASS.BACKGROUND_LAYER_DARK_CLASS : ATOMIX_GLASS.BACKGROUND_LAYER_BLACK_CLASS, isOverLight ? ATOMIX_GLASS.BACKGROUND_LAYER_OVER_LIGHT_CLASS : ATOMIX_GLASS.BACKGROUND_LAYER_HIDDEN_CLASS ].filter(Boolean).join(" ")
|
|
3255
3254
|
});
|
|
3256
|
-
|
|
3255
|
+
// Calculate position and size styles for internal layers
|
|
3256
|
+
// When root is fixed/sticky, internal layers use absolute (relative to root)
|
|
3257
|
+
return jsxs("div", {
|
|
3257
3258
|
...rest,
|
|
3258
3259
|
className: componentClassName,
|
|
3259
3260
|
style: {
|
|
@@ -3270,7 +3271,12 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
|
|
|
3270
3271
|
ref: glassRef,
|
|
3271
3272
|
contentRef: contentRef,
|
|
3272
3273
|
className: className,
|
|
3273
|
-
style:
|
|
3274
|
+
style: {
|
|
3275
|
+
...restStyle,
|
|
3276
|
+
...!isFixedOrSticky && {
|
|
3277
|
+
position: "relative"
|
|
3278
|
+
}
|
|
3279
|
+
},
|
|
3274
3280
|
borderRadius: effectiveBorderRadius,
|
|
3275
3281
|
displacementScale: effectiveWithoutEffects ? 0 : "shader" === mode ? displacementScale * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.SHADER_DISPLACEMENT : isOverLight ? displacementScale * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.OVER_LIGHT_DISPLACEMENT : displacementScale,
|
|
3276
3282
|
blurAmount: effectiveWithoutEffects ? 0 : blurAmount,
|
|
@@ -3301,7 +3307,6 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef:
|
|
|
3301
3307
|
},
|
|
3302
3308
|
onClick: onClick,
|
|
3303
3309
|
mode: mode,
|
|
3304
|
-
transform: baseStyle.transform,
|
|
3305
3310
|
effectiveWithoutEffects: effectiveWithoutEffects,
|
|
3306
3311
|
effectiveReducedMotion: effectiveReducedMotion,
|
|
3307
3312
|
shaderVariant: shaderVariant,
|
|
@@ -5391,7 +5396,7 @@ function getDatasetBounds(data) {
|
|
|
5391
5396
|
pan: !0,
|
|
5392
5397
|
reset: !0
|
|
5393
5398
|
}, exportFormats: exportFormats = [ "png", "svg", "csv" ], size: size = "md", position: position = "top", onRefresh: onRefresh, onExport: onExport, onFullscreen: onFullscreen, onSettings: onSettings, onZoomIn: onZoomIn, onZoomOut: onZoomOut, onZoomReset: onZoomReset, onPanToggle: onPanToggle, onReset: onReset, onGridToggle: onGridToggle, onLegendToggle: onLegendToggle, onTooltipsToggle: onTooltipsToggle, onAnimationsToggle: onAnimationsToggle, state: state = {}, className: className = "", ...props}, ref) => {
|
|
5394
|
-
const [showExportMenu, setShowExportMenu] = useState(!1), [showSettingsMenu, setShowSettingsMenu] = useState(!1), exportMenuRef = useRef(null), settingsMenuRef = useRef(null), exportButtonRef = useRef(null), settingsButtonRef = useRef(null), effectiveDefaults = groups && groups.length > 0 ? {
|
|
5399
|
+
const [showExportMenu, setShowExportMenu] = useState(!1), [showSettingsMenu, setShowSettingsMenu] = useState(!1), exportMenuRef = useRef(null), settingsMenuRef = useRef(null), exportButtonRef = useRef(null), settingsButtonRef = useRef(null), effectiveDefaults = useMemo((() => groups && groups.length > 0 ? {
|
|
5395
5400
|
refresh: defaults.refresh ?? !0,
|
|
5396
5401
|
export: defaults.export ?? !0,
|
|
5397
5402
|
fullscreen: defaults.fullscreen ?? !0,
|
|
@@ -5403,7 +5408,7 @@ function getDatasetBounds(data) {
|
|
|
5403
5408
|
legend: defaults.legend ?? !0,
|
|
5404
5409
|
tooltips: defaults.tooltips ?? !0,
|
|
5405
5410
|
animations: defaults.animations ?? !0
|
|
5406
|
-
} : defaults;
|
|
5411
|
+
} : defaults), [ groups, defaults ]);
|
|
5407
5412
|
// Close menus when clicking outside
|
|
5408
5413
|
useEffect((() => {
|
|
5409
5414
|
const handleClickOutside = event => {
|
|
@@ -6853,120 +6858,6 @@ const BaseChart = memo( forwardRef((({type: type, datasets: datasets = [], conf
|
|
|
6853
6858
|
|
|
6854
6859
|
BaseChart.displayName = "BaseChart";
|
|
6855
6860
|
|
|
6856
|
-
const AnimatedChart = memo( forwardRef((({datasets: datasets = [], config: config = {}, chartType: chartType = "line", particleEffects: particleEffects, onDataPointClick: onDataPointClick, ...props}, ref) => {
|
|
6857
|
-
const animationRef = useRef(0), timeRef = useRef(0), particlesRef = useRef([]);
|
|
6858
|
-
// Animation time tracking - moved outside callback
|
|
6859
|
-
useEffect((() => {
|
|
6860
|
-
const animateFrame = timestamp => {
|
|
6861
|
-
timeRef.current = timestamp, animationRef.current = requestAnimationFrame(animateFrame);
|
|
6862
|
-
};
|
|
6863
|
-
return animationRef.current = requestAnimationFrame(animateFrame), () => {
|
|
6864
|
-
animationRef.current && cancelAnimationFrame(animationRef.current);
|
|
6865
|
-
};
|
|
6866
|
-
}), []);
|
|
6867
|
-
const renderContent = useCallback((({scales: scales, colors: colors, datasets: chartDatasets, handlers: handlers, hoveredPoint: hoveredPoint, toolbarState: toolbarState, config: renderConfig}) => {
|
|
6868
|
-
if (!chartDatasets.length) return null;
|
|
6869
|
-
const chartWidth = scales.width - 80, chartHeight = scales.height - 80, elements = [];
|
|
6870
|
-
// Particle effects
|
|
6871
|
-
if (chartDatasets.forEach(((dataset, datasetIndex) => {
|
|
6872
|
-
const color = dataset.color || colors[datasetIndex % colors.length];
|
|
6873
|
-
switch (chartType) {
|
|
6874
|
-
case "bar":
|
|
6875
|
-
// Create animated bars
|
|
6876
|
-
dataset.data.forEach(((point, pointIndex) => {
|
|
6877
|
-
const barWidth = chartWidth / dataset.data.length * .8, x = 40 + pointIndex * (chartWidth / dataset.data.length) + (chartWidth / dataset.data.length - barWidth) / 2, height = point.value / 100 * chartHeight, y = 40 + chartHeight - height;
|
|
6878
|
-
elements.push(jsx("rect", {
|
|
6879
|
-
x: x,
|
|
6880
|
-
y: y,
|
|
6881
|
-
width: barWidth,
|
|
6882
|
-
height: height,
|
|
6883
|
-
fill: color,
|
|
6884
|
-
style: {
|
|
6885
|
-
transform: `scaleY(${.1 * Math.sin(.01 * timeRef.current + .2 * pointIndex) + .9})`,
|
|
6886
|
-
transformOrigin: "bottom"
|
|
6887
|
-
},
|
|
6888
|
-
onClick: () => handlers.onDataPointClick?.(point, datasetIndex, pointIndex)
|
|
6889
|
-
}, `bar-${datasetIndex}-${pointIndex}`));
|
|
6890
|
-
}));
|
|
6891
|
-
break;
|
|
6892
|
-
|
|
6893
|
-
default:
|
|
6894
|
-
{
|
|
6895
|
-
// Create animated line/area
|
|
6896
|
-
const points = dataset.data.map(((point, pointIndex) => ({
|
|
6897
|
-
x: 40 + pointIndex / (dataset.data.length - 1) * chartWidth,
|
|
6898
|
-
y: 40 + chartHeight - point.value / 100 * chartHeight
|
|
6899
|
-
})));
|
|
6900
|
-
if (points.length > 0) {
|
|
6901
|
-
const linePath = `M ${points.map((p => `${p.x},${p.y}`)).join(" L ")}`;
|
|
6902
|
-
// Area for area chart
|
|
6903
|
-
if ("area" === chartType) {
|
|
6904
|
-
const areaPath = `${linePath} L ${40 + chartWidth},${40 + chartHeight} L 40,${40 + chartHeight} Z`;
|
|
6905
|
-
elements.push(jsx("path", {
|
|
6906
|
-
d: areaPath,
|
|
6907
|
-
fill: color,
|
|
6908
|
-
fillOpacity: "0.3",
|
|
6909
|
-
style: {
|
|
6910
|
-
transform: `translateY(${2 * Math.sin(.01 * timeRef.current)}px)`
|
|
6911
|
-
}
|
|
6912
|
-
}, `area-${datasetIndex}`));
|
|
6913
|
-
}
|
|
6914
|
-
// Line
|
|
6915
|
-
elements.push(jsx("path", {
|
|
6916
|
-
d: linePath,
|
|
6917
|
-
stroke: color,
|
|
6918
|
-
fill: "none",
|
|
6919
|
-
className: "c-chart__data-line",
|
|
6920
|
-
style: {
|
|
6921
|
-
transform: `translateY(${2 * Math.sin(.01 * timeRef.current)}px)`
|
|
6922
|
-
}
|
|
6923
|
-
}, `line-${datasetIndex}`)),
|
|
6924
|
-
// Data points
|
|
6925
|
-
points.forEach(((point, pointIndex) => {
|
|
6926
|
-
elements.push(jsx("circle", {
|
|
6927
|
-
cx: point.x,
|
|
6928
|
-
cy: point.y,
|
|
6929
|
-
r: "4",
|
|
6930
|
-
fill: color,
|
|
6931
|
-
style: {
|
|
6932
|
-
transform: `scale(${1 + .2 * Math.sin(.01 * timeRef.current + pointIndex)})`
|
|
6933
|
-
},
|
|
6934
|
-
onClick: () => handlers.onDataPointClick?.(dataset.data[pointIndex], datasetIndex, pointIndex)
|
|
6935
|
-
}, `point-${datasetIndex}-${pointIndex}`));
|
|
6936
|
-
}));
|
|
6937
|
-
}
|
|
6938
|
-
break;
|
|
6939
|
-
}
|
|
6940
|
-
}
|
|
6941
|
-
})), particleEffects?.enabled) for (let i = 0; i < particleEffects.count; i++) {
|
|
6942
|
-
const particle = particlesRef.current[i];
|
|
6943
|
-
particle && elements.push(jsx("circle", {
|
|
6944
|
-
cx: particle.x,
|
|
6945
|
-
cy: particle.y,
|
|
6946
|
-
r: particle.size,
|
|
6947
|
-
fill: particle.color,
|
|
6948
|
-
style: {
|
|
6949
|
-
opacity: particle.life
|
|
6950
|
-
}
|
|
6951
|
-
}, `particle-${i}`));
|
|
6952
|
-
}
|
|
6953
|
-
return jsx("g", {
|
|
6954
|
-
children: elements
|
|
6955
|
-
});
|
|
6956
|
-
}), [ chartType, particleEffects ]);
|
|
6957
|
-
return jsx(BaseChart, {
|
|
6958
|
-
ref: ref,
|
|
6959
|
-
type: "line",
|
|
6960
|
-
datasets: datasets,
|
|
6961
|
-
config: config,
|
|
6962
|
-
renderContent: renderContent,
|
|
6963
|
-
onDataPointClick: onDataPointClick,
|
|
6964
|
-
...props
|
|
6965
|
-
});
|
|
6966
|
-
})));
|
|
6967
|
-
|
|
6968
|
-
AnimatedChart.displayName = "AnimatedChart";
|
|
6969
|
-
|
|
6970
6861
|
const ChartTooltip = memo((({dataPoint: dataPoint, datasetLabel: datasetLabel, datasetColor: datasetColor, position: position, visible: visible, customRenderer: customRenderer}) => {
|
|
6971
6862
|
const tooltipRef = useRef(null), [adjustedPosition, setAdjustedPosition] = useState(position);
|
|
6972
6863
|
// Dynamic positioning to keep tooltip in viewport
|
|
@@ -6988,15 +6879,16 @@ const ChartTooltip = memo((({dataPoint: dataPoint, datasetLabel: datasetLabel,
|
|
|
6988
6879
|
ref: tooltipRef,
|
|
6989
6880
|
className: "c-chart__tooltip",
|
|
6990
6881
|
style: {
|
|
6991
|
-
|
|
6992
|
-
top: `${adjustedPosition.y}px`,
|
|
6882
|
+
transform: `translate3d(${adjustedPosition.x}px, ${adjustedPosition.y}px, 0)`,
|
|
6993
6883
|
opacity: visible ? 1 : 0,
|
|
6994
6884
|
visibility: visible ? "visible" : "hidden",
|
|
6995
|
-
transition: "opacity 0.2s ease
|
|
6996
|
-
transform: "translateZ(0)",
|
|
6885
|
+
transition: "opacity 0.2s ease",
|
|
6997
6886
|
position: "fixed",
|
|
6887
|
+
left: 0,
|
|
6888
|
+
top: 0,
|
|
6998
6889
|
zIndex: 1e3,
|
|
6999
|
-
pointerEvents: "none"
|
|
6890
|
+
pointerEvents: "none",
|
|
6891
|
+
willChange: "transform"
|
|
7000
6892
|
},
|
|
7001
6893
|
children: customRenderer ? customRenderer(dataPoint) : jsxs(Fragment, {
|
|
7002
6894
|
children: [ jsx("div", {
|
|
@@ -7315,8 +7207,9 @@ const BubbleChart = memo( forwardRef((({bubbleData: bubbleData = [], config: co
|
|
|
7315
7207
|
if (!bubbleData.length) return null;
|
|
7316
7208
|
const showTooltips = toolbarState?.showTooltips ?? renderConfig?.showTooltips ?? !0, sizeValues = bubbleData.map((b => b.size)), minSize = Math.min(...sizeValues), sizeRange = Math.max(...sizeValues) - minSize || 1, bubbles = bubbleData.map(((bubble, index) => {
|
|
7317
7209
|
// Calculate scaled size
|
|
7318
|
-
const scaledSize = minBubbleSize + (bubble.size - minSize) / sizeRange * (maxBubbleSize - minBubbleSize), x = scales.padding.left + bubble.x / 100 *
|
|
7210
|
+
const scaledSize = minBubbleSize + (bubble.size - minSize) / sizeRange * (maxBubbleSize - minBubbleSize), effectiveWidth = scales.innerWidth - 2 * maxBubbleSize, effectiveHeight = scales.innerHeight - 2 * maxBubbleSize, x = scales.padding.left + maxBubbleSize + bubble.x / 100 * effectiveWidth, y = scales.padding.top + maxBubbleSize + effectiveHeight - bubble.y / 100 * effectiveHeight;
|
|
7319
7211
|
// Calculate position
|
|
7212
|
+
// Ensure bubbles don't get cut off by adding padding equal to maxBubbleSize
|
|
7320
7213
|
// Determine color
|
|
7321
7214
|
let bubbleColor = bubble.color;
|
|
7322
7215
|
if (!bubbleColor) if (sizeBasedColoring) {
|
|
@@ -7777,9 +7670,10 @@ const GaugeChart = memo( forwardRef((({value: value, min: min = 0, max: max = 1
|
|
|
7777
7670
|
// Create ticks
|
|
7778
7671
|
const ticks = [];
|
|
7779
7672
|
if (showTicks) {
|
|
7673
|
+
const innerRadius = radius * (1 - thickness);
|
|
7780
7674
|
// Major ticks
|
|
7781
|
-
|
|
7782
|
-
const tickValue = min + i / majorTicks * (max - min), tickAngle = startAngleRad + i / majorTicks * angleRange, tickRadius =
|
|
7675
|
+
for (let i = 0; i <= majorTicks; i++) {
|
|
7676
|
+
const tickValue = min + i / majorTicks * (max - min), tickAngle = startAngleRad + i / majorTicks * angleRange, tickRadius = innerRadius - 2, tickLength = .05 * radius, x1 = centerX + tickRadius * Math.cos(tickAngle), y1 = centerY + tickRadius * Math.sin(tickAngle), x2 = centerX + (tickRadius - tickLength) * Math.cos(tickAngle), y2 = centerY + (tickRadius - tickLength) * Math.sin(tickAngle);
|
|
7783
7677
|
// Labels for major ticks
|
|
7784
7678
|
if (ticks.push(jsx("line", {
|
|
7785
7679
|
x1: x1,
|
|
@@ -7789,12 +7683,12 @@ const GaugeChart = memo( forwardRef((({value: value, min: min = 0, max: max = 1
|
|
|
7789
7683
|
stroke: "var(--atomix-brand-border-subtle)",
|
|
7790
7684
|
strokeWidth: "2"
|
|
7791
7685
|
}, `major-tick-${i}`)), showMinMaxLabels) {
|
|
7792
|
-
const
|
|
7686
|
+
const labelRadius = tickRadius - tickLength - 15, labelX = centerX + labelRadius * Math.cos(tickAngle), labelY = centerY + labelRadius * Math.sin(tickAngle);
|
|
7793
7687
|
ticks.push(jsx("text", {
|
|
7794
7688
|
x: labelX,
|
|
7795
7689
|
y: labelY,
|
|
7796
7690
|
textAnchor: "middle",
|
|
7797
|
-
dominantBaseline: "
|
|
7691
|
+
dominantBaseline: "central",
|
|
7798
7692
|
fontSize: "12",
|
|
7799
7693
|
fill: "var(--atomix-brand-text-emphasis)",
|
|
7800
7694
|
children: tickValue
|
|
@@ -7802,8 +7696,9 @@ const GaugeChart = memo( forwardRef((({value: value, min: min = 0, max: max = 1
|
|
|
7802
7696
|
}
|
|
7803
7697
|
}
|
|
7804
7698
|
// Minor ticks
|
|
7805
|
-
for (let i = 0; i
|
|
7806
|
-
|
|
7699
|
+
for (let i = 0; i <= majorTicks * minorTicks; i++) {
|
|
7700
|
+
if (i % minorTicks == 0) continue;
|
|
7701
|
+
const tickAngle = startAngleRad + i / (majorTicks * minorTicks) * angleRange, tickRadius = innerRadius - 2, tickLength = .025 * radius, x1 = centerX + tickRadius * Math.cos(tickAngle), y1 = centerY + tickRadius * Math.sin(tickAngle), x2 = centerX + (tickRadius - tickLength) * Math.cos(tickAngle), y2 = centerY + (tickRadius - tickLength) * Math.sin(tickAngle);
|
|
7807
7702
|
ticks.push(jsx("line", {
|
|
7808
7703
|
x1: x1,
|
|
7809
7704
|
y1: y1,
|
|
@@ -7814,39 +7709,43 @@ const GaugeChart = memo( forwardRef((({value: value, min: min = 0, max: max = 1
|
|
|
7814
7709
|
}, `minor-tick-${i}`));
|
|
7815
7710
|
}
|
|
7816
7711
|
}
|
|
7817
|
-
|
|
7818
|
-
const needle = showNeedle ? jsxs("g", {
|
|
7712
|
+
const innerRadius = radius * (1 - thickness), needle = showNeedle ? jsxs("g", {
|
|
7819
7713
|
children: [ jsx("line", {
|
|
7820
7714
|
x1: centerX,
|
|
7821
7715
|
y1: centerY,
|
|
7822
|
-
x2: centerX +
|
|
7823
|
-
y2: centerY +
|
|
7716
|
+
x2: centerX + (innerRadius - 15) * Math.cos(valueAngle),
|
|
7717
|
+
y2: centerY + (innerRadius - 15) * Math.sin(valueAngle),
|
|
7824
7718
|
stroke: needleColor,
|
|
7825
|
-
strokeWidth: "
|
|
7719
|
+
strokeWidth: "4",
|
|
7826
7720
|
strokeLinecap: "round"
|
|
7827
7721
|
}), jsx("circle", {
|
|
7828
7722
|
cx: centerX,
|
|
7829
7723
|
cy: centerY,
|
|
7830
7724
|
r: "8",
|
|
7831
7725
|
fill: needleColor
|
|
7726
|
+
}), jsx("circle", {
|
|
7727
|
+
cx: centerX,
|
|
7728
|
+
cy: centerY,
|
|
7729
|
+
r: "3",
|
|
7730
|
+
fill: "var(--atomix-primary-bg, #fff)"
|
|
7832
7731
|
}) ]
|
|
7833
7732
|
}) : null, valueText = showValue ? jsx("text", {
|
|
7834
7733
|
x: centerX,
|
|
7835
|
-
y: centerY +
|
|
7734
|
+
y: centerY + 35,
|
|
7836
7735
|
textAnchor: "middle",
|
|
7837
|
-
fontSize: "
|
|
7736
|
+
fontSize: "32",
|
|
7838
7737
|
fontWeight: "bold",
|
|
7839
7738
|
fill: "var(--atomix-primary-text-emphasis)",
|
|
7840
7739
|
children: valueFormatter(clampedValue)
|
|
7841
7740
|
}) : null, labelText = label ? jsx("text", {
|
|
7842
7741
|
x: centerX,
|
|
7843
|
-
y: "top" === labelPosition ? centerY - .7 * radius : centerY + .7 * radius,
|
|
7742
|
+
y: "top" === labelPosition ? centerY - .7 * radius : centerY + .7 * radius + 10,
|
|
7844
7743
|
textAnchor: "middle",
|
|
7845
7744
|
fontSize: "16",
|
|
7846
7745
|
fill: "var(--atomix-brand-text-emphasis)",
|
|
7847
7746
|
children: label
|
|
7848
7747
|
}) : null;
|
|
7849
|
-
//
|
|
7748
|
+
// Create needle
|
|
7850
7749
|
return jsxs("g", {
|
|
7851
7750
|
children: [ jsx("path", {
|
|
7852
7751
|
d: createArcPath(centerX, centerY, radius, startAngleRad, endAngleRad, thickness),
|
|
@@ -7878,11 +7777,9 @@ const colorSchemes = {
|
|
|
7878
7777
|
greens: [ "var(--atomix-green-1)", "var(--atomix-green-2)", "var(--atomix-green-3)", "var(--atomix-green-4)", "var(--atomix-green-5)", "var(--atomix-green-6)", "var(--atomix-green-7)", "var(--atomix-green-8)", "var(--atomix-green-9)" ],
|
|
7879
7778
|
github: [ "var(--atomix-gray-2)", "var(--atomix-green-3)", "var(--atomix-green-4)", "var(--atomix-green-5)", "var(--atomix-green-6)" ]
|
|
7880
7779
|
}, HeatmapChart = memo( forwardRef((({data: data = [], config: config = {}, colorScale: colorScale = {
|
|
7881
|
-
scheme: "
|
|
7780
|
+
scheme: "blues",
|
|
7882
7781
|
steps: 9
|
|
7883
7782
|
}, cellConfig: cellConfig = {
|
|
7884
|
-
width: 40,
|
|
7885
|
-
height: 40,
|
|
7886
7783
|
spacing: 2,
|
|
7887
7784
|
borderRadius: 4,
|
|
7888
7785
|
showLabels: !1
|
|
@@ -7942,9 +7839,8 @@ const colorSchemes = {
|
|
|
7942
7839
|
renderContent: ({scales: scales, colors: colors, datasets: renderedDatasets, handlers: handlers, hoveredPoint: hoveredPoint, toolbarState: toolbarState, config: renderConfig}) => {
|
|
7943
7840
|
const {matrix: matrix, xLabels: xLabels, yLabels: yLabels} = processedData, showTooltips = toolbarState?.showTooltips ?? renderConfig?.showTooltips ?? !0;
|
|
7944
7841
|
if (!matrix.length) return null;
|
|
7945
|
-
const cellWidth = cellConfig.width ||
|
|
7946
|
-
|
|
7947
|
-
return xLabels.length, yLabels.length, jsxs(Fragment, {
|
|
7842
|
+
const spacing = cellConfig.spacing ?? 2, borderRadius = cellConfig.borderRadius ?? 4, {width: width, height: height} = scales, paddingRight = 20 + (showColorLegend ? 60 : 0), availableWidth = Math.max(0, width - 60 - paddingRight), availableHeight = Math.max(0, height - 20 - 40), cols = Math.max(1, xLabels.length), rows = Math.max(1, yLabels.length), maxCellWidth = Math.max(2, Math.floor((availableWidth - (cols - 1) * spacing) / cols)), maxCellHeight = Math.max(2, Math.floor((availableHeight - (rows - 1) * spacing) / rows)), cellWidth = cellConfig.width || maxCellWidth, cellHeight = cellConfig.height || maxCellHeight, totalWidth = cols * cellWidth + (cols - 1) * spacing, totalHeight = rows * cellHeight + (rows - 1) * spacing, startX = 60 + Math.max(0, (availableWidth - totalWidth) / 2), startY = 20 + Math.max(0, (availableHeight - totalHeight) / 2);
|
|
7843
|
+
return jsxs(Fragment, {
|
|
7948
7844
|
children: [ jsxs("g", {
|
|
7949
7845
|
children: [ jsx("defs", {
|
|
7950
7846
|
children: showColorLegend && (() => {
|
|
@@ -7963,7 +7859,7 @@ const colorSchemes = {
|
|
|
7963
7859
|
})()
|
|
7964
7860
|
}), matrix.map(((row, rowIndex) => row.map(((cell, colIndex) => {
|
|
7965
7861
|
if (!cell) return null;
|
|
7966
|
-
const x =
|
|
7862
|
+
const x = startX + colIndex * (cellWidth + spacing), y = startY + rowIndex * (cellHeight + spacing), color = getColorForValue(cell.value);
|
|
7967
7863
|
return jsxs("g", {
|
|
7968
7864
|
children: [ jsx("rect", {
|
|
7969
7865
|
x: x,
|
|
@@ -7973,12 +7869,7 @@ const colorSchemes = {
|
|
|
7973
7869
|
rx: borderRadius,
|
|
7974
7870
|
ry: borderRadius,
|
|
7975
7871
|
fill: color,
|
|
7976
|
-
className: "c-chart__heatmap-cell " + (
|
|
7977
|
-
style: {
|
|
7978
|
-
transition: "all 0.2s ease",
|
|
7979
|
-
transform: isHovered ? "scale(1.05)" : "scale(1)",
|
|
7980
|
-
transformOrigin: "center"
|
|
7981
|
-
},
|
|
7872
|
+
className: "c-chart__heatmap-cell " + (hoveredCell === cell ? "c-chart__heatmap-cell--hovered" : ""),
|
|
7982
7873
|
onClick: () => {
|
|
7983
7874
|
cell && handlers.onDataPointClick?.({
|
|
7984
7875
|
...cell,
|
|
@@ -7988,8 +7879,14 @@ const colorSchemes = {
|
|
|
7988
7879
|
},
|
|
7989
7880
|
onMouseEnter: e => {
|
|
7990
7881
|
setHoveredCell(cell);
|
|
7882
|
+
const pointIndex = data.findIndex((d => d.x === cell.x && d.y === cell.y)), rect = e.currentTarget.getBoundingClientRect();
|
|
7883
|
+
handlers.onPointHover(0,
|
|
7884
|
+
// datasetIndex is always 0 for Heatmap
|
|
7885
|
+
pointIndex >= 0 ? pointIndex : 0, x, y, rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
7991
7886
|
},
|
|
7992
|
-
onMouseLeave: () =>
|
|
7887
|
+
onMouseLeave: () => {
|
|
7888
|
+
setHoveredCell(null), handlers.onPointLeave();
|
|
7889
|
+
}
|
|
7993
7890
|
}), cellConfig.showLabels && cell.label && jsx("text", {
|
|
7994
7891
|
x: x + cellWidth / 2,
|
|
7995
7892
|
y: y + cellHeight / 2,
|
|
@@ -8000,7 +7897,7 @@ const colorSchemes = {
|
|
|
8000
7897
|
}) ]
|
|
8001
7898
|
}, `cell-${rowIndex}-${colIndex}`);
|
|
8002
7899
|
})))), xLabels.map(((label, index) => {
|
|
8003
|
-
const x =
|
|
7900
|
+
const x = startX + index * (cellWidth + spacing) + cellWidth / 2, y = startY + matrix.length * (cellHeight + spacing) + 20;
|
|
8004
7901
|
return jsx("text", {
|
|
8005
7902
|
x: x,
|
|
8006
7903
|
y: y,
|
|
@@ -8009,36 +7906,38 @@ const colorSchemes = {
|
|
|
8009
7906
|
children: String(label)
|
|
8010
7907
|
}, `x-label-${index}`);
|
|
8011
7908
|
})), yLabels.map(((label, index) => jsx("text", {
|
|
8012
|
-
x:
|
|
8013
|
-
y:
|
|
7909
|
+
x: startX - 20,
|
|
7910
|
+
y: startY + index * (cellHeight + spacing) + cellHeight / 2,
|
|
8014
7911
|
textAnchor: "end",
|
|
8015
7912
|
dominantBaseline: "middle",
|
|
8016
7913
|
className: "c-chart__heatmap-axis-label",
|
|
8017
7914
|
children: String(label)
|
|
8018
7915
|
}, `y-label-${index}`))), showColorLegend && jsxs("g", {
|
|
8019
|
-
transform:
|
|
7916
|
+
transform: `translate(${startX + totalWidth + 20}, ${startY})`,
|
|
8020
7917
|
children: [ jsx("rect", {
|
|
8021
7918
|
x: "0",
|
|
8022
7919
|
y: "0",
|
|
8023
|
-
width: "
|
|
8024
|
-
height:
|
|
7920
|
+
width: "12",
|
|
7921
|
+
height: totalHeight,
|
|
8025
7922
|
fill: "url(#heatmap-legend-gradient)",
|
|
8026
7923
|
stroke: "var(--atomix-border-color)",
|
|
8027
|
-
className: "c-chart__grid"
|
|
7924
|
+
className: "c-chart__grid",
|
|
7925
|
+
rx: borderRadius,
|
|
7926
|
+
ry: borderRadius
|
|
8028
7927
|
}), jsx("text", {
|
|
8029
|
-
x: "-
|
|
7928
|
+
x: "-5",
|
|
8030
7929
|
y: "-10",
|
|
8031
7930
|
className: "c-chart__heatmap-legend-title",
|
|
8032
7931
|
children: "Values"
|
|
8033
7932
|
}), jsx("text", {
|
|
8034
|
-
x: "
|
|
8035
|
-
y: "
|
|
7933
|
+
x: "20",
|
|
7934
|
+
y: "8",
|
|
8036
7935
|
textAnchor: "start",
|
|
8037
7936
|
className: "c-chart__heatmap-legend-label",
|
|
8038
7937
|
children: "High"
|
|
8039
7938
|
}), jsx("text", {
|
|
8040
|
-
x: "
|
|
8041
|
-
y:
|
|
7939
|
+
x: "20",
|
|
7940
|
+
y: totalHeight,
|
|
8042
7941
|
textAnchor: "start",
|
|
8043
7942
|
className: "c-chart__heatmap-legend-label",
|
|
8044
7943
|
children: "Low"
|
|
@@ -8810,8 +8709,7 @@ const DEFAULT_COLOR_CONFIG = {
|
|
|
8810
8709
|
}, DEFAULT_LABEL_CONFIG = {
|
|
8811
8710
|
showLabels: !0,
|
|
8812
8711
|
minSize: 1e3,
|
|
8813
|
-
fontSize: 12
|
|
8814
|
-
textColor: "white"
|
|
8712
|
+
fontSize: 12
|
|
8815
8713
|
}, DEFAULT_CONFIG = {}, TreemapChart = memo( forwardRef((({data: data = [], algorithm: algorithm = "squarified", colorConfig: colorConfig = DEFAULT_COLOR_CONFIG, labelConfig: labelConfig = DEFAULT_LABEL_CONFIG, onDataPointClick: onDataPointClick, config: config = DEFAULT_CONFIG, ...props}, ref) => {
|
|
8816
8714
|
const [hoveredNode, setHoveredNode] = useState(null), [selectedNode, setSelectedNode] = useState(null);
|
|
8817
8715
|
useState({
|
|
@@ -8875,13 +8773,13 @@ const DEFAULT_COLOR_CONFIG = {
|
|
|
8875
8773
|
}
|
|
8876
8774
|
// Sort nodes by value (descending)
|
|
8877
8775
|
const sortedNodes = [ ...nodes ].sort(((a, b) => b.value - a.value)), aspectRatio = rect => Math.max(rect.width / rect.height, rect.height / rect.width);
|
|
8878
|
-
let currentRow = [], remainingNodes = [ ...sortedNodes ], currentX = x, currentY = y, remainingWidth = width, remainingHeight = height;
|
|
8776
|
+
let currentRow = [], remainingNodes = [ ...sortedNodes ], currentX = x, currentY = y, remainingWidth = width, remainingHeight = height, remainingValue = totalValue;
|
|
8879
8777
|
for (;remainingNodes.length > 0; ) {
|
|
8880
8778
|
const node = remainingNodes.shift();
|
|
8881
8779
|
if (!node) break;
|
|
8882
8780
|
currentRow.push(node);
|
|
8883
8781
|
// Calculate dimensions for current row
|
|
8884
|
-
const rowValue = _reduceInstanceProperty(currentRow).call(currentRow, ((sum, n) => sum + n.value), 0), rowRatio = rowValue /
|
|
8782
|
+
const rowValue = _reduceInstanceProperty(currentRow).call(currentRow, ((sum, n) => sum + n.value), 0), rowRatio = remainingValue > 0 ? rowValue / remainingValue : 0;
|
|
8885
8783
|
let rowWidth, rowHeight;
|
|
8886
8784
|
remainingWidth >= remainingHeight ? (rowWidth = remainingWidth * rowRatio, rowHeight = remainingHeight) : (rowWidth = remainingWidth,
|
|
8887
8785
|
rowHeight = remainingHeight * rowRatio);
|
|
@@ -8890,7 +8788,7 @@ const DEFAULT_COLOR_CONFIG = {
|
|
|
8890
8788
|
if (remainingNodes.length > 0) {
|
|
8891
8789
|
const nextNode = remainingNodes[0];
|
|
8892
8790
|
if (!nextNode) break;
|
|
8893
|
-
const testRow = [ ...currentRow, nextNode ], testRowValue = _reduceInstanceProperty(testRow).call(testRow, ((sum, n) => sum + n.value), 0), testRowRatio = testRowValue /
|
|
8791
|
+
const testRow = [ ...currentRow, nextNode ], testRowValue = _reduceInstanceProperty(testRow).call(testRow, ((sum, n) => sum + n.value), 0), testRowRatio = remainingValue > 0 ? testRowValue / remainingValue : 0;
|
|
8894
8792
|
let testRowWidth, testRowHeight;
|
|
8895
8793
|
remainingWidth >= remainingHeight ? (testRowWidth = remainingWidth * testRowRatio,
|
|
8896
8794
|
testRowHeight = remainingHeight) : (testRowWidth = remainingWidth, testRowHeight = remainingHeight * testRowRatio);
|
|
@@ -8921,14 +8819,14 @@ const DEFAULT_COLOR_CONFIG = {
|
|
|
8921
8819
|
})),
|
|
8922
8820
|
// Update remaining space
|
|
8923
8821
|
remainingWidth >= remainingHeight ? (currentX += rowWidth, remainingWidth -= rowWidth) : (currentY += rowHeight,
|
|
8924
|
-
remainingHeight -= rowHeight), currentRow = [];
|
|
8822
|
+
remainingHeight -= rowHeight), remainingValue -= rowValue, currentRow = [];
|
|
8925
8823
|
}
|
|
8926
8824
|
}
|
|
8927
|
-
}), []), renderContent = useCallback((({scales: scales, colors: colors, datasets: renderedDatasets, handlers: handlers, hoveredPoint: hoveredPoint}) => {
|
|
8825
|
+
}), []), renderContent = useCallback((({scales: scales, colors: colors, datasets: renderedDatasets, handlers: handlers, hoveredPoint: hoveredPoint, toolbarState: toolbarState, config: renderConfig}) => {
|
|
8928
8826
|
if (!data.length) return null;
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8827
|
+
const showTooltips = toolbarState?.showTooltips ?? renderConfig?.showTooltips ?? !0, availableWidth = Math.max(0, scales.width), availableHeight = Math.max(0, scales.height), leafNodes = data.filter((item => !item.children || 0 === item.children.length));
|
|
8828
|
+
// Calculate available space
|
|
8829
|
+
if (!leafNodes.length) return null;
|
|
8932
8830
|
const totalValue = _reduceInstanceProperty(leafNodes).call(leafNodes, ((sum, node) => sum + node.value), 0), treemapNodes = leafNodes.map(((item, index) => ({
|
|
8933
8831
|
id: item.id,
|
|
8934
8832
|
label: item.label,
|
|
@@ -8948,24 +8846,26 @@ const DEFAULT_COLOR_CONFIG = {
|
|
|
8948
8846
|
})));
|
|
8949
8847
|
// Create treemap nodes with proper dimensions
|
|
8950
8848
|
// Apply squarified algorithm to layout nodes proportionally by value
|
|
8951
|
-
if ("squarified" === algorithm && totalValue > 0) squarify(treemapNodes,
|
|
8849
|
+
if ("squarified" === algorithm && totalValue > 0) squarify(treemapNodes, 0, 0, availableWidth, availableHeight); else {
|
|
8952
8850
|
// Fallback: simple grid layout (equal sizes)
|
|
8953
8851
|
const cols = Math.ceil(Math.sqrt(leafNodes.length)), rows = Math.ceil(leafNodes.length / cols), nodeWidth = availableWidth / cols, nodeHeight = availableHeight / rows;
|
|
8954
8852
|
treemapNodes.forEach(((node, index) => {
|
|
8955
8853
|
const col = index % cols, row = Math.floor(index / cols);
|
|
8956
|
-
node.x =
|
|
8854
|
+
node.x = 0 + col * nodeWidth, node.y = 0 + row * nodeHeight, node.width = nodeWidth,
|
|
8957
8855
|
node.height = nodeHeight;
|
|
8958
8856
|
}));
|
|
8959
8857
|
}
|
|
8960
|
-
return
|
|
8961
|
-
children: treemapNodes.map((node => {
|
|
8858
|
+
return jsxs(Fragment, {
|
|
8859
|
+
children: [ treemapNodes.map((node => {
|
|
8962
8860
|
const isHovered = hoveredNode === node, isSelected = selectedNode === node, area = node.width * node.height, showLabel = labelConfig.showLabels && area >= (labelConfig.minSize || 1e3);
|
|
8963
8861
|
return jsxs("g", {
|
|
8964
8862
|
children: [ jsx("rect", {
|
|
8965
|
-
x: node.x,
|
|
8966
|
-
y: node.y,
|
|
8967
|
-
width: node.width,
|
|
8968
|
-
height: node.height,
|
|
8863
|
+
x: node.x + 2,
|
|
8864
|
+
y: node.y + 2,
|
|
8865
|
+
width: Math.max(0, node.width - 4),
|
|
8866
|
+
height: Math.max(0, node.height - 4),
|
|
8867
|
+
rx: 6,
|
|
8868
|
+
ry: 6,
|
|
8969
8869
|
fill: node.color,
|
|
8970
8870
|
className: `c-chart__treemap-node ${isHovered ? "c-chart__treemap-node--hovered" : ""} ${isSelected ? "c-chart__treemap-node--selected" : ""}`,
|
|
8971
8871
|
onClick: () => {
|
|
@@ -8973,8 +8873,8 @@ const DEFAULT_COLOR_CONFIG = {
|
|
|
8973
8873
|
},
|
|
8974
8874
|
onMouseEnter: e => {
|
|
8975
8875
|
setHoveredNode(node);
|
|
8976
|
-
const rect = e.currentTarget.getBoundingClientRect();
|
|
8977
|
-
handlers.onPointHover(0, 0, node.x, node.y, rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
8876
|
+
const rect = e.currentTarget.getBoundingClientRect(), pointIndex = data.indexOf(node.originalData);
|
|
8877
|
+
handlers.onPointHover(0, pointIndex >= 0 ? pointIndex : 0, node.x, node.y, rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
8978
8878
|
},
|
|
8979
8879
|
onMouseLeave: () => {
|
|
8980
8880
|
setHoveredNode(null), handlers.onPointLeave();
|
|
@@ -8986,13 +8886,21 @@ const DEFAULT_COLOR_CONFIG = {
|
|
|
8986
8886
|
dominantBaseline: "middle",
|
|
8987
8887
|
className: "c-chart__treemap-label",
|
|
8988
8888
|
style: {
|
|
8989
|
-
fontSize: labelConfig.fontSize
|
|
8990
|
-
fill: labelConfig.textColor
|
|
8889
|
+
fontSize: labelConfig.fontSize
|
|
8991
8890
|
},
|
|
8992
8891
|
children: node.label
|
|
8993
8892
|
}) ]
|
|
8994
8893
|
}, node.id);
|
|
8995
|
-
}))
|
|
8894
|
+
})), showTooltips && hoveredPoint && renderedDatasets[hoveredPoint.datasetIndex]?.data?.[hoveredPoint.pointIndex] && jsx(ChartTooltip, {
|
|
8895
|
+
dataPoint: renderedDatasets[hoveredPoint.datasetIndex].data[hoveredPoint.pointIndex],
|
|
8896
|
+
datasetLabel: renderedDatasets[hoveredPoint.datasetIndex]?.label,
|
|
8897
|
+
datasetColor: renderedDatasets[hoveredPoint.datasetIndex]?.color || colors[hoveredPoint.datasetIndex % colors.length],
|
|
8898
|
+
position: {
|
|
8899
|
+
x: hoveredPoint.clientX,
|
|
8900
|
+
y: hoveredPoint.clientY
|
|
8901
|
+
},
|
|
8902
|
+
visible: !0
|
|
8903
|
+
}) ]
|
|
8996
8904
|
});
|
|
8997
8905
|
}), [ data, algorithm, generateColor, squarify, labelConfig, hoveredNode, selectedNode ]), datasets = useMemo((() => [ {
|
|
8998
8906
|
label: "Treemap Data",
|
|
@@ -19254,7 +19162,6 @@ VideoPlayer.displayName = "VideoPlayer";
|
|
|
19254
19162
|
const components = Object.freeze( Object.defineProperty({
|
|
19255
19163
|
__proto__: null,
|
|
19256
19164
|
Accordion: Accordion,
|
|
19257
|
-
AnimatedChart: AnimatedChart,
|
|
19258
19165
|
AreaChart: AreaChart,
|
|
19259
19166
|
AtomixGlass: AtomixGlass,
|
|
19260
19167
|
AtomixLogo: AtomixLogo,
|
|
@@ -25341,5 +25248,5 @@ const atomix = {
|
|
|
25341
25248
|
types: types
|
|
25342
25249
|
};
|
|
25343
25250
|
|
|
25344
|
-
export { ACCORDION, ATOMIX_GLASS, AVATAR, AVATAR_GROUP, Accordion,
|
|
25251
|
+
export { ACCORDION, ATOMIX_GLASS, AVATAR, AVATAR_GROUP, Accordion, AreaChart, AtomixGlass, AtomixLogo, Avatar, AvatarGroup, BADGE, BADGE_CSS_VARS, BLOCK, BREADCRUMB, BUTTON, BUTTON_CSS_VARS, BUTTON_GROUP, Badge, BarChart, Block, Breadcrumb, BubbleChart, Button, ButtonGroup, CALLOUT, CARD, CARD_CSS_VARS, CHART, CHECKBOX_CSS_VARS, CLASS_PREFIX, CODE_SNIPPET, COMPONENT_CSS_VARS, COUNTDOWN, Callout, CandlestickChart, Card, Chart, ChartRenderer, Checkbox, ColorModeToggle, Container, Countdown, DATA_TABLE_CLASSES, DATA_TABLE_SELECTORS, DATEPICKER, DEFAULT_ATOMIX_FONTS, DOTS, DROPDOWN, DROPDOWN_CSS_VARS, DataTable, DatePicker, DesignTokensCustomizer, DonutChart, Dropdown, EDGE_PANEL, EdgePanel, ElevationCard, FOOTER, FORM, FORM_GROUP, Footer, FooterLink, FooterSection, FooterSocialLink, Form, FormGroup, FunnelChart, GaugeChart, Grid, GridCol, HERO, HeatmapChart, Hero, INPUT, INPUT_CSS_VARS, Icon, Input, LIST, LIST_GROUP, LineChart, List, ListGroup, MESSAGES, MODAL, MODAL_CSS_VARS, MasonryGrid, MasonryGridItem, MegaMenu, MegaMenuColumn, MegaMenuLink, Menu, MenuDivider, MenuItem, Messages, Modal, MultiAxisChart, NAV, NAVBAR, Nav, NavDropdown, NavItem, Navbar, PAGINATION_DEFAULTS, PHOTOVIEWER, POPOVER, PROGRESS, PROGRESS_CSS_VARS, Pagination, PhotoViewer, PieChart, Popover, ProductReview, Progress, RADIO, RADIO_CSS_VARS, RATING, RIVER, RTLManager, RadarChart, Radio, Rating, River, Row, SECTION_INTRO, SELECT, SIDE_MENU, SIZES, SLIDER, SPINNER, STEPS, ScatterChart, SectionIntro, Select, SideMenu, SideMenuItem, SideMenuList, Slider, Spinner, Steps, TAB, TABS_CSS_VARS, TESTIMONIAL, TEXTAREA, THEME_COLORS, THEME_NAMING, TODO, TOGGLE, TOOLTIP, TOOLTIP_CSS_VARS, Tabs, Testimonial, Textarea, ThemeApplicator, ThemeComparator, ThemeContext, ThemeErrorBoundary, ThemeInspector, ThemeLiveEditor, ThemePreview, ThemeProvider, ThemeValidator, Todo, Toggle, Tooltip, TreemapChart, UPLOAD, Upload, VIDEO_PLAYER, VideoPlayer, WaterfallChart, applyCSSVariables, applyCSSVarsToStyle, applyComponentTheme, applyPartStyles, applyTheme, camelToKebab, clearThemes, composables, constants, createCSSVarStyle, createDarkVariant, createDebugAttrs, createFontPreloadLink, createPartProps, createSlotComponent, createSlotProps, createTheme, createThemeRegistry, createTokens, cssVarsToStyle, deepMerge, atomix as default, defaultTokens, defineConfig, designTokensToCSSVars, exportTheme, extendTheme, extractComponentName, extractYouTubeId, generateCSSVariableName, generateCSSVariables$1 as generateCSSVariables, generateCSSVariablesForSelector, generateClassName, generateComponentCSSVars, generateFontPreloadTags, generateUUID, getAllThemes, getCSSVariable, getComponentCSSVars, getComponentThemeValue, getPartStyles, getTheme, getThemeApplicator, getThemeCount, getThemeIds, getThemeMetadata, hasCustomization, hasTheme, importTheme, injectCSS$1 as injectCSS, injectTheme, isCSSInjected, isDesignTokens, isSlot, isValidCSSVariableName, isYouTubeUrl, mapSCSSTokensToCSSVars, mergeCSSVars, mergeClassNames, mergeComponentProps, mergePartStyles, mergeSlots, mergeTheme, normalizeThemeTokens, preloadFonts, quickTheme, registerTheme, removeCSS, removeCSSVariables, removeTheme, renderSlot, sliderConstants, supportsDarkMode, theme, themePropertyToCSSVar, themeToCSS, types, unregisterTheme, useAccordion, useAtomixGlass, useBadge, useBarChart, useBlock, useBreadcrumb, useCard, useChartData, useChartInteraction, useChartScale, useComponentCustomization, useComponentDefaultProps, useComponentTheme, useDataTable, useEdgePanel, useForm, useFormGroup, useHero, useHistory, useInput, useLineChart, useMergedProps, useModal$1 as useModal, useNav, useNavDropdown, useNavItem, useNavbar, usePagination, usePieChart, useRadio, useRiver, useSelect, useSideMenu, useSideMenuItem, useSlider, useSlot, useSpinner, useTextarea, useTheme, useThemeTokens, useTodo, utils, validateTheme };
|
|
25345
25252
|
//# sourceMappingURL=index.esm.js.map
|