@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/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":";;;;;;;AA0Ba,MAAA,WAAW,GAAG,CAAC,OAAqB,KAAc;IAC3D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAsB,IAAI,CAAC;IAC7D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA0B,EAAE,CAAC;IACjE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAqB,EAAE,CAAC;IACxD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC;IAEzD,SAAS,CAAC,MAAK;AACX,QAAA,MAAM,QAAQ,GAAiB,EAAE,GAAG,OAAO,EAAE;AAC7C,QAAA,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,QAAQ;QAEvE,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK,IAAI,MAAM;AAC1C,YAAA,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC;AAE/D,QAAA,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC;AAC3C,QAAA,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;AAExE,QAAA,QAAQ,CAAC,YAAY,CAAC,MAAM,GAAG,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;QAC1F,QAAQ,CAAC,MAAM,GAAG,WAAW,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;YACI,KAAK;YACL,IAAI;YACJ,MAAM;YACN,WAAW;AACd,SAAA;AACD,QAAA;YACI,QAAQ;YACR,OAAO;YACP,SAAS;YACT,cAAc;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":"AAYO,MAAM,uBAAuB,GAAG,CACnC,YAAgC,EAChC,MAA+B,EAC/B,KAA6B,EAC7B,KAAiB,MACkB;IACnC,GAAG,EACC,CAAC,YAAY,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;SAClC,MAAM,EAAE,aAAa,KAAK,KAAK,IAAI,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3F,MAAM,EACF,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACtC,SAAC,KAAK,EAAE,UAAU,IAAI,CAAC,CAAC;AACxB,SAAC,KAAK,EAAE,WAAW,IAAI,CAAC,CAAC;AACzB,SAAC,MAAM,EAAE,aAAa,KAAK,KAAK,IAAI,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;AACjF,IAAA,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,IAAI,CAAC;AACzC,IAAA,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;AAC9C,CAAA;;;;"}
|
|
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":"AAYO,MAAM,uBAAuB,GAAG,CACnC,YAAgC,EAChC,MAA+B,EAC/B,KAA6B,EAC7B,KAAiB,MACkB;IACnC,GAAG,EACC,CAAC,YAAY,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;SAClC,MAAM,EAAE,aAAa,KAAK,KAAK,IAAI,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3F,MAAM,EACF,CAAC,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACtC,SAAC,KAAK,EAAE,UAAU,IAAI,CAAC,CAAC;AACxB,SAAC,KAAK,EAAE,WAAW,IAAI,CAAC,CAAC;AACzB,SAAC,MAAM,EAAE,aAAa,KAAK,KAAK,IAAI,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;AACjF,IAAA,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,IAAI,CAAC;AACzC,IAAA,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;AAC9C,CAAA;;;;"}
|
|
@@ -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 });\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E,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,EAAE;AACxD;AAED,YAAA,OAAO,IAAI;AACf,SAAC,CAAC;AACL;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":"MASa,QAAQ,GAAG,CACpB,MAAoB,EACpB,MAA8B,KACZ;IAClB,MAAM,QAAQ,GAAuB,EAAE;IACvC,MAAM,WAAW,GAA4B,EAAE;IAC/C,IAAI,KAAK,GAAG,CAAC;AAEb,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,EACF,UAAU,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,EACjC,IAAI,EAAE,SAAS,GAAG,EAAE,EACpB,UAAU,EACV,IAAI,GACP,GAAG,MAAM,CAAC,CAAC,CAAC;AAEb,QAAA,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI;YAAE,KAAK,IAAI,CAAC;AAEpC,QAAA,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAI;AACjB,YAAA,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAY,KAAK,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC;AAEhE,YAAA,IAAI,IAAI,EAAE;AACN,gBAAA,MAAM,GAAG,GAAqB;oBAC1B,KAAK;iBACR;gBAED,GAAG,CAAC,GAAG,OAAO,CAAA,CAAE,CAAC,GAAG,IAAI,CAAC,KAAK;AAE9B,gBAAA,IAAI,CAAC,WAAW,CAAC,CAAG,EAAA,OAAO,EAAE,CAAC;AAAE,oBAAA,WAAW,CAAC,CAAG,EAAA,OAAO,EAAE,CAAC,GAAG,IAAI;gBAEhE,MAAM,KAAK,GAAG;qBACT,GAAG,CAAC,CAAC,QAA0B,KAAK,QAAQ,CAAC,KAAK;qBAClD,OAAO,CAAC,KAAK,CAAC;gBAEnB,IAAI,KAAK,KAAK,EAAE;AAAE,oBAAA,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;;AAC/B,oBAAA,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,EAAE;AACxD;AAED,YAAA,OAAO,IAAI;AACf,SAAC,CAAC;AACL;AAED,IAAA,OAAO,CAAC,QAAQ,EAAE,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":[],"mappings":"AAGa,MAAA,iBAAiB,GAAG,CAAC,MAAoB,KAAkB;AACpE,IAAA,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAAK,UAAU,CAAC;IAEvE,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,KAAmB,EAAE,IAAgB,KAAI;AACjE,QAAA,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI;QAErD,IAAI,KAAK,KAAK,MAAM,EAAE;YAClB,IAAI,OAAO,GAAG,IAAI;AAElB,YAAA,IAAI,MAAM,EAAE;gBACR,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAY,KAAI;AACrC,oBAAA,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC;oBAE1B,OAAO;wBACH,KAAK;wBACL,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;qBAC3C;AACL,iBAAC,CAAC;AACL;YAED,KAAK,CAAC,IAAI,CAAC;AACP,gBAAA,GAAG,IAAI;gBACP,MAAM,EAAE,IAAI;AACZ,gBAAA,KAAK,EAAE,UAAU;AACjB,gBAAA,UAAU,EAAE,IAAI;AAChB,gBAAA,WAAW,EAAE,IAAI;AACjB,gBAAA,UAAU,EAAE;oBACR,GAAG,IAAI,CAAC,UAAU;AAClB,oBAAA,OAAO,EAAE,CAAG,EAAA,IAAI,CAAC,UAAU,CAAC,OAAO,CAAW,SAAA,CAAA;oBAC9C,IAAI;AACP,iBAAA;AACD,gBAAA,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC,IAAI;AAC7B,aAAA,CAAC;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 },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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":"MAGa,eAAe,GAAG,CAAC,KAAiB,EAAE,MAAmB,KAAY;IAC9E,IAAI,GAAG,GAAG,CAAC;IAEX,IAAI,OAAO,KAAK,EAAE,WAAW,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE,aAAa;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;QACH,GAAG,GAAG,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,KAAK,EAAE,WAAW,IAAI,CAAC,CAAC,GAAG,KAAK,EAAE,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":"MAGa,eAAe,GAAG,CAAC,KAAiB,EAAE,MAAmB,KAAY;IAC9E,IAAI,GAAG,GAAG,CAAC;IAEX,IAAI,OAAO,KAAK,EAAE,WAAW,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE,aAAa;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;QACH,GAAG,GAAG,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,KAAK,EAAE,WAAW,IAAI,CAAC,CAAC,GAAG,KAAK,EAAE,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":"AAEa,MAAA,WAAW,GAAG,CAAC,MAAoB,KAC5C,MAAM,CAAC,IAAI,CAAC,CAAC,CAAa,EAAE,CAAa,KAAI;AACzC,IAAA,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE;AACjD,QAAA,OAAO,CAAC;AACX;IAED,OAAO,EAAE;AACb,CAAC;;;;"}
|
|
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":"AAEa,MAAA,WAAW,GAAG,CAAC,MAAoB,KAC5C,MAAM,CAAC,IAAI,CAAC,CAAC,CAAa,EAAE,CAAa,KAAI;AACzC,IAAA,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE;AACjD,QAAA,OAAO,CAAC;AACX;IAED,OAAO,EAAE;AACb,CAAC;;;;"}
|
package/modern/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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"coreChart":"
|
|
3
|
+
const 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,eAAe,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.
|
package/moderncssm/Component.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any,prefer-template */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport cn from 'classnames';\nimport {\n Area,\n Bar,\n Brush,\n CartesianGrid,\n Cell,\n ComposedChart,\n LabelList,\n Legend,\n Line,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { CustomizedLabel } from './components/CustomizedLabel';\nimport { Dot } from './components/Dot';\nimport { Legends } from './components/Legends';\nimport { LinearGradient } from './components/LinearGradient';\nimport { RectBar } from './components/RectBar';\nimport { Tick } from './components/Tick';\nimport { TooltipContent } from './components/TooltipContent';\nimport { CustomizedHOC } from './hoc/Customized';\nimport { useSettings } from './hooks/useSettings';\nimport {\n ActiveDotProps,\n CoordinatesProps,\n DataDynamicBooleanProps,\n DataDynamicProps,\n OptionsProps,\n SeriaProps,\n ToggleChartProps,\n} from './types';\n\nimport styles from './index.module.css';\n\nexport const Chart = (props: OptionsProps) => {\n const [{ state, data, charts, filterCount }, { setCharts, setFilterCount }] =\n useSettings(props);\n const [activeDotsState, setActiveDotsState] = useState<ActiveDotProps>({\n prev: null,\n active: null,\n });\n\n const [yBrush, setYBrush] = useState<number | null>(null);\n const [tooltipArrowSide, setTooltipArrowSide] = useState<boolean | null>(null);\n const [heightLegend, setHeightLegend] = useState<number>(0);\n\n const svgRef = useRef<HTMLDivElement>(null);\n const tooltipRef = useRef<any>(null);\n\n const renderGradient = useMemo(() => {\n if (!state) return null;\n\n return state.series.map((item: SeriaProps) => {\n const { chart, gradient } = item;\n\n if (chart !== 'gradient' || !gradient) return null;\n const { gid, points } = gradient;\n\n return (\n <LinearGradient\n key={`${state.id}-${gid}`}\n id={state.id}\n gid={gid}\n points={points}\n />\n );\n });\n }, [state]);\n\n const toggleChart = useCallback(\n (item: ToggleChartProps): void => {\n const {\n chart,\n properties: { dataKey },\n } = item;\n\n const withGrad = chart === 'area';\n let changed = false;\n\n if (charts[dataKey + ''] && filterCount > 1) {\n changed = true;\n setFilterCount((prev) => prev - 1);\n }\n\n if (!charts[dataKey + '']) {\n changed = true;\n setFilterCount((prev) => prev + 1);\n }\n\n if (!changed) return;\n setCharts((prev: DataDynamicBooleanProps) => {\n const newState = { ...prev };\n\n newState[dataKey + ''] = !newState[dataKey + ''];\n if (withGrad) newState[dataKey + '-gradient'] = !newState[dataKey + '-gradient'];\n\n return newState;\n });\n },\n [charts, filterCount, setCharts, setFilterCount],\n );\n\n const legendRef = useCallback((node: HTMLUListElement): void => {\n if (node !== null) {\n setTimeout(() => {\n const { height } = node.getBoundingClientRect();\n\n setHeightLegend(height);\n }, 0);\n }\n }, []);\n\n const renderLegend = useMemo((): React.ReactElement | null => {\n if (!state?.legend) return null;\n\n const translate =\n state?.xAxis?.tickMargin && state?.legend?.verticalAlign !== 'top'\n ? state.xAxis.tickMargin + (state?.brush?.brushMargin || 0)\n : 0;\n\n return (\n <Legend\n {...(state.legend || null)}\n content={\n <Legends\n legend={state.legend}\n series={state.series}\n id={state.id}\n toggleChart={toggleChart}\n ref={legendRef}\n charts={charts}\n />\n }\n wrapperStyle={{\n transform: `translateY(${translate}px)`,\n }}\n />\n );\n }, [state, charts, toggleChart, legendRef]);\n\n const renderCartesianGrid = useMemo((): React.ReactElement | null => {\n if (!state?.cartesianGrid) return null;\n\n return <CartesianGrid {...state.cartesianGrid} />;\n }, [state]);\n\n const renderXAxis = useMemo((): React.ReactElement | null => {\n if (!state?.xAxis) return null;\n\n let tick;\n\n if (state?.xAxis?.tickType === 'point') {\n tick = CustomizedHOC(Tick, { xAxis: state.xAxis });\n } else if (typeof state.xAxis.tick === 'boolean') {\n tick = state.xAxis.tick;\n } else {\n tick = true;\n }\n\n return <XAxis {...state.xAxis} tick={tick} />;\n }, [state]);\n\n const renderYAxis = useMemo((): React.ReactElement | null => {\n if (!state?.yAxis) return null;\n\n let tick;\n\n if (state?.yAxis?.tick) {\n tick = CustomizedHOC(state.yAxis.tick, { state });\n } else if (typeof state.yAxis.tick === 'boolean') {\n tick = state.yAxis.tick;\n } else {\n tick = true;\n }\n\n return <YAxis {...state.yAxis} tick={tick} />;\n }, [state]);\n\n const renderBrush = useMemo((): React.ReactElement | null => {\n if (!state?.brush) return null;\n\n return <Brush y={typeof yBrush === 'number' ? yBrush : 0} {...state.brush} />;\n }, [state, yBrush]);\n\n const renderTooltip = useMemo((): React.ReactElement | null => {\n if (!state?.tooltip) return null;\n\n return (\n <Tooltip\n ref={tooltipRef}\n {...state.tooltip}\n content={CustomizedHOC(TooltipContent, { series: state.series, tooltipArrowSide })}\n />\n );\n }, [state, tooltipArrowSide]);\n\n const renderChartsItems = useMemo(() => {\n if (!state || !charts) return null;\n\n return state.series.map((item: SeriaProps) => {\n const { chart, properties, radius, labelList } = item;\n const show = charts[`${properties.dataKey}`];\n\n switch (chart) {\n case 'bar':\n return show && !item?.hide ? (\n <Bar\n key={`${state.id}-${properties.dataKey}`}\n {...properties}\n shape={<RectBar radius={radius} />}\n >\n {labelList && (\n <LabelList\n dataKey={properties.dataKey.toString()}\n {...labelList}\n content={<CustomizedLabel radius={radius} />}\n />\n )}\n {data.map((_: DataDynamicProps, index: number) => {\n const key = `${state.id}-${properties.dataKey}-${index}`;\n\n return (\n <Cell\n key={key}\n className={cn(\n styles.bar,\n typeof activeDotsState.active === 'number' &&\n activeDotsState.active !== index\n ? styles.unfocused\n : '',\n )}\n />\n );\n })}\n </Bar>\n ) : null;\n\n case 'area':\n case 'line':\n return show && !item?.hide ? (\n <Line\n key={`${state.id}-${properties.dataKey}`}\n {...properties}\n dot={\n properties.dot && properties.dotSettings\n ? CustomizedHOC(Dot, {\n activeDot: activeDotsState.active,\n dotSettings: properties.dotSettings,\n inherit: properties?.inheritStroke\n ? properties.inheritStroke\n : false,\n })\n : false\n }\n activeDot={false}\n />\n ) : null;\n\n case 'gradient':\n return show && !item?.hide ? (\n <Area\n {...item.properties}\n key={`${state.id}-${item.properties.dataKey}`}\n dataKey={`${item.properties.dataKey}`}\n stroke='transparent'\n fill={\n item.gradient.gid\n ? `url(#${state.id}-${item.gradient.gid})`\n : item.properties.fill\n }\n dot={false}\n activeDot={false}\n />\n ) : null;\n\n default:\n return null;\n }\n });\n }, [charts, state, activeDotsState, data]);\n\n // Позиционирование brush\n useEffect(() => {\n if (!state || !state.brush) return;\n if (!heightLegend || heightLegend === 0) return;\n\n const align = state?.legend?.verticalAlign;\n const legendHeight = align === 'top' ? 0 : heightLegend;\n const marginTick = state?.xAxis?.tickMargin ? state?.xAxis?.tickMargin : 0;\n const brushY =\n (svgRef.current?.clientHeight ? svgRef.current.clientHeight : 0) -\n legendHeight -\n state.brush.height -\n (state?.composeChart?.margin?.bottom ? state.composeChart.margin.bottom : 0) +\n marginTick +\n (state.brush?.brushMargin ? state.brush.brushMargin : 0);\n\n setYBrush(brushY);\n }, [heightLegend, state]);\n\n const leaveEvent = (isTooltipActive: boolean): void => {\n if (isTooltipActive) return;\n\n if (typeof activeDotsState.prev !== 'number' || typeof activeDotsState.active !== 'number')\n return;\n\n setActiveDotsState({\n prev: null,\n active: null,\n });\n };\n\n const arrowTooltipEvent = (activeCoordinate: CoordinatesProps): void => {\n if (!state?.tooltip?.arrow) return;\n\n if (state?.tooltip?.arrow && activeCoordinate?.x) {\n const side =\n (svgRef?.current?.clientWidth || 0) -\n (state?.composeChart?.margin?.right || 0) -\n activeCoordinate.x -\n (tooltipRef.current?.state?.boxWidth || 0) >\n 20;\n\n setTooltipArrowSide(side);\n }\n };\n\n const hoverEvent = (isTooltipActive: boolean, activeTooltipIndex: number | undefined): void => {\n if (!isTooltipActive) return;\n\n if (\n typeof activeDotsState.active === 'number' &&\n activeTooltipIndex === activeDotsState.active\n )\n return;\n if (typeof activeTooltipIndex === 'number' && typeof activeDotsState.active !== 'number') {\n setActiveDotsState({\n prev: activeTooltipIndex,\n active: activeTooltipIndex,\n });\n }\n\n if (typeof activeTooltipIndex === 'number' && typeof activeDotsState.prev === 'number') {\n setActiveDotsState((prev: ActiveDotProps) => ({\n prev: prev.active,\n active: activeTooltipIndex,\n }));\n }\n };\n\n const mouseMove = (e: any): void => {\n if (!state?.tooltip) return;\n\n arrowTooltipEvent(e.activeCoordinate);\n hoverEvent(e.isTooltipActive, e.activeTooltipIndex);\n leaveEvent(e.isTooltipActive);\n };\n\n const mouseLeave = (e: any): void => {\n if (!state?.tooltip) return;\n\n leaveEvent(e.isTooltipActive);\n };\n\n if (!data || !charts || !state) return null;\n\n return (\n <div\n className={styles.coreChart}\n ref={svgRef}\n id={state?.id || ''}\n style={{ width: '100%', height: '100%' }}\n >\n <ResponsiveContainer\n debounce={\n state?.responsiveContainer?.debounce ? state.responsiveContainer.debounce : 0\n }\n width='100%'\n >\n <ComposedChart\n {...state?.composeChart}\n onMouseMove={mouseMove}\n onMouseLeave={mouseLeave}\n data={data}\n >\n <defs>{renderGradient}</defs>\n {state.cartesianGrid && renderCartesianGrid}\n {state.xAxis && renderXAxis}\n {state.yAxis && renderYAxis}\n {renderChartsItems}\n {state.tooltip && renderTooltip}\n {state.brush && renderBrush}\n {state.legend && renderLegend}\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n );\n};\n\nChart.displayName = 'Chart';\nResponsiveContainer.displayName = 'ResponsiveContainer';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AAwCa,MAAA,KAAK,GAAG,CAAC,KAAmB,KAAI;IACzC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,GACvE,WAAW,CAAC,KAAK,CAAC;AACtB,IAAA,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAiB;AACnE,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,MAAM,EAAE,IAAI;AACf,KAAA,CAAC;IAEF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC;IACzD,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAiB,IAAI,CAAC;IAC9E,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC;AAE3D,IAAA,MAAM,MAAM,GAAG,MAAM,CAAiB,IAAI,CAAC;AAC3C,IAAA,MAAM,UAAU,GAAG,MAAM,CAAM,IAAI,CAAC;AAEpC,IAAA,MAAM,cAAc,GAAG,OA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,CAAC,KAAK,IAAI,WAAW;gBAC1B,iBAAiB;gBACjB,KAAK,CAAC,OAAO,IAAI,aAAa;gBAC9B,KAAK,CAAC,KAAK,IAAI,WAAW;gBAC1B,KAAK,CAAC,MAAM,IAAI,YAAY,CACjB,CACE,CACpB;AAEd;AAEA,KAAK,CAAC,WAAW,GAAG,OAAO;AAC3B,mBAAmB,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any,prefer-template */\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport cn from 'classnames';\nimport {\n Area,\n Bar,\n Brush,\n CartesianGrid,\n Cell,\n ComposedChart,\n LabelList,\n Legend,\n Line,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { CustomizedLabel } from './components/CustomizedLabel';\nimport { Dot } from './components/Dot';\nimport { Legends } from './components/Legends';\nimport { LinearGradient } from './components/LinearGradient';\nimport { RectBar } from './components/RectBar';\nimport { Tick } from './components/Tick';\nimport { TooltipContent } from './components/TooltipContent';\nimport { CustomizedHOC } from './hoc/Customized';\nimport { useSettings } from './hooks/useSettings';\nimport {\n type ActiveDotProps,\n type CoordinatesProps,\n type DataDynamicBooleanProps,\n type DataDynamicProps,\n type OptionsProps,\n type SeriaProps,\n type ToggleChartProps,\n} from './types';\n\nimport styles from './index.module.css';\n\nexport const Chart = (props: OptionsProps) => {\n const [{ state, data, charts, filterCount }, { setCharts, setFilterCount }] =\n useSettings(props);\n const [activeDotsState, setActiveDotsState] = useState<ActiveDotProps>({\n prev: null,\n active: null,\n });\n\n const [yBrush, setYBrush] = useState<number | null>(null);\n const [tooltipArrowSide, setTooltipArrowSide] = useState<boolean | null>(null);\n const [heightLegend, setHeightLegend] = useState<number>(0);\n\n const svgRef = useRef<HTMLDivElement>(null);\n const tooltipRef = useRef<any>(null);\n\n const renderGradient = useMemo(() => {\n if (!state) return null;\n\n return state.series.map((item: SeriaProps) => {\n const { chart, gradient } = item;\n\n if (chart !== 'gradient' || !gradient) return null;\n const { gid, points } = gradient;\n\n return (\n <LinearGradient\n key={`${state.id}-${gid}`}\n id={state.id}\n gid={gid}\n points={points}\n />\n );\n });\n }, [state]);\n\n const toggleChart = useCallback(\n (item: ToggleChartProps): void => {\n const {\n chart,\n properties: { dataKey },\n } = item;\n\n const withGrad = chart === 'area';\n let changed = false;\n\n if (charts[dataKey + ''] && filterCount > 1) {\n changed = true;\n setFilterCount((prev) => prev - 1);\n }\n\n if (!charts[dataKey + '']) {\n changed = true;\n setFilterCount((prev) => prev + 1);\n }\n\n if (!changed) return;\n setCharts((prev: DataDynamicBooleanProps) => {\n const newState = { ...prev };\n\n newState[dataKey + ''] = !newState[dataKey + ''];\n if (withGrad) newState[dataKey + '-gradient'] = !newState[dataKey + '-gradient'];\n\n return newState;\n });\n },\n [charts, filterCount, setCharts, setFilterCount],\n );\n\n const legendRef = useCallback((node: HTMLUListElement): void => {\n if (node !== null) {\n setTimeout(() => {\n const { height } = node.getBoundingClientRect();\n\n setHeightLegend(height);\n }, 0);\n }\n }, []);\n\n const renderLegend = useMemo((): React.ReactElement | null => {\n if (!state?.legend) return null;\n\n const translate =\n state?.xAxis?.tickMargin && state?.legend?.verticalAlign !== 'top'\n ? state.xAxis.tickMargin + (state?.brush?.brushMargin || 0)\n : 0;\n\n return (\n <Legend\n {...(state.legend || null)}\n content={\n <Legends\n legend={state.legend}\n series={state.series}\n id={state.id}\n toggleChart={toggleChart}\n ref={legendRef}\n charts={charts}\n />\n }\n wrapperStyle={{\n transform: `translateY(${translate}px)`,\n }}\n />\n );\n }, [state, charts, toggleChart, legendRef]);\n\n const renderCartesianGrid = useMemo((): React.ReactElement | null => {\n if (!state?.cartesianGrid) return null;\n\n return <CartesianGrid {...state.cartesianGrid} />;\n }, [state]);\n\n const renderXAxis = useMemo((): React.ReactElement | null => {\n if (!state?.xAxis) return null;\n\n let tick;\n\n if (state?.xAxis?.tickType === 'point') {\n tick = CustomizedHOC(Tick, { xAxis: state.xAxis });\n } else if (typeof state.xAxis.tick === 'boolean') {\n tick = state.xAxis.tick;\n } else {\n tick = true;\n }\n\n return <XAxis {...state.xAxis} tick={tick} />;\n }, [state]);\n\n const renderYAxis = useMemo((): React.ReactElement | null => {\n if (!state?.yAxis) return null;\n\n let tick;\n\n if (state?.yAxis?.tick) {\n tick = CustomizedHOC(state.yAxis.tick, { state });\n } else if (typeof state.yAxis.tick === 'boolean') {\n tick = state.yAxis.tick;\n } else {\n tick = true;\n }\n\n return <YAxis {...state.yAxis} tick={tick} />;\n }, [state]);\n\n const renderBrush = useMemo((): React.ReactElement | null => {\n if (!state?.brush) return null;\n\n return <Brush y={typeof yBrush === 'number' ? yBrush : 0} {...state.brush} />;\n }, [state, yBrush]);\n\n const renderTooltip = useMemo((): React.ReactElement | null => {\n if (!state?.tooltip) return null;\n\n return (\n <Tooltip\n ref={tooltipRef}\n {...state.tooltip}\n content={CustomizedHOC(TooltipContent, { series: state.series, tooltipArrowSide })}\n />\n );\n }, [state, tooltipArrowSide]);\n\n const renderChartsItems = useMemo(() => {\n if (!state || !charts) return null;\n\n return state.series.map((item: SeriaProps) => {\n const { chart, properties, radius, labelList } = item;\n const show = charts[`${properties.dataKey}`];\n\n switch (chart) {\n case 'bar':\n return show && !item?.hide ? (\n <Bar\n key={`${state.id}-${properties.dataKey}`}\n {...properties}\n shape={<RectBar radius={radius} />}\n >\n {labelList && (\n <LabelList\n dataKey={properties.dataKey.toString()}\n {...labelList}\n content={<CustomizedLabel radius={radius} />}\n />\n )}\n {data.map((_: DataDynamicProps, index: number) => {\n const key = `${state.id}-${properties.dataKey}-${index}`;\n\n return (\n <Cell\n key={key}\n className={cn(\n styles.bar,\n typeof activeDotsState.active === 'number' &&\n activeDotsState.active !== index\n ? styles.unfocused\n : '',\n )}\n />\n );\n })}\n </Bar>\n ) : null;\n\n case 'area':\n case 'line':\n return show && !item?.hide ? (\n <Line\n key={`${state.id}-${properties.dataKey}`}\n {...properties}\n dot={\n properties.dot && properties.dotSettings\n ? CustomizedHOC(Dot, {\n activeDot: activeDotsState.active,\n dotSettings: properties.dotSettings,\n inherit: properties?.inheritStroke\n ? properties.inheritStroke\n : false,\n })\n : false\n }\n activeDot={false}\n />\n ) : null;\n\n case 'gradient':\n return show && !item?.hide ? (\n <Area\n {...item.properties}\n key={`${state.id}-${item.properties.dataKey}`}\n dataKey={`${item.properties.dataKey}`}\n stroke='transparent'\n fill={\n item.gradient.gid\n ? `url(#${state.id}-${item.gradient.gid})`\n : item.properties.fill\n }\n dot={false}\n activeDot={false}\n />\n ) : null;\n\n default:\n return null;\n }\n });\n }, [charts, state, activeDotsState, data]);\n\n // Позиционирование brush\n useEffect(() => {\n if (!state?.brush) return;\n if (!heightLegend || heightLegend === 0) return;\n\n const align = state?.legend?.verticalAlign;\n const legendHeight = align === 'top' ? 0 : heightLegend;\n const marginTick = state?.xAxis?.tickMargin ? state?.xAxis?.tickMargin : 0;\n const brushY =\n (svgRef.current?.clientHeight ? svgRef.current.clientHeight : 0) -\n legendHeight -\n state.brush.height -\n (state?.composeChart?.margin?.bottom ? state.composeChart.margin.bottom : 0) +\n marginTick +\n (state.brush?.brushMargin ? state.brush.brushMargin : 0);\n\n setYBrush(brushY);\n }, [heightLegend, state]);\n\n const leaveEvent = (isTooltipActive: boolean): void => {\n if (isTooltipActive) return;\n\n if (typeof activeDotsState.prev !== 'number' || typeof activeDotsState.active !== 'number')\n return;\n\n setActiveDotsState({\n prev: null,\n active: null,\n });\n };\n\n const arrowTooltipEvent = (activeCoordinate: CoordinatesProps): void => {\n if (!state?.tooltip?.arrow) return;\n\n if (state?.tooltip?.arrow && activeCoordinate?.x) {\n const side =\n (svgRef?.current?.clientWidth || 0) -\n (state?.composeChart?.margin?.right || 0) -\n activeCoordinate.x -\n (tooltipRef.current?.state?.boxWidth || 0) >\n 20;\n\n setTooltipArrowSide(side);\n }\n };\n\n const hoverEvent = (isTooltipActive: boolean, activeTooltipIndex: number | undefined): void => {\n if (!isTooltipActive) return;\n\n if (\n typeof activeDotsState.active === 'number' &&\n activeTooltipIndex === activeDotsState.active\n )\n return;\n if (typeof activeTooltipIndex === 'number' && typeof activeDotsState.active !== 'number') {\n setActiveDotsState({\n prev: activeTooltipIndex,\n active: activeTooltipIndex,\n });\n }\n\n if (typeof activeTooltipIndex === 'number' && typeof activeDotsState.prev === 'number') {\n setActiveDotsState((prev: ActiveDotProps) => ({\n prev: prev.active,\n active: activeTooltipIndex,\n }));\n }\n };\n\n const mouseMove = (e: any): void => {\n if (!state?.tooltip) return;\n\n arrowTooltipEvent(e.activeCoordinate);\n hoverEvent(e.isTooltipActive, e.activeTooltipIndex);\n leaveEvent(e.isTooltipActive);\n };\n\n const mouseLeave = (e: any): void => {\n if (!state?.tooltip) return;\n\n leaveEvent(e.isTooltipActive);\n };\n\n if (!data || !charts || !state) return null;\n\n return (\n <div\n className={styles.coreChart}\n ref={svgRef}\n id={state?.id || ''}\n style={{ width: '100%', height: '100%' }}\n >\n <ResponsiveContainer\n debounce={\n state?.responsiveContainer?.debounce ? state.responsiveContainer.debounce : 0\n }\n width='100%'\n >\n <ComposedChart\n {...state?.composeChart}\n onMouseMove={mouseMove}\n onMouseLeave={mouseLeave}\n data={data}\n >\n <defs>{renderGradient}</defs>\n {state.cartesianGrid && renderCartesianGrid}\n {state.xAxis && renderXAxis}\n {state.yAxis && renderYAxis}\n {renderChartsItems}\n {state.tooltip && renderTooltip}\n {state.brush && renderBrush}\n {state.legend && renderLegend}\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n );\n};\n\nChart.displayName = 'Chart';\nResponsiveContainer.displayName = 'ResponsiveContainer';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AAwCa,MAAA,KAAK,GAAG,CAAC,KAAmB,KAAI;IACzC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,EAA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EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAA;QAExC,KAAC,CAAA,aAAA,CAAA,mBAAmB,EAChB,EAAA,QAAQ,EACJ,KAAK,EAAE,mBAAmB,EAAE,QAAQ,GAAG,KAAK,CAAC,mBAAmB,CAAC,QAAQ,GAAG,CAAC,EAEjF,KAAK,EAAC,MAAM,EAAA;AAEZ,YAAA,KAAA,CAAA,aAAA,CAAC,aAAa,EACN,EAAA,GAAA,KAAK,EAAE,YAAY,EACvB,WAAW,EAAE,SAAS,EACtB,YAAY,EAAE,UAAU,EACxB,IAAI,EAAE,IAAI,EAAA;AAEV,gBAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAAO,cAAc,CAAQ;gBAC5B,KAAK,CAAC,aAAa,IAAI,mBAAmB;gBAC1C,KAAK,CAAC,KAAK,IAAI,WAAW;gBAC1B,KAAK,CAAC,KAAK,IAAI,WAAW;gBAC1B,iBAAiB;gBACjB,KAAK,CAAC,OAAO,IAAI,aAAa;gBAC9B,KAAK,CAAC,KAAK,IAAI,WAAW;gBAC1B,KAAK,CAAC,MAAM,IAAI,YAAY,CACjB,CACE,CACpB;AAEd;AAEA,KAAK,CAAC,WAAW,GAAG,OAAO;AAC3B,mBAAmB,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Dot/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport cn from 'classnames';\n\nimport { PointIcon } from '../../icons/Point';\nimport { DotProps, DotSettingProps } from '../../types/utils/dot.types';\n\nimport styles from './index.module.css';\n\nexport const Dot = React.forwardRef<SVGSVGElement, DotProps>(\n (\n { cx, cy, index, activeDot, dataKey, dotSettings, value, stroke },\n ref,\n ): React.ReactElement | null => {\n const [windowWidth, setWindowWidth] = useState<number>(0);\n\n const [height, setHeight] = useState<number>(0);\n const [width, setWidth] = useState<number>(0);\n const [option, setOption] = useState<DotSettingProps | null>(null);\n\n useEffect(() => {\n let dotSetting: DotSettingProps =\n Array.isArray(dotSettings) && dotSettings.length > 0\n ? dotSettings.find((item) => item.media && windowWidth < item.media)\n : dotSettings;\n\n if (Array.isArray(dotSettings) && dotSettings.length > 0 && !dotSetting) {\n dotSetting = dotSettings[dotSettings.length - 1];\n }\n\n setWindowWidth(window.innerWidth);\n setOption(dotSetting);\n }, [dotSettings, windowWidth]);\n\n useEffect(() => {\n if (!option) return;\n\n if (typeof activeDot === 'number' && activeDot === index) {\n setHeight(option.height * option.scale);\n setWidth(option.width * option.scale);\n } else {\n setHeight(option.height * option.initScale);\n setWidth(option.width * option.initScale);\n }\n }, [activeDot, index, option]);\n\n if (!value) return null;\n\n return (\n <g\n ref={ref}\n className={cn(styles.dot)}\n transform={`translate(${cx - width / 2}, ${cy - height / 2})`}\n >\n <g\n className={cn(styles.dotWrap)}\n transform={`scale(${\n activeDot === index ? option?.scale || 0 : option?.initScale || 0\n })`}\n >\n <svg\n className={cn(\n styles.dotItem,\n activeDot === index ? styles.dotActive : '',\n typeof activeDot === 'number' && activeDot !== index\n ? styles.dotUnfocused\n : '',\n )}\n data-id={index}\n data-name={dataKey}\n width={option?.width || 0}\n height={option?.height || 0}\n >\n <PointIcon fill={stroke} />\n </svg>\n </g>\n </g>\n );\n },\n);\n"],"names":[],"mappings":";;;;;AAQO,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAC/B,CACI,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,EACjE,GAAG,KACwB;IAC3B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC;IAEzD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC;IAC/C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,Q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A,GAAA,EAAA,EACI,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EACzB,SAAS,EAAE,CAAA,UAAA,EAAa,EAAE,GAAG,KAAK,GAAG,CAAC,CAAA,EAAA,EAAK,EAAE,GAAG,MAAM,GAAG,CAAC,CAAG,CAAA,CAAA,EAAA;AAE7D,QAAA,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAC7B,SAAS,EAAE,CAAA,MAAA,EACP,SAAS,KAAK,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,SAAS,IAAI,CACpE,CAAG,CAAA,CAAA,EAAA;AAEH,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,OAAO,EACd,SAAS,KAAK,KAAK,GAAG,MAAM,CAAC,SAAS,GAAG,EAAE,EAC3C,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK;sBACzC,MAAM,CAAC;sBACP,EAAE,CACX,EAAA,SAAA,EACQ,KAAK,EACH,WAAA,EAAA,OAAO,EAClB,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,EACzB,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,EAAA;gBAE3B,KAAC,CAAA,aAAA,CAAA,SAAS,EAAC,EAAA,IAAI,EAAE,MAAM,GAAI,CACzB,CACN,CACJ;AAEZ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Dot/index.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport cn from 'classnames';\n\nimport { PointIcon } from '../../icons/Point';\nimport { type DotProps, type DotSettingProps } from '../../types/utils/dot.types';\n\nimport styles from './index.module.css';\n\nexport const Dot = React.forwardRef<SVGSVGElement, DotProps>(\n (\n { cx, cy, index, activeDot, dataKey, dotSettings, value, stroke },\n ref,\n ): React.ReactElement | null => {\n const [windowWidth, setWindowWidth] = useState<number>(0);\n\n const [height, setHeight] = useState<number>(0);\n const [width, setWidth] = useState<number>(0);\n const [option, setOption] = useState<DotSettingProps | null>(null);\n\n useEffect(() => {\n let dotSetting: DotSettingProps =\n Array.isArray(dotSettings) && dotSettings.length > 0\n ? dotSettings.find((item) => item.media && windowWidth < item.media)\n : dotSettings;\n\n if (Array.isArray(dotSettings) && dotSettings.length > 0 && !dotSetting) {\n dotSetting = dotSettings[dotSettings.length - 1];\n }\n\n setWindowWidth(window.innerWidth);\n setOption(dotSetting);\n }, [dotSettings, windowWidth]);\n\n useEffect(() => {\n if (!option) return;\n\n if (typeof activeDot === 'number' && activeDot === index) {\n setHeight(option.height * option.scale);\n setWidth(option.width * option.scale);\n } else {\n setHeight(option.height * option.initScale);\n setWidth(option.width * option.initScale);\n }\n }, [activeDot, index, option]);\n\n if (!value) return null;\n\n return (\n <g\n ref={ref}\n className={cn(styles.dot)}\n transform={`translate(${cx - width / 2}, ${cy - height / 2})`}\n >\n <g\n className={cn(styles.dotWrap)}\n transform={`scale(${\n activeDot === index ? option?.scale || 0 : option?.initScale || 0\n })`}\n >\n <svg\n className={cn(\n styles.dotItem,\n activeDot === index ? styles.dotActive : '',\n typeof activeDot === 'number' && activeDot !== index\n ? styles.dotUnfocused\n : '',\n )}\n data-id={index}\n data-name={dataKey}\n width={option?.width || 0}\n height={option?.height || 0}\n >\n <PointIcon fill={stroke} />\n </svg>\n </g>\n </g>\n );\n },\n);\n"],"names":[],"mappings":";;;;;AAQO,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAC/B,CACI,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,EACjE,GAAG,KACwB;IAC3B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,CAAC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.types';
|
|
4
|
-
import { DataDynamicBooleanProps } from '../../types/utils/data.types';
|
|
2
|
+
import { type LegendProps } from '../../types/legend.types';
|
|
3
|
+
import { type SeriaProps } from '../../types/seria.types';
|
|
4
|
+
import { type DataDynamicBooleanProps } from '../../types/utils/data.types';
|
|
5
5
|
interface Props {
|
|
6
6
|
legend: LegendProps;
|
|
7
7
|
series: SeriaProps[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Legends/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { CircleIcon } from '../../icons/Circle';\nimport { CircleLineIcon } from '../../icons/CircleLine';\nimport { FilledCircleIcon } from '../../icons/FilledCircle';\nimport { StrokeCircleIcon } from '../../icons/StrokeCircle';\nimport { LegendProps } from '../../types/legend.types';\nimport { SeriaProps } from '../../types/seria.types';\nimport { DataDynamicBooleanProps } from '../../types/utils/data.types';\n\nimport styles from './index.module.css';\n\ninterface Props {\n legend: LegendProps;\n series: SeriaProps[];\n id: string;\n charts: DataDynamicBooleanProps;\n toggleChart(item: SeriaProps): void;\n}\n\nconst icons = {\n circleLine: CircleLineIcon,\n filledCircle: FilledCircleIcon,\n strokeCircle: StrokeCircleIcon,\n circle: CircleIcon,\n};\n\nexport const Legends = React.forwardRef<HTMLUListElement, Props>(\n ({ legend, series, id, charts, toggleChart }, ref): React.ReactElement => {\n const style: React.CSSProperties = {\n textAlign: legend.align || 'center',\n transform: `translateY(${\n (legend?.marginTop ? legend.marginTop : 0) *\n (legend.verticalAlign === 'top' ? -1 : 1)\n }px)`,\n };\n\n return (\n <ul ref={ref} className={cn(styles.legendWrap)} style={style}>\n {series.map((item: SeriaProps) => {\n if (item.hideLegend || item.hide) return null;\n\n const Icon = icons[item.icon] || CircleIcon;\n\n return (\n <li\n role='presentation'\n key={`${id}-${item.properties.dataKey}`}\n className={cn(\n styles.legendItem,\n charts[`${item.properties.dataKey}`] ? '' : styles.legendUnactive,\n )}\n onClick={() => toggleChart(item)}\n >\n <div className={cn(styles.legendContent)}>\n {Icon ? (\n <i className={cn(styles.legendIcon)}>\n <Icon\n fill={\n item.properties?.fill ||\n item.properties?.stroke ||\n ''\n }\n height={legend.iconHeight || 16}\n />\n </i>\n ) : null}\n <Text\n view='primary-medium'\n tag='span'\n className={cn(styles.legendValue)}\n >\n {item.properties.name}\n </Text>\n </div>\n </li>\n );\n })}\n </ul>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AAuBA,MAAM,KAAK,GAAG;AACV,IAAA,UAAU,EAAE,cAAc;AAC1B,IAAA,YAAY,EAAE,gBAAgB;AAC9B,IAAA,YAAY,EAAE,gBAAgB;AAC9B,IAAA,MAAM,EAAE,UAAU;CACrB;MAEY,OAAO,GAAG,KAAK,CAAC,UAAU,CACnC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,GAAG,KAAwB;AACrE,IAAA,MAAM,KAAK,GAAwB;AAC/B,QAAA,SAAS,EAAE,MAAM,CAAC,KAAK,IAAI,QAAQ;AACnC,QAAA,SAAS,EAAE,CACP,WAAA,EAAA,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC;AACzC,aAAC,MAAM,CAAC,aAAa,KAAK,KAAK,GAAG,EAAE,GAAG,CAAC,CAC5C,CAAK,GAAA,CAAA;KACR;IAED,QACI,KAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EACvD,EAAA,MAAM,CAAC,GAAG,CAAC,CAAC,IAAgB,KAAI;AAC7B,QAAA,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI;AAAE,YAAA,OAAO,IAAI;QAE7C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,UAAU;QAE3C,QACI,KACI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,IAAI,EAAC,cAAc,EACnB,GAAG,EAAE,CAAA,EAAG,EAAE,CAAA,CAAA,EAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,CAAA,EACvC,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAA,CAAE,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,cAAc,CACpE,EACD,OAAO,EAAE,MAAM,WAAW,CAAC,IAAI,CAAC,EAAA;AAEhC,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAA;AACnC,gBAAA,IAAI,IACD,KAAG,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAA;oBAC/B,KAAC,CAAA,aAAA,CAAA,IAAI,IACD,IAAI,EACA,IAAI,CAAC,UAAU,EAAE,IAAI;4BACrB,IAAI,CAAC,UAAU,EAAE,MAAM;AACvB,4BAAA,EAAE,EAEN,MAAM,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE,EAAA,CACjC,CACF,IACJ,IAAI;AACR,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EACD,IAAI,EAAC,gBAAgB,EACrB,GAAG,EAAC,MAAM,EACV,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAEhC,EAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,CACL,CACL;KAEZ,CAAC,CACD;AAEb,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Legends/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { CircleIcon } from '../../icons/Circle';\nimport { CircleLineIcon } from '../../icons/CircleLine';\nimport { FilledCircleIcon } from '../../icons/FilledCircle';\nimport { StrokeCircleIcon } from '../../icons/StrokeCircle';\nimport { type LegendProps } from '../../types/legend.types';\nimport { type SeriaProps } from '../../types/seria.types';\nimport { type DataDynamicBooleanProps } from '../../types/utils/data.types';\n\nimport styles from './index.module.css';\n\ninterface Props {\n legend: LegendProps;\n series: SeriaProps[];\n id: string;\n charts: DataDynamicBooleanProps;\n toggleChart(item: SeriaProps): void;\n}\n\nconst icons = {\n circleLine: CircleLineIcon,\n filledCircle: FilledCircleIcon,\n strokeCircle: StrokeCircleIcon,\n circle: CircleIcon,\n};\n\nexport const Legends = React.forwardRef<HTMLUListElement, Props>(\n ({ legend, series, id, charts, toggleChart }, ref): React.ReactElement => {\n const style: React.CSSProperties = {\n textAlign: legend.align || 'center',\n transform: `translateY(${\n (legend?.marginTop ? legend.marginTop : 0) *\n (legend.verticalAlign === 'top' ? -1 : 1)\n }px)`,\n };\n\n return (\n <ul ref={ref} className={cn(styles.legendWrap)} style={style}>\n {series.map((item: SeriaProps) => {\n if (item.hideLegend || item.hide) return null;\n\n const Icon = icons[item.icon] || CircleIcon;\n\n return (\n <li\n role='presentation'\n key={`${id}-${item.properties.dataKey}`}\n className={cn(\n styles.legendItem,\n charts[`${item.properties.dataKey}`] ? '' : styles.legendUnactive,\n )}\n onClick={() => toggleChart(item)}\n >\n <div className={cn(styles.legendContent)}>\n {Icon ? (\n <i className={cn(styles.legendIcon)}>\n <Icon\n fill={\n item.properties?.fill ||\n item.properties?.stroke ||\n ''\n }\n height={legend.iconHeight || 16}\n />\n </i>\n ) : null}\n <Text\n view='primary-medium'\n tag='span'\n className={cn(styles.legendValue)}\n >\n {item.properties.name}\n </Text>\n </div>\n </li>\n );\n })}\n </ul>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AAuBA,MAAM,KAAK,GAAG;AACV,IAAA,UAAU,EA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O,EAAE,MAAM,WAAW,CAAC,IAAI,CAAC,EAAA;AAEhC,YAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAA;AACnC,gBAAA,IAAI,IACD,KAAG,CAAA,aAAA,CAAA,GAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAA;oBAC/B,KAAC,CAAA,aAAA,CAAA,IAAI,IACD,IAAI,EACA,IAAI,CAAC,UAAU,EAAE,IAAI;4BACrB,IAAI,CAAC,UAAU,EAAE,MAAM;AACvB,4BAAA,EAAE,EAEN,MAAM,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE,EAAA,CACjC,CACF,IACJ,IAAI;AACR,gBAAA,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EACD,IAAI,EAAC,gBAAgB,EACrB,GAAG,EAAC,MAAM,EACV,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAEhC,EAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,CACL,CACL;KAEZ,CAAC,CACD;AAEb,CAAC;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { LinearGradientProps } from '../types/utils/gradient.types';
|
|
2
|
+
import { type LinearGradientProps } from '../types/utils/gradient.types';
|
|
3
3
|
export declare const LinearGradient: ({ id, gid, points }: LinearGradientProps) => React.ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearGradient.js","sources":["../../src/components/LinearGradient.tsx"],"sourcesContent":["import React from 'react';\n\nimport { GradientProps, LinearGradientProps } from '../types/utils/gradient.types';\n\nexport const LinearGradient = ({ id, gid, points }: LinearGradientProps): React.ReactElement => (\n <linearGradient key={`${id}-${gid}`} id={`${id}-${gid}`} x1='0' y1='0' x2='0' y2='1'>\n {points.map((point: GradientProps, index: number) => (\n <stop\n key={`${id}${gid}-${index.toString()}`}\n offset={`${point.offset}%`}\n stopColor={point.stopColor}\n stopOpacity={point.stopOpacity}\n />\n ))}\n </linearGradient>\n);\n"],"names":[],"mappings":";;MAIa,cAAc,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAuB,MACnE,wCAAgB,GAAG,EAAE,CAAG,EAAA,EAAE,CAAI,CAAA,EAAA,GAAG,EAAE,EAAE,EAAE,EAAE,CAAG,EAAA,EAAE,IAAI,GAAG,CAAA,CAAE,EAAE,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAA,EAC/E,MAAM,CAAC,GAAG,CAAC,CAAC,KAAoB,EAAE,KAAa,MAC5C,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACI,GAAG,EAAE,CAAA,EAAG,EAAE,CAAG,EAAA,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAE,CAAA,EACtC,MAAM,EAAE,CAAA,EAAG,KAAK,CAAC,MAAM,GAAG,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,WAAW,EAAE,KAAK,CAAC,WAAW,GAChC,CACL,CAAC,CACW;;;;"}
|
|
1
|
+
{"version":3,"file":"LinearGradient.js","sources":["../../src/components/LinearGradient.tsx"],"sourcesContent":["import React from 'react';\n\nimport { type GradientProps, type LinearGradientProps } from '../types/utils/gradient.types';\n\nexport const LinearGradient = ({ id, gid, points }: LinearGradientProps): React.ReactElement => (\n <linearGradient key={`${id}-${gid}`} id={`${id}-${gid}`} x1='0' y1='0' x2='0' y2='1'>\n {points.map((point: GradientProps, index: number) => (\n <stop\n key={`${id}${gid}-${index.toString()}`}\n offset={`${point.offset}%`}\n stopColor={point.stopColor}\n stopOpacity={point.stopOpacity}\n />\n ))}\n </linearGradient>\n);\n"],"names":[],"mappings":";;MAIa,cAAc,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAuB,MACnE,wCAAgB,GAAG,EAAE,CAAG,EAAA,EAAE,CAAI,CAAA,EAAA,GAAG,EAAE,EAAE,EAAE,EAAE,CAAG,EAAA,EAAE,IAAI,GAAG,CAAA,CAAE,EAAE,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAA,EAC/E,MAAM,CAAC,GAAG,CAAC,CAAC,KAAoB,EAAE,KAAa,MAC5C,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EACI,GAAG,EAAE,CAAA,EAAG,EAAE,CAAG,EAAA,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAE,CAAA,EACtC,MAAM,EAAE,CAAA,EAAG,KAAK,CAAC,MAAM,GAAG,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,WAAW,EAAE,KAAK,CAAC,WAAW,GAChC,CACL,CAAC,CACW;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RectBar.js","sources":["../../src/components/RectBar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useMemo } from 'react';\n\nimport { usePathBar } from '../hooks/usePathBar';\n\n// eslint-disable-next-line complexity\nconst getPath = (\n x: number,\n width: number,\n height: number,\n initHeight: number,\n topRadius: number,\n bottomRadius: number,\n initY: number,\n): string =>\n `\n M${x + ((height !== 0 && bottomRadius) || 0)} ${initY + initHeight || 0}\n Q${x} ${initY + initHeight} ${x} ${\n
|
|
1
|
+
{"version":3,"file":"RectBar.js","sources":["../../src/components/RectBar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useMemo } from 'react';\n\nimport { usePathBar } from '../hooks/usePathBar';\n\n// eslint-disable-next-line complexity\nconst getPath = (\n x: number,\n width: number,\n height: number,\n initHeight: number,\n topRadius: number,\n bottomRadius: number,\n initY: number,\n): string =>\n `\n M${x + ((height !== 0 && bottomRadius) || 0)} ${initY + initHeight || 0}\n Q${x} ${initY + initHeight} ${x} ${\n initY + initHeight - ((height !== 0 && bottomRadius) || 0)\n }\n L${x} ${initY + ((height !== 0 && topRadius) || 0)}\n Q${x} ${initY} ${x + ((height !== 0 && topRadius) || 0)} ${initY}\n L${x + width - ((height !== 0 && topRadius) || 0)} ${initY}\n Q${x + width} ${initY} ${x + width} ${initY + (topRadius || 0)}\n L${x + width} ${initY + initHeight - ((height !== 0 && bottomRadius) || 0)}\n Q${x + width} ${initY + initHeight} ${x + width - ((height !== 0 && bottomRadius) || 0)} ${\n initY + initHeight\n }\n Z\n `;\n\nexport const RectBar = ({ fill, x, y, width, height, radius, background }: any): JSX.Element => {\n const [initHeight, topRadius, bottomRadius, initY]: any = usePathBar({\n radius,\n height,\n background,\n y,\n });\n\n return useMemo(\n () => (\n <path\n d={getPath(x, width, height, initHeight, topRadius, bottomRadius, initY)}\n stroke='none'\n fill={fill}\n />\n ),\n [x, width, height, initHeight, topRadius, bottomRadius, initY, fill],\n );\n};\n"],"names":[],"mappings":";;;AAAA;AAKA;AACA,MAAM,OAAO,GAAG,CACZ,CAAS,EACT,KAAa,EACb,MAAc,EACd,UAAkB,EAClB,SAAiB,EACjB,YAAoB,EACpB,KAAa,KAEb;AACO,SAAA,EAAA,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,YAAY,KAAK,CAAC,CAAC,CAAA,CAAA,EAAI,KAAK,GAAG,UAAU,IAAI,CAAC;WACpE,CAAC,CAAA,CAAA,EAAI,KAAK,GAAG,UAAU,IAAI,CAAC,CAAA,CAAA,EAC3B,KAAK,GAAG,UAAU,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,YAAY,KAAK,CAAC,CAC7D;AACG,SAAA,EAAA,CAAC,CAAI,CAAA,EAAA,KAAK,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,KAAK,CAAC,CAAC;AAC/C,SAAA,EAAA,CAAC,IAAI,K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AM,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CACvE;AACL;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Tick/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { TickProps } from '../../types/utils/tick.types';\n\nimport styles from './index.module.css';\n\nexport const Tick = ({ y, payload, tickFormatter, xAxis }: TickProps) => {\n const radius = 4;\n\n const marginTick =\n xAxis?.tickMargin &&\n (xAxis.tickMargin > 0 ? xAxis.tickMargin - radius / 2 : xAxis.tickMargin === 0)\n ? (radius / 2) * -1\n : null;\n\n return (\n <g\n className={cn(styles.tick)}\n opacity='1'\n textAnchor='middle'\n transform={`translate(${payload.coordinate}, ${\n y - (typeof marginTick === 'number' ? marginTick : 0) - radius * 2\n })`}\n >\n <text className={cn(styles.tickText)} y='30'>\n {tickFormatter ? tickFormatter(payload.value) : payload.value}\n </text>\n <circle r={radius} className={cn(styles.circle)} />\n </g>\n );\n};\n"],"names":[],"mappings":";;;;AAOO,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAa,KAAI;IACpE,MAAM,MAAM,GAAG,CAAC;AAEhB,IAAA,MAAM,UAAU,GACZ,KAAK,EAAE,UAAU;SAChB,KAAK,CAAC,UAAU,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,GAAG,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,KAAK,CAAC;UACxE,CAAC,MAAM,GAAG,CAAC,IAAI;UACf,IAAI;IAEd,QACI,2BACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAC1B,OAAO,EAAC,GAAG,EACX,UAAU,EAAC,QAAQ,EACnB,SAAS,EAAE,CAAa,UAAA,EAAA,OAAO,CAAC,UAAU,CAAA,EAAA,EACtC,CAAC,IAAI,OAAO,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CACrE,CAAG,CAAA,CAAA,EAAA;AAEH,QAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAC,IAAI,EACvC,EAAA,aAAa,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAC1D;AACP,QAAA,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAI,CAAA,CACnD;AAEZ;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Tick/index.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type TickProps } from '../../types/utils/tick.types';\n\nimport styles from './index.module.css';\n\nexport const Tick = ({ y, payload, tickFormatter, xAxis }: TickProps) => {\n const radius = 4;\n\n const marginTick =\n xAxis?.tickMargin &&\n (xAxis.tickMargin > 0 ? xAxis.tickMargin - radius / 2 : xAxis.tickMargin === 0)\n ? (radius / 2) * -1\n : null;\n\n return (\n <g\n className={cn(styles.tick)}\n opacity='1'\n textAnchor='middle'\n transform={`translate(${payload.coordinate}, ${\n y - (typeof marginTick === 'number' ? marginTick : 0) - radius * 2\n })`}\n >\n <text className={cn(styles.tickText)} y='30'>\n {tickFormatter ? tickFormatter(payload.value) : payload.value}\n </text>\n <circle r={radius} className={cn(styles.circle)} />\n </g>\n );\n};\n"],"names":[],"mappings":";;;;AAOO,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAa,KAAI;IACpE,MAAM,MAAM,GAAG,CAAC;AAEhB,IAAA,MAAM,UAAU,GACZ,KAAK,EAAE,UAAU;SAChB,KAAK,CAAC,UAAU,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,GAAG,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,KAAK,CAAC;UACxE,CAAC,MAAM,GAAG,CAAC,IAAI;UACf,IAAI;IAEd,QACI,2BACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAC1B,OAAO,EAAC,GAAG,EACX,UAAU,EAAC,QAAQ,EACnB,SAAS,EAAE,CAAa,UAAA,EAAA,OAAO,CAAC,UAAU,CAAA,EAAA,EACtC,CAAC,IAAI,OAAO,UAAU,KAAK,QAAQ,GAAG,UAAU,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,CACrE,CAAG,CAAA,CAAA,EAAA;AAEH,QAAA,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAC,IAAI,EACvC,EAAA,aAAa,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAC1D;AACP,QAAA,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAI,CAAA,CACnD;AAEZ;;;;"}
|