@semcore/d3-chart 17.3.0 → 17.3.1-prerelease.11
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/CHANGELOG.md +9 -0
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +16 -16
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +14 -14
- package/lib/cjs/CompactHorizontalBar.js +16 -16
- package/lib/cjs/Donut.js +9 -9
- package/lib/cjs/Dots.js +8 -8
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +3 -3
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +2 -2
- package/lib/cjs/Radar.js +19 -19
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +9 -9
- package/lib/cjs/Venn.js +9 -9
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +5 -5
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +41 -7
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/cjs/component/Cigarette/Cigarette.js +9 -12
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/style/bar.shadow.css +2 -1
- package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/types/Line.d.js.map +1 -1
- package/lib/cjs/types/Plot.d.js.map +1 -1
- package/lib/cjs/types/Radar.d.js.map +1 -1
- package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/cjs/types/Tooltip.d.js.map +1 -1
- package/lib/cjs/types/Venn.d.js.map +1 -1
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +16 -16
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +14 -14
- package/lib/es6/CompactHorizontalBar.js +16 -16
- package/lib/es6/Donut.js +9 -9
- package/lib/es6/Dots.js +8 -8
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +3 -3
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +2 -2
- package/lib/es6/Radar.js +19 -19
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +9 -9
- package/lib/es6/Venn.js +9 -9
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +5 -5
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +41 -7
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/es6/component/Cigarette/Cigarette.js +9 -12
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/style/bar.shadow.css +2 -1
- package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/types/Line.d.js.map +1 -1
- package/lib/es6/types/Plot.d.js.map +1 -1
- package/lib/es6/types/Radar.d.js.map +1 -1
- package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/es6/types/Tooltip.d.js.map +1 -1
- package/lib/es6/types/Venn.d.js.map +1 -1
- package/lib/esm/Area.mjs +12 -12
- package/lib/esm/Axis.mjs +17 -17
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +15 -15
- package/lib/esm/CompactHorizontalBar.mjs +17 -17
- package/lib/esm/Donut.mjs +10 -10
- package/lib/esm/Dots.mjs +9 -9
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +4 -4
- package/lib/esm/Line.mjs +10 -10
- package/lib/esm/Plot.mjs +3 -3
- package/lib/esm/Radar.mjs +20 -20
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ScatterPlot.mjs +10 -10
- package/lib/esm/Tooltip.mjs +10 -10
- package/lib/esm/Venn.mjs +10 -10
- package/lib/esm/a11y/PlotA11yModule.mjs +3 -3
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +6 -6
- package/lib/esm/component/Chart/CigaretteChart.mjs +41 -7
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +18 -18
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +7 -7
- package/lib/esm/component/Cigarette/Cigarette.mjs +9 -12
- package/lib/esm/style/bar.shadow.css +2 -1
- package/lib/types/CompactHorizontalBar.d.ts +8 -8
- package/lib/types/Hover.d.ts +2 -2
- package/lib/types/Line.d.ts +2 -2
- package/lib/types/Pattern.d.ts +1 -0
- package/lib/types/Pattern.d.ts.map +1 -0
- package/lib/types/Plot.d.ts +2 -2
- package/lib/types/Radar.d.ts +2 -2
- package/lib/types/RadialTree.d.ts +1 -0
- package/lib/types/RadialTree.d.ts.map +1 -0
- package/lib/types/ResponsiveContainer.d.ts +2 -2
- package/lib/types/Tooltip.d.ts +9 -9
- package/lib/types/Venn.d.ts +3 -3
- package/lib/types/a11y/DataAccessibilityTable.d.ts +1 -0
- package/lib/types/a11y/DataAccessibilityTable.d.ts.map +1 -0
- package/lib/types/a11y/PlotA11yModule.d.ts +1 -0
- package/lib/types/a11y/PlotA11yModule.d.ts.map +1 -0
- package/lib/types/a11y/PlotA11yView.d.ts +1 -0
- package/lib/types/a11y/PlotA11yView.d.ts.map +1 -0
- package/lib/types/a11y/bezier.d.ts +1 -0
- package/lib/types/a11y/bezier.d.ts.map +1 -0
- package/lib/types/a11y/focus.d.ts +1 -0
- package/lib/types/a11y/focus.d.ts.map +1 -0
- package/lib/types/a11y/hints.d.ts +1 -0
- package/lib/types/a11y/hints.d.ts.map +1 -0
- package/lib/types/a11y/insights.d.ts +1 -0
- package/lib/types/a11y/insights.d.ts.map +1 -0
- package/lib/types/a11y/intl.d.ts +1 -0
- package/lib/types/a11y/intl.d.ts.map +1 -0
- package/lib/types/a11y/locale.d.ts +1 -0
- package/lib/types/a11y/locale.d.ts.map +1 -0
- package/lib/types/a11y/serialize.d.ts +1 -0
- package/lib/types/a11y/serialize.d.ts.map +1 -0
- package/lib/types/a11y/summarize.d.ts +1 -0
- package/lib/types/a11y/summarize.d.ts.map +1 -0
- package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +1 -0
- package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts.map +1 -0
- package/lib/types/a11y/translations/view/__intergalactic-dynamic-locales.d.ts +1 -0
- package/lib/types/a11y/translations/view/__intergalactic-dynamic-locales.d.ts.map +1 -0
- package/lib/types/component/Chart/AbstractChart.d.ts +2 -1
- package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -0
- package/lib/types/component/Chart/AbstractChart.type.d.ts +3 -2
- package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/AreaChart.d.ts +1 -0
- package/lib/types/component/Chart/AreaChart.d.ts.map +1 -0
- package/lib/types/component/Chart/AreaChart.type.d.ts +1 -0
- package/lib/types/component/Chart/AreaChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/BarChart.d.ts +1 -0
- package/lib/types/component/Chart/BarChart.d.ts.map +1 -0
- package/lib/types/component/Chart/BarChart.type.d.ts +1 -0
- package/lib/types/component/Chart/BarChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/BubbleChart.d.ts +1 -0
- package/lib/types/component/Chart/BubbleChart.d.ts.map +1 -0
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -0
- package/lib/types/component/Chart/BubbleChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/CigaretteChart.d.ts +1 -0
- package/lib/types/component/Chart/CigaretteChart.d.ts.map +1 -0
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +1 -0
- package/lib/types/component/Chart/CigaretteChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts +1 -0
- package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts.map +1 -0
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -0
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/DonutChart.d.ts +1 -0
- package/lib/types/component/Chart/DonutChart.d.ts.map +1 -0
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -0
- package/lib/types/component/Chart/DonutChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/HistogramChart.d.ts +1 -0
- package/lib/types/component/Chart/HistogramChart.d.ts.map +1 -0
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -0
- package/lib/types/component/Chart/HistogramChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/LineChart.d.ts +1 -0
- package/lib/types/component/Chart/LineChart.d.ts.map +1 -0
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -0
- package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/RadarChart.d.ts +1 -0
- package/lib/types/component/Chart/RadarChart.d.ts.map +1 -0
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -0
- package/lib/types/component/Chart/RadarChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/ScatterPlotChart.d.ts +1 -0
- package/lib/types/component/Chart/ScatterPlotChart.d.ts.map +1 -0
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -0
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/VennChart.d.ts +1 -0
- package/lib/types/component/Chart/VennChart.d.ts.map +1 -0
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -0
- package/lib/types/component/Chart/VennChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/index.d.ts +1 -0
- package/lib/types/component/Chart/index.d.ts.map +1 -0
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -0
- package/lib/types/component/ChartLegend/BaseLegend.d.ts.map +1 -0
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +4 -3
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts.map +1 -0
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.d.ts +1 -0
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.d.ts.map +1 -0
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +4 -3
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts.map +1 -0
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts +1 -0
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts.map +1 -0
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -0
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts.map +1 -0
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts +1 -0
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts.map +1 -0
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -0
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts.map +1 -0
- package/lib/types/component/ChartLegend/index.d.ts +1 -0
- package/lib/types/component/ChartLegend/index.d.ts.map +1 -0
- package/lib/types/component/Cigarette/Cigarette.d.ts +1 -0
- package/lib/types/component/Cigarette/Cigarette.d.ts.map +1 -0
- package/lib/types/component/StackGroupBar/StackGroupBar.d.ts +1 -0
- package/lib/types/component/StackGroupBar/StackGroupBar.d.ts.map +1 -0
- package/lib/types/component/StackGroupBar/StackGroupBar.type.d.ts +1 -0
- package/lib/types/component/StackGroupBar/StackGroupBar.type.d.ts.map +1 -0
- package/lib/types/component/SvgElement.d.ts +1 -0
- package/lib/types/component/SvgElement.d.ts.map +1 -0
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +1 -0
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts.map +1 -0
- package/lib/types/utils.d.ts +1 -0
- package/lib/types/utils.d.ts.map +1 -0
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CigaretteChart.js","names":["_core","require","_baseComponents","_i18nEnhance","_interopRequireDefault","_resolveColorEnhance","_rafTrottle","_uniqueID","_divider","_typography","_d3Scale","_react","_","_AbstractChart","_AnimatedClipPath","_intergalacticDynamicLocales","_utils","_Cigarette","DEFAULT_MINIMAL_BAR_WIDTH","DEFAULT_GAP","CigaretteChartComponent","AbstractChart","constructor","props","_defineProperty2","default","React","createRef","trottle","event","plotRef","current","pX","pY","eventToPoint","setState","state","activeDataDefinitions","dataDefinitions","filter","checked","activePositiveDataDefinitions","data","asProps","id","itemValue","resolveColor","index","colorMap","getDefaultDataDefinitions","map","dataDef","columns","slice","defaultLegendProps","legendType","w","totalValue","reduce","acc","computeCigaretteItems","invertAxis","minimalBarWidth","plotWidth","plotHeight","reverse","count","length","totalGapWidth","Math","max","availableSpace","dataDefinitionsItemSize","result","dd","value","dataWidth","visualWidth","isMinVisible","smallItems","r","extraNeeded","smallItem","donors","donorCapacity","s","d","donor","available","share","taken","xScale","scaleLinear","yScale","renderChart","uid","duration","patterns","onClick","highlightedLine","offset","items","createElement","Fragment","item","interpolateValue","height","width","y","x","key","dataKey","hide","color","direction","hovered","undefined","renderTooltip","_ref","tooltipTitle","tooltipViewType","showPercentValueInTooltip","styles","showTooltip","STooltipChildrenWrapper","Box","HoverRect","Tooltip","wMin","hideHoverLine","xIndex","visualScale","yIndex","tooltipProps","_ref4","showPercentColumn","_ref3","find","dataDefItem","children","sstyled","cn","assignProps","Dot","mr","label","Text","percentValue","tooltipValueFormatter","Flex","Title","style","opacity","textAlign","bold","renderTooltipTotalLine","percentFormatter","total","rawPercent","formattedPercent","round","NOT_A_VALUE","dataItem","showTotalInTooltip","mt","Number","isNaN","renderHeader","header","render","_ref2","_ref6","SChart","a11yAltTextConfig","_ref5","chartRef","Plot","dataHints","onPlotMouseMove","onPlotMouseLeave","renderLegend","getLegendAriaLabel","getI18nText","chartType","cigaretteItems","range","domain","push","lastAddedDomain","scaleThreshold","showXAxis","showYAxis","showLegend","marginX","marginY","resolveColorEnhance","uniqueIDEnhancement","i18nEnhance","localizedMessages","CigaretteChart","exports","createComponent"],"sources":["../../../../src/component/Chart/CigaretteChart.tsx"],"sourcesContent":["import { Box, Flex } from '@semcore/base-components';\nimport { createComponent, Root, sstyled } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport trottle from '@semcore/core/lib/utils/rafTrottle';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport Divider from '@semcore/divider';\nimport { Text } from '@semcore/typography';\nimport { scaleThreshold, scaleLinear, scaleBand } from 'd3-scale';\nimport React from 'react';\n\nimport type { CigaretteChartData, CigaretteChartDataKey, CigaretteChartDefaultProps, CigaretteChartProps, CigaretteChartType } from './CigaretteChart.type';\n// @ts-ignore\nimport { HoverRect, Plot } from '../..';\nimport type { ChartState } from './AbstractChart';\nimport { AbstractChart, NOT_A_VALUE } from './AbstractChart';\nimport type { ObjectData } from './AbstractChart.type';\n// @ts-ignore\nimport AnimatedClipPath from '../../AnimatedClipPath';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport { eventToPoint, interpolateValue } from '../../utils';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\nimport Cigarette from '../Cigarette/Cigarette';\n\nconst DEFAULT_MINIMAL_BAR_WIDTH = 2;\nconst DEFAULT_GAP = 2;\n\ntype ScaleThresholdConfig = { range: Array<CigaretteChartDataKey>; domain: Array<number> };\n\ntype CigaretteChartState = ChartState & {\n pX: number | null;\n pY: number | null;\n};\n\nclass CigaretteChartComponent extends AbstractChart<\n CigaretteChartData,\n CigaretteChartProps,\n typeof CigaretteChartComponent.enhance,\n {},\n CigaretteChartState,\n CigaretteChartDefaultProps\n> {\n static displayName = 'Cigarette.Bar';\n\n static defaultProps = (props: CigaretteChartProps) => {\n const invertAxis = props.invertAxis ?? true;\n return {\n invertAxis,\n showXAxis: false,\n showYAxis: false,\n showTooltip: true,\n showLegend: false,\n marginX: 0,\n marginY: 0,\n duration: 500,\n plotWidth: !invertAxis && !props.plotWidth ? 44 : props.plotWidth,\n plotHeight: invertAxis && !props.plotHeight ? 28 : props.plotHeight,\n showPercentValueInTooltip: false,\n minimalBarWidth: DEFAULT_MINIMAL_BAR_WIDTH,\n direction: invertAxis ? 'column' : 'row',\n } as const;\n };\n\n static enhance = [\n resolveColorEnhance(),\n uniqueIDEnhancement(),\n i18nEnhance(localizedMessages),\n ] as const;\n\n constructor(props: CigaretteChartProps) {\n super(props);\n\n this.state = {\n ...this.state,\n pX: null,\n pY: null,\n };\n }\n\n private plotRef = React.createRef<SVGElement>();\n\n protected override plotPadding = 0;\n\n private offset = 0;\n\n private get activeDataDefinitions() {\n const { dataDefinitions } = this.state;\n\n return dataDefinitions.filter(({ checked }) => checked);\n }\n\n private get activePositiveDataDefinitions() {\n const { data } = this.asProps;\n\n return this.activeDataDefinitions.filter(({ id }) => {\n const itemValue = data[id];\n\n return typeof itemValue === 'number' && itemValue > 0;\n });\n }\n\n protected override resolveColor(id: string, index: number) {\n return this.props.colorMap?.[id] ?? `blue-${5 - index}00`;\n }\n\n protected override getDefaultDataDefinitions(): Array<\n LegendItem & { columns: React.ReactNode[] }\n > {\n const dataDefinitions = super.getDefaultDataDefinitions();\n\n return dataDefinitions.map((dataDef) => {\n dataDef.columns = dataDef.columns.slice(1);\n return dataDef;\n });\n }\n\n protected override defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n w: 'fit-content',\n };\n }\n\n private onPlotMouseMove = trottle((event: React.MouseEvent<HTMLElement>) => {\n if (!this.plotRef.current) return;\n\n const [pX, pY] = eventToPoint(event, this.plotRef.current);\n\n this.setState(() => ({ pX, pY }));\n });\n\n private onPlotMouseLeave = trottle(() => {\n this.setState(() => ({ pX: null, pY: null }));\n });\n\n protected override totalValue() {\n const { data } = this.asProps;\n\n return this.activeDataDefinitions.reduce((acc, { id }) => {\n const itemValue = data[id];\n\n if (typeof itemValue === 'number') {\n acc += itemValue;\n }\n\n return acc;\n }, 0);\n }\n\n private computeCigaretteItems() {\n const { data, invertAxis, minimalBarWidth } = this.asProps;\n const { plotWidth, plotHeight } = this;\n\n const dataDefinitions = invertAxis\n ? this.activeDataDefinitions\n : [...this.activeDataDefinitions].reverse();\n\n const count = this.activePositiveDataDefinitions.length;\n const totalGapWidth = DEFAULT_GAP * Math.max(0, count - 1);\n const availableSpace = Math.max(0, (invertAxis ? plotWidth : plotHeight) - totalGapWidth);\n\n const totalValue = this.totalValue();\n\n const dataDefinitionsItemSize = dataDefinitions.map(({ id }) => {\n if (totalValue === 0) {\n return 0;\n }\n\n const itemValue = data[id];\n\n if (typeof itemValue !== 'number') return 0;\n\n return (itemValue / totalValue) * availableSpace;\n });\n\n const result = dataDefinitions.map((dd, index) => ({\n ...dd,\n value: data[dd.id],\n dataWidth: dataDefinitionsItemSize[index],\n visualWidth: dataDefinitionsItemSize[index],\n isMinVisible: false,\n }));\n\n const smallItems = result.filter((r) => {\n const { value, dataWidth } = r;\n\n if (typeof value !== 'number') return false;\n\n return value > 0 && dataWidth < minimalBarWidth;\n });\n\n if (smallItems.length === 0) return result;\n\n let extraNeeded = 0;\n\n for (const smallItem of smallItems) {\n extraNeeded += minimalBarWidth - smallItem.dataWidth;\n smallItem.visualWidth = minimalBarWidth;\n smallItem.isMinVisible = true;\n }\n\n const donors = result.filter((r) => !r.isMinVisible && r.dataWidth > minimalBarWidth);\n const donorCapacity = donors.reduce(\n (s, d) => s + (d.dataWidth - minimalBarWidth),\n 0,\n );\n\n for (const donor of donors) {\n const available = donor.dataWidth - minimalBarWidth;\n const share = available / donorCapacity;\n const taken = share * extraNeeded;\n donor.visualWidth = donor.dataWidth - taken;\n }\n\n return result;\n };\n\n get xScale() {\n const { plotWidth } = this;\n\n return scaleLinear([0, plotWidth]);\n }\n\n get yScale() {\n const { plotHeight } = this;\n\n return scaleLinear([plotHeight, 0]);\n }\n\n renderChart() {\n const { invertAxis, data, uid, duration, patterns, onClick } =\n this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n const { plotWidth, plotHeight } = this;\n\n this.offset = 0;\n\n const items = this.computeCigaretteItems();\n\n return (\n <>\n {items.map((item, index) => {\n const { visualWidth, id } = item;\n const value = data[id];\n\n if (value === interpolateValue || value === null) {\n return null;\n }\n\n const height = invertAxis ? plotHeight - DEFAULT_GAP * 2 : plotWidth - DEFAULT_GAP * 2;\n const width = visualWidth;\n const y = DEFAULT_GAP;\n const x = this.offset;\n const r = height < 28 ? 2 : 4;\n\n this.offset += visualWidth;\n\n if (index < items.length - 1) {\n this.offset += DEFAULT_GAP;\n }\n\n return (\n <Cigarette\n key={item.id}\n dataKey={item.id}\n index={index}\n y={invertAxis ? y : x}\n x={invertAxis ? x : y}\n width={invertAxis ? width : height}\n height={invertAxis ? height : width}\n uid={uid}\n hide={!item.checked}\n duration={duration}\n r={index === 0 || index === dataDefinitions.length - 1 ? r : 0}\n color={item.color}\n patterns={patterns}\n direction={invertAxis ? 'horizontal' : 'vertical'}\n onClick={onClick}\n hovered={\n highlightedLine === index ? true : highlightedLine === -1 ? undefined : false\n }\n />\n );\n })}\n\n <AnimatedClipPath\n aria-hidden\n duration={duration}\n id={uid}\n x='0'\n y='0'\n width={invertAxis ? 0 : plotWidth}\n height={invertAxis ? plotHeight : 0}\n />\n </>\n );\n }\n\n renderTooltip(): React.ReactNode {\n const { data, invertAxis, tooltipTitle, tooltipViewType, showPercentValueInTooltip, styles, showTooltip } =\n this.asProps;\n const { dataDefinitions, pX, pY } = this.state;\n const STooltipChildrenWrapper = Root;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <HoverRect.Tooltip\n x={invertAxis ? '' : undefined}\n y={invertAxis ? undefined : ''}\n wMin={100}\n hideHoverLine={true}\n xIndex={pX !== null ? this.visualScale(pX) : undefined}\n yIndex={pY !== null ? this.visualScale(pY) : undefined}\n >\n {(tooltipProps: any) => {\n const dataKey = invertAxis ? tooltipProps.xIndex : tooltipProps.yIndex;\n const showPercentColumn = showPercentValueInTooltip && this.totalValue() !== 0;\n\n if (tooltipViewType === 'single') {\n const item = dataDefinitions.find((dataDefItem) => dataDefItem.id === dataKey);\n if (!item) {\n return {\n children: null,\n };\n }\n\n return {\n children: sstyled(styles)(\n <STooltipChildrenWrapper render={Box} columnsCount={showPercentColumn ? '3' : '2'} __excludeProps={['data']}>\n <HoverRect.Tooltip.Dot mr={2} color={item.color}>\n {item.label}\n </HoverRect.Tooltip.Dot>\n { showPercentColumn && <Text textAlign='end' color='text-secondary'>{this.percentValue(data, item.id)}</Text> }\n <Text textAlign='end' bold>{this.tooltipValueFormatter(data[item.id])}</Text>\n </STooltipChildrenWrapper>,\n ),\n };\n }\n\n return {\n children: sstyled(styles)(\n <Flex direction='column'>\n {tooltipTitle && (\n <HoverRect.Tooltip.Title>Some tooltip title</HoverRect.Tooltip.Title>\n )}\n\n <STooltipChildrenWrapper render={Box} columnsCount={showPercentColumn ? '3' : '2'} __excludeProps={['data']}>\n {dataDefinitions.map((item) => {\n const style = { opacity: item.id === dataKey ? 1 : 0.3 };\n return (\n item.checked && (\n <React.Fragment key={item.id}>\n <HoverRect.Tooltip.Dot mr={2} color={item.color} style={style}>\n {item.label}\n </HoverRect.Tooltip.Dot>\n { showPercentColumn && <Text textAlign='end' color='text-secondary' style={style}>{this.percentValue(data, item.id)}</Text> }\n <Text textAlign='end' bold style={style}>{this.tooltipValueFormatter(data[item.id])}</Text>\n </React.Fragment>\n )\n );\n })}\n\n {this.renderTooltipTotalLine(data)}\n </STooltipChildrenWrapper>\n </Flex>,\n ),\n };\n }}\n </HoverRect.Tooltip>\n );\n }\n\n protected percentValue(data: ObjectData, key: string): string {\n const { percentFormatter } = this.asProps;\n\n const total = this.totalValue();\n\n const value = data[key];\n\n if (typeof value === 'number' && total !== 0) {\n const rawPercent = (100 * value) / total;\n const formattedPercent = percentFormatter ? percentFormatter(rawPercent) : Math.round(rawPercent);\n\n return `${formattedPercent}%`;\n }\n\n if (value === null) {\n return `0%`;\n }\n\n return NOT_A_VALUE;\n }\n\n protected override renderTooltipTotalLine<D extends ObjectData>(dataItem: D) {\n const { showTotalInTooltip, showPercentValueInTooltip } = this.asProps;\n\n if (!showTotalInTooltip) {\n return null;\n }\n\n const total = this.totalValue();\n\n return (\n <>\n <Box mt={2} mr={2}>Total</Box>\n { showPercentValueInTooltip && total !== 0 && <Text mt={2} textAlign='end' color='text-secondary'>{Number.isNaN(total) ? NOT_A_VALUE : '100%'}</Text> }\n <Text mt={2} textAlign='end' bold>{Number.isNaN(total) ? NOT_A_VALUE : total}</Text>\n </>\n );\n }\n\n renderHeader() {\n return this.asProps.header ?? null;\n }\n\n override render() {\n const SChart = Root;\n const { styles, data, patterns, direction, invertAxis, a11yAltTextConfig } = this.asProps;\n const { plotWidth, plotHeight } = this;\n const header = this.renderHeader();\n\n if (invertAxis) {\n return sstyled(styles)(\n <SChart render={Flex} gap={6} direction={direction} __excludeProps={['onClick', 'data']} ref={this.chartRef}>\n <Flex direction='column'>\n {header}\n <Plot\n ref={this.plotRef}\n data={data}\n scale={[this.xScale, this.yScale]}\n width={plotWidth}\n height={plotHeight}\n dataHints={this.dataHints}\n patterns={patterns}\n a11yAltTextConfig={a11yAltTextConfig}\n onMouseMove={this.onPlotMouseMove}\n onMouseLeave={this.onPlotMouseLeave}\n >\n {this.renderTooltip()}\n {this.renderChart()}\n </Plot>\n </Flex>\n {this.renderLegend()}\n </SChart>,\n );\n }\n\n return sstyled(styles)(\n <SChart render={Flex} gap={6} __excludeProps={['onClick', 'data']} ref={this.chartRef}>\n <Plot\n ref={this.plotRef}\n data={data}\n scale={[this.xScale, this.yScale]}\n width={plotWidth}\n height={plotHeight}\n dataHints={this.dataHints}\n patterns={patterns}\n a11yAltTextConfig={a11yAltTextConfig}\n onMouseMove={this.onPlotMouseMove}\n onMouseLeave={this.onPlotMouseLeave}\n >\n {this.renderTooltip()}\n {this.renderChart()}\n </Plot>\n <Flex direction='column' gap={2}>\n {header && (\n <>\n <Box>{header}</Box>\n <Divider />\n </>\n )}\n {this.renderLegend()}\n </Flex>\n </SChart>,\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Cigarette' });\n }\n\n private get visualScale() {\n const cigaretteItems = this.computeCigaretteItems();\n\n const { range, domain } = cigaretteItems.reduce<ScaleThresholdConfig>((acc, { id, visualWidth }, index) => {\n const { range, domain } = acc;\n\n if (visualWidth) {\n range.push(id);\n\n if (domain.length === 0) {\n domain.push(visualWidth + DEFAULT_GAP);\n\n return acc;\n }\n\n if (index !== cigaretteItems.length - 1) {\n const lastAddedDomain = domain[domain.length - 1];\n domain.push(lastAddedDomain + visualWidth + DEFAULT_GAP);\n }\n }\n\n return acc;\n }, { range: [], domain: [] });\n\n return scaleThreshold(domain, range);\n }\n}\n\n/**\n * CigaretteChart\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/cigarette-chart/cigarette-chart-api/|API} | {@link https://developer.semrush.com/intergalactic/data-display/cigarette-chart/cigarette-chart-code/|Examples}\n */\nexport const CigaretteChart = createComponent<\n CigaretteChartType,\n typeof CigaretteChartComponent\n>(CigaretteChartComponent);\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,WAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,SAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,QAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAP,sBAAA,CAAAH,OAAA;AAIA,IAAAW,CAAA,GAAAX,OAAA;AAEA,IAAAY,cAAA,GAAAZ,OAAA;AAGA,IAAAa,iBAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,4BAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AAEA,IAAAgB,UAAA,GAAAb,sBAAA,CAAAH,OAAA;AAVA;;AAKA;;AAOA,MAAMiB,yBAAyB,GAAG,CAAC;AACnC,MAAMC,WAAW,GAAG,CAAC;AASrB,MAAMC,uBAAuB,SAASC,4BAAa,CAOjD;EA4BAC,WAAWA,CAACC,KAA0B,EAAE;IACtC,KAAK,CAACA,KAAK,CAAC;IAAC,IAAAC,gBAAA,CA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ACyC,UAAU,GAAG,EAAE,GAAGzC,KAAK,CAACyC,UAAU;IACnEyD,yBAAyB,EAAE,KAAK;IAChC3D,eAAe,EAAE5C,yBAAyB;IAC1CgG,SAAS,EAAErD,UAAU,GAAG,QAAQ,GAAG;EACrC,CAAC;AACH,CAAC;AAAA,IAAArC,gBAAA,CAAAC,OAAA,EA3BGL,uBAAuB,aA6BV,CACf,IAAA+K,4BAAmB,EAAC,CAAC,EACrB,IAAAC,iBAAmB,EAAC,CAAC,EACrB,IAAAC,oBAAW,EAACC,8CAAiB,CAAC,CAC/B;AAkcI,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,qBAAe,EAG3CrL,uBAAuB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"CigaretteChart.js","names":["_core","require","_baseComponents","_i18nEnhance","_interopRequireDefault","_resolveColorEnhance","_rafTrottle","_uniqueID","_divider","_typography","_d3Scale","_react","_","_AbstractChart","_AnimatedClipPath","_intergalacticDynamicLocales","_utils","_Cigarette","DEFAULT_MINIMAL_BAR_WIDTH","DEFAULT_GAP","CigaretteChartComponent","AbstractChart","constructor","props","_defineProperty2","default","React","createRef","trottle","event","plotRef","current","pX","pY","eventToPoint","setState","state","activeDataDefinitions","dataDefinitions","filter","checked","activePositiveDataDefinitions","data","asProps","id","itemValue","resolveColor","index","colorMap","getDefaultDataDefinitions","map","dataDef","columns","slice","defaultLegendProps","legendType","w","totalValue","reduce","acc","computeCigaretteItems","invertAxis","minimalBarWidth","plotWidth","plotHeight","reverse","count","length","totalGapWidth","Math","max","availableSpace","dataDefinitionsItemSize","result","dd","value","dataWidth","visualWidth","isMinVisible","smallItems","r","extraNeeded","smallItem","donors","donorCapacity","s","d","donor","available","share","taken","xScale","scaleLinear","yScale","isNoData","items","noData","every","item","interpolateValue","renderChart","uid","duration","patterns","onClick","highlightedLine","offset","height","width","y","x","createElement","Fragment","key","hide","color","direction","hovered","dataKey","undefined","renderTooltip","_ref","tooltipTitle","tooltipViewType","showPercentValueInTooltip","styles","showTooltip","STooltipChildrenWrapper","Box","HoverRect","Tooltip","wMin","hideHoverLine","xIndex","visualScale","yIndex","tooltipProps","_ref4","showPercentColumn","_ref3","find","dataDefItem","children","sstyled","cn","assignProps","Dot","mr","label","Text","percentValue","tooltipValueFormatter","Flex","Title","style","opacity","textAlign","bold","renderTooltipTotalLine","percentFormatter","total","rawPercent","formattedPercent","round","NOT_A_VALUE","dataItem","showTotalInTooltip","mt","Number","isNaN","renderHeader","header","render","_ref2","_ref6","SChart","a11yAltTextConfig","_ref5","chartRef","Plot","dataHints","onPlotMouseMove","onPlotMouseLeave","renderLegend","getLegendAriaLabel","getI18nText","chartType","cigaretteItems","range","domain","push","lastAddedDomain","scaleThreshold","showXAxis","showYAxis","showLegend","marginX","marginY","resolveColorEnhance","uniqueIDEnhancement","i18nEnhance","localizedMessages","CigaretteChart","exports","createComponent"],"sources":["../../../../src/component/Chart/CigaretteChart.tsx"],"sourcesContent":["import { Box, Flex } from '@semcore/base-components';\nimport { createComponent, Root, sstyled } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport trottle from '@semcore/core/lib/utils/rafTrottle';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport Divider from '@semcore/divider';\nimport { Text } from '@semcore/typography';\nimport { scaleThreshold, scaleLinear, scaleBand } from 'd3-scale';\nimport React from 'react';\n\nimport type { CigaretteChartData, CigaretteChartDataKey, CigaretteChartDefaultProps, CigaretteChartProps, CigaretteChartType } from './CigaretteChart.type';\n// @ts-ignore\nimport { HoverRect, Plot } from '../..';\nimport type { ChartState } from './AbstractChart';\nimport { AbstractChart, NOT_A_VALUE } from './AbstractChart';\nimport type { ObjectData } from './AbstractChart.type';\n// @ts-ignore\nimport AnimatedClipPath from '../../AnimatedClipPath';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport { eventToPoint, interpolateValue } from '../../utils';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\nimport Cigarette from '../Cigarette/Cigarette';\n\nconst DEFAULT_MINIMAL_BAR_WIDTH = 2;\nconst DEFAULT_GAP = 2;\n\ntype ScaleThresholdConfig = { range: Array<CigaretteChartDataKey>; domain: Array<number> };\n\ntype CigaretteChartState = ChartState & {\n pX: number | null;\n pY: number | null;\n};\n\nclass CigaretteChartComponent extends AbstractChart<\n CigaretteChartData,\n CigaretteChartProps,\n typeof CigaretteChartComponent.enhance,\n {},\n CigaretteChartState,\n CigaretteChartDefaultProps\n> {\n static displayName = 'Cigarette.Bar';\n\n static defaultProps = (props: CigaretteChartProps) => {\n const invertAxis = props.invertAxis ?? true;\n return {\n invertAxis,\n showXAxis: false,\n showYAxis: false,\n showTooltip: true,\n showLegend: false,\n marginX: 0,\n marginY: 0,\n duration: 500,\n plotWidth: !invertAxis && !props.plotWidth ? 44 : props.plotWidth,\n plotHeight: invertAxis && !props.plotHeight ? 28 : props.plotHeight,\n showPercentValueInTooltip: false,\n minimalBarWidth: DEFAULT_MINIMAL_BAR_WIDTH,\n direction: invertAxis ? 'column' : 'row',\n } as const;\n };\n\n static enhance = [\n resolveColorEnhance(),\n uniqueIDEnhancement(),\n i18nEnhance(localizedMessages),\n ] as const;\n\n constructor(props: CigaretteChartProps) {\n super(props);\n\n this.state = {\n ...this.state,\n pX: null,\n pY: null,\n };\n }\n\n private plotRef = React.createRef<SVGElement>();\n\n protected override plotPadding = 0;\n\n private offset = 0;\n\n private get activeDataDefinitions() {\n const { dataDefinitions } = this.state;\n\n return dataDefinitions.filter(({ checked }) => checked);\n }\n\n private get activePositiveDataDefinitions() {\n const { data } = this.asProps;\n\n return this.activeDataDefinitions.filter(({ id }) => {\n const itemValue = data[id];\n\n return typeof itemValue === 'number' && itemValue > 0;\n });\n }\n\n protected override resolveColor(id: string, index: number) {\n return this.props.colorMap?.[id] ?? `blue-${5 - index}00`;\n }\n\n protected override getDefaultDataDefinitions(): Array<\n LegendItem & { columns: React.ReactNode[] }\n > {\n const dataDefinitions = super.getDefaultDataDefinitions();\n\n return dataDefinitions.map((dataDef) => {\n dataDef.columns = dataDef.columns.slice(1);\n return dataDef;\n });\n }\n\n protected override defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n w: 'fit-content',\n };\n }\n\n private onPlotMouseMove = trottle((event: React.MouseEvent<HTMLElement>) => {\n if (!this.plotRef.current) return;\n\n const [pX, pY] = eventToPoint(event, this.plotRef.current);\n\n this.setState(() => ({ pX, pY }));\n });\n\n private onPlotMouseLeave = trottle(() => {\n this.setState(() => ({ pX: null, pY: null }));\n });\n\n protected override totalValue() {\n const { data } = this.asProps;\n\n return this.activeDataDefinitions.reduce((acc, { id }) => {\n const itemValue = data[id];\n\n if (typeof itemValue === 'number') {\n acc += itemValue;\n }\n\n return acc;\n }, 0);\n }\n\n private computeCigaretteItems() {\n const { data, invertAxis, minimalBarWidth } = this.asProps;\n const { plotWidth, plotHeight } = this;\n\n const dataDefinitions = invertAxis\n ? this.activeDataDefinitions\n : [...this.activeDataDefinitions].reverse();\n\n const count = this.activePositiveDataDefinitions.length;\n const totalGapWidth = DEFAULT_GAP * Math.max(0, count - 1);\n const availableSpace = Math.max(0, (invertAxis ? plotWidth : plotHeight) - totalGapWidth);\n\n const totalValue = this.totalValue();\n\n const dataDefinitionsItemSize = dataDefinitions.map(({ id }) => {\n if (totalValue === 0) {\n return 0;\n }\n\n const itemValue = data[id];\n\n if (typeof itemValue !== 'number') return 0;\n\n return (itemValue / totalValue) * availableSpace;\n });\n\n const result = dataDefinitions.map((dd, index) => ({\n ...dd,\n value: data[dd.id],\n dataWidth: dataDefinitionsItemSize[index],\n visualWidth: dataDefinitionsItemSize[index],\n isMinVisible: false,\n }));\n\n const smallItems = result.filter((r) => {\n const { value, dataWidth } = r;\n\n if (typeof value !== 'number') return false;\n\n return value > 0 && dataWidth < minimalBarWidth;\n });\n\n if (smallItems.length === 0) return result;\n\n let extraNeeded = 0;\n\n for (const smallItem of smallItems) {\n extraNeeded += minimalBarWidth - smallItem.dataWidth;\n smallItem.visualWidth = minimalBarWidth;\n smallItem.isMinVisible = true;\n }\n\n const donors = result.filter((r) => !r.isMinVisible && r.dataWidth > minimalBarWidth);\n const donorCapacity = donors.reduce(\n (s, d) => s + (d.dataWidth - minimalBarWidth),\n 0,\n );\n\n for (const donor of donors) {\n const available = donor.dataWidth - minimalBarWidth;\n const share = available / donorCapacity;\n const taken = share * extraNeeded;\n donor.visualWidth = donor.dataWidth - taken;\n }\n\n return result;\n };\n\n get xScale() {\n const { plotWidth } = this;\n\n return scaleLinear([0, plotWidth]);\n }\n\n get yScale() {\n const { plotHeight } = this;\n\n return scaleLinear([plotHeight, 0]);\n }\n\n get isNoData() {\n const { data } = this.asProps;\n const items = this.computeCigaretteItems();\n const noData = items.every((item) => {\n const value = data[item.id];\n\n return value === interpolateValue || value === 0;\n });\n\n return noData;\n }\n\n renderChart() {\n const { invertAxis, data, uid, duration, patterns, onClick } =\n this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n const { plotWidth, plotHeight } = this;\n\n this.offset = 0;\n\n const items = this.computeCigaretteItems();\n\n if (this.isNoData) {\n const height = invertAxis ? plotHeight - DEFAULT_GAP * 2 : plotWidth - DEFAULT_GAP * 2;\n const width = Math.max(0, (invertAxis ? plotWidth : plotHeight));\n const y = DEFAULT_GAP;\n const x = 0;\n const r = height < 28 ? 2 : 4;\n\n return (\n <>\n <g>\n <Cigarette\n key='empty_cigarette'\n index={0}\n y={invertAxis ? y : x}\n x={invertAxis ? x : y}\n width={invertAxis ? width : height}\n height={invertAxis ? height : width}\n uid={uid}\n hide={false}\n duration={duration}\n r={r}\n color='--intergalactic-chart-palette-order-null'\n patterns={patterns}\n direction={invertAxis ? 'horizontal' : 'vertical'}\n hovered={false}\n />\n </g>\n </>\n );\n }\n\n return (\n <>\n <g>\n {items.map((item, index) => {\n const { visualWidth, id } = item;\n const value = data[id];\n\n if (value === interpolateValue || value === 0) {\n return null;\n }\n\n const height = invertAxis ? plotHeight - DEFAULT_GAP * 2 : plotWidth - DEFAULT_GAP * 2;\n const width = visualWidth;\n const y = DEFAULT_GAP;\n const x = this.offset;\n const r = height < 28 ? 2 : 4;\n\n this.offset += visualWidth;\n\n if (index < items.length - 1) {\n this.offset += DEFAULT_GAP;\n }\n\n return (\n <Cigarette\n key={`${item.id}_${index}_${items.length}`}\n dataKey={item.id}\n index={index}\n y={invertAxis ? y : x}\n x={invertAxis ? x : y}\n width={invertAxis ? width : height}\n height={invertAxis ? height : width}\n uid={uid}\n hide={!item.checked}\n duration={duration}\n r={r}\n color={item.color}\n patterns={patterns}\n direction={invertAxis ? 'horizontal' : 'vertical'}\n onClick={onClick}\n hovered={\n highlightedLine === index ? true : highlightedLine === -1 ? undefined : false\n }\n />\n );\n })}\n </g>\n\n <AnimatedClipPath\n aria-hidden\n duration={duration}\n id={uid}\n x='0'\n y='0'\n width={invertAxis ? 0 : plotWidth}\n height={invertAxis ? plotHeight : 0}\n />\n </>\n );\n }\n\n renderTooltip(): React.ReactNode {\n const { data, invertAxis, tooltipTitle, tooltipViewType, showPercentValueInTooltip, styles, showTooltip } =\n this.asProps;\n const { dataDefinitions, pX, pY } = this.state;\n const STooltipChildrenWrapper = Root;\n\n if (!showTooltip || this.isNoData) {\n return null;\n }\n\n return (\n <HoverRect.Tooltip\n x={invertAxis ? '' : undefined}\n y={invertAxis ? undefined : ''}\n wMin={100}\n hideHoverLine={true}\n xIndex={pX !== null ? this.visualScale(pX) : undefined}\n yIndex={pY !== null ? this.visualScale(pY) : undefined}\n >\n {(tooltipProps: any) => {\n const dataKey = invertAxis ? tooltipProps.xIndex : tooltipProps.yIndex;\n const showPercentColumn = showPercentValueInTooltip && this.totalValue() !== 0;\n\n if (tooltipViewType === 'single') {\n const item = dataDefinitions.find((dataDefItem) => dataDefItem.id === dataKey);\n if (!item) {\n return {\n children: null,\n };\n }\n\n return {\n children: sstyled(styles)(\n <STooltipChildrenWrapper render={Box} columnsCount={showPercentColumn ? '3' : '2'} __excludeProps={['data']}>\n <HoverRect.Tooltip.Dot mr={2} color={item.color}>\n {item.label}\n </HoverRect.Tooltip.Dot>\n { showPercentColumn && <Text textAlign='end' color='text-secondary'>{this.percentValue(data, item.id)}</Text> }\n <Text textAlign='end' bold>{this.tooltipValueFormatter(data[item.id])}</Text>\n </STooltipChildrenWrapper>,\n ),\n };\n }\n\n return {\n children: sstyled(styles)(\n <Flex direction='column'>\n {tooltipTitle && (\n <HoverRect.Tooltip.Title>{tooltipTitle}</HoverRect.Tooltip.Title>\n )}\n\n <STooltipChildrenWrapper render={Box} columnsCount={showPercentColumn ? '3' : '2'} __excludeProps={['data']}>\n {dataDefinitions.map((item) => {\n const style = { opacity: item.id === dataKey ? 1 : 0.3 };\n return (\n item.checked && (\n <React.Fragment key={item.id}>\n <HoverRect.Tooltip.Dot mr={2} color={item.color} style={style}>\n {item.label}\n </HoverRect.Tooltip.Dot>\n { showPercentColumn && <Text textAlign='end' color='text-secondary' style={style}>{this.percentValue(data, item.id)}</Text> }\n <Text textAlign='end' bold style={style}>{this.tooltipValueFormatter(data[item.id])}</Text>\n </React.Fragment>\n )\n );\n })}\n\n {this.renderTooltipTotalLine(data)}\n </STooltipChildrenWrapper>\n </Flex>,\n ),\n };\n }}\n </HoverRect.Tooltip>\n );\n }\n\n protected percentValue(data: ObjectData, key: string): string {\n const { percentFormatter } = this.asProps;\n\n const total = this.totalValue();\n\n const value = data[key];\n\n if (typeof value === 'number' && total !== 0) {\n const rawPercent = (100 * value) / total;\n const formattedPercent = percentFormatter ? percentFormatter(rawPercent) : Math.round(rawPercent);\n\n return `${formattedPercent}%`;\n }\n\n if (value === null) {\n return `0%`;\n }\n\n return NOT_A_VALUE;\n }\n\n protected override renderTooltipTotalLine<D extends ObjectData>(dataItem: D) {\n const { showTotalInTooltip, showPercentValueInTooltip } = this.asProps;\n\n if (!showTotalInTooltip) {\n return null;\n }\n\n const total = this.totalValue();\n\n return (\n <>\n <Box mt={2} mr={2}>Total</Box>\n { showPercentValueInTooltip && total !== 0 && <Text mt={2} textAlign='end' color='text-secondary'>{Number.isNaN(total) ? NOT_A_VALUE : '100%'}</Text> }\n <Text mt={2} textAlign='end' bold>{Number.isNaN(total) ? NOT_A_VALUE : total}</Text>\n </>\n );\n }\n\n renderHeader() {\n return this.asProps.header ?? null;\n }\n\n override render() {\n const SChart = Root;\n const { styles, data, patterns, direction, invertAxis, a11yAltTextConfig } = this.asProps;\n const { plotWidth, plotHeight } = this;\n const header = this.renderHeader();\n\n if (invertAxis) {\n return sstyled(styles)(\n <SChart render={Flex} gap={6} direction={direction} __excludeProps={['onClick', 'data']} ref={this.chartRef}>\n <Flex direction='column'>\n {header}\n <Plot\n ref={this.plotRef}\n data={data}\n scale={[this.xScale, this.yScale]}\n width={plotWidth}\n height={plotHeight}\n dataHints={this.dataHints}\n patterns={patterns}\n a11yAltTextConfig={a11yAltTextConfig}\n onMouseMove={this.onPlotMouseMove}\n onMouseLeave={this.onPlotMouseLeave}\n >\n {this.renderTooltip()}\n {this.renderChart()}\n </Plot>\n </Flex>\n {this.renderLegend()}\n </SChart>,\n );\n }\n\n return sstyled(styles)(\n <SChart render={Flex} gap={6} __excludeProps={['onClick', 'data']} ref={this.chartRef}>\n <Plot\n ref={this.plotRef}\n data={data}\n scale={[this.xScale, this.yScale]}\n width={plotWidth}\n height={plotHeight}\n dataHints={this.dataHints}\n patterns={patterns}\n a11yAltTextConfig={a11yAltTextConfig}\n onMouseMove={this.onPlotMouseMove}\n onMouseLeave={this.onPlotMouseLeave}\n >\n {this.renderTooltip()}\n {this.renderChart()}\n </Plot>\n <Flex direction='column' gap={2}>\n {header && (\n <>\n <Box>{header}</Box>\n <Divider />\n </>\n )}\n {this.renderLegend()}\n </Flex>\n </SChart>,\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Cigarette' });\n }\n\n private get visualScale() {\n const cigaretteItems = this.computeCigaretteItems();\n\n const { range, domain } = cigaretteItems.reduce<ScaleThresholdConfig>((acc, { id, visualWidth }, index) => {\n const { range, domain } = acc;\n\n if (visualWidth) {\n range.push(id);\n\n if (domain.length === 0) {\n domain.push(visualWidth + DEFAULT_GAP);\n\n return acc;\n }\n\n if (index !== cigaretteItems.length - 1) {\n const lastAddedDomain = domain[domain.length - 1];\n domain.push(lastAddedDomain + visualWidth + DEFAULT_GAP);\n }\n }\n\n return acc;\n }, { range: [], domain: [] });\n\n return scaleThreshold(domain, range);\n }\n}\n\n/**\n * CigaretteChart\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/cigarette-chart/cigarette-chart-api/|API} | {@link https://developer.semrush.com/intergalactic/data-display/cigarette-chart/cigarette-chart-code/|Examples}\n */\nexport const CigaretteChart = createComponent<\n CigaretteChartType,\n typeof CigaretteChartComponent\n>(CigaretteChartComponent);\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,WAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,SAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,QAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAP,sBAAA,CAAAH,OAAA;AAIA,IAAAW,CAAA,GAAAX,OAAA;AAEA,IAAAY,cAAA,GAAAZ,OAAA;AAGA,IAAAa,iBAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,4BAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AAEA,IAAAgB,UAAA,GAAAb,sBAAA,CAAAH,OAAA;AAVA;;AAKA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AAA,CAAAC,OAAA,EA3gBML,uBAAuB,iBAQN,eAAe;AAAA,IAAAI,gBAAA,CAAAC,OAAA,EARhCL,uBAAuB,kBAUJG,KAA0B,IAAK;EACpD,MAAMsC,UAAU,GAAGtC,KAAK,CAACsC,UAAU,IAAI,IAAI;EAC3C,OAAO;IACLA,UAAU;IACVoI,SAAS,EAAE,KAAK;IAChBC,SAAS,EAAE,KAAK;IAChBpE,WAAW,EAAE,IAAI;IACjBqE,UAAU,EAAE,KAAK;IACjBC,OAAO,EAAE,CAAC;IACVC,OAAO,EAAE,CAAC;IACV/F,QAAQ,EAAE,GAAG;IACbvC,SAAS,EAAE,CAACF,UAAU,IAAI,CAACtC,KAAK,CAACwC,SAAS,GAAG,EAAE,GAAGxC,KAAK,CAACwC,SAAS;IACjEC,UAAU,EAAEH,UAAU,IAAI,CAACtC,KAAK,CAACyC,UAAU,GAAG,EAAE,GAAGzC,KAAK,CAACyC,UAAU;IACnE4D,yBAAyB,EAAE,KAAK;IAChC9D,eAAe,EAAE5C,yBAAyB;IAC1CkG,SAAS,EAAEvD,UAAU,GAAG,QAAQ,GAAG;EACrC,CAAC;AACH,CAAC;AAAA,IAAArC,gBAAA,CAAAC,OAAA,EA3BGL,uBAAuB,aA6BV,CACf,IAAAkL,4BAAmB,EAAC,CAAC,EACrB,IAAAC,iBAAmB,EAAC,CAAC,EACrB,IAAAC,oBAAW,EAACC,8CAAiB,CAAC,CAC/B;AA+eI,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,qBAAe,EAG3CxL,uBAAuB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import type { NSBox, NSFlex } from '@semcore/base-components';\n\nimport type { LegendItem, LegendItemKey, ShapeType } from './LegendItem/LegendItem.type';\nimport type { DataStructureHints } from '../../a11y/hints';\nimport type { PatternsConfig } from '../../Pattern';\nimport type { AriaNameProps } from '../Chart/AbstractChart.type';\n\nexport type LSize = 'm' | 'l';\n\nexport type BaseChartLegendProps = NSFlex.Props &\n AriaNameProps & {\n /**\n * Size for legend items\n */\n size?: LSize;\n /**\n * Shape of data item on Legend panel\n */\n shape?: ShapeType;\n /**\n * Handler for change visible for data items. Doesn't work if Shape one of 'Circle' | 'Line' | 'Square'\n */\n onChangeVisibleItem?: (key: LegendItemKey, isVisible: boolean) => void;\n\n onMouseEnterItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n onMouseLeaveItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n dataHints?: DataStructureHints;\n };\n\nexport type LegendProps = NSBox.Props &\n BaseChartLegendProps & {\n /**\n * Legend items\n */\n items: LegendItem[];\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -16,12 +16,12 @@ var _intergalacticDynamicLocales = require("../../../translations/__intergalacti
|
|
|
16
16
|
var _BaseLegend = require("../BaseLegend");
|
|
17
17
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
18
18
|
/*!__reshadow-styles__:"./legend-flex.shadow.css"*/
|
|
19
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
19
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendFlex_1s327_gg_._direction_row_1s327_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_1s327_gg_._direction_column_1s327_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}", /*__inner_css_end__*/"1s327_gg_"),
|
|
20
20
|
/*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SLegendFlex": "
|
|
23
|
-
"_direction_row": "
|
|
24
|
-
"_direction_column": "
|
|
22
|
+
"__SLegendFlex": "___SLegendFlex_1s327_gg_",
|
|
23
|
+
"_direction_row": "_direction_row_1s327_gg_",
|
|
24
|
+
"_direction_column": "_direction_column_1s327_gg_"
|
|
25
25
|
});
|
|
26
26
|
class LegendFlexRoot extends _BaseLegend.BaseLegend {
|
|
27
27
|
renderTrend() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendFlex.type.js","names":[],"sources":["../../../../../src/component/ChartLegend/LegendFlex/LegendFlex.type.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"LegendFlex.type.js","names":[],"sources":["../../../../../src/component/ChartLegend/LegendFlex/LegendFlex.type.ts"],"sourcesContent":["import type { NSFlex } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\n\nimport type { LegendProps } from '../BaseLegend.type';\nimport type { LegendItemType } from '../LegendItem/LegendItem.type';\n\nexport type TrendProps = {\n /**\n * Flag for include trend LegendItem in Legend\n */\n withTrend: true;\n /**\n * Trend label (for localization)\n */\n trendLabel?: string;\n /**\n * Flag for describe are trend is visible\n */\n trendIsVisible: boolean;\n /**\n * Handler for change trend visibility\n */\n onTrendIsVisibleChange: (isVisible: boolean) => void;\n};\n\ntype SuffixProps = {\n /**\n * Element after all Legend items\n */\n suffix?: React.ReactElement;\n};\n\ntype AddonProps = ({ withTrend?: never } & SuffixProps) | ({ suffix?: never } & TrendProps);\n\nexport type LegendFlexProps = LegendProps & AddonProps & NSFlex.Props;\n\nexport type LegendFlexDefaultProps = {\n direction: 'row';\n children: React.JSX.Element;\n};\n\nexport type LegendFlexType = Intergalactic.Component<NSFlex.Component, LegendFlexProps> & {\n LegendItem: LegendItemType;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -17,25 +17,25 @@ var _LegendItem = require("./LegendItem.type");
|
|
|
17
17
|
var _Pattern = require("../../../Pattern");
|
|
18
18
|
var _utils = require("../../../utils");
|
|
19
19
|
/*!__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
20
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
20
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendItem_de4s5_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_de4s5_gg_:hover{cursor:pointer}.___SLegendItem_de4s5_gg_.__disabled_de4s5_gg_:hover{cursor:default}}.___SPointShape_de4s5_gg_.__color_de4s5_gg_{background-color:var(--color_de4s5);margin-right:8px;flex-shrink:0}.___SPointShape_de4s5_gg_._shape_Circle_de4s5_gg_._size_l_de4s5_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_de4s5_gg_._shape_Circle_de4s5_gg_._size_m_de4s5_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_de4s5_gg_._shape_Line_de4s5_gg_._size_l_de4s5_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_de4s5_gg_._shape_Line_de4s5_gg_._size_m_de4s5_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_de4s5_gg_._shape_Square_de4s5_gg_._size_l_de4s5_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_de4s5_gg_._shape_Square_de4s5_gg_._size_m_de4s5_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_de4s5_gg_._shape_Pattern_de4s5_gg_{background-color:initial;margin-right:4px}.___SIcon_de4s5_gg_{line-height:0;margin-right:4px}.___SIcon_de4s5_gg_._size_l_de4s5_gg_{margin-top:4px}.___SIcon_de4s5_gg_._size_m_de4s5_gg_{margin-top:2px}.___SLabel_de4s5_gg_{min-width:0}.___SAdditionalLabel_de4s5_gg_._size_l_de4s5_gg_,.___SCount_de4s5_gg_._size_l_de4s5_gg_,.___SLabel_de4s5_gg_._size_l_de4s5_gg_{font-size:var(--intergalactic-fs-300,16px);line-height:var(--intergalactic-lh-300,150%)}.___SAdditionalLabel_de4s5_gg_._size_m_de4s5_gg_,.___SCount_de4s5_gg_._size_m_de4s5_gg_,.___SLabel_de4s5_gg_._size_m_de4s5_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SAdditionalLabel_de4s5_gg_,.___SCount_de4s5_gg_{margin-left:4px}.___SAdditionalLabel_de4s5_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_de4s5_gg_:before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary,#00030095);height:4px;width:4px;border-radius:2px;margin-right:4px}@media (color-gamut:p3){.___SAdditionalLabel_de4s5_gg_:before{background-color:var(--intergalactic-text-secondary,oklch(.088 .026 147.7/.583))}}.___SAdditionalLabel_de4s5_gg_._size_l_de4s5_gg_:before{margin-top:10px}.___SAdditionalLabel_de4s5_gg_._size_m_de4s5_gg_:before{margin-top:8px}.___SPatternSymbol_de4s5_gg_{transform:scale(.8)}", /*__inner_css_end__*/"de4s5_gg_"),
|
|
21
21
|
/*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"__SLegendItem": "
|
|
24
|
-
"_disabled": "
|
|
25
|
-
"__SPointShape": "
|
|
26
|
-
"_color": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"_shape_Circle": "
|
|
29
|
-
"_size_l": "
|
|
30
|
-
"_size_m": "
|
|
31
|
-
"_shape_Line": "
|
|
32
|
-
"_shape_Square": "
|
|
33
|
-
"_shape_Pattern": "
|
|
34
|
-
"__SIcon": "
|
|
35
|
-
"__SLabel": "
|
|
36
|
-
"__SAdditionalLabel": "
|
|
37
|
-
"__SCount": "
|
|
38
|
-
"__SPatternSymbol": "
|
|
23
|
+
"__SLegendItem": "___SLegendItem_de4s5_gg_",
|
|
24
|
+
"_disabled": "__disabled_de4s5_gg_",
|
|
25
|
+
"__SPointShape": "___SPointShape_de4s5_gg_",
|
|
26
|
+
"_color": "__color_de4s5_gg_",
|
|
27
|
+
"--color": "--color_de4s5",
|
|
28
|
+
"_shape_Circle": "_shape_Circle_de4s5_gg_",
|
|
29
|
+
"_size_l": "_size_l_de4s5_gg_",
|
|
30
|
+
"_size_m": "_size_m_de4s5_gg_",
|
|
31
|
+
"_shape_Line": "_shape_Line_de4s5_gg_",
|
|
32
|
+
"_shape_Square": "_shape_Square_de4s5_gg_",
|
|
33
|
+
"_shape_Pattern": "_shape_Pattern_de4s5_gg_",
|
|
34
|
+
"__SIcon": "___SIcon_de4s5_gg_",
|
|
35
|
+
"__SLabel": "___SLabel_de4s5_gg_",
|
|
36
|
+
"__SAdditionalLabel": "___SAdditionalLabel_de4s5_gg_",
|
|
37
|
+
"__SCount": "___SCount_de4s5_gg_",
|
|
38
|
+
"__SPatternSymbol": "___SPatternSymbol_de4s5_gg_"
|
|
39
39
|
});
|
|
40
40
|
const enhance = [(0, _resolveColorEnhance.default)(), (0, _uniqueID.default)()];
|
|
41
41
|
class LegendItemRoot extends _core.Component {
|
|
@@ -12,14 +12,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _BaseLegend = require("../BaseLegend");
|
|
13
13
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
14
14
|
/*!__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
15
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
15
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendTable_12pme_gg_.__columns-count_12pme_gg_{font-feature-settings:\"tnum\";font-variant-numeric:tabular-nums;display:grid;grid-template-columns:auto .2fr;align-items:center;height:-moz-fit-content;height:fit-content;grid-column-gap:16px;grid-row-gap:8px}.___SColumnItem_12pme_gg_._size_l_12pme_gg_{font-size:var(--intergalactic-fs-300,16px);text-align:right}.___SColumnItem_12pme_gg_._size_m_12pme_gg_{font-size:var(--intergalactic-fs-200,14px);text-align:right}", /*__inner_css_end__*/"12pme_gg_"),
|
|
16
16
|
/*__reshadow_css_end__*/
|
|
17
17
|
{
|
|
18
|
-
"__SLegendTable": "
|
|
19
|
-
"_columns-count": "__columns-
|
|
20
|
-
"__SColumnItem": "
|
|
21
|
-
"_size_l": "
|
|
22
|
-
"_size_m": "
|
|
18
|
+
"__SLegendTable": "___SLegendTable_12pme_gg_",
|
|
19
|
+
"_columns-count": "__columns-count_12pme_gg_",
|
|
20
|
+
"__SColumnItem": "___SColumnItem_12pme_gg_",
|
|
21
|
+
"_size_l": "_size_l_12pme_gg_",
|
|
22
|
+
"_size_m": "_size_m_12pme_gg_"
|
|
23
23
|
});
|
|
24
24
|
class LegendTableRoot extends _BaseLegend.BaseLegend {
|
|
25
25
|
render() {
|
|
@@ -45,12 +45,15 @@ class CigaretteBarRoot extends _core.Component {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
+
componentDidMount() {
|
|
49
|
+
this.forceUpdate();
|
|
50
|
+
}
|
|
48
51
|
uncontrolledProps() {
|
|
49
52
|
return {
|
|
50
53
|
hovered: false
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
|
-
|
|
56
|
+
getPath() {
|
|
54
57
|
const {
|
|
55
58
|
x,
|
|
56
59
|
y,
|
|
@@ -74,18 +77,12 @@ class CigaretteBarRoot extends _core.Component {
|
|
|
74
77
|
widthV = widthV + 4;
|
|
75
78
|
}
|
|
76
79
|
if (radius) {
|
|
80
|
+
const hasPrev = Boolean(this.refElement.current?.previousSibling);
|
|
81
|
+
const hasNext = Boolean(this.refElement.current?.nextSibling);
|
|
77
82
|
if (direction === 'horizontal') {
|
|
78
|
-
|
|
79
|
-
return (0, _utils.roundedPath)(xV, yV, widthV, heightV, radius, true, false, true, false);
|
|
80
|
-
} else {
|
|
81
|
-
return (0, _utils.roundedPath)(xV, yV, widthV, heightV, radius, false, true, false, true);
|
|
82
|
-
}
|
|
83
|
+
return (0, _utils.roundedPath)(xV, yV, widthV, heightV, radius, !hasPrev, !hasNext, !hasPrev, !hasNext);
|
|
83
84
|
} else {
|
|
84
|
-
|
|
85
|
-
return (0, _utils.roundedPath)(xV, yV, widthV, heightV, radius, true, true, false, false);
|
|
86
|
-
} else {
|
|
87
|
-
return (0, _utils.roundedPath)(xV, yV, widthV, heightV, radius, false, false, true, true);
|
|
88
|
-
}
|
|
85
|
+
return (0, _utils.roundedPath)(xV, yV, widthV, heightV, radius, !hasPrev, !hasPrev, !hasNext, !hasNext);
|
|
89
86
|
}
|
|
90
87
|
}
|
|
91
88
|
return (0, _utils.roundedPath)(xV, yV, widthV, heightV, radius);
|
|
@@ -109,7 +106,7 @@ class CigaretteBarRoot extends _core.Component {
|
|
|
109
106
|
resolveColor,
|
|
110
107
|
patterns
|
|
111
108
|
} = this.asProps;
|
|
112
|
-
const dSvg = this.
|
|
109
|
+
const dSvg = this.getPath();
|
|
113
110
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
114
111
|
key: `horizontal-bar-${index}`
|
|
115
112
|
}, (_ref = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SBar, _ref.cn("SBar", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cigarette.js","names":["_core","require","_assignProps","_uniqueID","_interopRequireDefault","_react","_createElement","_Pattern","_utils","CigaretteBarRoot","Component","constructor","args","_defineProperty2","default","React","createRef","handlers","hovered","setCursor","e","onClick","dataKey","asProps","currentTarget","tagName","stopPropagation","value","refElement","current","style","setProperty","uncontrolledProps","
|
|
1
|
+
{"version":3,"file":"Cigarette.js","names":["_core","require","_assignProps","_uniqueID","_interopRequireDefault","_react","_createElement","_Pattern","_utils","CigaretteBarRoot","Component","constructor","args","_defineProperty2","default","React","createRef","handlers","hovered","setCursor","e","onClick","dataKey","asProps","currentTarget","tagName","stopPropagation","value","refElement","current","style","setProperty","componentDidMount","forceUpdate","uncontrolledProps","getPath","x","y","width","height","r","radius","direction","index","xV","yV","widthV","heightV","hasPrev","Boolean","previousSibling","hasNext","nextSibling","roundedPath","render","_ref","SBar","Element","styles","color","data","hide","uid","duration","onMouseMove","onMouseLeave","transparent","resolveColor","patterns","dSvg","createElement","Fragment","key","sstyled","cn","undefined","callAllEventHandlers","handleMouseMove","handleMouseLeave","handleClick","PatternFill","uniqueIDEnhancement","offset","defaultHovered","_default","exports"],"sources":["../../../../src/component/Cigarette/Cigarette.tsx"],"sourcesContent":["import { Component, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport React from 'react';\n\nimport createElement from '../../createElement';\nimport { PatternFill } from '../../Pattern';\nimport { roundedPath } from '../../utils';\n\nclass CigaretteBarRoot extends Component<any, [], { hovered: boolean }> {\n static displayName = 'Cigarette.BarItem';\n static enhance = [uniqueIDEnhancement()];\n static style = {};\n\n static defaultProps = {\n offset: [0, 0],\n duration: 500,\n direction: 'horizontal',\n defaultHovered: false,\n };\n\n refElement = React.createRef<SVGPathElement>();\n\n componentDidMount(): void {\n this.forceUpdate();\n }\n\n uncontrolledProps() {\n return {\n hovered: false,\n };\n }\n\n handleMouseMove = () => {\n this.handlers.hovered(true);\n this.setCursor('pointer');\n };\n\n handleMouseLeave = () => {\n this.handlers.hovered(false);\n this.setCursor('auto');\n };\n\n handleClick = (e: React.SyntheticEvent) => {\n const { onClick, dataKey } = this.asProps;\n\n if (onClick && e.currentTarget.tagName === 'path') {\n e.stopPropagation();\n\n onClick(dataKey, e);\n\n return false;\n }\n };\n\n setCursor = (value: 'pointer' | 'auto') => {\n const { onClick } = this.asProps;\n\n if (onClick) {\n this.refElement.current?.style.setProperty('cursor', value);\n }\n };\n\n getPath() {\n const { x, y, width, height, r: radius, direction, index, hovered } = this.asProps;\n\n let xV = x;\n let yV = y;\n let widthV = width;\n let heightV = height;\n\n if (hovered && direction === 'horizontal') {\n yV = yV - 2;\n heightV = heightV + 4;\n }\n\n if (hovered && direction === 'vertical') {\n xV = xV - 2;\n widthV = widthV + 4;\n }\n\n if (radius) {\n const hasPrev = Boolean(this.refElement.current?.previousSibling);\n const hasNext = Boolean(this.refElement.current?.nextSibling);\n\n if (direction === 'horizontal') {\n return roundedPath(\n xV,\n yV,\n widthV,\n heightV,\n radius,\n !hasPrev,\n !hasNext,\n !hasPrev,\n !hasNext,\n );\n } else {\n return roundedPath(\n xV,\n yV,\n widthV,\n heightV,\n radius,\n !hasPrev,\n !hasPrev,\n !hasNext,\n !hasNext,\n );\n }\n }\n\n return roundedPath(xV, yV, widthV, heightV, radius);\n }\n\n render() {\n // @ts-ignore\n const SBar = this.Element;\n const {\n styles,\n color,\n data,\n dataKey,\n index,\n hide,\n uid,\n duration,\n onMouseMove,\n onMouseLeave,\n transparent,\n resolveColor,\n patterns,\n } = this.asProps;\n\n const dSvg = this.getPath();\n\n return (\n <React.Fragment key={`horizontal-bar-${index}`}>\n {sstyled(styles)(\n <SBar\n ref={this.refElement}\n aria-hidden\n render='path'\n clipPath={`url(#${uid})`}\n __excludeProps={['data', 'scale', 'value', 'offset']}\n childrenPosition='above'\n value={data[dataKey]}\n index={index}\n hide={hide}\n fill={resolveColor(color)}\n pattern={patterns ? `url(#${uid}-${index}-pattern)` : undefined}\n transparent={transparent}\n d={dSvg}\n use:duration={`${duration}ms`}\n onMouseMove={callAllEventHandlers(onMouseMove, this.handleMouseMove)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n use:onClick={this.handleClick}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-${index}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </React.Fragment>\n );\n }\n}\n\n/**\n * CigaretteBar\n *\n * {@link https://developer.semrush.com/intergalactic/data-display/cigarette-chart/cigarette-chart-api/|API} | {@link https://developer.semrush.com/intergalactic/data-display/cigarette-chart/cigarette-chart-code/|Examples}\n */\nexport default createElement(CigaretteBarRoot);\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(--intergalactic-chart-grid-bar-chart-base-bg, oklch(0.
|
|
33
|
+
fill: var(--intergalactic-chart-grid-bar-chart-base-bg, oklch(0.88 0.002 175.6));
|
|
34
|
+
opacity: 0.4;
|
|
34
35
|
}
|
|
35
36
|
SBackground[onClick] {
|
|
36
37
|
cursor: pointer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactHorizontalBar.d.js","names":[],"sources":["../../../src/types/CompactHorizontalBar.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"CompactHorizontalBar.d.js","names":[],"sources":["../../../src/types/CompactHorizontalBar.d.ts"],"sourcesContent":["import type { NSBox } from '@semcore/base-components';\n\nimport type { BackgroundProps } from './Bar';\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { IntergalacticD3Component } from './Plot';\nimport type { TooltipType } from './Tooltip';\n\nexport type CompactHorizontalBarProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /**\n * Bars rounded corners\n * @default 2\n */\n radius?: number;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\ntype BarContext = {\n /** Index in `data` array of the current items */\n index: number;\n};\n\nexport type CompactHorizontalBarHoverProps = NSBox.Props;\ntype Hover = IntergalacticD3Component<'rect', CompactHorizontalBarHoverProps, Context>;\nexport type CompactHorizontalBarAnnotationProps = NSBox.Props;\ntype Annotation = IntergalacticD3Component<\n 'foreignObject',\n CompactHorizontalBarAnnotationProps,\n Context & BarContext\n>;\nexport type CompactHorizontalBarLabelProps = NSBox.Props;\ntype Label = IntergalacticD3Component<'div', CompactHorizontalBarLabelProps, Context & BarContext>;\nexport type CompactHorizontalBarPercentProps = NSBox.Props;\nexport type CompactHorizontalBarPercentContext = {\n formatted: string;\n percent: number;\n} & BarContext;\ntype Percent = IntergalacticD3Component<\n 'div',\n CompactHorizontalBarPercentProps,\n Context & CompactHorizontalBarPercentContext\n>;\nexport type CompactHorizontalBarValueProps = NSBox.Props;\nexport type CompactHorizontalBarValueContext = { formatted: string; value: number } & BarContext;\ntype Value = IntergalacticD3Component<\n 'div',\n CompactHorizontalBarValueProps,\n Context & CompactHorizontalBarValueContext\n>;\nexport type CompactHorizontalBarBarProps = {};\ntype Bar = IntergalacticD3Component<'g', CompactHorizontalBarBarProps, Context & BarContext>;\nexport type CompactHorizontalBarBackgroundProps = NSBox.Props;\ntype Background = IntergalacticD3Component<'rect', BackgroundProps, Context & BarContext>;\nexport type CompactHorizontalBarFillProps = NSBox.Props & {\n patterns?: PatternsConfig;\n color?: string;\n transparent?: boolean;\n hide?: boolean;\n};\ntype Fill = IntergalacticD3Component<'rect', CompactHorizontalBarFillProps, Context & BarContext>;\n\ndeclare const CompactHorizontalBar: IntergalacticD3Component<\n 'g',\n CompactHorizontalBarProps,\n BarContext\n> & {\n Hover: Hover;\n Annotation: Annotation;\n Label: Label;\n Percent: Percent;\n Value: Value;\n Bar: Bar & {\n Background: Background;\n Fill: Fill;\n };\n Tooltip: TooltipType<BarContext>;\n};\n\nexport default CompactHorizontalBar;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hover.d.js","names":[],"sources":["../../../src/types/Hover.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Hover.d.js","names":[],"sources":["../../../src/types/Hover.d.ts"],"sourcesContent":["import type { NSBox } from '@semcore/base-components';\nimport type { UnknownProperties, ReturnEl } from '@semcore/core';\nimport type React from 'react';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\nimport type { TooltipTypeBase } from './Tooltip';\n\n/** @deprecated */\nexport interface IHoverProps extends HoverProps, UnknownProperties {}\nexport type HoverProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n};\n\ntype HoverTooltip = (<X, Y>(\n props: {\n /** Field name from `data` array item for the XAxis */\n x?: X;\n /** Field name from `data` array item for the YAxis */\n y?: Y;\n /** Handle click by trigger has an index - it is an index of the data array. */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n children: (props: {\n /** Index in `data` array of the current item */\n xIndex: X extends string ? number : never;\n /** Index in `data` array of the current item */\n yIndex: Y extends string ? number : never;\n }) => { children: ReturnEl };\n /** Flag for hide line on hovered value */\n hideHoverLine?: boolean | ((xIndex: number | null, yIndex: number | null) => boolean);\n } & Omit<NSBox.Props, 'children'>,\n) => ReturnEl) &\nTooltipTypeBase;\n\ntype HoverContext = {\n /** Index in `data` array of the current item */\n index: number;\n};\n\ndeclare const HoverLine: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\n\ndeclare const HoverRect: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\nexport { HoverLine, HoverRect };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import type { NSAnimation } from '@semcore/base-components';\nimport type { UnknownProperties } from '@semcore/core';\nimport type { CurveFactory } from 'd3-shape';\n\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ILineProps extends LineProps, UnknownProperties {}\nexport type LineProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Curve method */\n curve?: CurveFactory;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n /** Callback triggered when a user clicks on a line */\n onClick?: (index: number, event: React.SyntheticEvent) => void;\n};\n\n/** @deprecated */\nexport interface ILineDotsProps extends LineDotsProps, UnknownProperties {}\nexport type LineDotsProps = Context &\n Omit<NSAnimation.FadeInOut.Props, 'display'> & {\n /** Show dots */\n display?: boolean | ((index: number, active: boolean, single: boolean) => boolean);\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n /** Dot radius, radius of active dot is 4/3 times larger\n * @default 6\n */\n radius?: number;\n };\n\n/** @deprecated */\nexport interface ILineDotsContext extends LineDotsContext, UnknownProperties {}\nexport type LineDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface ILineNullProps extends LineNullProps, UnknownProperties {}\nexport type LineNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\nexport type LineAreaProps = Omit<LineProps, 'transparent'> & {\n /**\n * Field name from `data` (or from `area`, if passed) array for y0 point by the YAxis for the Area\n */\n y0: string;\n /**\n * Field name from `data` (or from `area`, if passed) array for y1 point by the YAxis for the Area\n */\n y1: string;\n\n /**\n * Optional data for render area\n */\n area?: Array<{ [key: string]: number }>;\n\n /**\n * If disabled, area will not be rendered if corresponding position data is null. That case you use\n * `interpolateValue` symbol for spot data interpolation.\n * @default true\n */\n autoInterpolate?: boolean;\n};\n\ndeclare const Line: IntergalacticD3Component<'line', LineProps, Context> & {\n Dots: IntergalacticD3Component<'circle', LineDotsProps, LineDotsContext>;\n Null: IntergalacticD3Component<'path', LineNullProps>;\n Area: IntergalacticD3Component<'path', LineAreaProps>;\n};\n\nexport default Line;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plot.d.js","names":[],"sources":["../../../src/types/Plot.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Plot.d.js","names":[],"sources":["../../../src/types/Plot.d.ts"],"sourcesContent":["import type { NSBox } from '@semcore/base-components';\nimport type { UnknownProperties, Intergalactic } from '@semcore/core';\n\nimport type { DataStructureHints } from './a11y/hints';\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { PlotEventEmitter } from './utils';\n\n/** @deprecated */\nexport interface IPlotProps extends PlotProps, UnknownProperties {}\nexport type PlotProps = Context &\n NSBox.Props & {\n /** Width of the svg element\n * @default 0 */\n width?: number;\n /** Height of the svg element\n * @default 0 */\n height?: number;\n /** Human readable chart name (e.g \"Last market trends\") */\n label?: string;\n /**\n * Locale for displaying the days of a week and months, to be transferred to `Intl`\n * @default en\n * */\n locale?: NavigatorLanguage['language'];\n /**\n * Optional container for data hints (use it if you have a legend component upper in tree)\n */\n dataHints?: DataStructureHints;\n /** Optional prop to tune up alt text generating for charts */\n a11yAltTextConfig?: PlotSummarizerConfig;\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n\n /** Event emitter for chart interactions */\n eventEmitter?: InstanceType<typeof PlotEventEmitter>;\n };\n\nexport type PlotSummarizerConfig = {\n /** Totally disable automatic data summarization */\n disable?: boolean;\n /** Disable automatic data summarization and use provided text */\n override?: string;\n /** Tuning up time series trends analyzing. Represents angle tangens of time series change of different strength */\n trendTangens?: {\n /** Angle tangens of time series that have meaningful trending change\n * @default 1/15\n */\n static?: number;\n /** Angle tangens of time series that have weak trending change\n * @default 1/10\n */\n weak?: number;\n /** Angle tangens of time series that have medium trending change\n * @default 1/5\n */\n medium?: number;\n /** Angle tangens of time series that have strong trending change\n * @default Infinity\n */\n strong?: number;\n };\n /** Tuning up time series local trends detection based on moving averages */\n movingAverage?: {\n /** Frame size of long moving average\n * @default Math.sqrt(data.length)\n */\n longSize?: number;\n /** Frame size of short moving average\n * @default Math.sqrt(data.length)/2\n */\n shortSize?: number;\n /** Absolute difference between values on moving averages crossing to\n * be handled as local trend change.\n * @default StandardDeviation/10\n */\n notableDiff?: number;\n };\n /** The way data to be interpreted as. By default is based on used used Plot elements and data structure.\n */\n dataType?: 'time-series' | 'points-cloud' | 'values-set';\n /** Grid size to split data of point clouds into clusters.\n */\n clustersGridSize?: number;\n /** Limits some output lists in chart alt text\n * @default 100\n * **/\n maxListSymbols?: number;\n /** Always add time to dates in chart alt text **/\n datesWithTime?: boolean;\n /** Described clusters count before text \"and X more\"\n * @default false\n * **/\n clustersLimit?: number;\n /** Described values count before text \"and X more\"\n * @default false\n * **/\n valuesLimit?: number;\n /** Described grouped value groups count before text \"and X more\"\n * @default false\n * **/\n groupsLimit?: number;\n /** Additional field for extra text description to the data\n * **/\n additionalFields?: string[];\n /** Allows to format titles (e.g. axes) in alt text and data table */\n titlesFormatter?: (key: string | number | null) => string | undefined;\n /** Allows to format values in alt text and data table */\n valuesFormatter?: (value: unknown, key: string | number | null) => string | undefined;\n};\n\n/** @deprecated */\nexport type MapProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?:\n | ((props: Props & Ctx, handlers: UCProps) => Props | React.PropsWithChildren)\n | React.ReactNode;\n};\n\nexport type IntergalacticD3Component<BaseTag extends Intergalactic.Tag, Props, Context = {}> = (<\n Tag extends Intergalactic.Tag = BaseTag,\n>(\n props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<Tag, Props, Context>,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\nIntergalactic.InternalTypings.ComponentAdditive<BaseTag, BaseTag, Props>;\n\ndeclare const Plot: IntergalacticD3Component<'svg', PlotProps, Context>;\nexport default Plot;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radar.d.js","names":[],"sources":["../../../src/types/Radar.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Radar.d.js","names":[],"sources":["../../../src/types/Radar.d.ts"],"sourcesContent":["import type { NSBox } from '@semcore/base-components';\nimport type { UnknownProperties } from '@semcore/core';\nimport type { CurveFactory } from 'd3-shape';\n\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { IntergalacticD3Component } from './Plot';\nimport type { TooltipType } from './Tooltip';\n\n/** @deprecated */\nexport interface IRadarProps extends RadarProps, UnknownProperties {}\nexport type RadarProps = Context & {\n /**\n * Scale for radar element\n * */\n /** @deprecated */\n scale: any;\n /**\n * Graph type to be displayed\n * @default 'polygon'\n * */\n type?: 'polygon' | 'circle';\n /**\n * Indent from the edge of svg to graph\n * */\n offset?: number;\n\n /**\n * Label font size\n * @default 12\n * */\n textSize?: number;\n\n /**\n * Base angle of chart rotation\n * @default 0\n * @example Math.PI/3\n * */\n angleOffset?: number;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n /** Callback triggered when a user clicks on a chart at a position corresponding to a category */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n};\n\n/** @deprecated */\nexport interface IRadarAxisProps extends RadarAxisProps, UnknownProperties {}\nexport type RadarAxisProps = Context & {\n /**\n * Sets the field name for categories\n * */\n dataKey: string;\n};\n\n/** @deprecated */\nexport interface IRadarAxisTicksProps extends RadarAxisTicksProps, UnknownProperties {}\nexport type RadarAxisTicksProps = {\n /**\n * Distance between auxiliary lines\n * @default 100\n * */\n tickSize?: number;\n};\n\n/** @deprecated */\nexport interface IRadarAxisLabelsProps extends RadarAxisLabelsProps, UnknownProperties {}\nexport type RadarAxisLabelsProps = {\n /**\n * Indent from graph to label\n * @default 10\n * */\n labelOffset?: number;\n};\n\ntype RadarAxisLabelsContext = Context & {\n xDirection: 'middle' | 'start' | 'end';\n yDirection: 'alphabetic' | 'mathematical' | 'middle';\n x: number;\n y: number;\n};\n\n/** @deprecated */\nexport interface IRadialPolygonProps extends RadialPolygonProps, UnknownProperties {}\nexport type RadialPolygonProps = Context & {\n /**\n * Sets the field name for data\n * */\n dataKey: string;\n /**\n * Curve method\n * @default curveLinearClosed\n * */\n curve?: CurveFactory;\n /**\n * Sets the color of the entire polygon\n * */\n color?: string;\n /**\n * Sets the fill color\n * */\n fill?: string;\n};\n\n/** @deprecated */\nexport interface IRadialPolygonLineProps extends RadialPolygonLineProps, UnknownProperties {}\nexport type RadialPolygonLineProps = {\n /**\n * Sets the line color\n * */\n color?: string;\n};\n\n/** @deprecated */\nexport interface IRadialPolygonDotsProps extends RadialPolygonDotsProps, UnknownProperties {}\nexport type RadialPolygonDotsProps = {\n /**\n * Sets the dot color\n * */\n color?: string;\n};\n\n/** @deprecated */\nexport interface IRadarHoverProps extends RadarHoverProps, UnknownProperties {}\nexport type RadarHoverProps = NSBox.Props & Context & {};\n\ndeclare const Radar: IntergalacticD3Component<'g', RadarProps, Context> & {\n Axis: IntergalacticD3Component<'path', RadarAxisProps, Context> & {\n Ticks: IntergalacticD3Component<'path', RadarAxisTicksProps, Context>;\n Labels: IntergalacticD3Component<'text', RadarAxisLabelsProps, RadarAxisLabelsContext>;\n };\n Polygon: IntergalacticD3Component<'path', RadialPolygonProps, Context> & {\n Line: IntergalacticD3Component<'line', RadialPolygonLineProps, Context>;\n Dots: IntergalacticD3Component<'circle', RadialPolygonDotsProps, Context>;\n };\n Hover: IntergalacticD3Component<'path', RadarHoverProps, Context>;\n Tooltip: TooltipType<\n RadarHoverProps & {\n /** Index in `data` array of the current items */\n index: number;\n }\n >;\n};\n\nexport declare function getLabelOffsetPosition(\n xDirection: 'middle' | 'start' | 'end',\n yDirection: 'alphabetic' | 'mathematical' | 'middle',\n width: number,\n height: number,\n): [xOffset: number, yOffset: number];\n\nexport default Radar;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveContainer.d.js","names":[],"sources":["../../../src/types/ResponsiveContainer.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"ResponsiveContainer.d.js","names":[],"sources":["../../../src/types/ResponsiveContainer.d.ts"],"sourcesContent":["import type { NSBox } from '@semcore/base-components';\nimport type { UnknownProperties } from '@semcore/core';\n\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IResponsiveContainerProps extends ResponsiveContainerProps, UnknownProperties {}\nexport type ResponsiveContainerProps = NSBox.Props & {\n /** Relation between height and width dimensions block */\n aspect?: number;\n /** Callback which will be called after changing the block size */\n onResize?: (size: [number, number], entries: ResizeObserverEntry[]) => void;\n};\n\n/** @deprecated */\nexport interface IResponsiveContainerContext\n extends ResponsiveContainerContext,\n UnknownProperties {}\nexport type ResponsiveContainerContext = {\n width?: number;\n height?: number;\n};\n\ndeclare const ResponsiveContainer: IntergalacticD3Component<\n 'div',\n ResponsiveContainerProps,\n ResponsiveContainerContext\n>;\n\nexport default ResponsiveContainer;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.js","names":[],"sources":["../../../src/types/Tooltip.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Tooltip.d.js","names":[],"sources":["../../../src/types/Tooltip.d.ts"],"sourcesContent":["import type { NSBox, NSPopper } from '@semcore/base-components';\nimport type { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';\nimport type React from 'react';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ITooltipChartProps extends TooltipChartProps, UnknownProperties {}\nexport type TooltipChartProps = NSPopper.Props &\n NSPopper.Trigger.Props &\n Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Handle click by trigger has an index - it is an index of the data array. */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n };\n\n/** @deprecated */\nexport interface ITooltipChartContext extends TooltipChartContext, UnknownProperties {\n /** Index active value for Axis x */\n xIndex: number | null;\n /** Index active value for Axis y */\n yIndex: number | null;\n}\nexport type TooltipChartContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n};\n\nexport type TooltipTypeBase = {\n Trigger: NSPopper.Trigger.Component;\n Popper: NSPopper.Popper.Component;\n Title: NSBox.Component;\n Dot: IntergalacticD3Component<'div', NSBox.Props & { color?: string }, TooltipChartContext>;\n Footer: NSBox.Component;\n};\n\nexport type TooltipType<ChildrenRenderProps = {}, TooltipProps = {}> = (<\n Tag extends Intergalactic.Tag = NSBox.Component,\n>(\n props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<\n Tag,\n TooltipProps,\n ChildrenRenderProps & TooltipChartContext\n >,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\nIntergalactic.InternalTypings.ComponentAdditive<\n Intergalactic.Tag,\n Intergalactic.Tag,\n TooltipProps\n> &\nTooltipTypeBase;\n\n/**\n * @deprecated Consider migration to better typed Bubble.Tooltip, HoverLine.Tooltip,\n * HoverRect.Tooltip, Donut.Tooltip, Radar.Tooltip,\n * ScatterPlot.Tooltip or Venn.Tooltip.\n *\n * Migration examples:\n * 1. `<Tooltip tag={HoverLine}>...</Tooltip>` => `<HoverLine.Tooltip>...</HoverLine.Tooltip>`\n * 2. `<Tooltip tag={HoverRect}>...</Tooltip>` => `<HoverRect.Tooltip>...</HoverRect.Tooltip>`\n * 3. `<Tooltip tag={Radar.Hover}>...</Tooltip>` => `<Radar.Tooltip>...</Radar.Tooltip>`\n * 4. `<Tooltip>...</Tooltip>` => `<Bubble.Tooltip>...</Bubble.Tooltip>`\n * 5. `<Tooltip>...</Tooltip>` => `<Donut.Tooltip>...</Donut.Tooltip>`\n * 6. `<Tooltip>...</Tooltip>` => `<ScatterPlot.Tooltip>...</ScatterPlot.Tooltip>`\n * 7. `<Tooltip>...</Tooltip>` => `<Venn.Tooltip>...</Venn.Tooltip>`\n */\ndeclare const Tooltip: TooltipType;\n\nexport default Tooltip;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Venn.d.js","names":[],"sources":["../../../src/types/Venn.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Venn.d.js","names":[],"sources":["../../../src/types/Venn.d.ts"],"sourcesContent":["import type { NSAnimation } from '@semcore/base-components';\nimport type { UnknownProperties } from '@semcore/core';\n\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { IntergalacticD3Component } from './Plot';\nimport type { TooltipType } from './Tooltip';\n\n/** @deprecated */\nexport interface IVennProps extends VennProps, UnknownProperties {}\nexport type VennProps = Context &\n NSAnimation.FadeInOut.Props & {\n /**\n * Rotate sets in the chart\n * @default Math.PI / 2\n */\n orientation?: number;\n /**\n * The function for sorting sets inside the chart\n * @default (circle1, circle2) => circle2.radius - circle1.radius\n */\n orientationOrder?: (c1: number, c2: number) => number;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n /**\n * Fallback for minimum value radius\n * @default 6\n * */\n minRadius?: number;\n };\n\n/** @deprecated */\nexport interface ICircleProps extends CircleProps, UnknownProperties {}\nexport type CircleProps = Context & {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /**\n * Human readable name of the circle\n * */\n name: string;\n /** Color circle\n @default #3AB011\n **/\n color?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface IIntersectionProps extends IntersectionProps, UnknownProperties {}\nexport type IntersectionProps = Context &\n NSAnimation.FadeInOut.Props & {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /**\n * Human readable name of the intersection\n * */\n name: string;\n /** Enables element transparency */\n transparent?: boolean;\n };\n\ndeclare const Venn: IntergalacticD3Component<'g', VennProps, Context> & {\n Circle: IntergalacticD3Component<'circle', CircleProps, Context>;\n Intersection: IntergalacticD3Component<'path', IntersectionProps, Context>;\n Tooltip: TooltipType<CircleProps>;\n};\n\nexport default Venn;\n"],"mappings":"","ignoreList":[]}
|