@semcore/d3-chart 3.37.2 → 3.38.0-prerelease.0
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 +18 -0
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +14 -14
- package/lib/cjs/Bar.js +10 -10
- package/lib/cjs/Bubble.js +12 -12
- package/lib/cjs/Donut.js +9 -9
- package/lib/cjs/Dots.js +10 -10
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +10 -10
- package/lib/cjs/Hover.js +13 -5
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +3 -3
- package/lib/cjs/Radar.js +19 -19
- package/lib/cjs/RadialTree.js +11 -11
- package/lib/cjs/ReferenceLine.js +9 -9
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +13 -11
- package/lib/cjs/Tooltip.js.map +1 -1
- 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 +41 -24
- 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/BubbleChart.js +2 -2
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +325 -0
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -0
- package/lib/cjs/component/Chart/CigaretteChart.type.js +2 -0
- package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/index.js +3 -1
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -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 +169 -0
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -0
- package/lib/cjs/style/bar.shadow.css +1 -1
- package/lib/cjs/types/index.d.js +12 -0
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +32 -4
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +14 -14
- package/lib/es6/Bar.js +10 -10
- package/lib/es6/Bubble.js +12 -12
- package/lib/es6/Donut.js +9 -9
- package/lib/es6/Dots.js +10 -10
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/HorizontalBar.js +10 -10
- package/lib/es6/Hover.js +13 -5
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +3 -3
- package/lib/es6/Radar.js +19 -19
- package/lib/es6/RadialTree.js +11 -11
- package/lib/es6/ReferenceLine.js +9 -9
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +13 -11
- package/lib/es6/Tooltip.js.map +1 -1
- 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 +41 -24
- 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/BubbleChart.js +2 -2
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +316 -0
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -0
- package/lib/es6/component/Chart/CigaretteChart.type.js +2 -0
- package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -0
- package/lib/es6/component/Chart/index.js +3 -1
- package/lib/es6/component/Chart/index.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -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 +161 -0
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -0
- package/lib/es6/style/bar.shadow.css +1 -1
- package/lib/es6/types/index.d.js +2 -0
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/es6/utils.js +32 -4
- package/lib/es6/utils.js.map +1 -1
- package/lib/types/component/Chart/AbstractChart.d.ts +2 -2
- package/lib/types/component/Chart/AbstractChart.type.d.ts +5 -0
- package/lib/types/component/Chart/CigaretteChart.d.ts +2 -0
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +15 -0
- package/lib/types/component/Chart/index.d.ts +1 -0
- package/lib/types/component/Cigarette/Cigarette.d.ts +2 -0
- package/lib/types/index.d.ts +5 -1
- package/lib/types/utils.d.ts +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractChart.type.js","names":[],"sources":["../../../../src/component/Chart/AbstractChart.type.ts"],"sourcesContent":["import React from 'react';\nimport { FlexProps } from '@semcore/flex-box';\nimport { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\nimport Icon from '@semcore/icon';\nimport { BaseChartLegendProps } from '../ChartLegend/BaseLegend.type';\nimport { TrendProps } from '../ChartLegend/LegendFlex/LegendFlex.type';\nimport { PatternsConfig } from '../../Pattern';\n\nexport type BaseLegendProps = BaseChartLegendProps & {\n /**\n * Disable hover (for transition items legend of each not hovered)\n */\n disableHoverItems?: boolean;\n /**\n * Disable selectable of data items by checkboxes in Legend\n */\n disableSelectItems?: boolean;\n} & (\n | (TrendProps & {\n /**\n * How to render Legend - Flex view. Just list of legend items\n */\n legendType?: never | 'Flex';\n /**\n * Config for Legend items\n */\n legendMap?: LegendDataMap<'Flex'>;\n })\n | {\n /**\n * How to render Legend - Table view. Table of legend items with some additional information in columns\n */\n legendType: 'Table';\n /**\n * Config for Legend items\n */\n legendMap?: LegendDataMap<'Table'>;\n }\n );\n\nexport type ObjectData = Record<string, unknown>;\nexport type ListData = ObjectData[];\n\nexport type BaseChartProps<T extends ListData | ObjectData> = FlexProps & {\n /**\n * Chart data. For all charts except Donut(Pie), Radar and Venn should be an Array\n */\n data: T;\n /**\n * Width of plot\n */\n plotWidth: number;\n /**\n * Height of plot\n */\n plotHeight: number;\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n /**\n * Margin (for Y axis points) from left side of chart container to Y axis\n */\n marginY?: number;\n /**\n * Margin (for X axis points) from bottom of chart container to X axis\n */\n marginX?: number;\n /**\n * invert axis and show horizontal charts (only for Bars!)\n */\n invertAxis?: boolean;\n\n /**\n * Show X axis\n * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)\n */\n showXAxis?: boolean;\n /**\n * Show Y axis\n * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)\n */\n showYAxis?: boolean;\n /**\n * Map with colors for data items\n */\n colorMap?: Record<string, string>;\n /**\n * Show tooltip's.\n * @default true\n */\n showTooltip?: boolean;\n /**\n * Show sum of values for selected point in tooltip\n */\n showTotalInTooltip?: boolean;\n /**\n * Scale for xAxis (see more in d3-scale)\n */\n xScale?: unknown;\n /**\n * Scale for yAxis (see more in d3-scale)\n */\n yScale?: unknown;\n /**\n * Count of ticks for X axis\n */\n xTicksCount?: number;\n /**\n * Count of ticks for Y axis\n */\n yTicksCount?: number;\n /**\n * Group key for all array-based charts (for get keys of items for legend except that group key)\n */\n groupKey?: string;\n /**\n * function for format axis item text\n */\n axisXValueFormatter?: (value: unknown) => string;\n axisYValueFormatter?: (value: unknown) => string;\n /**\n * Function for format text for tooltip\n */\n tooltipValueFormatter?: (value?: unknown) => string;\n} /**\n * By default, we show the Legend for all charts with more the one data item.\n * For hide the Legend, you should set showLegend prop to `false`.\n */ & (\n | {\n /**\n * Don't show legend\n */\n showLegend?: false;\n legendProps?: never;\n }\n | {\n /**\n * By default (if showLegend don't set), for one data item on chart,\n * Legend component will be hide, and show for more then 1 data item.\n * If set `true` - Legend component will show always.\n */\n showLegend?: true;\n /**\n * Props for Legend\n */\n legendProps?: Partial<BaseLegendProps>;\n }\n );\n\ntype LegendDataMap<T extends 'Flex' | 'Table'> = Record<\n LegendItemKey,\n {\n /**\n * Custom label for legend item (by default use keys from data item object)\n */\n label?: string;\n /**\n * Additional text after label\n */\n additionalInfo?: string;\n /**\n * Count after label\n */\n count?: number;\n /**\n * Custom Icon\n */\n icon?: typeof Icon;\n /**\n * Flag for uncheck some items by default\n */\n defaultChecked?: boolean;\n } & (T extends 'Table' ? { columns?: React.ReactNode[] } : { columns?: never })\n>;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"AbstractChart.type.js","names":[],"sources":["../../../../src/component/Chart/AbstractChart.type.ts"],"sourcesContent":["import React from 'react';\nimport { FlexProps } from '@semcore/flex-box';\nimport { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\nimport Icon from '@semcore/icon';\nimport { BaseChartLegendProps } from '../ChartLegend/BaseLegend.type';\nimport { TrendProps } from '../ChartLegend/LegendFlex/LegendFlex.type';\nimport { PatternsConfig } from '../../Pattern';\n// @ts-ignore\nimport { PlotSummarizerConfig } from '../../Plot';\n\nexport type BaseLegendProps = BaseChartLegendProps & {\n /**\n * Disable hover (for transition items legend of each not hovered)\n */\n disableHoverItems?: boolean;\n /**\n * Disable selectable of data items by checkboxes in Legend\n */\n disableSelectItems?: boolean;\n} & (\n | (TrendProps & {\n /**\n * How to render Legend - Flex view. Just list of legend items\n */\n legendType?: never | 'Flex';\n /**\n * Config for Legend items\n */\n legendMap?: LegendDataMap<'Flex'>;\n })\n | {\n /**\n * How to render Legend - Table view. Table of legend items with some additional information in columns\n */\n legendType: 'Table';\n /**\n * Config for Legend items\n */\n legendMap?: LegendDataMap<'Table'>;\n }\n );\n\nexport type ObjectData = Record<string, unknown>;\nexport type ListData = ObjectData[];\n\nexport type BaseChartProps<T extends ListData | ObjectData> = FlexProps & {\n /**\n * Chart data. For all charts except Donut(Pie), Radar and Venn should be an Array\n */\n data: T;\n /**\n * Width of plot\n */\n plotWidth: number;\n /**\n * Height of plot\n */\n plotHeight: number;\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n /**\n * Margin (for Y axis points) from left side of chart container to Y axis\n */\n marginY?: number;\n /**\n * Margin (for X axis points) from bottom of chart container to X axis\n */\n marginX?: number;\n /**\n * invert axis and show horizontal charts (only for Bars!)\n */\n invertAxis?: boolean;\n\n /**\n * Show X axis\n * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)\n */\n showXAxis?: boolean;\n /**\n * Show Y axis\n * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)\n */\n showYAxis?: boolean;\n /**\n * Map with colors for data items\n */\n colorMap?: Record<string, string>;\n /**\n * Show tooltip's.\n * @default true\n */\n showTooltip?: boolean;\n /**\n * Show sum of values for selected point in tooltip\n */\n showTotalInTooltip?: boolean;\n /**\n * Scale for xAxis (see more in d3-scale)\n */\n xScale?: unknown;\n /**\n * Scale for yAxis (see more in d3-scale)\n */\n yScale?: unknown;\n /**\n * Count of ticks for X axis\n */\n xTicksCount?: number;\n /**\n * Count of ticks for Y axis\n */\n yTicksCount?: number;\n /**\n * Group key for all array-based charts (for get keys of items for legend except that group key)\n */\n groupKey?: string;\n /**\n * function for format axis item text\n */\n axisXValueFormatter?: (value: unknown) => string;\n axisYValueFormatter?: (value: unknown) => string;\n /**\n * Function for format text for tooltip\n */\n tooltipValueFormatter?: (value?: unknown) => string;\n /**\n * Config for a11y summary\n */\n a11yAltTextConfig?: PlotSummarizerConfig;\n} /**\n * By default, we show the Legend for all charts with more the one data item.\n * For hide the Legend, you should set showLegend prop to `false`.\n */ & (\n | {\n /**\n * Don't show legend\n */\n showLegend?: false;\n legendProps?: never;\n }\n | {\n /**\n * By default (if showLegend don't set), for one data item on chart,\n * Legend component will be hide, and show for more then 1 data item.\n * If set `true` - Legend component will show always.\n */\n showLegend?: true;\n /**\n * Props for Legend\n */\n legendProps?: Partial<BaseLegendProps>;\n }\n );\n\ntype LegendDataMap<T extends 'Flex' | 'Table'> = Record<\n LegendItemKey,\n {\n /**\n * Custom label for legend item (by default use keys from data item object)\n */\n label?: string;\n /**\n * Additional text after label\n */\n additionalInfo?: string;\n /**\n * Count after label\n */\n count?: number;\n /**\n * Custom Icon\n */\n icon?: typeof Icon;\n /**\n * Flag for uncheck some items by default\n */\n defaultChecked?: boolean;\n } & (T extends 'Table' ? { columns?: React.ReactNode[] } : { columns?: never })\n>;\n"],"mappings":""}
|
|
@@ -33,8 +33,8 @@ var BubbleChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
}, {
|
|
36
|
-
key: "
|
|
37
|
-
|
|
36
|
+
key: "getDefaultDataDefinitions",
|
|
37
|
+
value: function getDefaultDataDefinitions() {
|
|
38
38
|
var _this = this;
|
|
39
39
|
var _this$props = this.props,
|
|
40
40
|
legendProps = _this$props.legendProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleChart.js","names":["_react","_interopRequireDefault","require","_core","_d3Scale","_2","_AbstractChart2","_typography","BubbleChartComponent","_AbstractChart","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","get","data","props","map","_","index","toString","_this","_this$props","legendProps","item","_legendProps$legendMa","_ref","_legendData$label","_legendData$icon","_legendData$defaultCh","legendData","legendMap","color","undefined","resolveColor","dataDefinition","id","label","icon","checked","defaultChecked","columns","additionalInfo","count","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","range","plotPadding","domain","calculateBubbleDomain","scaleLinear","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","
|
|
1
|
+
{"version":3,"file":"BubbleChart.js","names":["_react","_interopRequireDefault","require","_core","_d3Scale","_2","_AbstractChart2","_typography","BubbleChartComponent","_AbstractChart","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","get","data","props","map","_","index","toString","value","getDefaultDataDefinitions","_this","_this$props","legendProps","item","_legendProps$legendMa","_ref","_legendData$label","_legendData$icon","_legendData$defaultCh","legendData","legendMap","color","undefined","resolveColor","dataDefinition","id","label","icon","checked","defaultChecked","columns","additionalInfo","count","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","range","plotPadding","domain","calculateBubbleDomain","scaleLinear","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","defaultLegendProps","shape","renderChart","createElement","Bubble","x","y","renderTooltip","showTooltip","Tooltip","_ref2","children","Fragment","Title","Text","tag","AbstractChart","_defineProperty2","BubbleChart","createComponent","exports"],"sources":["../../../../src/component/Chart/BubbleChart.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent from '@semcore/core';\nimport { scaleLinear, ScaleLinear } from 'd3-scale';\n// @ts-ignore\nimport { Bubble, calculateBubbleDomain } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { BubbleChartData, BubbleChartProps, BubbleChartType } from './BubbleChart.type';\nimport { Text } from '@semcore/typography';\nimport { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass BubbleChartComponent extends AbstractChart<BubbleChartData, BubbleChartProps> {\n static displayName = 'Chart.Bubble';\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n return data.map((_, index) => index.toString());\n }\n\n protected override getDefaultDataDefinitions(): Array<\n LegendItem & { columns: React.ReactNode[] }\n > {\n const { legendProps, data } = this.props;\n\n return data.map((item, index) => {\n const key = index.toString();\n const legendData = legendProps?.legendMap?.[key];\n\n if (item.color === undefined) {\n item.color = this.resolveColor(key, index);\n }\n\n const dataDefinition: LegendItem & { columns: React.ReactNode[] } = {\n id: key,\n label: legendData?.label ?? item.label ?? key,\n icon: legendData?.icon ?? undefined,\n checked: legendData?.defaultChecked ?? true,\n color: item.color,\n columns: [],\n };\n\n if (legendData?.additionalInfo || legendData?.count) {\n dataDefinition.additionalInfo = legendData.additionalInfo\n ? { label: legendData.additionalInfo }\n : legendData.count\n ? { count: legendData.count }\n : undefined;\n }\n\n return dataDefinition;\n });\n }\n\n get xScale() {\n const { xScale, marginY = 30, plotWidth, data } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const range = [marginY, plotWidth - this.plotPadding];\n const domain = calculateBubbleDomain(data, 'x', range);\n\n return scaleLinear().domain(domain).range(range);\n }\n\n get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight, data } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const range = [plotHeight - marginX, this.plotPadding];\n const domain = calculateBubbleDomain(data, 'y', range);\n\n return scaleLinear().domain(domain).range(range);\n }\n\n defaultLegendProps() {\n return {\n shape: 'Circle' as const,\n };\n }\n\n renderChart() {\n return <Bubble x='x' y='y' value='value' color={'color'} label={'label'} />;\n }\n\n renderTooltip() {\n const { showTooltip } = this.asProps;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Bubble.Tooltip>\n {({ index, data }: any) => {\n return {\n children: (\n <>\n <Bubble.Tooltip.Title>Data</Bubble.Tooltip.Title>\n <Text tag='div'>X axis {data[index].x}</Text>\n <Text tag='div'>Y axis {data[index].y}</Text>\n <Text tag='div'>Value {data[index].value}</Text>\n </>\n ),\n };\n }}\n </Bubble.Tooltip>\n );\n }\n}\n\nexport const BubbleChart: BubbleChartType = createComponent(BubbleChartComponent);\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,EAAA,GAAAH,OAAA;AACA,IA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AAA,aAA1C3E,oBAAoB,iBACH,cAAc;AAwG9B,IAAM4E,WAA4B,GAAG,IAAAC,gBAAe,EAAC7E,oBAAoB,CAAC;AAAC8E,OAAA,CAAAF,WAAA,GAAAA,WAAA"}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.CigaretteChart = void 0;
|
|
9
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
14
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
15
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
18
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
+
var _core = _interopRequireWildcard(require("@semcore/core"));
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
|
+
var _divider = _interopRequireDefault(require("@semcore/divider"));
|
|
22
|
+
var _flexBox = require("@semcore/flex-box");
|
|
23
|
+
var _typography = require("@semcore/typography");
|
|
24
|
+
var _resolveColorEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/resolveColorEnhance"));
|
|
25
|
+
var _uniqueID = _interopRequireDefault(require("@semcore/utils/lib/uniqueID"));
|
|
26
|
+
var _d3Scale = require("d3-scale");
|
|
27
|
+
var _ = require("../..");
|
|
28
|
+
var _AnimatedClipPath = _interopRequireDefault(require("../../AnimatedClipPath"));
|
|
29
|
+
var _AbstractChart2 = require("./AbstractChart");
|
|
30
|
+
var _utils = require("../../utils");
|
|
31
|
+
var _Cigarette = _interopRequireDefault(require("../Cigarette/Cigarette"));
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
|
|
36
|
+
var wMin = 2;
|
|
37
|
+
var CigaretteChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
38
|
+
(0, _inherits2["default"])(CigaretteChartComponent, _AbstractChart);
|
|
39
|
+
var _super = (0, _createSuper2["default"])(CigaretteChartComponent);
|
|
40
|
+
function CigaretteChartComponent() {
|
|
41
|
+
var _this;
|
|
42
|
+
(0, _classCallCheck2["default"])(this, CigaretteChartComponent);
|
|
43
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
+
args[_key] = arguments[_key];
|
|
45
|
+
}
|
|
46
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "plotPadding", 0);
|
|
48
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "offset", 0);
|
|
49
|
+
return _this;
|
|
50
|
+
}
|
|
51
|
+
(0, _createClass2["default"])(CigaretteChartComponent, [{
|
|
52
|
+
key: "resolveColor",
|
|
53
|
+
value: function resolveColor(id, index) {
|
|
54
|
+
var _this$props$colorMap$, _this$props$colorMap;
|
|
55
|
+
return (_this$props$colorMap$ = (_this$props$colorMap = this.props.colorMap) === null || _this$props$colorMap === void 0 ? void 0 : _this$props$colorMap[id]) !== null && _this$props$colorMap$ !== void 0 ? _this$props$colorMap$ : "blue-".concat(5 - index, "00");
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "getDefaultDataDefinitions",
|
|
59
|
+
value: function getDefaultDataDefinitions() {
|
|
60
|
+
var dataDefinitions = (0, _get2["default"])((0, _getPrototypeOf2["default"])(CigaretteChartComponent.prototype), "getDefaultDataDefinitions", this).call(this);
|
|
61
|
+
return dataDefinitions.map(function (dataDef) {
|
|
62
|
+
dataDef.columns = dataDef.columns.slice(1);
|
|
63
|
+
return dataDef;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
key: "defaultLegendProps",
|
|
68
|
+
value: function defaultLegendProps() {
|
|
69
|
+
return {
|
|
70
|
+
legendType: 'Table',
|
|
71
|
+
w: 'fit-content'
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "xScale",
|
|
76
|
+
get: function get() {
|
|
77
|
+
var invertAxis = this.asProps.invertAxis;
|
|
78
|
+
return invertAxis ? this.valueScale : this.categoryScale;
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "yScale",
|
|
82
|
+
get: function get() {
|
|
83
|
+
var invertAxis = this.asProps.invertAxis;
|
|
84
|
+
return invertAxis ? this.categoryScale : this.valueScale;
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "renderChart",
|
|
88
|
+
value: function renderChart() {
|
|
89
|
+
var _this2 = this;
|
|
90
|
+
var _this$asProps = this.asProps,
|
|
91
|
+
invertAxis = _this$asProps.invertAxis,
|
|
92
|
+
data = _this$asProps.data,
|
|
93
|
+
uid = _this$asProps.uid,
|
|
94
|
+
duration = _this$asProps.duration,
|
|
95
|
+
patterns = _this$asProps.patterns,
|
|
96
|
+
plotHeight = _this$asProps.plotHeight,
|
|
97
|
+
plotWidth = _this$asProps.plotWidth,
|
|
98
|
+
onClick = _this$asProps.onClick;
|
|
99
|
+
var _this$state = this.state,
|
|
100
|
+
dataDefinitions = _this$state.dataDefinitions,
|
|
101
|
+
highlightedLine = _this$state.highlightedLine;
|
|
102
|
+
this.offset = 0;
|
|
103
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, (invertAxis ? dataDefinitions : (0, _toConsumableArray2["default"])(dataDefinitions).reverse()).map(function (item, index) {
|
|
104
|
+
var value = data[item.id];
|
|
105
|
+
if (!item.checked || value === _utils.interpolateValue || value === null) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
var absWidth = Math.abs(_this2.valueScale(value) - Math.max(_this2.valueScale(_this2.valueScale.domain()[0]), _this2.valueScale(0)));
|
|
109
|
+
var height = (0, _utils.scaleToBand)(_this2.categoryScale).bandwidth() - 4;
|
|
110
|
+
var width = value === 0 ? 0 : Math.max(absWidth, wMin * 2) - wMin;
|
|
111
|
+
var y = 2;
|
|
112
|
+
var x = index === 0 ? 0 : _this2.offset;
|
|
113
|
+
var r = height < 28 ? 2 : 4;
|
|
114
|
+
_this2.offset = _this2.offset + width + wMin;
|
|
115
|
+
return /*#__PURE__*/_react["default"].createElement(_Cigarette["default"], {
|
|
116
|
+
key: item.id,
|
|
117
|
+
dataKey: item.id,
|
|
118
|
+
index: index,
|
|
119
|
+
y: invertAxis ? y : x,
|
|
120
|
+
x: invertAxis ? x : y,
|
|
121
|
+
width: invertAxis ? width : height,
|
|
122
|
+
height: invertAxis ? height : width,
|
|
123
|
+
uid: uid,
|
|
124
|
+
hide: !item.checked,
|
|
125
|
+
duration: duration,
|
|
126
|
+
r: index === 0 || index === dataDefinitions.length - 1 ? r : 0,
|
|
127
|
+
color: item.color,
|
|
128
|
+
patterns: patterns,
|
|
129
|
+
direction: invertAxis ? 'horizontal' : 'vertical',
|
|
130
|
+
onClick: onClick,
|
|
131
|
+
hovered: highlightedLine === index ? true : highlightedLine === -1 ? undefined : false
|
|
132
|
+
});
|
|
133
|
+
}), /*#__PURE__*/_react["default"].createElement(_AnimatedClipPath["default"], {
|
|
134
|
+
"aria-hidden": true,
|
|
135
|
+
duration: duration,
|
|
136
|
+
id: uid,
|
|
137
|
+
x: "0",
|
|
138
|
+
y: "0",
|
|
139
|
+
width: invertAxis ? 0 : plotWidth,
|
|
140
|
+
height: invertAxis ? plotHeight : 0
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
key: "renderTooltip",
|
|
145
|
+
value: function renderTooltip() {
|
|
146
|
+
var _this3 = this;
|
|
147
|
+
var _this$asProps2 = this.asProps,
|
|
148
|
+
data = _this$asProps2.data,
|
|
149
|
+
showTotalInTooltip = _this$asProps2.showTotalInTooltip,
|
|
150
|
+
showTooltip = _this$asProps2.showTooltip,
|
|
151
|
+
invertAxis = _this$asProps2.invertAxis,
|
|
152
|
+
tooltipTitle = _this$asProps2.tooltipTitle,
|
|
153
|
+
tooltipViewType = _this$asProps2.tooltipViewType;
|
|
154
|
+
var dataDefinitions = this.state.dataDefinitions;
|
|
155
|
+
if (!showTooltip) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
return /*#__PURE__*/_react["default"].createElement(_.HoverRect.Tooltip, {
|
|
159
|
+
x: invertAxis ? '' : undefined,
|
|
160
|
+
y: invertAxis ? undefined : '',
|
|
161
|
+
wMin: 100,
|
|
162
|
+
hideHoverLine: true
|
|
163
|
+
}, function (tooltipProps) {
|
|
164
|
+
var dataKey = invertAxis ? tooltipProps.xIndex : tooltipProps.yIndex;
|
|
165
|
+
var total = _this3.totalValue(data);
|
|
166
|
+
if (tooltipViewType === 'single') {
|
|
167
|
+
var item = dataDefinitions.find(function (dataDefItem) {
|
|
168
|
+
return dataDefItem.id === dataKey;
|
|
169
|
+
});
|
|
170
|
+
if (!item) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
children: /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, {
|
|
175
|
+
justifyContent: "space-between",
|
|
176
|
+
key: dataKey
|
|
177
|
+
}, /*#__PURE__*/_react["default"].createElement(_.HoverRect.Tooltip.Dot, {
|
|
178
|
+
mr: 4,
|
|
179
|
+
color: item.color
|
|
180
|
+
}, item.label), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
181
|
+
bold: true
|
|
182
|
+
}, _this3.tooltipValueFormatter(data[dataKey])))
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
children: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, tooltipTitle && /*#__PURE__*/_react["default"].createElement(_.HoverRect.Tooltip.Title, null, "Some tooltip title"), dataDefinitions.map(function (item) {
|
|
187
|
+
return item.checked && /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, {
|
|
188
|
+
justifyContent: "space-between",
|
|
189
|
+
key: item.id,
|
|
190
|
+
style: {
|
|
191
|
+
opacity: item.id === dataKey ? 1 : 0.3
|
|
192
|
+
}
|
|
193
|
+
}, /*#__PURE__*/_react["default"].createElement(_.HoverRect.Tooltip.Dot, {
|
|
194
|
+
mr: 4,
|
|
195
|
+
color: item.color
|
|
196
|
+
}, item.label), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
197
|
+
bold: true
|
|
198
|
+
}, _this3.tooltipValueFormatter(data[item.id])));
|
|
199
|
+
}), showTotalInTooltip === true && /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, {
|
|
200
|
+
mt: 2,
|
|
201
|
+
justifyContent: "space-between"
|
|
202
|
+
}, /*#__PURE__*/_react["default"].createElement(_flexBox.Box, {
|
|
203
|
+
mr: 4
|
|
204
|
+
}, "Total"), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
205
|
+
bold: true
|
|
206
|
+
}, total)))
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}, {
|
|
211
|
+
key: "renderHeader",
|
|
212
|
+
value: function renderHeader() {
|
|
213
|
+
var _this$asProps$header;
|
|
214
|
+
return (_this$asProps$header = this.asProps.header) !== null && _this$asProps$header !== void 0 ? _this$asProps$header : null;
|
|
215
|
+
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "render",
|
|
218
|
+
value: function render() {
|
|
219
|
+
var _ref = this.asProps,
|
|
220
|
+
_ref3;
|
|
221
|
+
var SChart = _flexBox.Flex;
|
|
222
|
+
var _this$asProps3 = this.asProps,
|
|
223
|
+
styles = _this$asProps3.styles,
|
|
224
|
+
plotWidth = _this$asProps3.plotWidth,
|
|
225
|
+
plotHeight = _this$asProps3.plotHeight,
|
|
226
|
+
data = _this$asProps3.data,
|
|
227
|
+
patterns = _this$asProps3.patterns,
|
|
228
|
+
invertAxis = _this$asProps3.invertAxis,
|
|
229
|
+
a11yAltTextConfig = _this$asProps3.a11yAltTextConfig;
|
|
230
|
+
var header = this.renderHeader();
|
|
231
|
+
if (invertAxis) {
|
|
232
|
+
var _ref2;
|
|
233
|
+
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SChart, _ref2.cn("SChart", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
234
|
+
"gap": 6,
|
|
235
|
+
"direction": 'column',
|
|
236
|
+
"__excludeProps": ['onClick', 'data']
|
|
237
|
+
}, _ref))), /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, _ref2.cn("Flex", {
|
|
238
|
+
"direction": 'column'
|
|
239
|
+
}), header, /*#__PURE__*/_react["default"].createElement(_.Plot, _ref2.cn("Plot", {
|
|
240
|
+
"data": data,
|
|
241
|
+
"scale": [this.xScale, this.yScale],
|
|
242
|
+
"width": plotWidth,
|
|
243
|
+
"height": plotHeight,
|
|
244
|
+
"dataHints": this.dataHints,
|
|
245
|
+
"patterns": patterns,
|
|
246
|
+
"a11yAltTextConfig": a11yAltTextConfig
|
|
247
|
+
}), this.renderTooltip(), this.renderChart())), this.renderLegend());
|
|
248
|
+
}
|
|
249
|
+
return _ref3 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SChart, _ref3.cn("SChart", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
250
|
+
"gap": 6,
|
|
251
|
+
"__excludeProps": ['onClick', 'data']
|
|
252
|
+
}, _ref))), /*#__PURE__*/_react["default"].createElement(_.Plot, _ref3.cn("Plot", {
|
|
253
|
+
"data": data,
|
|
254
|
+
"scale": [this.xScale, this.yScale],
|
|
255
|
+
"width": plotWidth,
|
|
256
|
+
"height": plotHeight,
|
|
257
|
+
"dataHints": this.dataHints,
|
|
258
|
+
"patterns": patterns,
|
|
259
|
+
"a11yAltTextConfig": a11yAltTextConfig
|
|
260
|
+
}), this.renderTooltip(), this.renderChart()), /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, _ref3.cn("Flex", {
|
|
261
|
+
"direction": 'column',
|
|
262
|
+
"gap": 2
|
|
263
|
+
}), header && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_flexBox.Box, _ref3.cn("Box", {}), header), /*#__PURE__*/_react["default"].createElement(_divider["default"], _ref3.cn("Divider", {}))), this.renderLegend()));
|
|
264
|
+
}
|
|
265
|
+
}, {
|
|
266
|
+
key: "selectedData",
|
|
267
|
+
get: function get() {
|
|
268
|
+
var data = this.asProps.data;
|
|
269
|
+
var dataDefinitions = this.state.dataDefinitions;
|
|
270
|
+
var result = new Map();
|
|
271
|
+
dataDefinitions.forEach(function (dataDefItem) {
|
|
272
|
+
var value = data[dataDefItem.id];
|
|
273
|
+
if (dataDefItem.checked && value !== _utils.interpolateValue) {
|
|
274
|
+
result.set(dataDefItem.id, value);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
return result;
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
key: "categoryScale",
|
|
281
|
+
get: function get() {
|
|
282
|
+
var _this$asProps4 = this.asProps,
|
|
283
|
+
plotWidth = _this$asProps4.plotWidth,
|
|
284
|
+
plotHeight = _this$asProps4.plotHeight,
|
|
285
|
+
invertAxis = _this$asProps4.invertAxis;
|
|
286
|
+
var range = invertAxis ? [plotHeight, 0] : [0, plotWidth];
|
|
287
|
+
return (0, _d3Scale.scaleBand)([0], range);
|
|
288
|
+
}
|
|
289
|
+
}, {
|
|
290
|
+
key: "valueScale",
|
|
291
|
+
get: function get() {
|
|
292
|
+
var _this$asProps5 = this.asProps,
|
|
293
|
+
plotWidth = _this$asProps5.plotWidth,
|
|
294
|
+
plotHeight = _this$asProps5.plotHeight,
|
|
295
|
+
invertAxis = _this$asProps5.invertAxis;
|
|
296
|
+
var max = 0;
|
|
297
|
+
this.selectedData.forEach(function (value) {
|
|
298
|
+
max = max + value;
|
|
299
|
+
});
|
|
300
|
+
return (0, _d3Scale.scaleLinear)().range(invertAxis ? [0, plotWidth] : [plotHeight, 0]).domain([0, max]);
|
|
301
|
+
}
|
|
302
|
+
}]);
|
|
303
|
+
return CigaretteChartComponent;
|
|
304
|
+
}(_AbstractChart2.AbstractChart);
|
|
305
|
+
(0, _defineProperty2["default"])(CigaretteChartComponent, "displayName", 'Cigarette.Bar');
|
|
306
|
+
(0, _defineProperty2["default"])(CigaretteChartComponent, "defaultProps", function (props) {
|
|
307
|
+
var _props$invertAxis;
|
|
308
|
+
var invertAxis = (_props$invertAxis = props.invertAxis) !== null && _props$invertAxis !== void 0 ? _props$invertAxis : true;
|
|
309
|
+
return {
|
|
310
|
+
invertAxis: invertAxis,
|
|
311
|
+
showXAxis: false,
|
|
312
|
+
showYAxis: false,
|
|
313
|
+
showTooltip: true,
|
|
314
|
+
showLegend: false,
|
|
315
|
+
marginX: 0,
|
|
316
|
+
marginY: 0,
|
|
317
|
+
duration: 500,
|
|
318
|
+
plotWidth: !invertAxis && !props.plotWidth ? 44 : props.plotWidth,
|
|
319
|
+
plotHeight: invertAxis && !props.plotHeight ? 28 : props.plotHeight
|
|
320
|
+
};
|
|
321
|
+
});
|
|
322
|
+
(0, _defineProperty2["default"])(CigaretteChartComponent, "enhance", [(0, _resolveColorEnhance["default"])(), (0, _uniqueID["default"])()]);
|
|
323
|
+
var CigaretteChart = (0, _core["default"])(CigaretteChartComponent);
|
|
324
|
+
exports.CigaretteChart = CigaretteChart;
|
|
325
|
+
//# sourceMappingURL=CigaretteChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CigaretteChart.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_divider","_flexBox","_typography","_resolveColorEnhance","_uniqueID","_d3Scale","_","_AnimatedClipPath","_AbstractChart2","_utils","_Cigarette","wMin","CigaretteChartComponent","_AbstractChart","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","_createClass2","key","value","resolveColor","id","index","_this$props$colorMap$","_this$props$colorMap","props","colorMap","getDefaultDataDefinitions","dataDefinitions","_get2","_getPrototypeOf2","prototype","map","dataDef","columns","slice","defaultLegendProps","legendType","w","get","invertAxis","asProps","valueScale","categoryScale","renderChart","_this2","_this$asProps","data","uid","duration","patterns","plotHeight","plotWidth","onClick","_this$state","state","highlightedLine","offset","createElement","Fragment","_toConsumableArray2","reverse","item","checked","interpolateValue","absWidth","Math","abs","max","domain","height","scaleToBand","bandwidth","width","y","x","r","dataKey","hide","color","direction","hovered","undefined","renderTooltip","_this3","_this$asProps2","showTotalInTooltip","showTooltip","tooltipTitle","tooltipViewType","HoverRect","Tooltip","hideHoverLine","tooltipProps","xIndex","yIndex","total","totalValue","find","dataDefItem","children","Flex","justifyContent","Dot","mr","label","Text","bold","tooltipValueFormatter","Title","style","opacity","mt","Box","renderHeader","_this$asProps$header","header","render","_ref","_ref3","SChart","_this$asProps3","styles","a11yAltTextConfig","_ref2","sstyled","cn","_objectSpread2","assignProps","Plot","xScale","yScale","dataHints","renderLegend","result","Map","forEach","set","_this$asProps4","range","scaleBand","_this$asProps5","selectedData","scaleLinear","AbstractChart","_props$invertAxis","showXAxis","showYAxis","showLegend","marginX","marginY","resolveColorEnhance","uniqueIDEnhancement","CigaretteChart","createComponent","exports"],"sources":["../../../../src/component/Chart/CigaretteChart.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Root, sstyled } from '@semcore/core';\nimport Divider from '@semcore/divider';\nimport { Box, Flex } from '@semcore/flex-box';\nimport { Text } from '@semcore/typography';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';\nimport { CigaretteChartData, CigaretteChartProps, CigaretteChartType } from './CigaretteChart.type';\nimport { scaleBand, scaleLinear } from 'd3-scale';\n// @ts-ignore\nimport { HoverRect, Plot } from '../..';\n// @ts-ignore\nimport AnimatedClipPath from '../../AnimatedClipPath';\n\nimport { AbstractChart } from './AbstractChart';\nimport { interpolateValue, scaleToBand } from '../../utils';\n\nimport Cigarette from '../Cigarette/Cigarette';\nimport { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nconst wMin = 2;\n\ntype Enhances = {\n resolveColor: ReturnType<typeof resolveColorEnhance>;\n uid: ReturnType<typeof uniqueIDEnhancement>;\n};\n\nclass CigaretteChartComponent extends AbstractChart<\n CigaretteChartData,\n CigaretteChartProps,\n Enhances\n> {\n static displayName = 'Cigarette.Bar';\n\n static defaultProps: any = (props: CigaretteChartProps) => {\n const invertAxis = props.invertAxis ?? true;\n return {\n invertAxis: 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 };\n };\n\n static enhance = [resolveColorEnhance(), uniqueIDEnhancement()];\n\n protected override plotPadding = 0;\n\n private offset = 0;\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 get xScale() {\n const { invertAxis } = this.asProps;\n\n return invertAxis ? this.valueScale : this.categoryScale;\n }\n\n get yScale() {\n const { invertAxis } = this.asProps;\n\n return invertAxis ? this.categoryScale : this.valueScale;\n }\n\n renderChart() {\n const { invertAxis, data, uid, duration, patterns, plotHeight, plotWidth, onClick } =\n this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n this.offset = 0;\n\n return (\n <>\n {(invertAxis ? dataDefinitions : [...dataDefinitions].reverse()).map((item, index) => {\n const value = data[item.id];\n\n if (!item.checked || value === interpolateValue || value === null) {\n return null;\n }\n\n const absWidth = Math.abs(\n this.valueScale(value) -\n Math.max(this.valueScale(this.valueScale.domain()[0]), this.valueScale(0)),\n );\n const height = scaleToBand(this.categoryScale).bandwidth() - 4;\n const width = value === 0 ? 0 : Math.max(absWidth, wMin * 2) - wMin;\n const y = 2;\n const x = index === 0 ? 0 : this.offset;\n const r = height < 28 ? 2 : 4;\n\n this.offset = this.offset + width + wMin;\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, showTotalInTooltip, showTooltip, invertAxis, tooltipTitle, tooltipViewType } =\n this.asProps;\n const { dataDefinitions } = this.state;\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 >\n {(tooltipProps: any) => {\n const dataKey = invertAxis ? tooltipProps.xIndex : tooltipProps.yIndex;\n const total = this.totalValue(data);\n\n if (tooltipViewType === 'single') {\n const item = dataDefinitions.find((dataDefItem) => dataDefItem.id === dataKey);\n\n if (!item) {\n return null;\n }\n\n return {\n children: (\n <Flex justifyContent='space-between' key={dataKey}>\n <HoverRect.Tooltip.Dot mr={4} color={item.color}>\n {item.label}\n </HoverRect.Tooltip.Dot>\n <Text bold>{this.tooltipValueFormatter(data[dataKey])}</Text>\n </Flex>\n ),\n };\n }\n\n return {\n children: (\n <>\n {tooltipTitle && (\n <HoverRect.Tooltip.Title>Some tooltip title</HoverRect.Tooltip.Title>\n )}\n\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Flex\n justifyContent='space-between'\n key={item.id}\n style={{ opacity: item.id === dataKey ? 1 : 0.3 }}\n >\n <HoverRect.Tooltip.Dot mr={4} color={item.color}>\n {item.label}\n </HoverRect.Tooltip.Dot>\n <Text bold>{this.tooltipValueFormatter(data[item.id])}</Text>\n </Flex>\n )\n );\n })}\n\n {showTotalInTooltip === true && (\n <Flex mt={2} justifyContent='space-between'>\n <Box mr={4}>Total</Box>\n <Text bold>{total}</Text>\n </Flex>\n )}\n </>\n ),\n };\n }}\n </HoverRect.Tooltip>\n );\n }\n\n renderHeader() {\n return this.asProps.header ?? null;\n }\n\n override render() {\n const SChart = Root;\n const { styles, plotWidth, plotHeight, data, patterns, invertAxis, a11yAltTextConfig } =\n this.asProps;\n\n const header = this.renderHeader();\n\n if (invertAxis) {\n return sstyled(styles)(\n <SChart render={Flex} gap={6} direction={'column'} __excludeProps={['onClick', 'data']}>\n <Flex direction={'column'}>\n {header}\n <Plot\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 >\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']}>\n <Plot\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 >\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 private get selectedData() {\n const { data } = this.asProps;\n const { dataDefinitions } = this.state;\n\n const result = new Map<string, number>();\n\n dataDefinitions.forEach((dataDefItem) => {\n const value = data[dataDefItem.id];\n if (dataDefItem.checked && value !== interpolateValue) {\n result.set(dataDefItem.id, value);\n }\n });\n\n return result;\n }\n\n private get categoryScale() {\n const { plotWidth, plotHeight, invertAxis } = this.asProps;\n\n const range = invertAxis ? [plotHeight, 0] : [0, plotWidth];\n\n return scaleBand<{}>([0], range);\n }\n\n private get valueScale() {\n const { plotWidth, plotHeight, invertAxis } = this.asProps;\n\n let max = 0;\n\n this.selectedData.forEach((value) => {\n max = max + value;\n });\n\n return scaleLinear()\n .range(invertAxis ? [0, plotWidth] : [plotHeight, 0])\n .domain([0, max]);\n }\n}\n\nexport const CigaretteChart: CigaretteChartType = createComponent(CigaretteChartComponent);\n"],"mappings":";;;;;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,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A;AAAA,EA9SmCiJ,6BAAa;AAAA,IAAAjI,gBAAA,aAA7ChB,uBAAuB,iBAKN,eAAe;AAAA,IAAAgB,gBAAA,aALhChB,uBAAuB,kBAOA,UAAC0B,KAA0B,EAAK;EAAA,IAAAwH,iBAAA;EACzD,IAAMzG,UAAU,IAAAyG,iBAAA,GAAGxH,KAAK,CAACe,UAAU,cAAAyG,iBAAA,cAAAA,iBAAA,GAAI,IAAI;EAC3C,OAAO;IACLzG,UAAU,EAAEA,UAAU;IACtB0G,SAAS,EAAE,KAAK;IAChBC,SAAS,EAAE,KAAK;IAChB5D,WAAW,EAAE,IAAI;IACjB6D,UAAU,EAAE,KAAK;IACjBC,OAAO,EAAE,CAAC;IACVC,OAAO,EAAE,CAAC;IACVrG,QAAQ,EAAE,GAAG;IACbG,SAAS,EAAE,CAACZ,UAAU,IAAI,CAACf,KAAK,CAAC2B,SAAS,GAAG,EAAE,GAAG3B,KAAK,CAAC2B,SAAS;IACjED,UAAU,EAAEX,UAAU,IAAI,CAACf,KAAK,CAAC0B,UAAU,GAAG,EAAE,GAAG1B,KAAK,CAAC0B;EAC3D,CAAC;AACH,CAAC;AAAA,IAAApC,gBAAA,aArBGhB,uBAAuB,aAuBV,CAAC,IAAAwJ,+BAAmB,GAAE,EAAE,IAAAC,oBAAmB,GAAE,CAAC;AA0R1D,IAAMC,cAAkC,GAAG,IAAAC,gBAAe,EAAC3J,uBAAuB,CAAC;AAAC4J,OAAA,CAAAF,cAAA,GAAAA,cAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CigaretteChart.type.js","names":[],"sources":["../../../../src/component/Chart/CigaretteChart.type.ts"],"sourcesContent":["import React from 'react';\nimport { Intergalactic } from '@semcore/core';\nimport { BaseChartProps } from './AbstractChart.type';\nimport { interpolateValue } from '../../utils';\n\ntype DataKey = string;\n\nexport type CigaretteChartData = Record<DataKey, number | typeof interpolateValue>;\n\nexport type CigaretteChartProps = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<CigaretteChartData>,\n 'xScale' | 'yScale'\n> & {\n tooltipTitle?: string;\n tooltipViewType?: 'all' | 'single';\n header?: React.ReactNode;\n duration?: number;\n onClick?: (key: DataKey, event: React.SyntheticEvent) => void;\n};\n\nexport type CigaretteChartType = Intergalactic.Component<'div', CigaretteChartProps>;\n"],"mappings":""}
|
|
@@ -13,6 +13,7 @@ var _BubbleChart = require("./BubbleChart");
|
|
|
13
13
|
var _DonutChart = require("./DonutChart");
|
|
14
14
|
var _VennChart = require("./VennChart");
|
|
15
15
|
var _RadarChart = require("./RadarChart");
|
|
16
|
+
var _CigaretteChart = require("./CigaretteChart");
|
|
16
17
|
var _default = {
|
|
17
18
|
Line: _LineChart.LineChart,
|
|
18
19
|
Bar: _BarChart.BarChart,
|
|
@@ -22,7 +23,8 @@ var _default = {
|
|
|
22
23
|
Bubble: _BubbleChart.BubbleChart,
|
|
23
24
|
Donut: _DonutChart.DonutChart,
|
|
24
25
|
Venn: _VennChart.VennChart,
|
|
25
|
-
Radar: _RadarChart.RadarChart
|
|
26
|
+
Radar: _RadarChart.RadarChart,
|
|
27
|
+
Cigarette: _CigaretteChart.CigaretteChart
|
|
26
28
|
};
|
|
27
29
|
exports["default"] = _default;
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_LineChart","require","_BarChart","_HistogramChart","_ScatterPlotChart","_AreaChart","_BubbleChart","_DonutChart","_VennChart","_RadarChart","_default","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","exports"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { LineChart } from './LineChart';\nimport { BarChart } from './BarChart';\nimport { HistogramChart } from './HistogramChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { AreaChart } from './AreaChart';\nimport { BubbleChart } from './BubbleChart';\nimport { DonutChart } from './DonutChart';\nimport { VennChart } from './VennChart';\nimport { RadarChart } from './RadarChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_LineChart","require","_BarChart","_HistogramChart","_ScatterPlotChart","_AreaChart","_BubbleChart","_DonutChart","_VennChart","_RadarChart","_CigaretteChart","_default","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","Cigarette","CigaretteChart","exports"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { LineChart } from './LineChart';\nimport { BarChart } from './BarChart';\nimport { HistogramChart } from './HistogramChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { AreaChart } from './AreaChart';\nimport { BubbleChart } from './BubbleChart';\nimport { DonutChart } from './DonutChart';\nimport { VennChart } from './VennChart';\nimport { RadarChart } from './RadarChart';\nimport { CigaretteChart } from './CigaretteChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AAAkD,IAAAU,QAAA,GAEnC;EACbC,IAAI,EAAEC,oBAAS;EACfC,GAAG,EAAEC,kBAAQ;EACbC,SAAS,EAAEC,8BAAc;EACzBC,WAAW,EAAEC,kCAAgB;EAC7BC,IAAI,EAAEC,oBAAS;EACfC,MAAM,EAAEC,wBAAW;EACnBC,KAAK,EAAEC,sBAAU;EACjBC,IAAI,EAAEC,oBAAS;EACfC,KAAK,EAAEC,sBAAU;EACjBC,SAAS,EAAEC;AACb,CAAC;AAAAC,OAAA,cAAArB,QAAA"}
|
|
@@ -22,10 +22,10 @@ var _BaseLegend2 = require("../BaseLegend");
|
|
|
22
22
|
var _intergalacticDynamicLocales = require("../../../translations/__intergalactic-dynamic-locales");
|
|
23
23
|
var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i18nEnhance"));
|
|
24
24
|
/*__reshadow-styles__:"./legend-flex.shadow.css"*/
|
|
25
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
26
|
-
"__SLegendFlex": "
|
|
27
|
-
"_direction_row": "
|
|
28
|
-
"_direction_column": "
|
|
25
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SLegendFlex_bz8dk_gg_._direction_row_bz8dk_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_bz8dk_gg_._direction_column_bz8dk_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}" /*__inner_css_end__*/, "bz8dk_gg_") /*__reshadow_css_end__*/, {
|
|
26
|
+
"__SLegendFlex": "___SLegendFlex_bz8dk_gg_",
|
|
27
|
+
"_direction_row": "_direction_row_bz8dk_gg_",
|
|
28
|
+
"_direction_column": "_direction_column_bz8dk_gg_"
|
|
29
29
|
});
|
|
30
30
|
var LegendFlexRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
31
31
|
(0, _inherits2["default"])(LegendFlexRoot, _BaseLegend);
|
|
@@ -24,23 +24,23 @@ var _Pattern = require("../../../Pattern");
|
|
|
24
24
|
var _utils = require("../../../utils");
|
|
25
25
|
var _excluded = ["color"];
|
|
26
26
|
/*__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
27
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
28
|
-
"__SLegendItem": "
|
|
29
|
-
"_disabled": "
|
|
30
|
-
"__SPointShape": "
|
|
31
|
-
"_color": "
|
|
32
|
-
"--color": "--
|
|
33
|
-
"_shape_Circle": "
|
|
34
|
-
"_size_l": "
|
|
35
|
-
"_size_m": "
|
|
36
|
-
"_shape_Line": "
|
|
37
|
-
"_shape_Square": "
|
|
38
|
-
"_shape_Pattern": "
|
|
39
|
-
"__SIcon": "
|
|
40
|
-
"__SLabel": "
|
|
41
|
-
"__SAdditionalLabel": "
|
|
42
|
-
"__SCount": "
|
|
43
|
-
"__SPatternSymbol": "
|
|
27
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SLegendItem_1n5bu_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_1n5bu_gg_:hover{cursor:pointer}.___SLegendItem_1n5bu_gg_.__disabled_1n5bu_gg_:hover{cursor:default}}.___SPointShape_1n5bu_gg_.__color_1n5bu_gg_{background-color:var(--color_1n5bu);margin-right:8px;flex-shrink:0}.___SPointShape_1n5bu_gg_._shape_Circle_1n5bu_gg_._size_l_1n5bu_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_1n5bu_gg_._shape_Circle_1n5bu_gg_._size_m_1n5bu_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_1n5bu_gg_._shape_Line_1n5bu_gg_._size_l_1n5bu_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_1n5bu_gg_._shape_Line_1n5bu_gg_._size_m_1n5bu_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_1n5bu_gg_._shape_Square_1n5bu_gg_._size_l_1n5bu_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_1n5bu_gg_._shape_Square_1n5bu_gg_._size_m_1n5bu_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_1n5bu_gg_._shape_Pattern_1n5bu_gg_{background-color:transparent;margin-right:4px}.___SIcon_1n5bu_gg_{line-height:0;margin-right:4px}.___SIcon_1n5bu_gg_._size_l_1n5bu_gg_{margin-top:4px}.___SIcon_1n5bu_gg_._size_m_1n5bu_gg_{margin-top:2px}.___SLabel_1n5bu_gg_{min-width:0}.___SAdditionalLabel_1n5bu_gg_._size_l_1n5bu_gg_,.___SCount_1n5bu_gg_._size_l_1n5bu_gg_,.___SLabel_1n5bu_gg_._size_l_1n5bu_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_1n5bu_gg_._size_m_1n5bu_gg_,.___SCount_1n5bu_gg_._size_m_1n5bu_gg_,.___SLabel_1n5bu_gg_._size_m_1n5bu_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_1n5bu_gg_,.___SCount_1n5bu_gg_{margin-left:4px}.___SAdditionalLabel_1n5bu_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_1n5bu_gg_::before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary, #6c6e79);height:4px;width:4px;border-radius:2px;margin-right:4px}.___SAdditionalLabel_1n5bu_gg_._size_l_1n5bu_gg_::before{margin-top:10px}.___SAdditionalLabel_1n5bu_gg_._size_m_1n5bu_gg_::before{margin-top:8px}.___SPatternSymbol_1n5bu_gg_{transform:scale(.8)}" /*__inner_css_end__*/, "1n5bu_gg_") /*__reshadow_css_end__*/, {
|
|
28
|
+
"__SLegendItem": "___SLegendItem_1n5bu_gg_",
|
|
29
|
+
"_disabled": "__disabled_1n5bu_gg_",
|
|
30
|
+
"__SPointShape": "___SPointShape_1n5bu_gg_",
|
|
31
|
+
"_color": "__color_1n5bu_gg_",
|
|
32
|
+
"--color": "--color_1n5bu",
|
|
33
|
+
"_shape_Circle": "_shape_Circle_1n5bu_gg_",
|
|
34
|
+
"_size_l": "_size_l_1n5bu_gg_",
|
|
35
|
+
"_size_m": "_size_m_1n5bu_gg_",
|
|
36
|
+
"_shape_Line": "_shape_Line_1n5bu_gg_",
|
|
37
|
+
"_shape_Square": "_shape_Square_1n5bu_gg_",
|
|
38
|
+
"_shape_Pattern": "_shape_Pattern_1n5bu_gg_",
|
|
39
|
+
"__SIcon": "___SIcon_1n5bu_gg_",
|
|
40
|
+
"__SLabel": "___SLabel_1n5bu_gg_",
|
|
41
|
+
"__SAdditionalLabel": "___SAdditionalLabel_1n5bu_gg_",
|
|
42
|
+
"__SCount": "___SCount_1n5bu_gg_",
|
|
43
|
+
"__SPatternSymbol": "___SPatternSymbol_1n5bu_gg_"
|
|
44
44
|
});
|
|
45
45
|
var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
46
46
|
(0, _inherits2["default"])(LegendItemRoot, _Component);
|
|
@@ -18,12 +18,12 @@ var _flexBox = require("@semcore/flex-box");
|
|
|
18
18
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
19
19
|
var _BaseLegend2 = require("../BaseLegend");
|
|
20
20
|
/*__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
21
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
22
|
-
"__SLegendTable": "
|
|
23
|
-
"_columns-count": "__columns-
|
|
24
|
-
"__SColumnItem": "
|
|
25
|
-
"_size_l": "
|
|
26
|
-
"_size_m": "
|
|
21
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SLegendTable_tcnh3_gg_.__columns-count_tcnh3_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_tcnh3_gg_._size_l_tcnh3_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_tcnh3_gg_._size_m_tcnh3_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}" /*__inner_css_end__*/, "tcnh3_gg_") /*__reshadow_css_end__*/, {
|
|
22
|
+
"__SLegendTable": "___SLegendTable_tcnh3_gg_",
|
|
23
|
+
"_columns-count": "__columns-count_tcnh3_gg_",
|
|
24
|
+
"__SColumnItem": "___SColumnItem_tcnh3_gg_",
|
|
25
|
+
"_size_l": "_size_l_tcnh3_gg_",
|
|
26
|
+
"_size_m": "_size_m_tcnh3_gg_"
|
|
27
27
|
});
|
|
28
28
|
var LegendTableRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
29
29
|
(0, _inherits2["default"])(LegendTableRoot, _BaseLegend);
|