@alfalab/core-components-chart 4.0.1 → 4.0.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/Component.d.ts +1 -1
- package/Component.js +1 -1
- package/Component.js.map +1 -1
- package/components/Dot/index.css +7 -7
- package/components/Dot/index.d.ts +1 -1
- package/components/Dot/index.js.map +1 -1
- package/components/Dot/index.module.css.js +1 -1
- package/components/Legends/index.css +7 -7
- package/components/Legends/index.d.ts +3 -3
- package/components/Legends/index.js.map +1 -1
- package/components/Legends/index.module.css.js +1 -1
- package/components/Legends/index.module.css.js.map +1 -1
- package/components/LinearGradient.d.ts +1 -1
- package/components/LinearGradient.js.map +1 -1
- package/components/RectBar.js.map +1 -1
- package/components/Tick/index.css +2 -5
- package/components/Tick/index.d.ts +1 -1
- package/components/Tick/index.js.map +1 -1
- package/components/Tick/index.module.css.js +1 -1
- package/components/Tick/index.module.css.js.map +1 -1
- package/components/TooltipContent/index.css +8 -7
- package/components/TooltipContent/index.d.ts +3 -3
- package/components/TooltipContent/index.js.map +1 -1
- package/components/TooltipContent/index.module.css.js +1 -1
- package/components/TooltipContent/index.module.css.js.map +1 -1
- package/cssm/Component.d.ts +1 -1
- package/cssm/Component.js +1 -1
- package/cssm/Component.js.map +1 -1
- package/cssm/components/Dot/index.d.ts +1 -1
- package/cssm/components/Dot/index.js.map +1 -1
- package/cssm/components/Legends/index.d.ts +3 -3
- package/cssm/components/Legends/index.js.map +1 -1
- package/cssm/components/LinearGradient.d.ts +1 -1
- package/cssm/components/LinearGradient.js.map +1 -1
- package/cssm/components/RectBar.js.map +1 -1
- package/cssm/components/Tick/index.d.ts +1 -1
- package/cssm/components/Tick/index.js.map +1 -1
- package/cssm/components/Tick/index.module.css +0 -3
- package/cssm/components/TooltipContent/index.d.ts +3 -3
- package/cssm/components/TooltipContent/index.js.map +1 -1
- package/cssm/components/TooltipContent/index.module.css +2 -1
- package/cssm/hooks/usePathBar/index.d.ts +1 -1
- package/cssm/hooks/usePathBar/index.js.map +1 -1
- package/cssm/hooks/useSettings/index.d.ts +3 -3
- package/cssm/hooks/useSettings/index.js.map +1 -1
- package/cssm/hooks/useSettings/utils/setComposedChartsMargin.d.ts +4 -4
- package/cssm/hooks/useSettings/utils/setComposedChartsMargin.js.map +1 -1
- package/cssm/hooks/useSettings/utils/setDatas.d.ts +2 -2
- package/cssm/hooks/useSettings/utils/setDatas.js.map +1 -1
- package/cssm/hooks/useSettings/utils/setGradientCharts.d.ts +1 -1
- package/cssm/hooks/useSettings/utils/setGradientCharts.js.map +1 -1
- package/cssm/hooks/useSettings/utils/setLegendMargin.d.ts +2 -2
- package/cssm/hooks/useSettings/utils/setLegendMargin.js.map +1 -1
- package/cssm/hooks/useSettings/utils/sortByIndex.d.ts +1 -1
- package/cssm/hooks/useSettings/utils/sortByIndex.js.map +1 -1
- package/cssm/index.module.css +3 -1
- package/cssm/types/brush.types.d.ts +2 -2
- package/cssm/types/chart.types.d.ts +5 -5
- package/cssm/types/legend.types.d.ts +1 -1
- package/cssm/types/options.types.d.ts +10 -10
- package/cssm/types/payload.types.d.ts +1 -1
- package/cssm/types/responsiveContainer.types.d.ts +1 -1
- package/cssm/types/seria.types.d.ts +4 -4
- package/cssm/types/tooltip.types.d.ts +2 -2
- package/cssm/types/utils/axis.types.d.ts +1 -1
- package/cssm/types/utils/dot.types.d.ts +2 -2
- package/cssm/types/utils/tick.types.d.ts +1 -1
- package/cssm/types/xAxis.types.d.ts +1 -1
- package/cssm/types/yAxis.types.d.ts +1 -1
- package/esm/Component.d.ts +1 -1
- package/esm/Component.js +1 -1
- package/esm/Component.js.map +1 -1
- package/esm/components/Dot/index.css +7 -7
- package/esm/components/Dot/index.d.ts +1 -1
- package/esm/components/Dot/index.js.map +1 -1
- package/esm/components/Dot/index.module.css.js +1 -1
- package/esm/components/Legends/index.css +7 -7
- package/esm/components/Legends/index.d.ts +3 -3
- package/esm/components/Legends/index.js.map +1 -1
- package/esm/components/Legends/index.module.css.js +1 -1
- package/esm/components/Legends/index.module.css.js.map +1 -1
- package/esm/components/LinearGradient.d.ts +1 -1
- package/esm/components/LinearGradient.js.map +1 -1
- package/esm/components/RectBar.js.map +1 -1
- package/esm/components/Tick/index.css +2 -5
- package/esm/components/Tick/index.d.ts +1 -1
- package/esm/components/Tick/index.js.map +1 -1
- package/esm/components/Tick/index.module.css.js +1 -1
- package/esm/components/Tick/index.module.css.js.map +1 -1
- package/esm/components/TooltipContent/index.css +8 -7
- package/esm/components/TooltipContent/index.d.ts +3 -3
- package/esm/components/TooltipContent/index.js.map +1 -1
- package/esm/components/TooltipContent/index.module.css.js +1 -1
- package/esm/components/TooltipContent/index.module.css.js.map +1 -1
- package/esm/hooks/usePathBar/index.d.ts +1 -1
- package/esm/hooks/usePathBar/index.js.map +1 -1
- package/esm/hooks/useSettings/index.d.ts +3 -3
- package/esm/hooks/useSettings/index.js.map +1 -1
- package/esm/hooks/useSettings/utils/setComposedChartsMargin.d.ts +4 -4
- package/esm/hooks/useSettings/utils/setComposedChartsMargin.js.map +1 -1
- package/esm/hooks/useSettings/utils/setDatas.d.ts +2 -2
- package/esm/hooks/useSettings/utils/setDatas.js.map +1 -1
- package/esm/hooks/useSettings/utils/setGradientCharts.d.ts +1 -1
- package/esm/hooks/useSettings/utils/setGradientCharts.js.map +1 -1
- package/esm/hooks/useSettings/utils/setLegendMargin.d.ts +2 -2
- package/esm/hooks/useSettings/utils/setLegendMargin.js.map +1 -1
- package/esm/hooks/useSettings/utils/sortByIndex.d.ts +1 -1
- package/esm/hooks/useSettings/utils/sortByIndex.js.map +1 -1
- package/esm/index.css +7 -5
- package/esm/index.module.css.js +1 -1
- package/esm/index.module.css.js.map +1 -1
- package/esm/types/brush.types.d.ts +2 -2
- package/esm/types/chart.types.d.ts +5 -5
- package/esm/types/legend.types.d.ts +1 -1
- package/esm/types/options.types.d.ts +10 -10
- package/esm/types/payload.types.d.ts +1 -1
- package/esm/types/responsiveContainer.types.d.ts +1 -1
- package/esm/types/seria.types.d.ts +4 -4
- package/esm/types/tooltip.types.d.ts +2 -2
- package/esm/types/utils/axis.types.d.ts +1 -1
- package/esm/types/utils/dot.types.d.ts +2 -2
- package/esm/types/utils/tick.types.d.ts +1 -1
- package/esm/types/xAxis.types.d.ts +1 -1
- package/esm/types/yAxis.types.d.ts +1 -1
- package/hooks/usePathBar/index.d.ts +1 -1
- package/hooks/usePathBar/index.js.map +1 -1
- package/hooks/useSettings/index.d.ts +3 -3
- package/hooks/useSettings/index.js.map +1 -1
- package/hooks/useSettings/utils/setComposedChartsMargin.d.ts +4 -4
- package/hooks/useSettings/utils/setComposedChartsMargin.js.map +1 -1
- package/hooks/useSettings/utils/setDatas.d.ts +2 -2
- package/hooks/useSettings/utils/setDatas.js.map +1 -1
- package/hooks/useSettings/utils/setGradientCharts.d.ts +1 -1
- package/hooks/useSettings/utils/setGradientCharts.js.map +1 -1
- package/hooks/useSettings/utils/setLegendMargin.d.ts +2 -2
- package/hooks/useSettings/utils/setLegendMargin.js.map +1 -1
- package/hooks/useSettings/utils/sortByIndex.d.ts +1 -1
- package/hooks/useSettings/utils/sortByIndex.js.map +1 -1
- package/index.css +7 -5
- package/index.module.css.js +1 -1
- package/index.module.css.js.map +1 -1
- package/modern/Component.d.ts +1 -1
- package/modern/Component.js +1 -1
- package/modern/Component.js.map +1 -1
- package/modern/components/Dot/index.css +7 -7
- package/modern/components/Dot/index.d.ts +1 -1
- package/modern/components/Dot/index.js.map +1 -1
- package/modern/components/Dot/index.module.css.js +1 -1
- package/modern/components/Legends/index.css +7 -7
- package/modern/components/Legends/index.d.ts +3 -3
- package/modern/components/Legends/index.js.map +1 -1
- package/modern/components/Legends/index.module.css.js +1 -1
- package/modern/components/Legends/index.module.css.js.map +1 -1
- package/modern/components/LinearGradient.d.ts +1 -1
- package/modern/components/LinearGradient.js.map +1 -1
- package/modern/components/RectBar.js.map +1 -1
- package/modern/components/Tick/index.css +2 -5
- package/modern/components/Tick/index.d.ts +1 -1
- package/modern/components/Tick/index.js.map +1 -1
- package/modern/components/Tick/index.module.css.js +1 -1
- package/modern/components/Tick/index.module.css.js.map +1 -1
- package/modern/components/TooltipContent/index.css +8 -7
- package/modern/components/TooltipContent/index.d.ts +3 -3
- package/modern/components/TooltipContent/index.js.map +1 -1
- package/modern/components/TooltipContent/index.module.css.js +1 -1
- package/modern/components/TooltipContent/index.module.css.js.map +1 -1
- package/modern/hooks/usePathBar/index.d.ts +1 -1
- package/modern/hooks/usePathBar/index.js.map +1 -1
- package/modern/hooks/useSettings/index.d.ts +3 -3
- package/modern/hooks/useSettings/index.js.map +1 -1
- package/modern/hooks/useSettings/utils/setComposedChartsMargin.d.ts +4 -4
- package/modern/hooks/useSettings/utils/setComposedChartsMargin.js.map +1 -1
- package/modern/hooks/useSettings/utils/setDatas.d.ts +2 -2
- package/modern/hooks/useSettings/utils/setDatas.js.map +1 -1
- package/modern/hooks/useSettings/utils/setGradientCharts.d.ts +1 -1
- package/modern/hooks/useSettings/utils/setGradientCharts.js.map +1 -1
- package/modern/hooks/useSettings/utils/setLegendMargin.d.ts +2 -2
- package/modern/hooks/useSettings/utils/setLegendMargin.js.map +1 -1
- package/modern/hooks/useSettings/utils/sortByIndex.d.ts +1 -1
- package/modern/hooks/useSettings/utils/sortByIndex.js.map +1 -1
- package/modern/index.css +7 -5
- package/modern/index.module.css.js +1 -1
- package/modern/index.module.css.js.map +1 -1
- package/modern/types/brush.types.d.ts +2 -2
- package/modern/types/chart.types.d.ts +5 -5
- package/modern/types/legend.types.d.ts +1 -1
- package/modern/types/options.types.d.ts +10 -10
- package/modern/types/payload.types.d.ts +1 -1
- package/modern/types/responsiveContainer.types.d.ts +1 -1
- package/modern/types/seria.types.d.ts +4 -4
- package/modern/types/tooltip.types.d.ts +2 -2
- package/modern/types/utils/axis.types.d.ts +1 -1
- package/modern/types/utils/dot.types.d.ts +2 -2
- package/modern/types/utils/tick.types.d.ts +1 -1
- package/modern/types/xAxis.types.d.ts +1 -1
- package/modern/types/yAxis.types.d.ts +1 -1
- package/moderncssm/Component.d.ts +1 -1
- package/moderncssm/Component.js +1 -1
- package/moderncssm/Component.js.map +1 -1
- package/moderncssm/components/Dot/index.d.ts +1 -1
- package/moderncssm/components/Dot/index.js.map +1 -1
- package/moderncssm/components/Legends/index.d.ts +3 -3
- package/moderncssm/components/Legends/index.js.map +1 -1
- package/moderncssm/components/Legends/index.module.css +2 -0
- package/moderncssm/components/LinearGradient.d.ts +1 -1
- package/moderncssm/components/LinearGradient.js.map +1 -1
- package/moderncssm/components/RectBar.js.map +1 -1
- package/moderncssm/components/Tick/index.d.ts +1 -1
- package/moderncssm/components/Tick/index.js.map +1 -1
- package/moderncssm/components/Tick/index.module.css +2 -5
- package/moderncssm/components/TooltipContent/index.d.ts +3 -3
- package/moderncssm/components/TooltipContent/index.js.map +1 -1
- package/moderncssm/components/TooltipContent/index.module.css +2 -0
- package/moderncssm/hooks/usePathBar/index.d.ts +1 -1
- package/moderncssm/hooks/usePathBar/index.js.map +1 -1
- package/moderncssm/hooks/useSettings/index.d.ts +3 -3
- package/moderncssm/hooks/useSettings/index.js.map +1 -1
- package/moderncssm/hooks/useSettings/utils/setComposedChartsMargin.d.ts +4 -4
- package/moderncssm/hooks/useSettings/utils/setComposedChartsMargin.js.map +1 -1
- package/moderncssm/hooks/useSettings/utils/setDatas.d.ts +2 -2
- package/moderncssm/hooks/useSettings/utils/setDatas.js.map +1 -1
- package/moderncssm/hooks/useSettings/utils/setGradientCharts.d.ts +1 -1
- package/moderncssm/hooks/useSettings/utils/setGradientCharts.js.map +1 -1
- package/moderncssm/hooks/useSettings/utils/setLegendMargin.d.ts +2 -2
- package/moderncssm/hooks/useSettings/utils/setLegendMargin.js.map +1 -1
- package/moderncssm/hooks/useSettings/utils/sortByIndex.d.ts +1 -1
- package/moderncssm/hooks/useSettings/utils/sortByIndex.js.map +1 -1
- package/moderncssm/index.module.css +5 -2
- package/moderncssm/types/brush.types.d.ts +2 -2
- package/moderncssm/types/chart.types.d.ts +5 -5
- package/moderncssm/types/legend.types.d.ts +1 -1
- package/moderncssm/types/options.types.d.ts +10 -10
- package/moderncssm/types/payload.types.d.ts +1 -1
- package/moderncssm/types/responsiveContainer.types.d.ts +1 -1
- package/moderncssm/types/seria.types.d.ts +4 -4
- package/moderncssm/types/tooltip.types.d.ts +2 -2
- package/moderncssm/types/utils/axis.types.d.ts +1 -1
- package/moderncssm/types/utils/dot.types.d.ts +2 -2
- package/moderncssm/types/utils/tick.types.d.ts +1 -1
- package/moderncssm/types/xAxis.types.d.ts +1 -1
- package/moderncssm/types/yAxis.types.d.ts +1 -1
- package/package.json +3 -3
- package/src/Component.tsx +8 -8
- package/src/components/Dot/index.tsx +1 -1
- package/src/components/Legends/index.module.css +1 -1
- package/src/components/Legends/index.tsx +3 -3
- package/src/components/LinearGradient.tsx +1 -1
- package/src/components/RectBar.tsx +4 -4
- package/src/components/Tick/index.module.css +1 -6
- package/src/components/Tick/index.tsx +1 -1
- package/src/components/TooltipContent/index.module.css +1 -1
- package/src/components/TooltipContent/index.tsx +3 -3
- package/src/hooks/usePathBar/{index.tsx → index.ts} +3 -3
- package/src/hooks/useSettings/{index.tsx → index.ts} +3 -3
- package/src/hooks/useSettings/utils/setComposedChartsMargin.ts +4 -4
- package/src/hooks/useSettings/utils/setDatas.ts +4 -4
- package/src/hooks/useSettings/utils/setGradientCharts.ts +2 -2
- package/src/hooks/useSettings/utils/setLegendMargin.ts +2 -2
- package/src/hooks/useSettings/utils/sortByIndex.ts +1 -1
- package/src/index.module.css +4 -2
- package/src/types/brush.types.ts +2 -2
- package/src/types/chart.types.ts +5 -5
- package/src/types/legend.types.ts +1 -1
- package/src/types/options.types.ts +10 -10
- package/src/types/payload.types.ts +1 -1
- package/src/types/responsiveContainer.types.ts +1 -1
- package/src/types/seria.types.ts +4 -4
- package/src/types/tooltip.types.ts +2 -2
- package/src/types/utils/axis.types.ts +1 -1
- package/src/types/utils/dot.types.ts +2 -2
- package/src/types/utils/tick.types.ts +1 -1
- package/src/types/xAxis.types.ts +1 -1
- package/src/types/yAxis.types.ts +1 -1
- package/types/brush.types.d.ts +2 -2
- package/types/chart.types.d.ts +5 -5
- package/types/legend.types.d.ts +1 -1
- package/types/options.types.d.ts +10 -10
- package/types/payload.types.d.ts +1 -1
- package/types/responsiveContainer.types.d.ts +1 -1
- package/types/seria.types.d.ts +4 -4
- package/types/tooltip.types.d.ts +2 -2
- package/types/utils/axis.types.d.ts +1 -1
- package/types/utils/dot.types.d.ts +2 -2
- package/types/utils/tick.types.d.ts +1 -1
- package/types/xAxis.types.d.ts +1 -1
- package/types/yAxis.types.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/TooltipContent/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { PayloadProps } from '../../types/payload.types';\nimport { SeriaProps } from '../../types/seria.types';\nimport { TooltipProps } from '../../types/tooltip.types';\n\nimport styles from './index.module.css';\n\nexport interface TooltipContentProps extends TooltipProps {\n payload: PayloadProps[];\n series: SeriaProps[];\n}\n\nexport const TooltipContent = ({\n payload,\n separator,\n label,\n tooltipArrowSide,\n arrow,\n series,\n labelFormatter,\n labelStyle,\n}: TooltipContentProps) => {\n if (!label || payload.length === 0) return null;\n\n return (\n <div className={cn(styles.tooltip)}>\n {arrow && (\n <span\n className={cn(\n styles.tooltipArrow,\n tooltipArrowSide ? '' : styles.tooltipArrowRight,\n )}\n />\n )}\n <ul className={cn(styles.tooltipList)}>\n <li className={cn(styles.tooltipItem)} style={labelStyle}>\n <Text\n view='primary-medium'\n tag='span'\n weight='medium'\n className={cn(styles.tooltipLabel)}\n >\n {labelFormatter ? labelFormatter(label) : label}\n </Text>\n </li>\n {payload.map((entry: PayloadProps) => {\n const data: SeriaProps | undefined = series.find(\n (d: SeriaProps) => d.properties.dataKey === entry.dataKey,\n );\n\n if (data?.hideTooltip || data?.hide) return null;\n\n return (\n <li\n className={cn(styles.tooltipItem)}\n key={entry.dataKey}\n style={{ color: entry.color }}\n >\n <Text\n view='primary-medium'\n tag='span'\n weight='medium'\n className={cn(styles.tooltipValue)}\n >\n {entry?.formatter ? entry.formatter(entry.value) : entry.value}\n {separator || ' '}\n </Text>\n <Text\n view='secondary-large'\n tag='span'\n className={cn(styles.tooltipName)}\n >{`${entry.name}`}</Text>\n </li>\n );\n })}\n </ul>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAgBO,IAAM,cAAc,GAAG,UAAC,EAST,EAAA;QARlB,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,gBAAgB,GAAA,EAAA,CAAA,gBAAA,EAChB,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,UAAU,GAAA,EAAA,CAAA,UAAA;AAEV,IAAA,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;IAE/C,QACI,6BAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAA;QAC7B,KAAK,KACF,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACI,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,YAAY,EACnB,gBAAgB,GAAG,EAAE,GAAG,MAAM,CAAC,iBAAiB,CACnD,EAAA,CACH,CACL;AACD,QAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAAA;YACjC,KAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,UAAU,EAAA;AACpD,gBAAA,KAAA,CAAA,a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A,CAAA,IAAI,EACD,EAAA,IAAI,EAAC,iBAAiB,EACtB,GAAG,EAAC,MAAM,EACV,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAAA,EACnC,EAAG,CAAA,MAAA,CAAA,KAAK,CAAC,IAAI,CAAE,CAAQ,CACxB;AAEb,aAAC,CAAC,CACD,CACH;AAEd;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/TooltipContent/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { type PayloadProps } from '../../types/payload.types';\nimport { type SeriaProps } from '../../types/seria.types';\nimport { type TooltipProps } from '../../types/tooltip.types';\n\nimport styles from './index.module.css';\n\nexport interface TooltipContentProps extends TooltipProps {\n payload: PayloadProps[];\n series: SeriaProps[];\n}\n\nexport const TooltipContent = ({\n payload,\n separator,\n label,\n tooltipArrowSide,\n arrow,\n series,\n labelFormatter,\n labelStyle,\n}: TooltipContentProps) => {\n if (!label || payload.length === 0) return null;\n\n return (\n <div className={cn(styles.tooltip)}>\n {arrow && (\n <span\n className={cn(\n styles.tooltipArrow,\n tooltipArrowSide ? '' : styles.tooltipArrowRight,\n )}\n />\n )}\n <ul className={cn(styles.tooltipList)}>\n <li className={cn(styles.tooltipItem)} style={labelStyle}>\n <Text\n view='primary-medium'\n tag='span'\n weight='medium'\n className={cn(styles.tooltipLabel)}\n >\n {labelFormatter ? labelFormatter(label) : label}\n </Text>\n </li>\n {payload.map((entry: PayloadProps) => {\n const data: SeriaProps | undefined = series.find(\n (d: SeriaProps) => d.properties.dataKey === entry.dataKey,\n );\n\n if (data?.hideTooltip || data?.hide) return null;\n\n return (\n <li\n className={cn(styles.tooltipItem)}\n key={entry.dataKey}\n style={{ color: entry.color }}\n >\n <Text\n view='primary-medium'\n tag='span'\n weight='medium'\n className={cn(styles.tooltipValue)}\n >\n {entry?.formatter ? entry.formatter(entry.value) : entry.value}\n {separator || ' '}\n </Text>\n <Text\n view='secondary-large'\n tag='span'\n className={cn(styles.tooltipName)}\n >{`${entry.name}`}</Text>\n </li>\n );\n })}\n </ul>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAgBO,IAAM,cAAc,GAAG,UAAC,EAST,EAAA;QARlB,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,gBAAgB,GAAA,EAAA,CAAA,gBAAA,EAChB,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,UAAU,GAAA,EAAA,CAAA,UAAA;AAEV,IAAA,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;IAE/C,QACI,6BAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAA;QAC7B,KAAK,KACF,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACI,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,YAAY,EACnB,gBAAgB,GAAG,EAAE,GAAG,MAAM,CAAC,iBAAiB,CACnD,EAAA,CACH,CACL;AACD,QAAA,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAAA;YACjC,KAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,UAAU,EAAA;AACpD,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EACD,EAAA,IAAI,EAAC,gBAAgB,EACrB,GAAG,EAAC,MAAM,EACV,MAAM,EAAC,QAAQ,EACf,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,EAAA,EAEjC,cAAc,GA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IAAI,CAAE,CAAQ,CACxB;AAEb,aAAC,CAAC,CACD,CACH;AAEd;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"tooltip":"
|
|
3
|
+
var styles = {"tooltip":"chart__tooltip_bssr1","tooltipList":"chart__tooltipList_bssr1","tooltipItem":"chart__tooltipItem_bssr1","tooltipArrow":"chart__tooltipArrow_bssr1","tooltipArrowRight":"chart__tooltipArrowRight_bssr1"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/TooltipContent/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.tooltip {\n background-color: var(--color-light-base-bg-primary);\n border: 1px solid var(--color-light-neutral-400);\n box-shadow: var(--shadow-l);\n border-radius: var(--border-radius-8);\n padding: var(--gap-12) var(--gap-16);\n pointer-events: none;\n position: relative;\n}\n\n.tooltipList {\n position: relative;\n z-index: 5;\n list-style-type: none;\n padding: var(--gap-0);\n margin: var(--gap-0);\n}\n\n.tooltipItem {\n margin-bottom: 10px;\n}\n\n.tooltipArrow {\n position: absolute;\n left: var(--gap-0);\n top: 50%;\n transform: translate(-50%, -50%) scale(1, 1) rotate(45deg);\n width: 10px;\n height: 10px;\n border: 1px solid var(--color-light-neutral-400);\n background-color: var(--color-light-base-bg-primary);\n}\n\n.tooltipArrow:before {\n content: '';\n position: absolute;\n left: var(--gap-2-neg);\n top: var(--gap-2-neg);\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 0 24px 24px 0;\n border-color: transparent var(--color-light-base-bg-primary) transparent transparent;\n}\n\n.tooltipArrowRight {\n left: 100%;\n transform: translate(-50%, -50%) scale(-1, 1) rotate(45deg);\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,0BAA0B,CAAC,aAAa,CAAC,0BAA0B,CAAC,cAAc,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,gCAAgC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/TooltipContent/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-typography-index.css';\n\n.tooltip {\n background-color: var(--color-light-base-bg-primary);\n border: 1px solid var(--color-light-neutral-400);\n box-shadow: var(--shadow-l);\n border-radius: var(--border-radius-8);\n padding: var(--gap-12) var(--gap-16);\n pointer-events: none;\n position: relative;\n}\n\n.tooltipList {\n position: relative;\n z-index: 5;\n list-style-type: none;\n padding: var(--gap-0);\n margin: var(--gap-0);\n}\n\n.tooltipItem {\n margin-bottom: 10px;\n}\n\n.tooltipArrow {\n position: absolute;\n left: var(--gap-0);\n top: 50%;\n transform: translate(-50%, -50%) scale(1, 1) rotate(45deg);\n width: 10px;\n height: 10px;\n border: 1px solid var(--color-light-neutral-400);\n background-color: var(--color-light-base-bg-primary);\n}\n\n.tooltipArrow:before {\n content: '';\n position: absolute;\n left: var(--gap-2-neg);\n top: var(--gap-2-neg);\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 0 24px 24px 0;\n border-color: transparent var(--color-light-base-bg-primary) transparent transparent;\n}\n\n.tooltipArrowRight {\n left: 100%;\n transform: translate(-50%, -50%) scale(-1, 1) rotate(45deg);\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,0BAA0B,CAAC,aAAa,CAAC,0BAA0B,CAAC,cAAc,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,gCAAgC,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/hooks/usePathBar/index.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/usePathBar/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { type RadiusProp } from '../../types/seria.types';\n\nimport { getRadius } from './utils/getRadius';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type usePathBarProps = {\n radius?: RadiusProp;\n height: number;\n background?: {\n x: number;\n y: number;\n height: number;\n width: number;\n };\n y?: number;\n};\n\nexport const usePathBar = (props: usePathBarProps): number[] => {\n const [topRadius, setTopRadius] = useState<number>(0);\n const [bottomRadius, setBottomRadius] = useState<number>(0);\n const [initHeight, setInitHeight] = useState<number>(0);\n const [initY, setInitY] = useState<number>(0);\n\n useEffect(() => {\n const { radius, height, background, y } = props;\n const radiusTop = radius?.top ? getRadius(height, radius.top) : 0;\n const radiusBottom = radius?.bottom ? getRadius(height, radius.bottom) : 0;\n\n const heightCheck =\n (radius && height !== 0 && height / 2 < (radius?.top || 0)) ||\n height / 2 < (radius?.bottom || 0);\n\n // eslint-disable-next-line no-nested-ternary\n const heightInit = heightCheck\n ? (radiusTop || radiusBottom) && radiusTop + radiusBottom\n : height > 0 && height < 2\n ? 2\n : height;\n\n if (background && y) {\n const yInit = heightCheck\n ? background.height + background.y - (radiusTop + radiusBottom)\n : y;\n\n setInitY(yInit);\n }\n\n if (radiusTop !== 0) setTopRadius(radiusTop);\n if (radiusBottom !== 0) setBottomRadius(radiusBottom);\n if (heightInit !== 0) setInitHeight(heightInit);\n }, [props]);\n\n return [initHeight, topRadius, bottomRadius, initY];\n};\n"],"names":[],"mappings":";;;AAmBO,IAAM,UAAU,GAAG,UAAC,KAAsB,EAAA;IACvC,IAAA,EAAA,GAA4B,QAAQ,CAAS,CAAC,CAAC,EAA9C,SAAS,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,YAAY,GAAA,EAAA,CAAA,CAAA,CAAuB;IAC/C,IAAA,EAAA,GAAkC,QAAQ,CAAS,CAAC,CAAC,EAApD,YAAY,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,eAAe,GAAA,EAAA,CAAA,CAAA,CAAuB;IACrD,IAAA,EAAA,GAA8B,Q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;AACvB,kBAAE;kBACA,MAAM;QAEd,IAAI,UAAU,IAAI,CAAC,EAAE;YACjB,IAAM,KAAK,GAAG;AACV,kBAAE,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,IAAI,SAAS,GAAG,YAAY;kBAC5D,CAAC;YAEP,QAAQ,CAAC,KAAK,CAAC;AAClB;QAED,IAAI,SAAS,KAAK,CAAC;YAAE,YAAY,CAAC,SAAS,CAAC;QAC5C,IAAI,YAAY,KAAK,CAAC;YAAE,eAAe,CAAC,YAAY,CAAC;QACrD,IAAI,UAAU,KAAK,CAAC;YAAE,aAAa,CAAC,UAAU,CAAC;AACnD,KAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAEX,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC;AACvD;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { OptionsProps } from '../../types/options.types';
|
|
3
|
-
import { DataDynamicBooleanProps, DataDynamicProps } from '../../types/utils/data.types';
|
|
1
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
|
+
import { type OptionsProps } from '../../types/options.types';
|
|
3
|
+
import { type DataDynamicBooleanProps, type DataDynamicProps } from '../../types/utils/data.types';
|
|
4
4
|
declare type Settings = [
|
|
5
5
|
{
|
|
6
6
|
state: OptionsProps | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/hooks/useSettings/index.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/useSettings/index.ts"],"sourcesContent":["import { type Dispatch, type SetStateAction, useEffect, useState } from 'react';\n\nimport { type OptionsProps } from '../../types/options.types';\nimport { type DataDynamicBooleanProps, type DataDynamicProps } from '../../types/utils/data.types';\n\nimport { setComposedChartsMargin } from './utils/setComposedChartsMargin';\nimport { setDatas } from './utils/setDatas';\nimport { setGradientCharts } from './utils/setGradientCharts';\nimport { setLegendMargin } from './utils/setLegendMargin';\nimport { sortByIndex } from './utils/sortByIndex';\n\ntype Settings = [\n {\n state: OptionsProps | null;\n data: DataDynamicProps[];\n charts: DataDynamicBooleanProps;\n filterCount: number;\n },\n {\n setState: Dispatch<SetStateAction<OptionsProps | null>>;\n setData: Dispatch<SetStateAction<DataDynamicProps[]>>;\n setCharts: Dispatch<SetStateAction<DataDynamicBooleanProps>>;\n setFilterCount: Dispatch<SetStateAction<number>>;\n },\n];\n\nexport const useSettings = (options: OptionsProps): Settings => {\n const [state, setState] = useState<OptionsProps | null>(null);\n const [charts, setCharts] = useState<DataDynamicBooleanProps>({});\n const [data, setData] = useState<DataDynamicProps[]>([]);\n const [filterCount, setFilterCount] = useState<number>(0);\n\n useEffect(() => {\n const settings: OptionsProps = { ...options };\n const { brush, legend, series, labels, composeChart, xAxis } = settings;\n\n if (settings.legend?.margin && brush && legend)\n settings.legend.margin.top = setLegendMargin(brush, legend);\n\n settings.series = setGradientCharts(series);\n const [initData, chartsNames, count] = setDatas(settings.series, labels);\n\n settings.composeChart.margin = setComposedChartsMargin(composeChart, legend, brush, xAxis);\n settings.series = sortByIndex(settings.series);\n\n setState(settings);\n setData(initData);\n setCharts(chartsNames);\n setFilterCount(count);\n }, [options]);\n\n return [\n {\n state,\n data,\n charts,\n filterCount,\n },\n {\n setState,\n setData,\n setCharts,\n setFilterCount,\n },\n ];\n};\n"],"names":[],"mappings":";;;;;;;;AA0BO,IAAM,WAAW,GAAG,UAAC,OAAqB,EAAA;IACvC,IAAA,EAAA,GAAoB,QAAQ,CAAsB,IAAI,CAAC,EAAtD,KAAK,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,CAAA,CAAuC;IACvD,IAAA,EAAA,GAAsB,QAAQ,CAA0B,EAAE,CAAC,EAA1D,MAAM,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,SAAS,GAAA,EAAA,CAAA,CAAA,CAAyC;IAC3D,IA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AAQ,CAAC;QACjB,SAAS,CAAC,WAAW,CAAC;QACtB,cAAc,CAAC,KAAK,CAAC;AACzB,KAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IAEb,OAAO;AACH,QAAA;AACI,YAAA,KAAK,EAAA,KAAA;AACL,YAAA,IAAI,EAAA,IAAA;AACJ,YAAA,MAAM,EAAA,MAAA;AACN,YAAA,WAAW,EAAA,WAAA;AACd,SAAA;AACD,QAAA;AACI,YAAA,QAAQ,EAAA,QAAA;AACR,YAAA,OAAO,EAAA,OAAA;AACP,YAAA,SAAS,EAAA,SAAA;AACT,YAAA,cAAc,EAAA,cAAA;AACjB,SAAA;KACJ;AACL;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BrushProps } from '../../../types/brush.types';
|
|
2
|
-
import { ComposedChartProps } from '../../../types/composedChart.types';
|
|
3
|
-
import { LegendProps } from '../../../types/legend.types';
|
|
4
|
-
import { XAxisProps } from '../../../types/xAxis.types';
|
|
1
|
+
import { type BrushProps } from '../../../types/brush.types';
|
|
2
|
+
import { type ComposedChartProps } from '../../../types/composedChart.types';
|
|
3
|
+
import { type LegendProps } from '../../../types/legend.types';
|
|
4
|
+
import { type XAxisProps } from '../../../types/xAxis.types';
|
|
5
5
|
declare type ComposedChartsMarginResultProps = {
|
|
6
6
|
top: number;
|
|
7
7
|
bottom: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setComposedChartsMargin.js","sources":["../../../../src/hooks/useSettings/utils/setComposedChartsMargin.ts"],"sourcesContent":["import { BrushProps } from '../../../types/brush.types';\nimport { ComposedChartProps } from '../../../types/composedChart.types';\nimport { LegendProps } from '../../../types/legend.types';\nimport { XAxisProps } from '../../../types/xAxis.types';\n\ntype ComposedChartsMarginResultProps = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport const setComposedChartsMargin = (\n composeChart: ComposedChartProps,\n legend: LegendProps | undefined,\n brush: BrushProps | undefined,\n xAxis: XAxisProps,\n): ComposedChartsMarginResultProps => ({\n top:\n (composeChart?.initMargin?.top || 0) +\n (legend?.verticalAlign === 'top' && legend?.marginTop ? Math.abs(legend.marginTop) : 0),\n bottom:\n (composeChart?.initMargin?.bottom || 0) +\n (xAxis?.tickMargin || 0) +\n (brush?.brushMargin || 0) +\n (legend?.verticalAlign !== 'top' && legend?.marginTop ? legend.marginTop : 0),\n left: composeChart?.initMargin?.left || 0,\n right: composeChart?.initMargin?.right || 0,\n});\n"],"names":[],"mappings":"AAYa,IAAA,uBAAuB,GAAG,UACnC,YAAgC,EAChC,MAA+B,EAC/B,KAA6B,EAC7B,KAAiB,EAAA;;AACiB,IAAA,QAAC;AACnC,QAAA,GAAG,EACC,CAAC,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,GAAG,KAAI,CAAC;AACnC,aAAC,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,aAAa,MAAK,KAAK,KAAI,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC3F,QAAA,MAAM,EACF,CAAC,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,KAAI,CAAC;aACrC,CAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,UAAU,KAAI,CAAC,CAAC;aACvB,CAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,WAAW,KAAI,CAAC,CAAC;AACzB,aAAC,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,aAAa,MAAK,KAAK,KAAI,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,SAAS,CAAA,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;AACjF,QAAA,IAAI,EAAE,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,KAAI,CAAC;AACzC,QAAA,KAAK,EAAE,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,KAAK,KAAI,CAAC;AAC9C,KAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"setComposedChartsMargin.js","sources":["../../../../src/hooks/useSettings/utils/setComposedChartsMargin.ts"],"sourcesContent":["import { type BrushProps } from '../../../types/brush.types';\nimport { type ComposedChartProps } from '../../../types/composedChart.types';\nimport { type LegendProps } from '../../../types/legend.types';\nimport { type XAxisProps } from '../../../types/xAxis.types';\n\ntype ComposedChartsMarginResultProps = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport const setComposedChartsMargin = (\n composeChart: ComposedChartProps,\n legend: LegendProps | undefined,\n brush: BrushProps | undefined,\n xAxis: XAxisProps,\n): ComposedChartsMarginResultProps => ({\n top:\n (composeChart?.initMargin?.top || 0) +\n (legend?.verticalAlign === 'top' && legend?.marginTop ? Math.abs(legend.marginTop) : 0),\n bottom:\n (composeChart?.initMargin?.bottom || 0) +\n (xAxis?.tickMargin || 0) +\n (brush?.brushMargin || 0) +\n (legend?.verticalAlign !== 'top' && legend?.marginTop ? legend.marginTop : 0),\n left: composeChart?.initMargin?.left || 0,\n right: composeChart?.initMargin?.right || 0,\n});\n"],"names":[],"mappings":"AAYa,IAAA,uBAAuB,GAAG,UACnC,YAAgC,EAChC,MAA+B,EAC/B,KAA6B,EAC7B,KAAiB,EAAA;;AACiB,IAAA,QAAC;AACnC,QAAA,GAAG,EACC,CAAC,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,GAAG,KAAI,CAAC;AACnC,aAAC,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,aAAa,MAAK,KAAK,KAAI,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC3F,QAAA,MAAM,EACF,CAAC,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,KAAI,CAAC;aACrC,CAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,UAAU,KAAI,CAAC,CAAC;aACvB,CAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,WAAW,KAAI,CAAC,CAAC;AACzB,aAAC,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,aAAa,MAAK,KAAK,KAAI,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,SAAS,CAAA,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;AACjF,QAAA,IAAI,EAAE,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,KAAI,CAAC;AACzC,QAAA,KAAK,EAAE,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,KAAK,KAAI,CAAC;AAC9C,KAAA;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SeriaProps } from '../../../types/seria.types';
|
|
2
|
-
import { DataDynamicBooleanProps, DataDynamicProps } from '../../../types/utils/data.types';
|
|
1
|
+
import { type SeriaProps } from '../../../types/seria.types';
|
|
2
|
+
import { type DataDynamicBooleanProps, type DataDynamicProps } from '../../../types/utils/data.types';
|
|
3
3
|
declare type DatasResultProps = [DataDynamicProps[], DataDynamicBooleanProps, number];
|
|
4
4
|
export declare const setDatas: (series: SeriaProps[], labels: Array<string | number>) => DatasResultProps;
|
|
5
5
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setDatas.js","sources":["../../../../src/hooks/useSettings/utils/setDatas.ts"],"sourcesContent":["import { SeriaProps } from '../../../types/seria.types';\nimport {\n DataDynamicBooleanProps,\n DataDynamicProps,\n DataProps,\n} from '../../../types/utils/data.types';\n\ntype DatasResultProps = [DataDynamicProps[], DataDynamicBooleanProps, number];\n\nexport const setDatas = (\n series: SeriaProps[],\n labels: Array<string | number>,\n): DatasResultProps => {\n const initData: DataDynamicProps[] = [];\n const chartsNames: DataDynamicBooleanProps = {};\n let count = 0;\n\n for (let i = 0; i < series.length; i++) {\n const {\n properties: { dataKey = '' } = {},\n data: seriaData = [],\n hideLegend,\n hide,\n } = series[i];\n\n if (!hideLegend && !hide) count += 1;\n\n labels.map((label) => {\n const item = seriaData.find((d: DataProps) => d.label === label);\n\n if (item) {\n const obj: DataDynamicProps = {\n label,\n };\n\n obj[`${dataKey}`] = item.value;\n\n if (!chartsNames[`${dataKey}`]) chartsNames[`${dataKey}`] = true;\n\n const index = initData\n .map((dataItem: DataDynamicProps) => dataItem.label)\n .indexOf(label);\n\n if (index === -1) initData.push(obj);\n else initData[index] = { ...initData[index], ...obj };\n }\n\n return null;\n });\n }\n\n return [initData, chartsNames, count];\n};\n"],"names":[],"mappings":";;AASa,IAAA,QAAQ,GAAG,UACpB,MAAoB,EACpB,MAA8B,EAAA;IAE9B,IAAM,QAAQ,GAAuB,EAAE;IACvC,IAAM,WAAW,GAA4B,EAAE;IAC/C,IAAI,KAAK,GAAG,CAAC;4BAEJ,CAAC,EAAA;AACA,QAAA,IAAA,EAKF,GAAA,MAAM,CAAC,CAAC,CAAC,EAJT,EAAiC,GAAA,EAAA,CAAA,UAAA,EAAjC,EAA+B,GAAA,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EAAnB,eAAY,EAAZ,OAAO,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EAC1B,EAAoB,GAAA,EAAA,CAAA,IAAA,EAAd,SAAS,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EACpB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,IAAI,UACK;AAEb,QAAA,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI;YAAE,KAAK,IAAI,CAAC;AAEpC,QAAA,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK,EAAA;AACb,YAAA,IAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,UAAC,CAAY,EAAA,EAAK,OAAA,CAAC,CAAC,KAAK,KAAK,KAAK,CAAjB,EAAiB,CAAC;AAEhE,YAAA,IAAI,IAAI,EAAE;AACN,gBAAA,IAAM,GAAG,GAAqB;AAC1B,oBAAA,KAAK,EAAA,KAAA;iBACR;gBAED,GAAG,CAAC,UAAG,OAAO,CAAE,CAAC,GAAG,IAAI,CAAC,KAAK;AAE9B,gBAAA,IAAI,CAAC,WAAW,CAAC,EAAG,CAAA,MAAA,CAAA,OAAO,CAAE,CAAC;AAAE,oBAAA,WAAW,CAAC,EAAG,CAAA,MAAA,CAAA,OAAO,CAAE,CAAC,GAAG,IAAI;gBAEhE,IAAM,KAAK,GAAG;qBACT,GAAG,CAAC,UAAC,QAA0B,EAAK,EAAA,OAAA,QAAQ,CAAC,KAAK,CAAd,EAAc;qBAClD,OAAO,CAAC,KAAK,CAAC;gBAEnB,IAAI,KAAK,KAAK,EAAE;AAAE,oBAAA,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;;oBAC/B,QAAQ,CAAC,KAAK,CAAC,GAAQ,QAAA,CAAA,QAAA,CAAA,EAAA,EAAA,QAAQ,CAAC,KAAK,CAAC,CAAA,EAAK,GAAG,CAAE;AACxD;AAED,YAAA,OAAO,IAAI;AACf,SAAC,CAAC;;AA/BN,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAA;gBAA7B,CAAC,CAAA;AAgCT;AAED,IAAA,OAAO,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,CAAC;AACzC;;;;"}
|
|
1
|
+
{"version":3,"file":"setDatas.js","sources":["../../../../src/hooks/useSettings/utils/setDatas.ts"],"sourcesContent":["import { type SeriaProps } from '../../../types/seria.types';\nimport {\n type DataDynamicBooleanProps,\n type DataDynamicProps,\n type DataProps,\n} from '../../../types/utils/data.types';\n\ntype DatasResultProps = [DataDynamicProps[], DataDynamicBooleanProps, number];\n\nexport const setDatas = (\n series: SeriaProps[],\n labels: Array<string | number>,\n): DatasResultProps => {\n const initData: DataDynamicProps[] = [];\n const chartsNames: DataDynamicBooleanProps = {};\n let count = 0;\n\n for (let i = 0; i < series.length; i++) {\n const {\n properties: { dataKey = '' } = {},\n data: seriaData = [],\n hideLegend,\n hide,\n } = series[i];\n\n if (!hideLegend && !hide) count += 1;\n\n labels.map((label) => {\n const item = seriaData.find((d: DataProps) => d.label === label);\n\n if (item) {\n const obj: DataDynamicProps = {\n label,\n };\n\n obj[`${dataKey}`] = item.value;\n\n if (!chartsNames[`${dataKey}`]) chartsNames[`${dataKey}`] = true;\n\n const index = initData\n .map((dataItem: DataDynamicProps) => dataItem.label)\n .indexOf(label);\n\n if (index === -1) initData.push(obj);\n else initData[index] = { ...initData[index], ...obj };\n }\n\n return null;\n });\n }\n\n return [initData, chartsNames, count];\n};\n"],"names":[],"mappings":";;AASa,IAAA,QAAQ,GAAG,UACpB,MAAoB,EACpB,MAA8B,EAAA;IAE9B,IAAM,QAAQ,GAAuB,EAAE;IACvC,IAAM,WAAW,GAA4B,EAAE;IAC/C,IAAI,KAAK,GAAG,CAAC;4BAEJ,CAAC,EAAA;AACA,QAAA,IAAA,EAKF,GAAA,MAAM,CAAC,CAAC,CAAC,EAJT,EAAiC,GAAA,EAAA,CAAA,UAAA,EAAjC,EAA+B,GAAA,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EAAnB,eAAY,EAAZ,OAAO,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EAC1B,EAAoB,GAAA,EAAA,CAAA,IAAA,EAAd,SAAS,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EACpB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,IAAI,UACK;AAEb,QAAA,IAAI,CAAC,UAAU,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
+
import { type SeriaProps } from '../../../types/seria.types';
|
|
2
2
|
export declare const setGradientCharts: (series: SeriaProps[]) => SeriaProps[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setGradientCharts.js","sources":["../../../../src/hooks/useSettings/utils/setGradientCharts.ts"],"sourcesContent":["import { SeriaProps } from '../../../types/seria.types';\nimport { DataProps } from '../../../types/utils/data.types';\n\nexport const setGradientCharts = (series: SeriaProps[]): SeriaProps[] => {\n const filterSeries = series.filter((item) => item.chart !== 'gradient');\n\n return filterSeries.reduce((accum: SeriaProps[], item: SeriaProps) => {\n const { chart, data: dataSeria, offset, fill } = item;\n\n if (chart === 'area') {\n let newData = null;\n\n if (offset) {\n newData = dataSeria.map((d: DataProps) => {\n const { label, value } = d;\n\n return {\n label,\n value: Math.ceil(value - value * offset),\n };\n });\n }\n\n accum.push({\n ...item,\n zIndex: -100,\n chart: 'gradient',\n hideLegend: true,\n hideTooltip: true,\n properties: {\n ...item.properties,\n dataKey: `${item.properties.dataKey}-gradient`,\n fill,\n },\n data: newData || item.data,\n });\n }\n\n accum.push(item);\n\n return accum;\n }, []);\n};\n"],"names":[],"mappings":";;AAGO,IAAM,iBAAiB,GAAG,UAAC,MAAoB,EAAA;AAClD,IAAA,IAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,UAAC,IAAI,EAAA,EAAK,OAAA,IAAI,CAAC,KAAK,KAAK,UAAU,CAAzB,EAAyB,CAAC;AAEvE,IAAA,OAAO,YAAY,CAAC,MAAM,CAAC,UAAC,KAAmB,EAAE,IAAgB,EAAA;AACrD,QAAA,IAAA,KAAK,GAAoC,IAAI,MAAxC,EAAQ,SAAS,GAAmB,IAAI,CAAA,IAAvB,EAAE,MAAM,GAAW,IAAI,CAAf,MAAA,EAAE,IAAI,GAAK,IAAI,KAAT;QAE5C,IAAI,KAAK,KAAK,MAAM,EAAE;YAClB,IAAI,OAAO,GAAG,IAAI;AAElB,YAAA,IAAI,MAAM,EAAE;AACR,gBAAA,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,UAAC,CAAY,EAAA;oBACzB,IAAA,KAAK,GAAY,CAAC,CAAA,KAAb,EAAE,KAAK,GAAK,CAAC,CAAA,KAAN;oBAEpB,OAAO;AACH,wBAAA,KAAK,EAAA,KAAA;wBACL,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;qBAC3C;AACL,iBAAC,CAAC;AACL;YAED,KAAK,CAAC,IAAI,CACH,QAAA,CAAA,QAAA,CAAA,EAAA,EAAA,IAAI,KACP,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,IAAI,EAChB,WAAW,EAAE,IAAI,EACjB,UAAU,EAAA,QAAA,CAAA,QAAA,CAAA,EAAA,EACH,IAAI,CAAC,UAAU,KAClB,OAAO,EAAE,UAAG,IAAI,CAAC,UAAU,CAAC,OAAO,EAAA,WAAA,CAAW,EAC9C,IAAI,EAAA,IAAA,EAER,CAAA,EAAA,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,IAAI,EAAA,CAAA,CAC5B;AACL;AAED,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAEhB,QAAA,OAAO,KAAK;KACf,EAAE,EAAE,CAAC;AACV;;;;"}
|
|
1
|
+
{"version":3,"file":"setGradientCharts.js","sources":["../../../../src/hooks/useSettings/utils/setGradientCharts.ts"],"sourcesContent":["import { type SeriaProps } from '../../../types/seria.types';\nimport { type DataProps } from '../../../types/utils/data.types';\n\nexport const setGradientCharts = (series: SeriaProps[]): SeriaProps[] => {\n const filterSeries = series.filter((item) => item.chart !== 'gradient');\n\n return filterSeries.reduce((accum: SeriaProps[], item: SeriaProps) => {\n const { chart, data: dataSeria, offset, fill } = item;\n\n if (chart === 'area') {\n let newData = null;\n\n if (offset) {\n newData = dataSeria.map((d: DataProps) => {\n const { label, value } = d;\n\n return {\n label,\n value: Math.ceil(value - value * offset),\n };\n });\n }\n\n accum.push({\n ...item,\n zIndex: -100,\n chart: 'gradient',\n hideLegend: true,\n hideTooltip: true,\n properties: {\n ...item.properties,\n dataKey: `${item.properties.dataKey}-gradient`,\n fill,\n },\n data: newData || item.data,\n });\n }\n\n accum.push(item);\n\n return accum;\n }, []);\n};\n"],"names":[],"mappings":";;AAGO,IAAM,iBAAiB,GAAG,UAAC,MAAoB,EAAA;AAClD,IAAA,IAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,UAAC,IAAI,EAAA,EAAK,OAAA,IAAI,CAAC,KAAK,KAAK,UAAU,CAAzB,EAAyB,CAAC;AAEvE,IAAA,OAAO,YAAY,CAAC,MAAM,CAAC,UAAC,KAAmB,EAAE,IAAgB,EAAA;AACrD,QAAA,IAAA,KAAK,GAAoC,IAAI,MAAxC,EAAQ,SAAS,GAAmB,IAAI,CAAA,IAAvB,EAAE,MAAM,GAAW,IAAI,CAAf,MAAA,EAAE,IAAI,GAAK,IAAI,KAAT;QAE5C,IAAI,KAAK,KAAK,MAAM,EAAE;YAClB,IAAI,OAAO,GAAG,IAAI;AAElB,YAAA,IAAI,MAAM,EAAE;AACR,gBAAA,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,UAAC,CAAY,EAAA;oBACzB,IAAA,KAAK,GAAY,CAAC,CAAA,KAAb,EAAE,KAAK,GAAK,CAAC,CAAA,KAAN;oBAEpB,OAAO;AACH,wBAAA,KAAK,EAAA,KAAA;wBACL,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;qBAC3C;AACL,iBAAC,CAAC;AACL;YAED,KAAK,CAAC,IAAI,CACH,QAAA,CAAA,QAAA,CAAA,EAAA,EAAA,IAAI,KACP,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,IAAI,EAChB,WAAW,EAAE,IAAI,EACjB,UAAU,EAAA,QAAA,CAAA,QAAA,CAAA,EAAA,EACH,IAAI,CAAC,UAAU,KAClB,OAAO,EAAE,UAAG,IAAI,CAAC,UAAU,CAAC,OAAO,EAAA,WAAA,CAAW,EAC9C,IAAI,EAAA,IAAA,EAER,CAAA,EAAA,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,IAAI,EAAA,CAAA,CAC5B;AACL;AAED,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAEhB,QAAA,OAAO,KAAK;KACf,EAAE,EAAE,CAAC;AACV;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BrushProps } from '../../../types/brush.types';
|
|
2
|
-
import { LegendProps } from '../../../types/legend.types';
|
|
1
|
+
import { type BrushProps } from '../../../types/brush.types';
|
|
2
|
+
import { type LegendProps } from '../../../types/legend.types';
|
|
3
3
|
export declare const setLegendMargin: (brush: BrushProps, legend: LegendProps) => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setLegendMargin.js","sources":["../../../../src/hooks/useSettings/utils/setLegendMargin.ts"],"sourcesContent":["import { BrushProps } from '../../../types/brush.types';\nimport { LegendProps } from '../../../types/legend.types';\n\nexport const setLegendMargin = (brush: BrushProps, legend: LegendProps): number => {\n let top = 0;\n\n if (typeof brush?.brushMargin !== 'number' || !legend?.verticalAlign) return top;\n\n if (legend.verticalAlign === 'top') {\n top = legend.marginTop ? Number(legend.marginTop * -1) : 0;\n } else {\n top = legend?.marginTop ? legend.marginTop + (brush?.brushMargin || 0) : brush?.brushMargin;\n }\n\n return top;\n};\n"],"names":[],"mappings":"AAGa,IAAA,eAAe,GAAG,UAAC,KAAiB,EAAE,MAAmB,EAAA;IAClE,IAAI,GAAG,GAAG,CAAC;IAEX,IAAI,QAAO,KAAK,KAAA,IAAA,IAAL,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,WAAW,CAAA,KAAK,QAAQ,IAAI,EAAC,MAAM,KAAA,IAAA,IAAN,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,aAAa,CAAA;AAAE,QAAA,OAAO,GAAG;AAEhF,IAAA,IAAI,MAAM,CAAC,aAAa,KAAK,KAAK,EAAE;QAChC,GAAG,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC,GAAG,CAAC;AAC7D;AAAM,SAAA;AACH,QAAA,GAAG,GAAG,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,SAAS,IAAG,MAAM,CAAC,SAAS,IAAI,CAAA,KAAK,KAAL,IAAA,IAAA,KAAK,uBAAL,KAAK,CAAE,WAAW,KAAI,CAAC,CAAC,GAAG,KAAK,KAAL,IAAA,IAAA,KAAK,uBAAL,KAAK,CAAE,WAAW;AAC9F;AAED,IAAA,OAAO,GAAG;AACd;;;;"}
|
|
1
|
+
{"version":3,"file":"setLegendMargin.js","sources":["../../../../src/hooks/useSettings/utils/setLegendMargin.ts"],"sourcesContent":["import { type BrushProps } from '../../../types/brush.types';\nimport { type LegendProps } from '../../../types/legend.types';\n\nexport const setLegendMargin = (brush: BrushProps, legend: LegendProps): number => {\n let top = 0;\n\n if (typeof brush?.brushMargin !== 'number' || !legend?.verticalAlign) return top;\n\n if (legend.verticalAlign === 'top') {\n top = legend.marginTop ? Number(legend.marginTop * -1) : 0;\n } else {\n top = legend?.marginTop ? legend.marginTop + (brush?.brushMargin || 0) : brush?.brushMargin;\n }\n\n return top;\n};\n"],"names":[],"mappings":"AAGa,IAAA,eAAe,GAAG,UAAC,KAAiB,EAAE,MAAmB,EAAA;IAClE,IAAI,GAAG,GAAG,CAAC;IAEX,IAAI,QAAO,KAAK,KAAA,IAAA,IAAL,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,WAAW,CAAA,KAAK,QAAQ,IAAI,EAAC,MAAM,KAAA,IAAA,IAAN,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,aAAa,CAAA;AAAE,QAAA,OAAO,GAAG;AAEhF,IAAA,IAAI,MAAM,CAAC,aAAa,KAAK,KAAK,EAAE;QAChC,GAAG,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC,GAAG,CAAC;AAC7D;AAAM,SAAA;AACH,QAAA,GAAG,GAAG,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,SAAS,IAAG,MAAM,CAAC,SAAS,IAAI,CAAA,KAAK,KAAL,IAAA,IAAA,KAAK,uBAAL,KAAK,CAAE,WAAW,KAAI,CAAC,CAAC,GAAG,KAAK,KAAL,IAAA,IAAA,KAAK,uBAAL,KAAK,CAAE,WAAW;AAC9F;AAED,IAAA,OAAO,GAAG;AACd;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SeriaProps } from '../../../types/seria.types';
|
|
1
|
+
import { type SeriaProps } from '../../../types/seria.types';
|
|
2
2
|
export declare const sortByIndex: (series: SeriaProps[]) => SeriaProps[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortByIndex.js","sources":["../../../../src/hooks/useSettings/utils/sortByIndex.ts"],"sourcesContent":["import { SeriaProps } from '../../../types/seria.types';\n\nexport const sortByIndex = (series: SeriaProps[]): SeriaProps[] =>\n series.sort((a: SeriaProps, b: SeriaProps) => {\n if (a?.zIndex && b?.zIndex && a?.zIndex > b?.zIndex) {\n return 1;\n }\n\n return -1;\n });\n"],"names":[],"mappings":"AAEO,IAAM,WAAW,GAAG,UAAC,MAAoB,EAAA;AAC5C,IAAA,OAAA,MAAM,CAAC,IAAI,CAAC,UAAC,CAAa,EAAE,CAAa,EAAA;AACrC,QAAA,IAAI,CAAA,CAAC,KAAD,IAAA,IAAA,CAAC,uBAAD,CAAC,CAAE,MAAM,MAAI,CAAC,KAAD,IAAA,IAAA,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,CAAA,IAAI,CAAA,CAAC,KAAD,IAAA,IAAA,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,KAAG,CAAC,KAAA,IAAA,IAAD,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,CAAA,EAAE;AACjD,YAAA,OAAO,CAAC;AACX;QAED,OAAO,EAAE;AACb,KAAC,CAAC;AANF;;;;"}
|
|
1
|
+
{"version":3,"file":"sortByIndex.js","sources":["../../../../src/hooks/useSettings/utils/sortByIndex.ts"],"sourcesContent":["import { type SeriaProps } from '../../../types/seria.types';\n\nexport const sortByIndex = (series: SeriaProps[]): SeriaProps[] =>\n series.sort((a: SeriaProps, b: SeriaProps) => {\n if (a?.zIndex && b?.zIndex && a?.zIndex > b?.zIndex) {\n return 1;\n }\n\n return -1;\n });\n"],"names":[],"mappings":"AAEO,IAAM,WAAW,GAAG,UAAC,MAAoB,EAAA;AAC5C,IAAA,OAAA,MAAM,CAAC,IAAI,CAAC,UAAC,CAAa,EAAE,CAAa,EAAA;AACrC,QAAA,IAAI,CAAA,CAAC,KAAD,IAAA,IAAA,CAAC,uBAAD,CAAC,CAAE,MAAM,MAAI,CAAC,KAAD,IAAA,IAAA,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,CAAA,IAAI,CAAA,CAAC,KAAD,IAAA,IAAA,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,KAAG,CAAC,KAAA,IAAA,IAAD,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,CAAA,EAAE;AACjD,YAAA,OAAO,CAAC;AACX;QAED,OAAO,EAAE;AACb,KAAC,CAAC;AANF;;;;"}
|
package/esm/index.css
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-light-text-primary: rgba(3, 3, 6, 0.88);
|
|
3
|
-
} .
|
|
3
|
+
} .chart__coreChart_v2vfw .recharts-line path {
|
|
4
4
|
transition: d 0.2s ease-out;
|
|
5
|
-
} .
|
|
5
|
+
} .chart__coreChart_v2vfw .recharts-text tspan {
|
|
6
6
|
fill: var(--color-light-text-primary);
|
|
7
7
|
font-size: 16px;
|
|
8
8
|
line-height: 22px;
|
|
9
|
-
} .
|
|
10
|
-
transition:
|
|
11
|
-
|
|
9
|
+
} .chart__bar_v2vfw {
|
|
10
|
+
transition:
|
|
11
|
+
opacity 0.2s ease-out,
|
|
12
|
+
d 0.2s ease-out;
|
|
13
|
+
} .chart__unfocused_v2vfw {
|
|
12
14
|
opacity: 0.3;
|
|
13
15
|
}
|
package/esm/index.module.css.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
var styles = {"coreChart":"
|
|
3
|
+
var styles = {"coreChart":"chart__coreChart_v2vfw","bar":"chart__bar_v2vfw","unfocused":"chart__unfocused_v2vfw"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.coreChart {\n & :global(.recharts-line path) {\n transition: d 0.2s ease-out;\n }\n\n & :global(.recharts-text tspan) {\n fill: var(--color-light-text-primary);\n font-size: 16px;\n line-height: 22px;\n }\n}\n\n.bar {\n transition
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-typography-index.css';\n\n.coreChart {\n & :global(.recharts-line path) {\n transition: d 0.2s ease-out;\n }\n\n & :global(.recharts-text tspan) {\n fill: var(--color-light-text-primary);\n font-size: 16px;\n line-height: 22px;\n }\n}\n\n.bar {\n transition:\n opacity 0.2s ease-out,\n d 0.2s ease-out;\n}\n\n.unfocused {\n opacity: 0.3;\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,WAAW,CAAC,wBAAwB,CAAC,KAAK,CAAC,kBAAkB,CAAC,WAAW,CAAC,wBAAwB,CAAC;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { RectangleProps } from 'recharts';
|
|
3
|
-
import { DataKey } from 'recharts/types/util/types';
|
|
4
|
-
import { DataProps } from './utils/data.types';
|
|
5
|
-
import { DotSettingProps } from './utils/dot.types';
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import { type RectangleProps } from 'recharts';
|
|
3
|
+
import { type DataKey } from 'recharts/types/util/types';
|
|
4
|
+
import { type DataProps } from './utils/data.types';
|
|
5
|
+
import { type DotSettingProps } from './utils/dot.types';
|
|
6
6
|
declare type CurveType = 'linear' | 'monotone' | 'step';
|
|
7
7
|
export declare type RectangleShapeType = ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | RectangleProps | boolean;
|
|
8
8
|
export interface ChartProps {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BrushProps } from './brush.types';
|
|
3
|
-
import { CartesianGridProps } from './cartesianGrid.types';
|
|
4
|
-
import { ComposedChartProps } from './composedChart.types';
|
|
5
|
-
import { LegendProps } from './legend.types';
|
|
6
|
-
import { ResponsiveContainerProps } from './responsiveContainer.types';
|
|
7
|
-
import { SeriaProps } from './seria.types';
|
|
8
|
-
import { TooltipProps } from './tooltip.types';
|
|
9
|
-
import { XAxisProps } from './xAxis.types';
|
|
10
|
-
import { YAxisProps } from './yAxis.types';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type BrushProps } from './brush.types';
|
|
3
|
+
import { type CartesianGridProps } from './cartesianGrid.types';
|
|
4
|
+
import { type ComposedChartProps } from './composedChart.types';
|
|
5
|
+
import { type LegendProps } from './legend.types';
|
|
6
|
+
import { type ResponsiveContainerProps } from './responsiveContainer.types';
|
|
7
|
+
import { type SeriaProps } from './seria.types';
|
|
8
|
+
import { type TooltipProps } from './tooltip.types';
|
|
9
|
+
import { type XAxisProps } from './xAxis.types';
|
|
10
|
+
import { type YAxisProps } from './yAxis.types';
|
|
11
11
|
export interface OptionsProps {
|
|
12
12
|
/**
|
|
13
13
|
* Индефикатор графика
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DataProps } from './utils/data.types';
|
|
2
|
-
import { GradientProps } from './utils/gradient.types';
|
|
3
|
-
import { ChartProps } from './chart.types';
|
|
4
|
-
import { LabelListProps } from './labelList.types';
|
|
1
|
+
import { type DataProps } from './utils/data.types';
|
|
2
|
+
import { type GradientProps } from './utils/gradient.types';
|
|
3
|
+
import { type ChartProps } from './chart.types';
|
|
4
|
+
import { type LabelListProps } from './labelList.types';
|
|
5
5
|
export declare type RadiusProp = {
|
|
6
6
|
top?: number;
|
|
7
7
|
bottom?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactElement, ReactText, SVGProps } from 'react';
|
|
2
|
-
import { AnimationTiming } from 'recharts/types/util/types';
|
|
1
|
+
import { type ReactElement, type ReactText, type SVGProps } from 'react';
|
|
2
|
+
import { type AnimationTiming } from 'recharts/types/util/types';
|
|
3
3
|
export interface TooltipProps {
|
|
4
4
|
/**
|
|
5
5
|
* Разделитель между именем и значением.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CoordinatesProps } from './coordinates.types';
|
|
2
|
-
import { DataProps } from './data.types';
|
|
1
|
+
import { type CoordinatesProps } from './coordinates.types';
|
|
2
|
+
import { type DataProps } from './data.types';
|
|
3
3
|
export interface DotSettingProps {
|
|
4
4
|
/**
|
|
5
5
|
* Значение media query.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/hooks/usePathBar/index.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/hooks/usePathBar/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { type RadiusProp } from '../../types/seria.types';\n\nimport { getRadius } from './utils/getRadius';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport type usePathBarProps = {\n radius?: RadiusProp;\n height: number;\n background?: {\n x: number;\n y: number;\n height: number;\n width: number;\n };\n y?: number;\n};\n\nexport const usePathBar = (props: usePathBarProps): number[] => {\n const [topRadius, setTopRadius] = useState<number>(0);\n const [bottomRadius, setBottomRadius] = useState<number>(0);\n const [initHeight, setInitHeight] = useState<number>(0);\n const [initY, setInitY] = useState<number>(0);\n\n useEffect(() => {\n const { radius, height, background, y } = props;\n const radiusTop = radius?.top ? getRadius(height, radius.top) : 0;\n const radiusBottom = radius?.bottom ? getRadius(height, radius.bottom) : 0;\n\n const heightCheck =\n (radius && height !== 0 && height / 2 < (radius?.top || 0)) ||\n height / 2 < (radius?.bottom || 0);\n\n // eslint-disable-next-line no-nested-ternary\n const heightInit = heightCheck\n ? (radiusTop || radiusBottom) && radiusTop + radiusBottom\n : height > 0 && height < 2\n ? 2\n : height;\n\n if (background && y) {\n const yInit = heightCheck\n ? background.height + background.y - (radiusTop + radiusBottom)\n : y;\n\n setInitY(yInit);\n }\n\n if (radiusTop !== 0) setTopRadius(radiusTop);\n if (radiusBottom !== 0) setBottomRadius(radiusBottom);\n if (heightInit !== 0) setInitHeight(heightInit);\n }, [props]);\n\n return [initHeight, topRadius, bottomRadius, initY];\n};\n"],"names":["useState","useEffect","getRadius"],"mappings":";;;;;;;AAmBO,IAAM,UAAU,GAAG,UAAC,KAAsB,EAAA;IACvC,IAAA,EAAA,GAA4BA,cAAQ,CAAS,CAAC,CAAC,EAA9C,SAAS,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,YAAY,GAAA,EAAA,CAAA,CAAA,CAAuB;IAC/C,IAAA,EAAA,GAAkCA,cAAQ,CAAS,CAAC,CAAC,EAApD,YAAY,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,eAAe,GAAA,EAAA,CAAA,CAAA,CAAuB;IACrD,IAAA,EAAA,GAA8B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MAAM,GAAG;AACvB,kBAAE;kBACA,MAAM;QAEd,IAAI,UAAU,IAAI,CAAC,EAAE;YACjB,IAAM,KAAK,GAAG;AACV,kBAAE,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,IAAI,SAAS,GAAG,YAAY;kBAC5D,CAAC;YAEP,QAAQ,CAAC,KAAK,CAAC;AAClB;QAED,IAAI,SAAS,KAAK,CAAC;YAAE,YAAY,CAAC,SAAS,CAAC;QAC5C,IAAI,YAAY,KAAK,CAAC;YAAE,eAAe,CAAC,YAAY,CAAC;QACrD,IAAI,UAAU,KAAK,CAAC;YAAE,aAAa,CAAC,UAAU,CAAC;AACnD,KAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAEX,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC;AACvD;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { OptionsProps } from '../../types/options.types';
|
|
3
|
-
import { DataDynamicBooleanProps, DataDynamicProps } from '../../types/utils/data.types';
|
|
1
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
|
+
import { type OptionsProps } from '../../types/options.types';
|
|
3
|
+
import { type DataDynamicBooleanProps, type DataDynamicProps } from '../../types/utils/data.types';
|
|
4
4
|
declare type Settings = [
|
|
5
5
|
{
|
|
6
6
|
state: OptionsProps | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/hooks/useSettings/index.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/hooks/useSettings/index.ts"],"sourcesContent":["import { type Dispatch, type SetStateAction, useEffect, useState } from 'react';\n\nimport { type OptionsProps } from '../../types/options.types';\nimport { type DataDynamicBooleanProps, type DataDynamicProps } from '../../types/utils/data.types';\n\nimport { setComposedChartsMargin } from './utils/setComposedChartsMargin';\nimport { setDatas } from './utils/setDatas';\nimport { setGradientCharts } from './utils/setGradientCharts';\nimport { setLegendMargin } from './utils/setLegendMargin';\nimport { sortByIndex } from './utils/sortByIndex';\n\ntype Settings = [\n {\n state: OptionsProps | null;\n data: DataDynamicProps[];\n charts: DataDynamicBooleanProps;\n filterCount: number;\n },\n {\n setState: Dispatch<SetStateAction<OptionsProps | null>>;\n setData: Dispatch<SetStateAction<DataDynamicProps[]>>;\n setCharts: Dispatch<SetStateAction<DataDynamicBooleanProps>>;\n setFilterCount: Dispatch<SetStateAction<number>>;\n },\n];\n\nexport const useSettings = (options: OptionsProps): Settings => {\n const [state, setState] = useState<OptionsProps | null>(null);\n const [charts, setCharts] = useState<DataDynamicBooleanProps>({});\n const [data, setData] = useState<DataDynamicProps[]>([]);\n const [filterCount, setFilterCount] = useState<number>(0);\n\n useEffect(() => {\n const settings: OptionsProps = { ...options };\n const { brush, legend, series, labels, composeChart, xAxis } = settings;\n\n if (settings.legend?.margin && brush && legend)\n settings.legend.margin.top = setLegendMargin(brush, legend);\n\n settings.series = setGradientCharts(series);\n const [initData, chartsNames, count] = setDatas(settings.series, labels);\n\n settings.composeChart.margin = setComposedChartsMargin(composeChart, legend, brush, xAxis);\n settings.series = sortByIndex(settings.series);\n\n setState(settings);\n setData(initData);\n setCharts(chartsNames);\n setFilterCount(count);\n }, [options]);\n\n return [\n {\n state,\n data,\n charts,\n filterCount,\n },\n {\n setState,\n setData,\n setCharts,\n setFilterCount,\n },\n ];\n};\n"],"names":["useState","useEffect","__assign","setLegendMargin","setGradientCharts","setDatas","setComposedChartsMargin","sortByIndex"],"mappings":";;;;;;;;;;;;AA0BO,IAAM,WAAW,GAAG,UAAC,OAAqB,EAAA;IACvC,IAAA,EAAA,GAAoBA,cAAQ,CAAsB,IAAI,CAAC,EAAtD,KAAK,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,CAAA,CAAuC;IACvD,IAAA,EAAA,GAAsBA,cAAQ,CAA0B,EAAE,CAAC,EAA1D,MAAM,GAAA,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uBAAW,CAAC,QAAQ,CAAC,MAAM,CAAC;QAE9C,QAAQ,CAAC,QAAQ,CAAC;QAClB,OAAO,CAAC,QAAQ,CAAC;QACjB,SAAS,CAAC,WAAW,CAAC;QACtB,cAAc,CAAC,KAAK,CAAC;AACzB,KAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IAEb,OAAO;AACH,QAAA;AACI,YAAA,KAAK,EAAA,KAAA;AACL,YAAA,IAAI,EAAA,IAAA;AACJ,YAAA,MAAM,EAAA,MAAA;AACN,YAAA,WAAW,EAAA,WAAA;AACd,SAAA;AACD,QAAA;AACI,YAAA,QAAQ,EAAA,QAAA;AACR,YAAA,OAAO,EAAA,OAAA;AACP,YAAA,SAAS,EAAA,SAAA;AACT,YAAA,cAAc,EAAA,cAAA;AACjB,SAAA;KACJ;AACL;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BrushProps } from '../../../types/brush.types';
|
|
2
|
-
import { ComposedChartProps } from '../../../types/composedChart.types';
|
|
3
|
-
import { LegendProps } from '../../../types/legend.types';
|
|
4
|
-
import { XAxisProps } from '../../../types/xAxis.types';
|
|
1
|
+
import { type BrushProps } from '../../../types/brush.types';
|
|
2
|
+
import { type ComposedChartProps } from '../../../types/composedChart.types';
|
|
3
|
+
import { type LegendProps } from '../../../types/legend.types';
|
|
4
|
+
import { type XAxisProps } from '../../../types/xAxis.types';
|
|
5
5
|
declare type ComposedChartsMarginResultProps = {
|
|
6
6
|
top: number;
|
|
7
7
|
bottom: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setComposedChartsMargin.js","sources":["../../../src/hooks/useSettings/utils/setComposedChartsMargin.ts"],"sourcesContent":["import { BrushProps } from '../../../types/brush.types';\nimport { ComposedChartProps } from '../../../types/composedChart.types';\nimport { LegendProps } from '../../../types/legend.types';\nimport { XAxisProps } from '../../../types/xAxis.types';\n\ntype ComposedChartsMarginResultProps = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport const setComposedChartsMargin = (\n composeChart: ComposedChartProps,\n legend: LegendProps | undefined,\n brush: BrushProps | undefined,\n xAxis: XAxisProps,\n): ComposedChartsMarginResultProps => ({\n top:\n (composeChart?.initMargin?.top || 0) +\n (legend?.verticalAlign === 'top' && legend?.marginTop ? Math.abs(legend.marginTop) : 0),\n bottom:\n (composeChart?.initMargin?.bottom || 0) +\n (xAxis?.tickMargin || 0) +\n (brush?.brushMargin || 0) +\n (legend?.verticalAlign !== 'top' && legend?.marginTop ? legend.marginTop : 0),\n left: composeChart?.initMargin?.left || 0,\n right: composeChart?.initMargin?.right || 0,\n});\n"],"names":[],"mappings":";;;;AAYa,IAAA,uBAAuB,GAAG,UACnC,YAAgC,EAChC,MAA+B,EAC/B,KAA6B,EAC7B,KAAiB,EAAA;;AACiB,IAAA,QAAC;AACnC,QAAA,GAAG,EACC,CAAC,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,GAAG,KAAI,CAAC;AACnC,aAAC,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,aAAa,MAAK,KAAK,KAAI,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC3F,QAAA,MAAM,EACF,CAAC,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,KAAI,CAAC;aACrC,CAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,UAAU,KAAI,CAAC,CAAC;aACvB,CAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,WAAW,KAAI,CAAC,CAAC;AACzB,aAAC,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,aAAa,MAAK,KAAK,KAAI,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,SAAS,CAAA,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;AACjF,QAAA,IAAI,EAAE,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,KAAI,CAAC;AACzC,QAAA,KAAK,EAAE,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,KAAK,KAAI,CAAC;AAC9C,KAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"setComposedChartsMargin.js","sources":["../../../src/hooks/useSettings/utils/setComposedChartsMargin.ts"],"sourcesContent":["import { type BrushProps } from '../../../types/brush.types';\nimport { type ComposedChartProps } from '../../../types/composedChart.types';\nimport { type LegendProps } from '../../../types/legend.types';\nimport { type XAxisProps } from '../../../types/xAxis.types';\n\ntype ComposedChartsMarginResultProps = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport const setComposedChartsMargin = (\n composeChart: ComposedChartProps,\n legend: LegendProps | undefined,\n brush: BrushProps | undefined,\n xAxis: XAxisProps,\n): ComposedChartsMarginResultProps => ({\n top:\n (composeChart?.initMargin?.top || 0) +\n (legend?.verticalAlign === 'top' && legend?.marginTop ? Math.abs(legend.marginTop) : 0),\n bottom:\n (composeChart?.initMargin?.bottom || 0) +\n (xAxis?.tickMargin || 0) +\n (brush?.brushMargin || 0) +\n (legend?.verticalAlign !== 'top' && legend?.marginTop ? legend.marginTop : 0),\n left: composeChart?.initMargin?.left || 0,\n right: composeChart?.initMargin?.right || 0,\n});\n"],"names":[],"mappings":";;;;AAYa,IAAA,uBAAuB,GAAG,UACnC,YAAgC,EAChC,MAA+B,EAC/B,KAA6B,EAC7B,KAAiB,EAAA;;AACiB,IAAA,QAAC;AACnC,QAAA,GAAG,EACC,CAAC,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,GAAG,KAAI,CAAC;AACnC,aAAC,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,aAAa,MAAK,KAAK,KAAI,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC3F,QAAA,MAAM,EACF,CAAC,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,MAAM,KAAI,CAAC;aACrC,CAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,UAAU,KAAI,CAAC,CAAC;aACvB,CAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,WAAW,KAAI,CAAC,CAAC;AACzB,aAAC,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,aAAa,MAAK,KAAK,KAAI,MAAM,KAAN,IAAA,IAAA,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,SAAS,CAAA,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;AACjF,QAAA,IAAI,EAAE,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,IAAI,KAAI,CAAC;AACzC,QAAA,KAAK,EAAE,CAAA,CAAA,EAAA,GAAA,YAAY,KAAZ,IAAA,IAAA,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,UAAU,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,KAAK,KAAI,CAAC;AAC9C,KAAA;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SeriaProps } from '../../../types/seria.types';
|
|
2
|
-
import { DataDynamicBooleanProps, DataDynamicProps } from '../../../types/utils/data.types';
|
|
1
|
+
import { type SeriaProps } from '../../../types/seria.types';
|
|
2
|
+
import { type DataDynamicBooleanProps, type DataDynamicProps } from '../../../types/utils/data.types';
|
|
3
3
|
declare type DatasResultProps = [DataDynamicProps[], DataDynamicBooleanProps, number];
|
|
4
4
|
export declare const setDatas: (series: SeriaProps[], labels: Array<string | number>) => DatasResultProps;
|
|
5
5
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setDatas.js","sources":["../../../src/hooks/useSettings/utils/setDatas.ts"],"sourcesContent":["import { SeriaProps } from '../../../types/seria.types';\nimport {\n DataDynamicBooleanProps,\n DataDynamicProps,\n DataProps,\n} from '../../../types/utils/data.types';\n\ntype DatasResultProps = [DataDynamicProps[], DataDynamicBooleanProps, number];\n\nexport const setDatas = (\n series: SeriaProps[],\n labels: Array<string | number>,\n): DatasResultProps => {\n const initData: DataDynamicProps[] = [];\n const chartsNames: DataDynamicBooleanProps = {};\n let count = 0;\n\n for (let i = 0; i < series.length; i++) {\n const {\n properties: { dataKey = '' } = {},\n data: seriaData = [],\n hideLegend,\n hide,\n } = series[i];\n\n if (!hideLegend && !hide) count += 1;\n\n labels.map((label) => {\n const item = seriaData.find((d: DataProps) => d.label === label);\n\n if (item) {\n const obj: DataDynamicProps = {\n label,\n };\n\n obj[`${dataKey}`] = item.value;\n\n if (!chartsNames[`${dataKey}`]) chartsNames[`${dataKey}`] = true;\n\n const index = initData\n .map((dataItem: DataDynamicProps) => dataItem.label)\n .indexOf(label);\n\n if (index === -1) initData.push(obj);\n else initData[index] = { ...initData[index], ...obj };\n }\n\n return null;\n });\n }\n\n return [initData, chartsNames, count];\n};\n"],"names":["__assign"],"mappings":";;;;;;AASa,IAAA,QAAQ,GAAG,UACpB,MAAoB,EACpB,MAA8B,EAAA;IAE9B,IAAM,QAAQ,GAAuB,EAAE;IACvC,IAAM,WAAW,GAA4B,EAAE;IAC/C,IAAI,KAAK,GAAG,CAAC;4BAEJ,CAAC,EAAA;AACA,QAAA,IAAA,EAKF,GAAA,MAAM,CAAC,CAAC,CAAC,EAJT,EAAiC,GAAA,EAAA,CAAA,UAAA,EAAjC,EAA+B,GAAA,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EAAnB,eAAY,EAAZ,OAAO,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EAC1B,EAAoB,GAAA,EAAA,CAAA,IAAA,EAAd,SAAS,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EACpB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,IA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ources":["../../../src/hooks/useSettings/utils/setDatas.ts"],"sourcesContent":["import { type SeriaProps } from '../../../types/seria.types';\nimport {\n type DataDynamicBooleanProps,\n type DataDynamicProps,\n type DataProps,\n} from '../../../types/utils/data.types';\n\ntype DatasResultProps = [DataDynamicProps[], DataDynamicBooleanProps, number];\n\nexport const setDatas = (\n series: SeriaProps[],\n labels: Array<string | number>,\n): DatasResultProps => {\n const initData: DataDynamicProps[] = [];\n const chartsNames: DataDynamicBooleanProps = {};\n let count = 0;\n\n for (let i = 0; i < series.length; i++) {\n const {\n properties: { dataKey = '' } = {},\n data: seriaData = [],\n hideLegend,\n hide,\n } = series[i];\n\n if (!hideLegend && !hide) count += 1;\n\n labels.map((label) => {\n const item = seriaData.find((d: DataProps) => d.label === label);\n\n if (item) {\n const obj: DataDynamicProps = {\n label,\n };\n\n obj[`${dataKey}`] = item.value;\n\n if (!chartsNames[`${dataKey}`]) chartsNames[`${dataKey}`] = true;\n\n const index = initData\n .map((dataItem: DataDynamicProps) => dataItem.label)\n .indexOf(label);\n\n if (index === -1) initData.push(obj);\n else initData[index] = { ...initData[index], ...obj };\n }\n\n return null;\n });\n }\n\n return [initData, chartsNames, count];\n};\n"],"names":["__assign"],"mappings":";;;;;;AASa,IAAA,QAAQ,GAAG,UACpB,MAAoB,EACpB,MAA8B,EAAA;IAE9B,IAAM,QAAQ,GAAuB,EAAE;IACvC,IAAM,WAAW,GAA4B,EAAE;IAC/C,IAAI,KAAK,GAAG,CAAC;4BAEJ,CAAC,EAAA;AACA,QAAA,IAAA,EAKF,GAAA,MAAM,CAAC,CAAC,CAAC,EAJT,EAAiC,GAAA,EAAA,CAAA,UAAA,EAAjC,EAA+B,GAAA,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EAAnB,eAAY,EAAZ,OAAO,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EAC1B,EAAoB,GAAA,EAAA,CAAA,IAAA,EAAd,SAAS,GAAG,EAAA,KAA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AAE,WAAW,EAAE,KAAK,CAAC;AACzC;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SeriaProps } from '../../../types/seria.types';
|
|
1
|
+
import { type SeriaProps } from '../../../types/seria.types';
|
|
2
2
|
export declare const setGradientCharts: (series: SeriaProps[]) => SeriaProps[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setGradientCharts.js","sources":["../../../src/hooks/useSettings/utils/setGradientCharts.ts"],"sourcesContent":["import { SeriaProps } from '../../../types/seria.types';\nimport { DataProps } from '../../../types/utils/data.types';\n\nexport const setGradientCharts = (series: SeriaProps[]): SeriaProps[] => {\n const filterSeries = series.filter((item) => item.chart !== 'gradient');\n\n return filterSeries.reduce((accum: SeriaProps[], item: SeriaProps) => {\n const { chart, data: dataSeria, offset, fill } = item;\n\n if (chart === 'area') {\n let newData = null;\n\n if (offset) {\n newData = dataSeria.map((d: DataProps) => {\n const { label, value } = d;\n\n return {\n label,\n value: Math.ceil(value - value * offset),\n };\n });\n }\n\n accum.push({\n ...item,\n zIndex: -100,\n chart: 'gradient',\n hideLegend: true,\n hideTooltip: true,\n properties: {\n ...item.properties,\n dataKey: `${item.properties.dataKey}-gradient`,\n fill,\n },\n data: newData || item.data,\n });\n }\n\n accum.push(item);\n\n return accum;\n }, []);\n};\n"],"names":["__assign"],"mappings":";;;;;;AAGO,IAAM,iBAAiB,GAAG,UAAC,MAAoB,EAAA;AAClD,IAAA,IAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,UAAC,IAAI,EAAA,EAAK,OAAA,IAAI,CAAC,KAAK,KAAK,UAAU,CAAzB,EAAyB,CAAC;AAEvE,IAAA,OAAO,YAAY,CAAC,MAAM,CAAC,UAAC,KAAmB,EAAE,IAAgB,EAAA;AACrD,QAAA,IAAA,KAAK,GAAoC,IAAI,MAAxC,EAAQ,SAAS,GAAmB,IAAI,CAAA,IAAvB,EAAE,MAAM,GAAW,IAAI,CAAf,MAAA,EAAE,IAAI,GAAK,IAAI,KAAT;QAE5C,IAAI,KAAK,KAAK,MAAM,EAAE;YAClB,IAAI,OAAO,GAAG,IAAI;AAElB,YAAA,IAAI,MAAM,EAAE;AACR,gBAAA,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,UAAC,CAAY,EAAA;oBACzB,IAAA,KAAK,GAAY,CAAC,CAAA,KAAb,EAAE,KAAK,GAAK,CAAC,CAAA,KAAN;oBAEpB,OAAO;AACH,wBAAA,KAAK,EAAA,KAAA;wBACL,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;qBAC3C;AACL,iBAAC,CAAC;AACL;YAED,KAAK,CAAC,IAAI,CACHA,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAA,IAAI,KACP,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,IAAI,EAChB,WAAW,EAAE,IAAI,EACjB,UAAU,EAAAA,cAAA,CAAAA,cAAA,CAAA,EAAA,EACH,IAAI,CAAC,UAAU,KAClB,OAAO,EAAE,UAAG,IAAI,CAAC,UAAU,CAAC,OAAO,EAAA,WAAA,CAAW,EAC9C,IAAI,EAAA,IAAA,EAER,CAAA,EAAA,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,IAAI,EAAA,CAAA,CAC5B;AACL;AAED,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAEhB,QAAA,OAAO,KAAK;KACf,EAAE,EAAE,CAAC;AACV;;;;"}
|
|
1
|
+
{"version":3,"file":"setGradientCharts.js","sources":["../../../src/hooks/useSettings/utils/setGradientCharts.ts"],"sourcesContent":["import { type SeriaProps } from '../../../types/seria.types';\nimport { type DataProps } from '../../../types/utils/data.types';\n\nexport const setGradientCharts = (series: SeriaProps[]): SeriaProps[] => {\n const filterSeries = series.filter((item) => item.chart !== 'gradient');\n\n return filterSeries.reduce((accum: SeriaProps[], item: SeriaProps) => {\n const { chart, data: dataSeria, offset, fill } = item;\n\n if (chart === 'area') {\n let newData = null;\n\n if (offset) {\n newData = dataSeria.map((d: DataProps) => {\n const { label, value } = d;\n\n return {\n label,\n value: Math.ceil(value - value * offset),\n };\n });\n }\n\n accum.push({\n ...item,\n zIndex: -100,\n chart: 'gradient',\n hideLegend: true,\n hideTooltip: true,\n properties: {\n ...item.properties,\n dataKey: `${item.properties.dataKey}-gradient`,\n fill,\n },\n data: newData || item.data,\n });\n }\n\n accum.push(item);\n\n return accum;\n }, []);\n};\n"],"names":["__assign"],"mappings":";;;;;;AAGO,IAAM,iBAAiB,GAAG,UAAC,MAAoB,EAAA;AAClD,IAAA,IAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,UAAC,IAAI,EAAA,EAAK,OAAA,IAAI,CAAC,KAAK,KAAK,UAAU,CAAzB,EAAyB,CAAC;AAEvE,IAAA,OAAO,YAAY,CAAC,MAAM,CAAC,UAAC,KAAmB,EAAE,IAAgB,EAAA;AACrD,QAAA,IAAA,KAAK,GAAoC,IAAI,MAAxC,EAAQ,SAAS,GAAmB,IAAI,CAAA,IAAvB,EAAE,MAAM,GAAW,IAAI,CAAf,MAAA,EAAE,IAAI,GAAK,IAAI,KAAT;QAE5C,IAAI,KAAK,KAAK,MAAM,EAAE;YAClB,IAAI,OAAO,GAAG,IAAI;AAElB,YAAA,IAAI,MAAM,EAAE;AACR,gBAAA,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,UAAC,CAAY,EAAA;oBACzB,IAAA,KAAK,GAAY,CAAC,CAAA,KAAb,EAAE,KAAK,GAAK,CAAC,CAAA,KAAN;oBAEpB,OAAO;AACH,wBAAA,KAAK,EAAA,KAAA;wBACL,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;qBAC3C;AACL,iBAAC,CAAC;AACL;YAED,KAAK,CAAC,IAAI,CACHA,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAA,IAAI,KACP,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,IAAI,EAChB,WAAW,EAAE,IAAI,EACjB,UAAU,EAAAA,cAAA,CAAAA,cAAA,CAAA,EAAA,EACH,IAAI,CAAC,UAAU,KAClB,OAAO,EAAE,UAAG,IAAI,CAAC,UAAU,CAAC,OAAO,EAAA,WAAA,CAAW,EAC9C,IAAI,EAAA,IAAA,EAER,CAAA,EAAA,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,IAAI,EAAA,CAAA,CAC5B;AACL;AAED,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAEhB,QAAA,OAAO,KAAK;KACf,EAAE,EAAE,CAAC;AACV;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BrushProps } from '../../../types/brush.types';
|
|
2
|
-
import { LegendProps } from '../../../types/legend.types';
|
|
1
|
+
import { type BrushProps } from '../../../types/brush.types';
|
|
2
|
+
import { type LegendProps } from '../../../types/legend.types';
|
|
3
3
|
export declare const setLegendMargin: (brush: BrushProps, legend: LegendProps) => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setLegendMargin.js","sources":["../../../src/hooks/useSettings/utils/setLegendMargin.ts"],"sourcesContent":["import { BrushProps } from '../../../types/brush.types';\nimport { LegendProps } from '../../../types/legend.types';\n\nexport const setLegendMargin = (brush: BrushProps, legend: LegendProps): number => {\n let top = 0;\n\n if (typeof brush?.brushMargin !== 'number' || !legend?.verticalAlign) return top;\n\n if (legend.verticalAlign === 'top') {\n top = legend.marginTop ? Number(legend.marginTop * -1) : 0;\n } else {\n top = legend?.marginTop ? legend.marginTop + (brush?.brushMargin || 0) : brush?.brushMargin;\n }\n\n return top;\n};\n"],"names":[],"mappings":";;;;AAGa,IAAA,eAAe,GAAG,UAAC,KAAiB,EAAE,MAAmB,EAAA;IAClE,IAAI,GAAG,GAAG,CAAC;IAEX,IAAI,QAAO,KAAK,KAAA,IAAA,IAAL,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,WAAW,CAAA,KAAK,QAAQ,IAAI,EAAC,MAAM,KAAA,IAAA,IAAN,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,aAAa,CAAA;AAAE,QAAA,OAAO,GAAG;AAEhF,IAAA,IAAI,MAAM,CAAC,aAAa,KAAK,KAAK,EAAE;QAChC,GAAG,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC,GAAG,CAAC;AAC7D;AAAM,SAAA;AACH,QAAA,GAAG,GAAG,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,SAAS,IAAG,MAAM,CAAC,SAAS,IAAI,CAAA,KAAK,KAAL,IAAA,IAAA,KAAK,uBAAL,KAAK,CAAE,WAAW,KAAI,CAAC,CAAC,GAAG,KAAK,KAAL,IAAA,IAAA,KAAK,uBAAL,KAAK,CAAE,WAAW;AAC9F;AAED,IAAA,OAAO,GAAG;AACd;;;;"}
|
|
1
|
+
{"version":3,"file":"setLegendMargin.js","sources":["../../../src/hooks/useSettings/utils/setLegendMargin.ts"],"sourcesContent":["import { type BrushProps } from '../../../types/brush.types';\nimport { type LegendProps } from '../../../types/legend.types';\n\nexport const setLegendMargin = (brush: BrushProps, legend: LegendProps): number => {\n let top = 0;\n\n if (typeof brush?.brushMargin !== 'number' || !legend?.verticalAlign) return top;\n\n if (legend.verticalAlign === 'top') {\n top = legend.marginTop ? Number(legend.marginTop * -1) : 0;\n } else {\n top = legend?.marginTop ? legend.marginTop + (brush?.brushMargin || 0) : brush?.brushMargin;\n }\n\n return top;\n};\n"],"names":[],"mappings":";;;;AAGa,IAAA,eAAe,GAAG,UAAC,KAAiB,EAAE,MAAmB,EAAA;IAClE,IAAI,GAAG,GAAG,CAAC;IAEX,IAAI,QAAO,KAAK,KAAA,IAAA,IAAL,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,WAAW,CAAA,KAAK,QAAQ,IAAI,EAAC,MAAM,KAAA,IAAA,IAAN,MAAM,KAAN,MAAA,GAAA,MAAA,GAAA,MAAM,CAAE,aAAa,CAAA;AAAE,QAAA,OAAO,GAAG;AAEhF,IAAA,IAAI,MAAM,CAAC,aAAa,KAAK,KAAK,EAAE;QAChC,GAAG,GAAG,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC,GAAG,CAAC;AAC7D;AAAM,SAAA;AACH,QAAA,GAAG,GAAG,CAAA,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,SAAS,IAAG,MAAM,CAAC,SAAS,IAAI,CAAA,KAAK,KAAL,IAAA,IAAA,KAAK,uBAAL,KAAK,CAAE,WAAW,KAAI,CAAC,CAAC,GAAG,KAAK,KAAL,IAAA,IAAA,KAAK,uBAAL,KAAK,CAAE,WAAW;AAC9F;AAED,IAAA,OAAO,GAAG;AACd;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SeriaProps } from '../../../types/seria.types';
|
|
1
|
+
import { type SeriaProps } from '../../../types/seria.types';
|
|
2
2
|
export declare const sortByIndex: (series: SeriaProps[]) => SeriaProps[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortByIndex.js","sources":["../../../src/hooks/useSettings/utils/sortByIndex.ts"],"sourcesContent":["import { SeriaProps } from '../../../types/seria.types';\n\nexport const sortByIndex = (series: SeriaProps[]): SeriaProps[] =>\n series.sort((a: SeriaProps, b: SeriaProps) => {\n if (a?.zIndex && b?.zIndex && a?.zIndex > b?.zIndex) {\n return 1;\n }\n\n return -1;\n });\n"],"names":[],"mappings":";;;;AAEO,IAAM,WAAW,GAAG,UAAC,MAAoB,EAAA;AAC5C,IAAA,OAAA,MAAM,CAAC,IAAI,CAAC,UAAC,CAAa,EAAE,CAAa,EAAA;AACrC,QAAA,IAAI,CAAA,CAAC,KAAD,IAAA,IAAA,CAAC,uBAAD,CAAC,CAAE,MAAM,MAAI,CAAC,KAAD,IAAA,IAAA,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,CAAA,IAAI,CAAA,CAAC,KAAD,IAAA,IAAA,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,KAAG,CAAC,KAAA,IAAA,IAAD,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,CAAA,EAAE;AACjD,YAAA,OAAO,CAAC;AACX;QAED,OAAO,EAAE;AACb,KAAC,CAAC;AANF;;;;"}
|
|
1
|
+
{"version":3,"file":"sortByIndex.js","sources":["../../../src/hooks/useSettings/utils/sortByIndex.ts"],"sourcesContent":["import { type SeriaProps } from '../../../types/seria.types';\n\nexport const sortByIndex = (series: SeriaProps[]): SeriaProps[] =>\n series.sort((a: SeriaProps, b: SeriaProps) => {\n if (a?.zIndex && b?.zIndex && a?.zIndex > b?.zIndex) {\n return 1;\n }\n\n return -1;\n });\n"],"names":[],"mappings":";;;;AAEO,IAAM,WAAW,GAAG,UAAC,MAAoB,EAAA;AAC5C,IAAA,OAAA,MAAM,CAAC,IAAI,CAAC,UAAC,CAAa,EAAE,CAAa,EAAA;AACrC,QAAA,IAAI,CAAA,CAAC,KAAD,IAAA,IAAA,CAAC,uBAAD,CAAC,CAAE,MAAM,MAAI,CAAC,KAAD,IAAA,IAAA,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,CAAA,IAAI,CAAA,CAAC,KAAD,IAAA,IAAA,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,KAAG,CAAC,KAAA,IAAA,IAAD,CAAC,KAAD,MAAA,GAAA,MAAA,GAAA,CAAC,CAAE,MAAM,CAAA,EAAE;AACjD,YAAA,OAAO,CAAC;AACX;QAED,OAAO,EAAE;AACb,KAAC,CAAC;AANF;;;;"}
|