@redsift/charts 11.5.0 → 11.6.0-muiv5-alpha.1
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/_virtual/_rollupPluginBabelHelpers.js +93 -0
- package/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/components/Arc/Arc.d.ts +6 -0
- package/components/Arc/Arc.js +74 -0
- package/components/Arc/Arc.js.map +1 -0
- package/components/Arc/styles.d.ts +17 -0
- package/components/Arc/styles.js +49 -0
- package/components/Arc/styles.js.map +1 -0
- package/components/Arc/types.d.ts +20 -0
- package/components/Arcs/Arcs.d.ts +6 -0
- package/components/Arcs/Arcs.js +90 -0
- package/components/Arcs/Arcs.js.map +1 -0
- package/components/Arcs/styles.d.ts +9 -0
- package/components/Arcs/styles.js +9 -0
- package/components/Arcs/styles.js.map +1 -0
- package/components/Arcs/types.d.ts +17 -0
- package/components/Axis/Axis.d.ts +7 -0
- package/components/Axis/Axis.js +211 -0
- package/components/Axis/Axis.js.map +1 -0
- package/components/Axis/computeTicks.js +117 -0
- package/components/Axis/computeTicks.js.map +1 -0
- package/components/Axis/styles.d.ts +14 -0
- package/components/Axis/styles.js +51 -0
- package/components/Axis/styles.js.map +1 -0
- package/components/Axis/types.d.ts +89 -0
- package/components/Axis/types.js +24 -0
- package/components/Axis/types.js.map +1 -0
- package/components/Bar/Bar.d.ts +6 -0
- package/components/Bar/Bar.js +95 -0
- package/components/Bar/Bar.js.map +1 -0
- package/components/Bar/styles.d.ts +16 -0
- package/components/Bar/styles.js +66 -0
- package/components/Bar/styles.js.map +1 -0
- package/components/Bar/types.d.ts +46 -0
- package/components/Bar/types.js +18 -0
- package/components/Bar/types.js.map +1 -0
- package/components/BarChart/BarChart.d.ts +29 -0
- package/components/BarChart/BarChart.js +141 -0
- package/components/BarChart/BarChart.js.map +1 -0
- package/components/BarChart/BarChartBars.js +168 -0
- package/components/BarChart/BarChartBars.js.map +1 -0
- package/components/BarChart/BarChartSection.js +139 -0
- package/components/BarChart/BarChartSection.js.map +1 -0
- package/components/BarChart/EmptyBarChart.js +57 -0
- package/components/BarChart/EmptyBarChart.js.map +1 -0
- package/components/BarChart/LoadingBarChart.js +18 -0
- package/components/BarChart/LoadingBarChart.js.map +1 -0
- package/components/BarChart/RenderedLinearBarChart.js +549 -0
- package/components/BarChart/RenderedLinearBarChart.js.map +1 -0
- package/components/BarChart/RenderedOrdinalBarChart.js +236 -0
- package/components/BarChart/RenderedOrdinalBarChart.js.map +1 -0
- package/components/BarChart/context.js +13 -0
- package/components/BarChart/context.js.map +1 -0
- package/components/BarChart/intl/en-US.json.js +17 -0
- package/components/BarChart/intl/en-US.json.js.map +1 -0
- package/components/BarChart/intl/fr-FR.json.js +17 -0
- package/components/BarChart/intl/fr-FR.json.js.map +1 -0
- package/components/BarChart/intl/index.js +10 -0
- package/components/BarChart/intl/index.js.map +1 -0
- package/components/BarChart/styles.d.ts +19 -0
- package/components/BarChart/styles.js +71 -0
- package/components/BarChart/styles.js.map +1 -0
- package/components/BarChart/types.d.ts +177 -0
- package/components/BarChart/types.js +17 -0
- package/components/BarChart/types.js.map +1 -0
- package/components/BarChart/utils.js +69 -0
- package/components/BarChart/utils.js.map +1 -0
- package/components/ChartContainer/ChartContainer.d.ts +9 -0
- package/components/ChartContainer/ChartContainer.js +167 -0
- package/components/ChartContainer/ChartContainer.js.map +1 -0
- package/components/ChartContainer/context.js +6 -0
- package/components/ChartContainer/context.js.map +1 -0
- package/components/ChartContainer/intl/en-US.json.js +14 -0
- package/components/ChartContainer/intl/en-US.json.js.map +1 -0
- package/components/ChartContainer/intl/fr-FR.json.js +14 -0
- package/components/ChartContainer/intl/fr-FR.json.js.map +1 -0
- package/components/ChartContainer/intl/index.js +10 -0
- package/components/ChartContainer/intl/index.js.map +1 -0
- package/components/ChartContainer/styles.d.ts +17 -0
- package/components/ChartContainer/styles.js +76 -0
- package/components/ChartContainer/styles.js.map +1 -0
- package/components/ChartContainer/types.d.ts +48 -0
- package/components/DataPoint/DataPoint.d.ts +6 -0
- package/components/DataPoint/DataPoint.js +104 -0
- package/components/DataPoint/DataPoint.js.map +1 -0
- package/components/DataPoint/styles.d.ts +12 -0
- package/components/DataPoint/styles.js +10 -0
- package/components/DataPoint/styles.js.map +1 -0
- package/components/DataPoint/types.d.ts +60 -0
- package/components/Dot/Dot.d.ts +6 -0
- package/components/Dot/Dot.js +55 -0
- package/components/Dot/Dot.js.map +1 -0
- package/components/Dot/styles.d.ts +16 -0
- package/components/Dot/styles.js +49 -0
- package/components/Dot/styles.js.map +1 -0
- package/components/Dot/types.d.ts +30 -0
- package/components/Dot/types.js +14 -0
- package/components/Dot/types.js.map +1 -0
- package/components/Legend/Legend.d.ts +6 -0
- package/components/Legend/Legend.js +73 -0
- package/components/Legend/Legend.js.map +1 -0
- package/components/Legend/styles.d.ts +11 -0
- package/components/Legend/styles.js +15 -0
- package/components/Legend/styles.js.map +1 -0
- package/components/Legend/types.d.ts +44 -0
- package/components/LegendItem/LegendItem.js +96 -0
- package/components/LegendItem/LegendItem.js.map +1 -0
- package/components/LegendItem/styles.js +63 -0
- package/components/LegendItem/styles.js.map +1 -0
- package/components/LegendItem/types.d.ts +20 -0
- package/components/Line/Line.d.ts +6 -0
- package/components/Line/Line.js +55 -0
- package/components/Line/Line.js.map +1 -0
- package/components/Line/styles.d.ts +9 -0
- package/components/Line/styles.js +9 -0
- package/components/Line/styles.js.map +1 -0
- package/components/Line/types.d.ts +21 -0
- package/components/LineChart/EmptyLineChart.js +58 -0
- package/components/LineChart/EmptyLineChart.js.map +1 -0
- package/components/LineChart/LineChart.d.ts +6 -0
- package/components/LineChart/LineChart.js +96 -0
- package/components/LineChart/LineChart.js.map +1 -0
- package/components/LineChart/LoadingLineChart.js +18 -0
- package/components/LineChart/LoadingLineChart.js.map +1 -0
- package/components/LineChart/RenderedLineChart.js +372 -0
- package/components/LineChart/RenderedLineChart.js.map +1 -0
- package/components/LineChart/intl/en-US.json.js +17 -0
- package/components/LineChart/intl/en-US.json.js.map +1 -0
- package/components/LineChart/intl/fr-FR.json.js +17 -0
- package/components/LineChart/intl/fr-FR.json.js.map +1 -0
- package/components/LineChart/intl/index.js +10 -0
- package/components/LineChart/intl/index.js.map +1 -0
- package/components/LineChart/styles.d.ts +17 -0
- package/components/LineChart/styles.js +53 -0
- package/components/LineChart/styles.js.map +1 -0
- package/components/LineChart/types.d.ts +90 -0
- package/components/LineChart/types.js +17 -0
- package/components/LineChart/types.js.map +1 -0
- package/components/LineChart/utils.js +67 -0
- package/components/LineChart/utils.js.map +1 -0
- package/components/PieChart/EmptyPieChart.js +85 -0
- package/components/PieChart/EmptyPieChart.js.map +1 -0
- package/components/PieChart/LoadingPieChart.js +18 -0
- package/components/PieChart/LoadingPieChart.js.map +1 -0
- package/components/PieChart/PieChart.d.ts +6 -0
- package/components/PieChart/PieChart.js +98 -0
- package/components/PieChart/PieChart.js.map +1 -0
- package/components/PieChart/RenderedPieChart.js +198 -0
- package/components/PieChart/RenderedPieChart.js.map +1 -0
- package/components/PieChart/intl/en-US.json.js +9 -0
- package/components/PieChart/intl/en-US.json.js.map +1 -0
- package/components/PieChart/intl/fr-FR.json.js +9 -0
- package/components/PieChart/intl/fr-FR.json.js.map +1 -0
- package/components/PieChart/intl/index.js +10 -0
- package/components/PieChart/intl/index.js.map +1 -0
- package/components/PieChart/styles.d.ts +24 -0
- package/components/PieChart/styles.js +168 -0
- package/components/PieChart/styles.js.map +1 -0
- package/components/PieChart/types.d.ts +115 -0
- package/components/PieChart/types.js +27 -0
- package/components/PieChart/types.js.map +1 -0
- package/components/PieChart/utils.js +37 -0
- package/components/PieChart/utils.js.map +1 -0
- package/components/ScatterPlot/EmptyScatterPlot.js +58 -0
- package/components/ScatterPlot/EmptyScatterPlot.js.map +1 -0
- package/components/ScatterPlot/LoadingScatterPlot.js +18 -0
- package/components/ScatterPlot/LoadingScatterPlot.js.map +1 -0
- package/components/ScatterPlot/RenderedScatterPlot.js +352 -0
- package/components/ScatterPlot/RenderedScatterPlot.js.map +1 -0
- package/components/ScatterPlot/ScatterPlot.d.ts +6 -0
- package/components/ScatterPlot/ScatterPlot.js +105 -0
- package/components/ScatterPlot/ScatterPlot.js.map +1 -0
- package/components/ScatterPlot/intl/en-US.json.js +12 -0
- package/components/ScatterPlot/intl/en-US.json.js.map +1 -0
- package/components/ScatterPlot/intl/fr-FR.json.js +17 -0
- package/components/ScatterPlot/intl/fr-FR.json.js.map +1 -0
- package/components/ScatterPlot/intl/index.js +10 -0
- package/components/ScatterPlot/intl/index.js.map +1 -0
- package/components/ScatterPlot/styles.d.ts +17 -0
- package/components/ScatterPlot/styles.js +53 -0
- package/components/ScatterPlot/styles.js.map +1 -0
- package/components/ScatterPlot/types.d.ts +109 -0
- package/components/ScatterPlot/types.js +24 -0
- package/components/ScatterPlot/types.js.map +1 -0
- package/components/ScatterPlot/utils.js +70 -0
- package/components/ScatterPlot/utils.js.map +1 -0
- package/config.js +15 -0
- package/config.js.map +1 -0
- package/design-system/src/react-aria/react-aria/i18n/useMessageFormatter.d.ts +5 -0
- package/hooks/useBrush.d.ts +17 -0
- package/hooks/useBrush.js +48 -0
- package/hooks/useBrush.js.map +1 -0
- package/hooks/useColor.d.ts +18 -0
- package/hooks/useColor.js +20 -0
- package/hooks/useColor.js.map +1 -0
- package/hooks/useFormatCategoricalData.d.ts +26 -0
- package/hooks/useFormatCategoricalData.js +57 -0
- package/hooks/useFormatCategoricalData.js.map +1 -0
- package/hooks/useZoom.d.ts +26 -0
- package/hooks/useZoom.js +39 -0
- package/hooks/useZoom.js.map +1 -0
- package/index.d.ts +51 -1277
- package/index.js +42 -5118
- package/index.js.map +1 -1
- package/package.json +4 -4
- package/scheme.d.ts +32 -0
- package/scheme.js +47 -0
- package/scheme.js.map +1 -0
- package/types/axis.d.ts +48 -0
- package/types/data.d.ts +72 -0
- package/types/legend.d.ts +30 -0
- package/types/legend.js +21 -0
- package/types/legend.js.map +1 -0
- package/types/scale.d.ts +48 -0
- package/types/size.d.ts +20 -0
- package/types/size.js +8 -0
- package/types/size.js.map +1 -0
- package/types/theme.d.ts +23 -0
- package/types/theme.js +13 -0
- package/types/theme.js.map +1 -0
- package/utils/index.d.ts +11 -0
- package/utils/index.js +44 -0
- package/utils/index.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RenderedPieChart.js","sources":["../../../src/components/PieChart/RenderedPieChart.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useEffect, useRef } from 'react';\nimport { arc as d3arc, pie as d3pie, sum as d3sum } from 'd3';\n\nimport { useTheme, useMessageFormatter } from '@redsift/design-system';\nimport intlMessages from './intl';\n\nimport { LegendVariant, ArcDatum, CategoryData, CategoryDatum, LegendItemDatum } from '../../types';\nimport { PieChartLegendVariant, PieChartProps, PieChartVariant } from './types';\nimport { StyledPieChartCenterText, StyledPieChart } from './styles';\nimport { Arcs } from '../Arcs';\nimport { useFormatCategoricalData } from '../../hooks';\nimport { Legend } from '../Legend';\nimport { sizeToDimension } from './utils';\nimport { PieChart } from './PieChart';\nimport { getSortingMethod, mergeLegends } from '../../utils';\n\ninterface RenderedPieChartProps extends Required<Pick<PieChartProps, 'data'>>, Omit<PieChartProps, 'data'> {}\n\nexport const RenderedPieChart = forwardRef<HTMLDivElement, RenderedPieChartProps>((props, ref) => {\n const {\n caping,\n className,\n data: propsData,\n disableAnimations,\n getSliceAnchorProps,\n id,\n isHalf,\n isSliceSelected,\n labelDecorator,\n legendDecorator,\n legendVariant,\n legendProps,\n middleText: propsMiddleText,\n onSliceClick,\n others,\n size,\n sliceProps,\n sliceRole,\n sortingMethod,\n subtext: propsSubtext,\n text: propsText,\n colorTheme,\n tooltipVariant,\n variant,\n ...forwardedProps\n } = props;\n\n const cache = useRef<CategoryData>();\n const theme = useTheme();\n\n const format = useMessageFormatter(intlMessages);\n\n const isDonut = variant === PieChartVariant.donut || variant === PieChartVariant.spacedDonut;\n const isSpaced = variant === PieChartVariant.spaced || variant === PieChartVariant.spacedDonut;\n\n const { data, colorScale } = useFormatCategoricalData({\n data: propsData,\n colorTheme: colorTheme!,\n sortingMethod: sortingMethod!,\n caping,\n others,\n theme,\n });\n\n useEffect(() => {\n cache.current = data;\n });\n\n const { width, height, smallFontSize, fontSize, innerRadius } = sizeToDimension(size!, isHalf);\n const externalRadiusPadding = 8;\n\n const createPie = d3pie<CategoryDatum>()\n .value((d) => d.value)\n .sort(null)\n .startAngle(isHalf ? Math.PI * -0.5 : 0)\n .endAngle(isHalf ? Math.PI * 0.5 : Math.PI * 2);\n const createArc = d3arc<ArcDatum>()\n .innerRadius(isDonut ? innerRadius : 0)\n .outerRadius(width / 2 - externalRadiusPadding);\n const pieData = createPie(data);\n const previousPieData = cache.current ? createPie(cache.current) : undefined;\n const total = d3sum(data, (d) => d.value);\n const legendWidth = useRef<string>();\n if (data && !legendWidth.current) {\n legendWidth.current = `${Math.max(...data.map((d) => d.key.length + String(d.value).length)) * 8 + 32}px`;\n }\n\n const text =\n typeof propsText === 'function'\n ? propsText(\n pieData.map((datum) => {\n const percent = datum.data.value / total;\n return { ...datum, data: { ...datum.data, percent } };\n }),\n total\n )\n : propsText;\n const subtext =\n typeof propsSubtext === 'function'\n ? propsSubtext(\n pieData.map((datum) => {\n const percent = datum.data.value / total;\n return { ...datum, data: { ...datum.data, percent } };\n }),\n total\n )\n : propsSubtext;\n const middleText =\n typeof propsMiddleText === 'function'\n ? propsMiddleText(\n pieData.map((datum) => {\n const percent = datum.data.value / total;\n return { ...datum, data: { ...datum.data, percent } };\n }),\n total\n )\n : propsMiddleText;\n\n const filteredPieData = pieData.filter((datum) => datum.data.value);\n\n const { extraLegendItems, ...forwardedLegendProps } = legendProps || {};\n\n return (\n <StyledPieChart\n mode={typeof onSliceClick === 'function' || typeof getSliceAnchorProps === 'function' ? 'interactive' : 'static'}\n definition={format('definition', { sliceLength: filteredPieData.length })}\n dataTableRepresentation={{\n header: (\n <thead>\n <tr>\n <th scope=\"col\">Key</th>\n <th scope=\"col\">Value</th>\n </tr>\n </thead>\n ),\n body: (\n <tbody>\n {filteredPieData.map((datum) => (\n <tr key={datum.data.key}>\n <th scope=\"row\">{datum.data.key}</th>\n <td>{datum.data.value}</td>\n </tr>\n ))}\n </tbody>\n ),\n }}\n {...forwardedProps}\n className={className}\n id={id}\n ref={ref as RefObject<HTMLDivElement>}\n >\n <div className={`${PieChart.className}__chart-wrapper`}>\n {text ? (\n <StyledPieChartCenterText\n $maxWidth={innerRadius * 2}\n $textSize={fontSize}\n $smallTextSize={smallFontSize}\n $theme={theme}\n >\n {subtext ? <b>{text}</b> : <span>{text}</span>}\n {middleText ? <b>{middleText}</b> : null}\n <span>{subtext}</span>\n </StyledPieChartCenterText>\n ) : null}\n <svg\n width={width}\n height={isHalf ? height + externalRadiusPadding : height}\n aria-label={\n typeof onSliceClick === 'function' || typeof getSliceAnchorProps === 'function'\n ? format('interactive-chart')\n : format('static-chart')\n }\n aria-hidden=\"false\"\n >\n <Arcs\n arcs={filteredPieData.map((datum, index) => {\n const percent = datum.data.value / total;\n const from = previousPieData\n ? previousPieData[index]\n : {\n data: {\n key: '',\n value: 0,\n },\n startAngle: isHalf ? Math.PI * -0.5 : 0,\n endAngle: isHalf ? Math.PI * -0.5 : 0,\n padAngle: 0,\n value: 0,\n index: index,\n };\n const to = { ...datum, data: { ...datum.data, percent } };\n\n return {\n color: colorScale?.(to.data.key),\n createArc,\n previousData: from,\n id: `id${id}__arc-${index}`,\n index,\n isSelected: isSliceSelected!(to),\n key: `id${id}__arc-${index}`,\n data: to,\n dataset: pieData,\n anchorProps: getSliceAnchorProps ? getSliceAnchorProps(to) : undefined,\n };\n })}\n disableAnimations={disableAnimations}\n hasLabels={legendVariant === PieChartLegendVariant.internal}\n hasStroke={isSpaced}\n labelDecorator={labelDecorator}\n onClick={onSliceClick}\n role={sliceRole}\n sliceProps={sliceProps}\n tooltipVariant={tooltipVariant}\n transform={`translate(${width / 2} ${isHalf ? height : height / 2})`}\n />\n </svg>\n </div>\n {legendVariant !== PieChartLegendVariant.none && legendVariant !== PieChartLegendVariant.internal ? (\n <Legend\n data={(extraLegendItems\n ? mergeLegends(extraLegendItems, data).sort(getSortingMethod(sortingMethod!))\n : data\n ).map((d) => ({\n ...d,\n color: colorScale?.(d.key)!,\n }))}\n variant={\n legendVariant === PieChartLegendVariant.externalLabelValue\n ? LegendVariant.value\n : legendVariant === PieChartLegendVariant.externalLabelPercent\n ? LegendVariant.percent\n : legendVariant === PieChartLegendVariant.externalLabel\n ? LegendVariant.label\n : LegendVariant.custom\n }\n width={legendWidth.current}\n labelDecorator={\n labelDecorator ? (datum: LegendItemDatum, props) => labelDecorator(datum as ArcDatum, props) : undefined\n }\n legendDecorator={\n legendDecorator ? (datum: LegendItemDatum, props) => legendDecorator(datum as ArcDatum, props) : undefined\n }\n {...forwardedLegendProps}\n />\n ) : null}\n </StyledPieChart>\n );\n});\n"],"names":["RenderedPieChart","forwardRef","props","ref","caping","className","data","propsData","disableAnimations","getSliceAnchorProps","id","isHalf","isSliceSelected","labelDecorator","legendDecorator","legendVariant","legendProps","middleText","propsMiddleText","onSliceClick","others","size","sliceProps","sliceRole","sortingMethod","subtext","propsSubtext","text","propsText","colorTheme","tooltipVariant","variant","forwardedProps","_objectWithoutProperties","_excluded","cache","useRef","theme","useTheme","format","useMessageFormatter","intlMessages","isDonut","PieChartVariant","donut","spacedDonut","isSpaced","spaced","colorScale","useFormatCategoricalData","useEffect","current","width","height","smallFontSize","fontSize","innerRadius","sizeToDimension","externalRadiusPadding","createPie","d3pie","value","d","sort","startAngle","Math","PI","endAngle","createArc","d3arc","outerRadius","pieData","previousPieData","undefined","total","d3sum","legendWidth","max","map","key","length","String","datum","percent","_objectSpread","filteredPieData","filter","_ref","extraLegendItems","forwardedLegendProps","_excluded2","React","createElement","StyledPieChart","_extends","mode","definition","sliceLength","dataTableRepresentation","header","scope","body","PieChart","StyledPieChartCenterText","$maxWidth","$textSize","$smallTextSize","$theme","Arcs","arcs","index","from","padAngle","to","color","previousData","isSelected","dataset","anchorProps","hasLabels","PieChartLegendVariant","internal","hasStroke","onClick","role","transform","none","Legend","mergeLegends","getSortingMethod","externalLabelValue","LegendVariant","externalLabelPercent","externalLabel","label","custom"],"mappings":";;;;;;;;;;;;;;;;;AAkBO,MAAMA,gBAAgB,gBAAGC,UAAU,CAAwC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAChG,MAAM;MACJC,MAAM;MACNC,SAAS;AACTC,MAAAA,IAAI,EAAEC,SAAS;MACfC,iBAAiB;MACjBC,mBAAmB;MACnBC,EAAE;MACFC,MAAM;MACNC,eAAe;MACfC,cAAc;MACdC,eAAe;MACfC,aAAa;MACbC,WAAW;AACXC,MAAAA,UAAU,EAAEC,eAAe;MAC3BC,YAAY;MACZC,MAAM;MACNC,IAAI;MACJC,UAAU;MACVC,SAAS;MACTC,aAAa;AACbC,MAAAA,OAAO,EAAEC,YAAY;AACrBC,MAAAA,IAAI,EAAEC,SAAS;MACfC,UAAU;MACVC,cAAc;AACdC,MAAAA,OAAAA;AAEF,KAAC,GAAG7B,KAAK;AADJ8B,IAAAA,cAAc,GAAAC,wBAAA,CACf/B,KAAK,EAAAgC,SAAA,CAAA,CAAA;AAET,EAAA,MAAMC,KAAK,GAAGC,MAAM,EAAgB,CAAA;AACpC,EAAA,MAAMC,KAAK,GAAGC,QAAQ,EAAE,CAAA;AAExB,EAAA,MAAMC,MAAM,GAAGC,mBAAmB,CAACC,YAAY,CAAC,CAAA;AAEhD,EAAA,MAAMC,OAAO,GAAGX,OAAO,KAAKY,eAAe,CAACC,KAAK,IAAIb,OAAO,KAAKY,eAAe,CAACE,WAAW,CAAA;AAC5F,EAAA,MAAMC,QAAQ,GAAGf,OAAO,KAAKY,eAAe,CAACI,MAAM,IAAIhB,OAAO,KAAKY,eAAe,CAACE,WAAW,CAAA;EAE9F,MAAM;IAAEvC,IAAI;AAAE0C,IAAAA,UAAAA;GAAY,GAAGC,wBAAwB,CAAC;AACpD3C,IAAAA,IAAI,EAAEC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AACG,KAAK,GACnBH,aAAa,CAACI,MACnB;IACDnF,KAAK,EAAEwB,WAAW,CAACzB,OAAQ;AAC3BtC,IAAAA,cAAc,EACZA,cAAc,GAAG,CAACqE,KAAsB,EAAEhF,KAAK,KAAKW,cAAc,CAACqE,KAAK,EAAchF,KAAK,CAAC,GAAGuE,SAChG;AACD3D,IAAAA,eAAe,EACbA,eAAe,GAAG,CAACoE,KAAsB,EAAEhF,KAAK,KAAKY,eAAe,CAACoE,KAAK,EAAchF,KAAK,CAAC,GAAGuE,SAAAA;AAClG,GAAA,EACGgB,oBAAoB,CACzB,CAAC,GACA,IACU,CAAC,CAAA;AAErB,CAAC;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var definition = "Pie Chart with {sliceLength} slices.";
|
|
2
|
+
var enUS = {
|
|
3
|
+
"interactive-chart": "Interactive Line Chart",
|
|
4
|
+
"static-chart": "Static Line Chart",
|
|
5
|
+
definition: definition
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { enUS as default, definition };
|
|
9
|
+
//# sourceMappingURL=en-US.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-US.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var definition = "Diagramme circulaire contenant {sliceLength} secteurs.";
|
|
2
|
+
var frFR = {
|
|
3
|
+
"interactive-chart": "Diagramme circulaire interactif",
|
|
4
|
+
"static-chart": "Diagramme circulaire statique",
|
|
5
|
+
definition: definition
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { frFR as default, definition };
|
|
9
|
+
//# sourceMappingURL=fr-FR.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr-FR.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/PieChart/intl/index.ts"],"sourcesContent":["import enUS from './en-US.json';\nimport frFR from './fr-FR.json';\n\nexport default {\n 'en-US': enUS,\n 'fr-FR': frFR,\n};\n"],"names":["enUS","frFR"],"mappings":";;;AAGA,mBAAe;AACb,EAAA,OAAO,EAAEA,IAAI;AACb,EAAA,OAAO,EAAEC,IAAAA;AACX,CAAC;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as styled_components from 'styled-components';
|
|
2
|
+
import { PieChartProps } from './types.js';
|
|
3
|
+
import * as _redsift_design_system from '@redsift/design-system';
|
|
4
|
+
import { Theme } from '@redsift/design-system';
|
|
5
|
+
import { ChartContainerProps } from '../ChartContainer/types.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Component style.
|
|
9
|
+
*/
|
|
10
|
+
declare const StyledPieChart: styled_components.StyledComponent<_redsift_design_system.Comp<ChartContainerProps, HTMLDivElement>, any, PieChartProps, never>;
|
|
11
|
+
declare const StyledPieChartCenterText: styled_components.StyledComponent<"div", any, {
|
|
12
|
+
$maxWidth: number;
|
|
13
|
+
$textSize: number;
|
|
14
|
+
$smallTextSize: number;
|
|
15
|
+
$theme: Theme;
|
|
16
|
+
}, never>;
|
|
17
|
+
declare const StyledPieChartEmptyText: styled_components.StyledComponent<"div", any, {
|
|
18
|
+
$maxWidth: number;
|
|
19
|
+
$textSize: number;
|
|
20
|
+
$isDonut: boolean;
|
|
21
|
+
$theme: Theme;
|
|
22
|
+
}, never>;
|
|
23
|
+
|
|
24
|
+
export { StyledPieChart, StyledPieChartCenterText, StyledPieChartEmptyText };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { Theme } from '@redsift/design-system';
|
|
3
|
+
import { ChartContainer } from '../ChartContainer/ChartContainer.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Component style.
|
|
7
|
+
*/
|
|
8
|
+
const StyledPieChart = styled(ChartContainer)`
|
|
9
|
+
.redsift-piechart__chart-wrapper {
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
const StyledPieChartCenterText = styled.div`
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
height: 100%;
|
|
18
|
+
width: 100%;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
|
|
25
|
+
> * {
|
|
26
|
+
max-width: ${_ref => {
|
|
27
|
+
let {
|
|
28
|
+
$maxWidth
|
|
29
|
+
} = _ref;
|
|
30
|
+
return $maxWidth;
|
|
31
|
+
}}px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
> b {
|
|
35
|
+
font-family: var(--redsift-typography-font-family-poppins);
|
|
36
|
+
color: ${_ref2 => {
|
|
37
|
+
let {
|
|
38
|
+
$theme
|
|
39
|
+
} = _ref2;
|
|
40
|
+
return `var(--redsift-color-${$theme}-components-text-primary)`;
|
|
41
|
+
}};
|
|
42
|
+
font-weight: var(--redsift-typography-font-weight-medium);
|
|
43
|
+
font-size: ${_ref3 => {
|
|
44
|
+
let {
|
|
45
|
+
$textSize
|
|
46
|
+
} = _ref3;
|
|
47
|
+
return $textSize;
|
|
48
|
+
}}px;
|
|
49
|
+
line-height: ${_ref4 => {
|
|
50
|
+
let {
|
|
51
|
+
$textSize
|
|
52
|
+
} = _ref4;
|
|
53
|
+
return $textSize;
|
|
54
|
+
}}px;
|
|
55
|
+
|
|
56
|
+
&:nth-child(2) {
|
|
57
|
+
font-weight: normal;
|
|
58
|
+
margin-top: 8px;
|
|
59
|
+
font-family: var(--redsift-typography-font-family-poppins);
|
|
60
|
+
font-size: ${_ref5 => {
|
|
61
|
+
let {
|
|
62
|
+
$smallTextSize
|
|
63
|
+
} = _ref5;
|
|
64
|
+
return $smallTextSize;
|
|
65
|
+
}}px;
|
|
66
|
+
line-height: ${_ref6 => {
|
|
67
|
+
let {
|
|
68
|
+
$smallTextSize
|
|
69
|
+
} = _ref6;
|
|
70
|
+
return $smallTextSize;
|
|
71
|
+
}}px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
> span {
|
|
75
|
+
color: ${_ref7 => {
|
|
76
|
+
let {
|
|
77
|
+
$theme
|
|
78
|
+
} = _ref7;
|
|
79
|
+
return `var(--redsift-color-${$theme}-components-text-primary)`;
|
|
80
|
+
}};
|
|
81
|
+
font-size: ${_ref8 => {
|
|
82
|
+
let {
|
|
83
|
+
$textSize
|
|
84
|
+
} = _ref8;
|
|
85
|
+
return $textSize;
|
|
86
|
+
}}px;
|
|
87
|
+
line-height: ${_ref9 => {
|
|
88
|
+
let {
|
|
89
|
+
$textSize
|
|
90
|
+
} = _ref9;
|
|
91
|
+
return $textSize;
|
|
92
|
+
}}px;
|
|
93
|
+
&:nth-child(3) {
|
|
94
|
+
margin-top: 4px;
|
|
95
|
+
font-size: ${_ref10 => {
|
|
96
|
+
let {
|
|
97
|
+
$smallTextSize
|
|
98
|
+
} = _ref10;
|
|
99
|
+
return $smallTextSize;
|
|
100
|
+
}}px;
|
|
101
|
+
line-height: ${_ref11 => {
|
|
102
|
+
let {
|
|
103
|
+
$smallTextSize
|
|
104
|
+
} = _ref11;
|
|
105
|
+
return $smallTextSize;
|
|
106
|
+
}}px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
> b + span {
|
|
110
|
+
font-size: var(--redsift-typography-body-font-size);
|
|
111
|
+
font-family: var(--redsift-typography-font-family-poppins);
|
|
112
|
+
line-height: var(--redsift-typography-badge-line-height);
|
|
113
|
+
color: ${_ref12 => {
|
|
114
|
+
let {
|
|
115
|
+
$theme
|
|
116
|
+
} = _ref12;
|
|
117
|
+
return $theme === Theme.light ? 'rgba(0, 0, 0, 0.6)' : 'rgba(255, 255, 255, 0.6)';
|
|
118
|
+
}};
|
|
119
|
+
text-align: center;
|
|
120
|
+
}
|
|
121
|
+
`;
|
|
122
|
+
const StyledPieChartEmptyText = styled.div`
|
|
123
|
+
position: absolute;
|
|
124
|
+
top: 0;
|
|
125
|
+
left: 0;
|
|
126
|
+
height: 100%;
|
|
127
|
+
width: 100%;
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
align-items: center;
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
|
|
134
|
+
> * {
|
|
135
|
+
max-width: ${_ref13 => {
|
|
136
|
+
let {
|
|
137
|
+
$maxWidth
|
|
138
|
+
} = _ref13;
|
|
139
|
+
return $maxWidth;
|
|
140
|
+
}}px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
> span {
|
|
144
|
+
font-family: var(--redsift-typography-font-family-poppins);
|
|
145
|
+
color: ${_ref14 => {
|
|
146
|
+
let {
|
|
147
|
+
$isDonut,
|
|
148
|
+
$theme
|
|
149
|
+
} = _ref14;
|
|
150
|
+
return $isDonut ? css`var(--redsift-color-neutral-mid-grey)` : css`var(--redsift-color-${$theme}-components-text-primary)`;
|
|
151
|
+
}};
|
|
152
|
+
font-size: ${_ref15 => {
|
|
153
|
+
let {
|
|
154
|
+
$textSize
|
|
155
|
+
} = _ref15;
|
|
156
|
+
return $textSize;
|
|
157
|
+
}}px;
|
|
158
|
+
line-height: ${_ref16 => {
|
|
159
|
+
let {
|
|
160
|
+
$textSize
|
|
161
|
+
} = _ref16;
|
|
162
|
+
return $textSize;
|
|
163
|
+
}}px;
|
|
164
|
+
}
|
|
165
|
+
`;
|
|
166
|
+
|
|
167
|
+
export { StyledPieChart, StyledPieChartCenterText, StyledPieChartEmptyText };
|
|
168
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/components/PieChart/styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { StyledPieChartProps } from './types';\nimport { ChartContainer } from '../ChartContainer';\nimport { Theme } from '@redsift/design-system';\n\n/**\n * Component style.\n */\nexport const StyledPieChart = styled(ChartContainer)<StyledPieChartProps>`\n .redsift-piechart__chart-wrapper {\n position: relative;\n }\n`;\n\nexport const StyledPieChartCenterText = styled.div<{\n $maxWidth: number;\n $textSize: number;\n $smallTextSize: number;\n $theme: Theme;\n}>`\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n\n > * {\n max-width: ${({ $maxWidth }) => $maxWidth}px;\n }\n\n > b {\n font-family: var(--redsift-typography-font-family-poppins);\n color: ${({ $theme }) => `var(--redsift-color-${$theme}-components-text-primary)`};\n font-weight: var(--redsift-typography-font-weight-medium);\n font-size: ${({ $textSize }) => $textSize}px;\n line-height: ${({ $textSize }) => $textSize}px;\n\n &:nth-child(2) {\n font-weight: normal;\n margin-top: 8px;\n font-family: var(--redsift-typography-font-family-poppins);\n font-size: ${({ $smallTextSize }) => $smallTextSize}px;\n line-height: ${({ $smallTextSize }) => $smallTextSize}px;\n }\n }\n > span {\n color: ${({ $theme }) => `var(--redsift-color-${$theme}-components-text-primary)`};\n font-size: ${({ $textSize }) => $textSize}px;\n line-height: ${({ $textSize }) => $textSize}px;\n &:nth-child(3) {\n margin-top: 4px;\n font-size: ${({ $smallTextSize }) => $smallTextSize}px;\n line-height: ${({ $smallTextSize }) => $smallTextSize}px;\n }\n }\n > b + span {\n font-size: var(--redsift-typography-body-font-size);\n font-family: var(--redsift-typography-font-family-poppins);\n line-height: var(--redsift-typography-badge-line-height);\n color: ${({ $theme }) => ($theme === Theme.light ? 'rgba(0, 0, 0, 0.6)' : 'rgba(255, 255, 255, 0.6)')};\n text-align: center;\n }\n`;\n\nexport const StyledPieChartEmptyText = styled.div<{\n $maxWidth: number;\n $textSize: number;\n $isDonut: boolean;\n $theme: Theme;\n}>`\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n\n > * {\n max-width: ${({ $maxWidth }) => $maxWidth}px;\n }\n\n > span {\n font-family: var(--redsift-typography-font-family-poppins);\n color: ${({ $isDonut, $theme }) =>\n $isDonut\n ? css`var(--redsift-color-neutral-mid-grey)`\n : css`var(--redsift-color-${$theme}-components-text-primary)`};\n font-size: ${({ $textSize }) => $textSize}px;\n line-height: ${({ $textSize }) => $textSize}px;\n }\n`;\n"],"names":["StyledPieChart","styled","ChartContainer","StyledPieChartCenterText","div","_ref","$maxWidth","_ref2","$theme","_ref3","$textSize","_ref4","_ref5","$smallTextSize","_ref6","_ref7","_ref8","_ref9","_ref10","_ref11","_ref12","Theme","light","StyledPieChartEmptyText","_ref13","_ref14","$isDonut","css","_ref15","_ref16"],"mappings":";;;;AAKA;AACA;AACA;MACaA,cAAc,GAAGC,MAAM,CAACC,cAAc,CAAuB,CAAA;AAC1E;AACA;AACA;AACA,EAAC;AAEYC,MAAAA,wBAAwB,GAAGF,MAAM,CAACG,GAK5C,CAAA;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,EAAiBC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,SAAAA;AAAU,GAAC,GAAAD,IAAA,CAAA;AAAA,EAAA,OAAKC,SAAS,CAAA;AAAA,CAAC,CAAA;AAC9C;AACA;AACA;AACA;AACA,WAAA,EAAaC,KAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,MAAAA;AAAO,GAAC,GAAAD,KAAA,CAAA;EAAA,OAAM,CAAA,oBAAA,EAAsBC,MAAO,CAA0B,yBAAA,CAAA,CAAA;AAAA,CAAC,CAAA;AACtF;AACA,eAAA,EAAiBC,KAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,SAAAA;AAAU,GAAC,GAAAD,KAAA,CAAA;AAAA,EAAA,OAAKC,SAAS,CAAA;AAAA,CA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2
|
+
import { PieArcDatum } from 'd3-shape';
|
|
3
|
+
import { ValueOf, Theme } from '@redsift/design-system';
|
|
4
|
+
import { SortingMethod } from '../../utils/index.js';
|
|
5
|
+
import { ArcProps } from '../Arc/types.js';
|
|
6
|
+
import { ChartDimensions, ChartSize } from '../../types/size.js';
|
|
7
|
+
import { ChartContainerProps } from '../ChartContainer/types.js';
|
|
8
|
+
import { CategoryData, ArcDatum, Statistics, CategoryDatum } from '../../types/data.js';
|
|
9
|
+
import { AnchorProps } from '../DataPoint/types.js';
|
|
10
|
+
import { LegendProps } from '../Legend/types.js';
|
|
11
|
+
import { ChartTheme } from '../../types/theme.js';
|
|
12
|
+
import { TooltipVariant } from '../../types/legend.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Component variant.
|
|
16
|
+
*/
|
|
17
|
+
declare const PieChartVariant: {
|
|
18
|
+
readonly plain: "plain";
|
|
19
|
+
readonly spaced: "spaced";
|
|
20
|
+
readonly donut: "donut";
|
|
21
|
+
readonly spacedDonut: "spacedDonut";
|
|
22
|
+
};
|
|
23
|
+
type PieChartVariant = ValueOf<typeof PieChartVariant>;
|
|
24
|
+
/**
|
|
25
|
+
* Component's labels variant.
|
|
26
|
+
*/
|
|
27
|
+
declare const PieChartLegendVariant: {
|
|
28
|
+
readonly none: "none";
|
|
29
|
+
readonly internal: "internal";
|
|
30
|
+
readonly externalLabel: "externalLabel";
|
|
31
|
+
readonly externalLabelValue: "externalLabelValue";
|
|
32
|
+
readonly externalLabelPercent: "externalLabelPercent";
|
|
33
|
+
readonly custom: "custom";
|
|
34
|
+
};
|
|
35
|
+
type PieChartLegendVariant = ValueOf<typeof PieChartLegendVariant>;
|
|
36
|
+
interface LocaleText {
|
|
37
|
+
emptyChartText: string;
|
|
38
|
+
}
|
|
39
|
+
type PieChartDimensions = ChartDimensions & {
|
|
40
|
+
smallFontSize: number;
|
|
41
|
+
fontSize: number;
|
|
42
|
+
innerRadius: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Component props.
|
|
46
|
+
*/
|
|
47
|
+
interface PieChartProps extends ChartContainerProps {
|
|
48
|
+
/** Number of categories to use, the rest being put into a new category called "Others". */
|
|
49
|
+
caping?: number;
|
|
50
|
+
/** Dataset to use to generate the chart, should be a list of objects containing a key and a value. */
|
|
51
|
+
data?: CategoryData;
|
|
52
|
+
/** Component to use if the chart is empty (replacing the default one). */
|
|
53
|
+
emptyComponent?: ReactNode;
|
|
54
|
+
/** Method used to define the anchor props to use when the slice is a navigation link. */
|
|
55
|
+
getSliceAnchorProps?: (datum: ArcDatum) => AnchorProps;
|
|
56
|
+
/** Whether the pie or donut is cut in half or not. */
|
|
57
|
+
isHalf?: boolean;
|
|
58
|
+
/** Method to determine whether a slice is selected or not. */
|
|
59
|
+
isSliceSelected?: (datum: ArcDatum) => boolean | undefined;
|
|
60
|
+
/** Method to override the data labels. */
|
|
61
|
+
labelDecorator?: (datum: ArcDatum, props?: {
|
|
62
|
+
index?: number;
|
|
63
|
+
isSelected?: boolean;
|
|
64
|
+
color?: string;
|
|
65
|
+
}) => string | ReactElement;
|
|
66
|
+
/** Method modifying what's displayed within the legend when the legendVariant is "custom". */
|
|
67
|
+
legendDecorator?: (datum: ArcDatum, props?: {
|
|
68
|
+
index?: number;
|
|
69
|
+
isSelected?: boolean;
|
|
70
|
+
color?: string;
|
|
71
|
+
}) => string | ReactElement;
|
|
72
|
+
/** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. If set to "custom", use `legendDecorator` to customize it. */
|
|
73
|
+
legendVariant?: PieChartLegendVariant;
|
|
74
|
+
/** Props to forward to the Legend block. Can be used to make the legend selectable. */
|
|
75
|
+
legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant'> & {
|
|
76
|
+
extraLegendItems?: Statistics;
|
|
77
|
+
};
|
|
78
|
+
/** Labels and texts. */
|
|
79
|
+
localeText?: LocaleText;
|
|
80
|
+
/** Method to be called on a click on a slice. For a navigation link, please use `getSliceAnchorProps` instead. */
|
|
81
|
+
onSliceClick?: (datum: ArcDatum) => void;
|
|
82
|
+
/** Whether a category should be displayed for categories that has been removed by the caping option. Optionaly, this prop can be used to change the label of this category. */
|
|
83
|
+
others?: boolean | string;
|
|
84
|
+
/** PieChart size. */
|
|
85
|
+
size?: ChartSize | PieChartDimensions;
|
|
86
|
+
/** Native HTML props to forward to each slice. */
|
|
87
|
+
sliceProps?: Omit<ComponentProps<'g'>, 'onClick' | 'ref' | 'width'>;
|
|
88
|
+
/** Slice role. If an onClick is provided, the slices will have the role `button`. For a navigation link, please use `getSliceAnchorProps` instead. */
|
|
89
|
+
sliceRole?: ArcProps['role'];
|
|
90
|
+
/** Define how to sort categories. */
|
|
91
|
+
sortingMethod?: SortingMethod;
|
|
92
|
+
/** Secondary text to be displayed in the middle of the chart, between the main text and subtext. Recommended to be used with donut variants only. */
|
|
93
|
+
middleText?: string | ReactElement | ((data: PieArcDatum<CategoryDatum>[], total: number) => string | ReactElement);
|
|
94
|
+
/** Secondary text to be displayed in the middle of the chart, above the main text. Recommended to be used with `donut` variants only. */
|
|
95
|
+
subtext?: string | ReactElement | ((data: PieArcDatum<CategoryDatum>[], total: number) => string | ReactElement);
|
|
96
|
+
/** Main text to be displayed in the middle of the chart. Recommended to be used with `donut` variants only. */
|
|
97
|
+
text?: string | ReactElement | ((data: PieArcDatum<CategoryDatum>[], total: number) => string | ReactElement);
|
|
98
|
+
/** Color palette to use. You can choose among the list of available color palette or also choose to use the success/warning/danger theme for which you have to specify which key corresponds to which status. */
|
|
99
|
+
colorTheme?: ChartTheme;
|
|
100
|
+
/** PieChart variant. */
|
|
101
|
+
variant?: PieChartVariant;
|
|
102
|
+
/** Method modifying what's displayed within the tooltip when the tooltipVariant is "custom". */
|
|
103
|
+
tooltipDecorator?: (data: ArcDatum, props?: {
|
|
104
|
+
index?: number;
|
|
105
|
+
isSelected?: boolean;
|
|
106
|
+
color?: string;
|
|
107
|
+
}) => string | ReactElement;
|
|
108
|
+
/** Tooltip variant. */
|
|
109
|
+
tooltipVariant?: TooltipVariant;
|
|
110
|
+
/** Theme. */
|
|
111
|
+
theme?: Theme;
|
|
112
|
+
}
|
|
113
|
+
type StyledPieChartProps = PieChartProps & {};
|
|
114
|
+
|
|
115
|
+
export { PieChartDimensions, PieChartLegendVariant, PieChartProps, PieChartVariant, StyledPieChartProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component variant.
|
|
3
|
+
*/
|
|
4
|
+
const PieChartVariant = {
|
|
5
|
+
plain: 'plain',
|
|
6
|
+
spaced: 'spaced',
|
|
7
|
+
donut: 'donut',
|
|
8
|
+
spacedDonut: 'spacedDonut'
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Component's labels variant.
|
|
12
|
+
*/
|
|
13
|
+
const PieChartLegendVariant = {
|
|
14
|
+
none: 'none',
|
|
15
|
+
internal: 'internal',
|
|
16
|
+
externalLabel: 'externalLabel',
|
|
17
|
+
externalLabelValue: 'externalLabelValue',
|
|
18
|
+
externalLabelPercent: 'externalLabelPercent',
|
|
19
|
+
custom: 'custom'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Component props.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export { PieChartLegendVariant, PieChartVariant };
|
|
27
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/PieChart/types.ts"],"sourcesContent":["import { ComponentProps, ReactElement, ReactNode } from 'react';\nimport { PieArcDatum as d3PieArcDatum } from 'd3-shape';\nimport {\n ChartDimensions,\n ChartSize,\n ChartTheme,\n ArcDatum,\n TooltipVariant,\n CategoryData,\n CategoryDatum,\n Statistics,\n} from '../../types';\nimport { Theme, ValueOf } from '@redsift/design-system';\nimport { ArcProps } from '../Arc';\nimport { ChartContainerProps } from '../ChartContainer';\nimport { LegendProps } from '../Legend';\nimport { SortingMethod } from '../../utils';\nimport { AnchorProps } from '../DataPoint';\n\n/**\n * Component variant.\n */\nexport const PieChartVariant = {\n plain: 'plain',\n spaced: 'spaced',\n donut: 'donut',\n spacedDonut: 'spacedDonut',\n} as const;\nexport type PieChartVariant = ValueOf<typeof PieChartVariant>;\n\n/**\n * Component's labels variant.\n */\nexport const PieChartLegendVariant = {\n none: 'none',\n internal: 'internal',\n externalLabel: 'externalLabel',\n externalLabelValue: 'externalLabelValue',\n externalLabelPercent: 'externalLabelPercent',\n custom: 'custom',\n} as const;\nexport type PieChartLegendVariant = ValueOf<typeof PieChartLegendVariant>;\n\ninterface LocaleText {\n emptyChartText: string;\n}\n\nexport type PieChartDimensions = ChartDimensions & {\n smallFontSize: number;\n fontSize: number;\n innerRadius: number;\n};\n\n/**\n * Component props.\n */\nexport interface PieChartProps extends ChartContainerProps {\n /** Number of categories to use, the rest being put into a new category called \"Others\". */\n caping?: number;\n /** Dataset to use to generate the chart, should be a list of objects containing a key and a value. */\n data?: CategoryData;\n /** Component to use if the chart is empty (replacing the default one). */\n emptyComponent?: ReactNode;\n /** Method used to define the anchor props to use when the slice is a navigation link. */\n getSliceAnchorProps?: (datum: ArcDatum) => AnchorProps;\n /** Whether the pie or donut is cut in half or not. */\n isHalf?: boolean;\n /** Method to determine whether a slice is selected or not. */\n isSliceSelected?: (datum: ArcDatum) => boolean | undefined;\n /** Method to override the data labels. */\n labelDecorator?: (\n datum: ArcDatum,\n props?: { index?: number; isSelected?: boolean; color?: string }\n ) => string | ReactElement;\n /** Method modifying what's displayed within the legend when the legendVariant is \"custom\". */\n legendDecorator?: (\n datum: ArcDatum,\n props?: { index?: number; isSelected?: boolean; color?: string }\n ) => string | ReactElement;\n /** Define whether the labels should be displayed inside or outside the charts and if they should contain raw or percentage values. If set to \"custom\", use `legendDecorator` to customize it. */\n legendVariant?: PieChartLegendVariant;\n /** Props to forward to the Legend block. Can be used to make the legend selectable. */\n legendProps?: Omit<LegendProps, 'data' | 'ref' | 'variant'> & { extraLegendItems?: Statistics };\n /** Labels and texts. */\n localeText?: LocaleText;\n /** Method to be called on a click on a slice. For a navigation link, please use `getSliceAnchorProps` instead. */\n onSliceClick?: (datum: ArcDatum) => void;\n /** Whether a category should be displayed for categories that has been removed by the caping option. Optionaly, this prop can be used to change the label of this category. */\n others?: boolean | string;\n /** PieChart size. */\n size?: ChartSize | PieChartDimensions;\n /** Native HTML props to forward to each slice. */\n sliceProps?: Omit<ComponentProps<'g'>, 'onClick' | 'ref' | 'width'>;\n /** Slice role. If an onClick is provided, the slices will have the role `button`. For a navigation link, please use `getSliceAnchorProps` instead. */\n sliceRole?: ArcProps['role'];\n /** Define how to sort categories. */\n sortingMethod?: SortingMethod;\n /** Secondary text to be displayed in the middle of the chart, between the main text and subtext. Recommended to be used with donut variants only. */\n middleText?: string | ReactElement | ((data: d3PieArcDatum<CategoryDatum>[], total: number) => string | ReactElement);\n /** Secondary text to be displayed in the middle of the chart, above the main text. Recommended to be used with `donut` variants only. */\n subtext?: string | ReactElement | ((data: d3PieArcDatum<CategoryDatum>[], total: number) => string | ReactElement);\n /** Main text to be displayed in the middle of the chart. Recommended to be used with `donut` variants only. */\n text?: string | ReactElement | ((data: d3PieArcDatum<CategoryDatum>[], total: number) => string | ReactElement);\n /** Color palette to use. You can choose among the list of available color palette or also choose to use the success/warning/danger theme for which you have to specify which key corresponds to which status. */\n colorTheme?: ChartTheme;\n /** PieChart variant. */\n variant?: PieChartVariant;\n /** Method modifying what's displayed within the tooltip when the tooltipVariant is \"custom\". */\n tooltipDecorator?: (\n data: ArcDatum,\n props?: { index?: number; isSelected?: boolean; color?: string }\n ) => string | ReactElement;\n /** Tooltip variant. */\n tooltipVariant?: TooltipVariant;\n /** Theme. */\n theme?: Theme;\n}\n\nexport type StyledPieChartProps = PieChartProps & {};\n"],"names":["PieChartVariant","plain","spaced","donut","spacedDonut","PieChartLegendVariant","none","internal","externalLabel","externalLabelValue","externalLabelPercent","custom"],"mappings":"AAmBA;AACA;AACA;AACO,MAAMA,eAAe,GAAG;AAC7BC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,WAAW,EAAE,aAAA;AACf,EAAU;AAGV;AACA;AACA;AACO,MAAMC,qBAAqB,GAAG;AACnCC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,EAAAA,aAAa,EAAE,eAAe;AAC9BC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,oBAAoB,EAAE,sBAAsB;AAC5CC,EAAAA,MAAM,EAAE,QAAA;AACV,EAAU;;AAaV;AACA;AACA;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ChartSize } from '../../types/size.js';
|
|
2
|
+
|
|
3
|
+
const sizeToDimension = (size, isHalf) => {
|
|
4
|
+
if (typeof size !== 'string') {
|
|
5
|
+
return size;
|
|
6
|
+
}
|
|
7
|
+
switch (size) {
|
|
8
|
+
case ChartSize.small:
|
|
9
|
+
return {
|
|
10
|
+
width: 200,
|
|
11
|
+
height: 200 * (isHalf ? 0.5 : 1),
|
|
12
|
+
smallFontSize: 13,
|
|
13
|
+
fontSize: 30,
|
|
14
|
+
innerRadius: 55
|
|
15
|
+
};
|
|
16
|
+
case ChartSize.large:
|
|
17
|
+
return {
|
|
18
|
+
width: 300,
|
|
19
|
+
height: 300 * (isHalf ? 0.5 : 1),
|
|
20
|
+
smallFontSize: 18,
|
|
21
|
+
fontSize: 38,
|
|
22
|
+
innerRadius: 80
|
|
23
|
+
};
|
|
24
|
+
case ChartSize.medium:
|
|
25
|
+
default:
|
|
26
|
+
return {
|
|
27
|
+
width: 240,
|
|
28
|
+
height: 240 * (isHalf ? 0.5 : 1),
|
|
29
|
+
smallFontSize: 14,
|
|
30
|
+
fontSize: 34,
|
|
31
|
+
innerRadius: 65
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { sizeToDimension };
|
|
37
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/PieChart/utils.ts"],"sourcesContent":["import { ChartSize } from '../../types';\nimport { PieChartDimensions } from './types';\n\nexport const sizeToDimension = (size: ChartSize | PieChartDimensions, isHalf?: boolean): PieChartDimensions => {\n if (typeof size !== 'string') {\n return size;\n }\n\n switch (size) {\n case ChartSize.small:\n return {\n width: 200,\n height: 200 * (isHalf ? 0.5 : 1),\n smallFontSize: 13,\n fontSize: 30,\n innerRadius: 55,\n };\n case ChartSize.large:\n return {\n width: 300,\n height: 300 * (isHalf ? 0.5 : 1),\n smallFontSize: 18,\n fontSize: 38,\n innerRadius: 80,\n };\n case ChartSize.medium:\n default:\n return {\n width: 240,\n height: 240 * (isHalf ? 0.5 : 1),\n smallFontSize: 14,\n fontSize: 34,\n innerRadius: 65,\n };\n }\n};\n"],"names":["sizeToDimension","size","isHalf","ChartSize","small","width","height","smallFontSize","fontSize","innerRadius","large","medium"],"mappings":";;MAGaA,eAAe,GAAGA,CAACC,IAAoC,EAAEC,MAAgB,KAAyB;AAC7G,EAAA,IAAI,OAAOD,IAAI,KAAK,QAAQ,EAAE;AAC5B,IAAA,OAAOA,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,QAAQA,IAAI;IACV,KAAKE,SAAS,CAACC,KAAK;MAClB,OAAO;AACLC,QAAAA,KAAK,EAAE,GAAG;QACVC,MAAM,EAAE,GAAG,IAAIJ,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC;AAChCK,QAAAA,aAAa,EAAE,EAAE;AACjBC,QAAAA,QAAQ,EAAE,EAAE;AACZC,QAAAA,WAAW,EAAE,EAAA;OACd,CAAA;IACH,KAAKN,SAAS,CAACO,KAAK;MAClB,OAAO;AACLL,QAAAA,KAAK,EAAE,GAAG;QACVC,MAAM,EAAE,GAAG,IAAIJ,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC;AAChCK,QAAAA,aAAa,EAAE,EAAE;AACjBC,QAAAA,QAAQ,EAAE,EAAE;AACZC,QAAAA,WAAW,EAAE,EAAA;OACd,CAAA;IACH,KAAKN,SAAS,CAACQ,MAAM,CAAA;AACrB,IAAA;MACE,OAAO;AACLN,QAAAA,KAAK,EAAE,GAAG;QACVC,MAAM,EAAE,GAAG,IAAIJ,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC;AAChCK,QAAAA,aAAa,EAAE,EAAE;AACjBC,QAAAA,QAAQ,EAAE,EAAE;AACZC,QAAAA,WAAW,EAAE,EAAA;OACd,CAAA;AACL,GAAA;AACF;;;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef, useRef, useEffect } from 'react';
|
|
3
|
+
import { scaleLinear } from 'd3';
|
|
4
|
+
import { StyledScatterPlot, StyledScatterPlotEmptyText } from './styles.js';
|
|
5
|
+
import { sizeToDimension } from './utils.js';
|
|
6
|
+
import { useTheme } from '@redsift/design-system';
|
|
7
|
+
import { Axis } from '../Axis/Axis.js';
|
|
8
|
+
|
|
9
|
+
const _excluded = ["className", "data", "emptyComponent", "localeText", "size"];
|
|
10
|
+
const EmptyScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
11
|
+
const {
|
|
12
|
+
className,
|
|
13
|
+
data: propsData,
|
|
14
|
+
emptyComponent,
|
|
15
|
+
localeText,
|
|
16
|
+
size
|
|
17
|
+
} = props,
|
|
18
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const cache = useRef();
|
|
21
|
+
const data = propsData;
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
cache.current = data;
|
|
24
|
+
});
|
|
25
|
+
const chartDimensions = sizeToDimension(size);
|
|
26
|
+
const width = chartDimensions.width;
|
|
27
|
+
const height = chartDimensions.height;
|
|
28
|
+
const margins = {
|
|
29
|
+
top: 16,
|
|
30
|
+
left: 48,
|
|
31
|
+
right: 16,
|
|
32
|
+
bottom: 48
|
|
33
|
+
};
|
|
34
|
+
const chartWidth = width - margins.left - margins.right;
|
|
35
|
+
return /*#__PURE__*/React__default.createElement(StyledScatterPlot, _extends({}, forwardedProps, {
|
|
36
|
+
className: className,
|
|
37
|
+
ref: ref
|
|
38
|
+
}), emptyComponent !== null && emptyComponent !== void 0 ? emptyComponent : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledScatterPlotEmptyText, {
|
|
39
|
+
$maxWidth: width,
|
|
40
|
+
$textSize: chartDimensions.fontSize / 2,
|
|
41
|
+
$theme: theme
|
|
42
|
+
}, /*#__PURE__*/React__default.createElement("span", null, localeText === null || localeText === void 0 ? void 0 : localeText.emptyChartText)), /*#__PURE__*/React__default.createElement("svg", {
|
|
43
|
+
width: width,
|
|
44
|
+
height: height
|
|
45
|
+
}, /*#__PURE__*/React__default.createElement("g", {
|
|
46
|
+
transform: `translate(${margins.left},${margins.top})`
|
|
47
|
+
}, /*#__PURE__*/React__default.createElement(Axis, {
|
|
48
|
+
position: "bottom",
|
|
49
|
+
length: width - 32,
|
|
50
|
+
scale: scaleLinear().domain([]).range([0, chartWidth]),
|
|
51
|
+
x: 0,
|
|
52
|
+
y: height,
|
|
53
|
+
tickValues: 4
|
|
54
|
+
})))));
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export { EmptyScatterPlot };
|
|
58
|
+
//# sourceMappingURL=EmptyScatterPlot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyScatterPlot.js","sources":["../../../src/components/ScatterPlot/EmptyScatterPlot.tsx"],"sourcesContent":["import React, { forwardRef, RefObject, useEffect, useRef } from 'react';\nimport { scaleLinear as d3scaleLinear } from 'd3';\n\nimport { AnyScale, JSONArray } from '../../types';\nimport { ScatterPlotProps } from './types';\nimport { StyledScatterPlot, StyledScatterPlotEmptyText } from './styles';\nimport { Axis } from '../Axis';\nimport { sizeToDimension } from './utils';\nimport { useTheme } from '@redsift/design-system';\n\nexport const EmptyScatterPlot = forwardRef<HTMLDivElement, ScatterPlotProps>((props, ref) => {\n const { className, data: propsData, emptyComponent, localeText, size, ...forwardedProps } = props;\n const theme = useTheme();\n\n const cache = useRef<JSONArray>();\n\n const data = propsData;\n\n useEffect(() => {\n cache.current = data;\n });\n\n const chartDimensions = sizeToDimension(size!);\n const width = chartDimensions.width;\n const height = chartDimensions.height;\n const margins = { top: 16, left: 48, right: 16, bottom: 48 };\n const chartWidth = width - margins.left - margins.right;\n\n return (\n <StyledScatterPlot {...forwardedProps} className={className} ref={ref as RefObject<HTMLDivElement>}>\n {emptyComponent ?? (\n <>\n <StyledScatterPlotEmptyText $maxWidth={width} $textSize={chartDimensions.fontSize / 2} $theme={theme}>\n <span>{localeText?.emptyChartText}</span>\n </StyledScatterPlotEmptyText>\n <svg width={width} height={height}>\n <g transform={`translate(${margins.left},${margins.top})`}>\n <Axis\n position=\"bottom\"\n length={width - 32}\n scale={d3scaleLinear().domain([]).range([0, chartWidth]) as AnyScale}\n x={0}\n y={height}\n tickValues={4}\n />\n </g>\n </svg>\n </>\n )}\n </StyledScatterPlot>\n );\n});\n"],"names":["EmptyScatterPlot","forwardRef","props","ref","className","data","propsData","emptyComponent","localeText","size","forwardedProps","_objectWithoutProperties","_excluded","theme","useTheme","cache","useRef","useEffect","current","chartDimensions","sizeToDimension","width","height","margins","top","left","right","bottom","chartWidth","React","createElement","StyledScatterPlot","_extends","Fragment","StyledScatterPlotEmptyText","$maxWidth","$textSize","fontSize","$theme","emptyChartText","transform","Axis","position","length","scale","d3scaleLinear","domain","range","x","y","tickValues"],"mappings":";;;;;;;;;AAUO,MAAMA,gBAAgB,gBAAGC,UAAU,CAAmC,CAACC,KAAK,EAAEC,GAAG,KAAK;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ACC,IAAAA,SAAS,EAAEd,KAAM;AAACe,IAAAA,SAAS,EAAEjB,eAAe,CAACkB,QAAQ,GAAG,CAAE;AAACC,IAAAA,MAAM,EAAEzB,KAAAA;AAAM,GAAA,eACnGgB,cAAA,CAAAC,aAAA,CAAOtB,MAAAA,EAAAA,IAAAA,EAAAA,UAAU,aAAVA,UAAU,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAVA,UAAU,CAAE+B,cAAqB,CACd,CAAC,eAC7BV,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKT,IAAAA,KAAK,EAAEA,KAAM;AAACC,IAAAA,MAAM,EAAEA,MAAAA;GACzBO,eAAAA,cAAA,CAAAC,aAAA,CAAA,GAAA,EAAA;IAAGU,SAAS,EAAG,aAAYjB,OAAO,CAACE,IAAK,CAAGF,CAAAA,EAAAA,OAAO,CAACC,GAAI,CAAA,CAAA,CAAA;AAAG,GAAA,eACxDK,cAAA,CAAAC,aAAA,CAACW,IAAI,EAAA;AACHC,IAAAA,QAAQ,EAAC,QAAQ;IACjBC,MAAM,EAAEtB,KAAK,GAAG,EAAG;AACnBuB,IAAAA,KAAK,EAAEC,WAAa,EAAE,CAACC,MAAM,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,EAAEnB,UAAU,CAAC,CAAc;AACrEoB,IAAAA,CAAC,EAAE,CAAE;AACLC,IAAAA,CAAC,EAAE3B,MAAO;AACV4B,IAAAA,UAAU,EAAE,CAAA;AAAE,GACf,CACA,CACA,CACL,CAEa,CAAC,CAAA;AAExB,CAAC;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef } from 'react';
|
|
3
|
+
import { StyledScatterPlot } from './styles.js';
|
|
4
|
+
|
|
5
|
+
const _excluded = ["className"];
|
|
6
|
+
const LoadingScatterPlot = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
const {
|
|
8
|
+
className
|
|
9
|
+
} = props,
|
|
10
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
11
|
+
return /*#__PURE__*/React__default.createElement(StyledScatterPlot, _extends({}, forwardedProps, {
|
|
12
|
+
className: className,
|
|
13
|
+
ref: ref
|
|
14
|
+
}), "Loading...");
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { LoadingScatterPlot };
|
|
18
|
+
//# sourceMappingURL=LoadingScatterPlot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingScatterPlot.js","sources":["../../../src/components/ScatterPlot/LoadingScatterPlot.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\n\nimport { ScatterPlotProps } from './types';\nimport { StyledScatterPlot } from './styles';\n\nexport const LoadingScatterPlot = forwardRef<HTMLDivElement, ScatterPlotProps>(\n (props, ref) => {\n const { className, ...forwardedProps } = props;\n\n return (\n <StyledScatterPlot\n {...forwardedProps}\n className={className}\n ref={ref as RefObject<HTMLDivElement>}\n >\n Loading...\n </StyledScatterPlot>\n );\n }\n);\n"],"names":["LoadingScatterPlot","forwardRef","props","ref","className","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","StyledScatterPlot","_extends"],"mappings":";;;;;AAKO,MAAMA,kBAAkB,gBAAGC,UAAU,CAC1C,CAACC,KAAK,EAAEC,GAAG,KAAK;EACd,MAAM;AAAEC,MAAAA,SAAAA;AAA6B,KAAC,GAAGF,KAAK;AAAxBG,IAAAA,cAAc,GAAAC,wBAAA,CAAKJ,KAAK,EAAAK,SAAA,CAAA,CAAA;EAE9C,oBACEC,cAAA,CAAAC,aAAA,CAACC,iBAAiB,EAAAC,QAAA,KACZN,cAAc,EAAA;AAClBD,IAAAA,SAAS,EAAEA,SAAU;AACrBD,IAAAA,GAAG,EAAEA,GAAAA;AAAiC,GAAA,CAAA,EACvC,YAEkB,CAAC,CAAA;AAExB,CACF;;;;"}
|