@semcore/d3-chart 16.0.6 → 16.1.0-prerelease.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/lib/cjs/Area.js +55 -30
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +14 -14
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +28 -15
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +31 -19
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +31 -16
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +24 -10
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +3 -3
- package/lib/cjs/Line.js +51 -25
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Plot.js +3 -3
- package/lib/cjs/Radar.js +206 -176
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ScatterPlot.js +22 -10
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/Tooltip.js +9 -9
- package/lib/cjs/Venn.js +32 -15
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AreaChart.js +6 -3
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +2 -0
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +3 -1
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +4 -2
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.js +3 -1
- package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +3 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.js +6 -2
- package/lib/cjs/component/Chart/VennChart.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/cjs/types/Area.d.js.map +1 -1
- package/lib/cjs/types/Bubble.d.js.map +1 -1
- package/lib/cjs/types/Donut.d.js.map +1 -1
- package/lib/cjs/types/Line.d.js.map +1 -1
- package/lib/cjs/types/Radar.d.js.map +1 -1
- package/lib/cjs/types/ScatterPlot.d.js.map +1 -1
- package/lib/es6/Area.js +56 -31
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +14 -14
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +28 -15
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +31 -19
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +31 -16
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +24 -10
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +3 -3
- package/lib/es6/Line.js +52 -26
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Plot.js +3 -3
- package/lib/es6/Radar.js +206 -176
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ScatterPlot.js +22 -10
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/Tooltip.js +9 -9
- package/lib/es6/Venn.js +32 -15
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AreaChart.js +6 -3
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +2 -0
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +3 -1
- package/lib/es6/component/Chart/DonutChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +4 -2
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.js +3 -1
- package/lib/es6/component/Chart/RadarChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +3 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.js +6 -2
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/es6/types/Area.d.js.map +1 -1
- package/lib/es6/types/Bubble.d.js.map +1 -1
- package/lib/es6/types/Donut.d.js.map +1 -1
- package/lib/es6/types/Line.d.js.map +1 -1
- package/lib/es6/types/Radar.d.js.map +1 -1
- package/lib/es6/types/ScatterPlot.d.js.map +1 -1
- package/lib/esm/Area.mjs +33 -17
- package/lib/esm/Axis.mjs +15 -15
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +28 -16
- package/lib/esm/CompactHorizontalBar.mjs +31 -20
- package/lib/esm/Donut.mjs +32 -18
- package/lib/esm/Dots.mjs +21 -11
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +4 -4
- package/lib/esm/Line.mjs +32 -15
- package/lib/esm/Plot.mjs +4 -4
- package/lib/esm/Radar.mjs +119 -96
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ScatterPlot.mjs +23 -11
- package/lib/esm/Tooltip.mjs +10 -10
- package/lib/esm/Venn.mjs +31 -16
- package/lib/esm/a11y/PlotA11yModule.mjs +3 -3
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AreaChart.mjs +5 -3
- package/lib/esm/component/Chart/BubbleChart.mjs +2 -0
- package/lib/esm/component/Chart/DonutChart.mjs +2 -1
- package/lib/esm/component/Chart/LineChart.mjs +3 -2
- package/lib/esm/component/Chart/RadarChart.mjs +2 -1
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +2 -1
- package/lib/esm/component/Chart/VennChart.mjs +4 -2
- 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/types/Area.d.ts +2 -0
- package/lib/types/Bubble.d.ts +2 -0
- package/lib/types/Donut.d.ts +2 -0
- package/lib/types/Line.d.ts +2 -0
- package/lib/types/Radar.d.ts +2 -0
- package/lib/types/ScatterPlot.d.ts +2 -0
- package/lib/types/component/Chart/AreaChart.type.d.ts +2 -0
- package/lib/types/component/Chart/BubbleChart.type.d.ts +2 -0
- package/lib/types/component/Chart/DonutChart.type.d.ts +4 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +2 -0
- package/lib/types/component/Chart/RadarChart.type.d.ts +2 -0
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +2 -0
- package/lib/types/component/Chart/VennChart.type.d.ts +4 -1
- package/package.json +16 -16
|
@@ -35,9 +35,11 @@ var RadarChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
35
35
|
var _this$asProps = this.asProps,
|
|
36
36
|
groupKey = _this$asProps.groupKey,
|
|
37
37
|
showDots = _this$asProps.showDots,
|
|
38
|
-
circle = _this$asProps.circle
|
|
38
|
+
circle = _this$asProps.circle,
|
|
39
|
+
onClickRadar = _this$asProps.onClickRadar;
|
|
39
40
|
var dataDefinitions = this.state.dataDefinitions;
|
|
40
41
|
return /*#__PURE__*/_react["default"].createElement(_.Radar, {
|
|
42
|
+
onClick: onClickRadar,
|
|
41
43
|
scale: this.xScale,
|
|
42
44
|
type: circle ? 'circle' : undefined
|
|
43
45
|
}, /*#__PURE__*/_react["default"].createElement(_.Radar.Axis, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadarChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_d3Scale","_react","_AbstractChart2","_","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","_superPropGet","r","p","_get2","prototype","RadarChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","renderChart","_this$asProps","asProps","groupKey","showDots","circle","dataDefinitions","state","createElement","Radar","scale","xScale","type","undefined","Axis","dataKey","Ticks","Labels","renderRadarTooltip","map","item","checked","Polygon","id","color","Line","Dots","_this","_this$asProps2","data","showTooltip","Tooltip","wMin","_ref","_data$groupKey","index","children","Fragment","Title","_data$item$id","Dot","tooltipValueFormatter","renderTooltip","get","_this$props","props","legendKeys","Object","keys","filter","_this$asProps$scale","scaleLinear","domain","_this$asProps$scale2","getLegendAriaLabel","getI18nText","chartType","Math","min","_toConsumableArray2","max","AbstractChart","_defineProperty2","i18nEnhance","localizedMessages","RadarChart","exports","createComponent"],"sources":["../../../../src/component/Chart/RadarChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { scaleLinear, type ScaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport { AbstractChart } from './AbstractChart';\nimport type { RadarChartData, RadarChartProps, RadarChartType } from './RadarChart.type';\n// @ts-ignore\nimport { Radar } from '../..';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass RadarChartComponent extends AbstractChart<\n RadarChartData,\n RadarChartProps,\n typeof RadarChartComponent.enhance\n> {\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected renderChart(): React.ReactNode {\n const { groupKey, showDots, circle } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return (\n <Radar scale={this.xScale} type={circle ? 'circle' : undefined}>\n <Radar.Axis dataKey={groupKey}>\n <Radar.Axis.Ticks />\n <Radar.Axis.Labels />\n </Radar.Axis>\n {this.renderRadarTooltip()}\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Radar.Polygon dataKey={item.id} key={item.id} color={item.color}>\n <Radar.Polygon.Line />\n {showDots && <Radar.Polygon.Dots />}\n </Radar.Polygon>\n )\n );\n })}\n </Radar>\n );\n }\n\n protected renderRadarTooltip(): React.ReactNode {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Radar.Tooltip wMin={100}>\n {({ index }: any) => {\n return {\n children: (\n <>\n <Radar.Tooltip.Title>{data[groupKey]?.[index]}</Radar.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n const value = data[item.id]?.[index];\n\n return (\n item.checked && (\n <Radar.Tooltip.Dot color={item.color} key={item.id}>\n {this.tooltipValueFormatter(value)}\n </Radar.Tooltip.Dot>\n )\n );\n })}\n </>\n ),\n };\n }}\n </Radar.Tooltip>\n );\n }\n\n // By default, tooltip will render in Plot component.\n // In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method\n protected renderTooltip(): React.ReactNode {\n return null;\n }\n\n protected get dataKeys(): string[] {\n const { data, groupKey } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((key) => key !== groupKey);\n\n return legendKeys;\n }\n\n protected get xScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Radar' });\n }\n\n private get domain(): [number, number] {\n return [Math.min(...super.flatValues), Math.max(...super.flatValues)];\n }\n}\n\nexport const RadarChart: RadarChartType = createComponent(RadarChartComponent);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,eAAA,GAAAL,OAAA;AAGA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,4BAAA,GAAAP,OAAA;AAAuF,SAAAQ,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAQ,cAAAV,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAS,CAAA,QAAAC,CAAA,OAAAC,KAAA,iBAAAV,gBAAA,iBAAAQ,CAAA,GAAAX,CAAA,CAAAc,SAAA,GAAAd,CAAA,GAAAC,CAAA,EAAAC,CAAA,cAAAS,CAAA,yBAAAC,CAAA,aAAAZ,CAAA,WAAAY,CAAA,CAAAH,KAAA,CAAAP,CAAA,EAAAF,CAAA,OAAAY,CAAA,IAFvF;AAAA,IAIMG,mBAAmB,0BAAAC,cAAA;EAAA,SAAAD,oBAAA;IAAA,IAAAE,gBAAA,mBAAAF,mBAAA;IAAA,OAAAhB,UAAA,OAAAgB,mBAAA,EAAAG,SAAA;EAAA;EAAA,IAAAC,UAAA,aAAAJ,mBAAA,EAAAC,cAAA;EAAA,WAAAI,aAAA,aAAAL,mBAAA;IAAAM,GAAA;IAAAC,KAAA,EAOvB,SAAUC,WAAWA,CAAA,EAAoB;MACvC,IAAAC,aAAA,
|
|
1
|
+
{"version":3,"file":"RadarChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_d3Scale","_react","_AbstractChart2","_","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","_superPropGet","r","p","_get2","prototype","RadarChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","renderChart","_this$asProps","asProps","groupKey","showDots","circle","onClickRadar","dataDefinitions","state","createElement","Radar","onClick","scale","xScale","type","undefined","Axis","dataKey","Ticks","Labels","renderRadarTooltip","map","item","checked","Polygon","id","color","Line","Dots","_this","_this$asProps2","data","showTooltip","Tooltip","wMin","_ref","_data$groupKey","index","children","Fragment","Title","_data$item$id","Dot","tooltipValueFormatter","renderTooltip","get","_this$props","props","legendKeys","Object","keys","filter","_this$asProps$scale","scaleLinear","domain","_this$asProps$scale2","getLegendAriaLabel","getI18nText","chartType","Math","min","_toConsumableArray2","max","AbstractChart","_defineProperty2","i18nEnhance","localizedMessages","RadarChart","exports","createComponent"],"sources":["../../../../src/component/Chart/RadarChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { scaleLinear, type ScaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport { AbstractChart } from './AbstractChart';\nimport type { RadarChartData, RadarChartProps, RadarChartType } from './RadarChart.type';\n// @ts-ignore\nimport { Radar } from '../..';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass RadarChartComponent extends AbstractChart<\n RadarChartData,\n RadarChartProps,\n typeof RadarChartComponent.enhance\n> {\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected renderChart(): React.ReactNode {\n const { groupKey, showDots, circle, onClickRadar } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return (\n <Radar onClick={onClickRadar} scale={this.xScale} type={circle ? 'circle' : undefined}>\n <Radar.Axis dataKey={groupKey}>\n <Radar.Axis.Ticks />\n <Radar.Axis.Labels />\n </Radar.Axis>\n {this.renderRadarTooltip()}\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Radar.Polygon dataKey={item.id} key={item.id} color={item.color}>\n <Radar.Polygon.Line />\n {showDots && <Radar.Polygon.Dots />}\n </Radar.Polygon>\n )\n );\n })}\n </Radar>\n );\n }\n\n protected renderRadarTooltip(): React.ReactNode {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Radar.Tooltip wMin={100}>\n {({ index }: any) => {\n return {\n children: (\n <>\n <Radar.Tooltip.Title>{data[groupKey]?.[index]}</Radar.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n const value = data[item.id]?.[index];\n\n return (\n item.checked && (\n <Radar.Tooltip.Dot color={item.color} key={item.id}>\n {this.tooltipValueFormatter(value)}\n </Radar.Tooltip.Dot>\n )\n );\n })}\n </>\n ),\n };\n }}\n </Radar.Tooltip>\n );\n }\n\n // By default, tooltip will render in Plot component.\n // In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method\n protected renderTooltip(): React.ReactNode {\n return null;\n }\n\n protected get dataKeys(): string[] {\n const { data, groupKey } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((key) => key !== groupKey);\n\n return legendKeys;\n }\n\n protected get xScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Radar' });\n }\n\n private get domain(): [number, number] {\n return [Math.min(...super.flatValues), Math.max(...super.flatValues)];\n }\n}\n\nexport const RadarChart: RadarChartType = createComponent(RadarChartComponent);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,eAAA,GAAAL,OAAA;AAGA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,4BAAA,GAAAP,OAAA;AAAuF,SAAAQ,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;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":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type RadarChartData = Record<string, string[] | number[]>;\n\nexport type RadarChartProps = BaseChartProps<RadarChartData> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type RadarChartData = Record<string, string[] | number[]>;\n\nexport type RadarChartProps = BaseChartProps<RadarChartData> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n /** Callback triggered when a user clicks on a chart at a position corresponding to a category */\n onClickRadar?: (index: number, e: React.SyntheticEvent) => void;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -106,10 +106,12 @@ var ScatterPlotChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
106
106
|
value: function renderChart() {
|
|
107
107
|
var _this$asProps4 = this.asProps,
|
|
108
108
|
groupKey = _this$asProps4.groupKey,
|
|
109
|
-
valueKey = _this$asProps4.valueKey
|
|
109
|
+
valueKey = _this$asProps4.valueKey,
|
|
110
|
+
onClickScatterItem = _this$asProps4.onClickScatterItem;
|
|
110
111
|
var dataDefinitions = this.state.dataDefinitions;
|
|
111
112
|
return dataDefinitions.map(function (item) {
|
|
112
113
|
return item.checked && /*#__PURE__*/_react["default"].createElement(_.ScatterPlot, {
|
|
114
|
+
onClick: onClickScatterItem,
|
|
113
115
|
x: groupKey,
|
|
114
116
|
y: item.id,
|
|
115
117
|
key: item.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterPlotChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart2","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","ScatterPlotChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","get","_this$props","props","data","groupKey","valueKey","Object","keys","filter","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","radius","getScatterPlotRadius","getValueScale","_toConsumableArray2","flatValues","testItem","range","plotPadding","domain","minMax","Date","Number","isNaN","getMilliseconds","scaleTime","scaleLinear","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","max","Math","min","_this$asProps3","reduce","result","item","entries","forEach","_ref","_ref2","_slicedToArray2","value","add","Set","renderChart","_this$asProps4","dataDefinitions","state","map","checked","createElement","ScatterPlot","x","y","id","color","renderTooltip","_this","_this$asProps5","showTooltip","Tooltip","wMin","_ref3","index","children","Fragment","Dot","Text","tag","tooltipValueFormatter","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","showXAxis","showYAxis","showLegend","i18nEnhance","localizedMessages","ScatterPlotChart","exports","createComponent"],"sources":["../../../../src/component/Chart/ScatterPlotChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { type ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\n// @ts-ignore\nimport { minMax, ScatterPlot, getScatterPlotRadius } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { BaseChartProps, ListData } from './AbstractChart.type';\nimport type {\n ScatterPlotChartData,\n ScatterPlotChartProps,\n ScatterPlotChartType,\n} from './ScatterPlotChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass ScatterPlotChartComponent extends AbstractChart<\n ScatterPlotChartData,\n ScatterPlotChartProps,\n typeof ScatterPlotChartComponent.enhance\n> {\n static displayName = 'Chart.ScatterPlot';\n public static defaultProps: Partial<BaseChartProps<ListData>> = {\n direction: 'column',\n showXAxis: true,\n showYAxis: true,\n showTooltip: true,\n showLegend: false,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get dataKeys(): string[] {\n const { data, groupKey, valueKey } = this.props;\n\n return Object.keys(data[0]).filter((key) => key !== groupKey && key !== valueKey);\n }\n\n protected get xScale() {\n const { xScale, marginY = 30, plotWidth, data, groupKey, valueKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...this.flatValues]);\n const testItem = data[0][groupKey];\n const range = [marginY, plotWidth - this.plotPadding];\n const domain = minMax(data, groupKey);\n\n if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {\n return scaleTime([domain[0] - radius, domain[1] + radius], range);\n }\n\n return scaleLinear([domain[0] - radius, domain[1] + radius], range);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight, valueKey } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = this.flatValues;\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...flatValues]);\n\n const max = Math.max(...flatValues) + radius;\n const min = Math.min(...flatValues) - radius;\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected get flatValues(): Set<number> {\n const { data, groupKey, valueKey } = this.asProps;\n\n const flatValues = data.reduce<Set<number>>((result, item) => {\n Object.entries(item).forEach(([key, value]) => {\n if (key !== groupKey && key !== valueKey && typeof value === 'number') {\n result.add(value);\n }\n });\n\n return result;\n }, new Set());\n\n return flatValues;\n }\n\n protected renderChart() {\n const { groupKey, valueKey } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return dataDefinitions.map((item) => {\n return (\n item.checked && (\n <ScatterPlot x={groupKey} y={item.id} key={item.id} color={item.color} value={valueKey} />\n )\n );\n });\n }\n\n protected renderTooltip() {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return dataDefinitions\n .filter((item) => item.checked)\n .map((item) => {\n return (\n <ScatterPlot.Tooltip key={item.id} x={groupKey} y={item.id} wMin={100}>\n {({ index, x, y }: any) => {\n return {\n children: (\n <>\n <ScatterPlot.Tooltip.Dot color={item.color}>Data</ScatterPlot.Tooltip.Dot>\n <Text tag='div'>\n X axis\n {this.tooltipValueFormatter(data[index][x])}\n </Text>\n <Text tag='div'>\n Y axis\n {this.tooltipValueFormatter(data[index][y])}\n </Text>\n </>\n ),\n };\n }}\n </ScatterPlot.Tooltip>\n );\n });\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'ScatterPlot' });\n }\n}\n\nexport const ScatterPlotChart: ScatterPlotChartType = createComponent(ScatterPlotChartComponent);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAGA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAOA,IAAAQ,4BAAA,GAAAR,OAAA;AAAuF,SAAAS,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,a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AAC,gBAAA,aAA/CxF,yBAAyB,iBAKR,mBAAmB;AAAA,IAAAwF,gBAAA,aALpCxF,yBAAyB,kBAMmC;EAC9DyF,SAAS,EAAE,QAAQ;EACnBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAE,IAAI;EACflB,WAAW,EAAE,IAAI;EACjBmB,UAAU,EAAE;AACd,CAAC;AAAA,IAAAJ,gBAAA,aAZGxF,yBAAyB,aAcZ,CAAC,IAAA6F,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AAkH5C,IAAMC,gBAAsC,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,qBAAe,EAACjG,yBAAyB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ScatterPlotChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart2","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","ScatterPlotChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","get","_this$props","props","data","groupKey","valueKey","Object","keys","filter","_this$asProps","asProps","xScale","_this$asProps$marginY","marginY","plotWidth","radius","getScatterPlotRadius","getValueScale","_toConsumableArray2","flatValues","testItem","range","plotPadding","domain","minMax","Date","Number","isNaN","getMilliseconds","scaleTime","scaleLinear","_this$asProps2","yScale","_this$asProps2$margin","marginX","plotHeight","max","Math","min","_this$asProps3","reduce","result","item","entries","forEach","_ref","_ref2","_slicedToArray2","value","add","Set","renderChart","_this$asProps4","onClickScatterItem","dataDefinitions","state","map","checked","createElement","ScatterPlot","onClick","x","y","id","color","renderTooltip","_this","_this$asProps5","showTooltip","Tooltip","wMin","_ref3","index","children","Fragment","Dot","Text","tag","tooltipValueFormatter","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","showXAxis","showYAxis","showLegend","i18nEnhance","localizedMessages","ScatterPlotChart","exports","createComponent"],"sources":["../../../../src/component/Chart/ScatterPlotChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { type ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\n// @ts-ignore\nimport { minMax, ScatterPlot, getScatterPlotRadius } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { BaseChartProps, ListData } from './AbstractChart.type';\nimport type {\n ScatterPlotChartData,\n ScatterPlotChartProps,\n ScatterPlotChartType,\n} from './ScatterPlotChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass ScatterPlotChartComponent extends AbstractChart<\n ScatterPlotChartData,\n ScatterPlotChartProps,\n typeof ScatterPlotChartComponent.enhance\n> {\n static displayName = 'Chart.ScatterPlot';\n public static defaultProps: Partial<BaseChartProps<ListData>> = {\n direction: 'column',\n showXAxis: true,\n showYAxis: true,\n showTooltip: true,\n showLegend: false,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get dataKeys(): string[] {\n const { data, groupKey, valueKey } = this.props;\n\n return Object.keys(data[0]).filter((key) => key !== groupKey && key !== valueKey);\n }\n\n protected get xScale() {\n const { xScale, marginY = 30, plotWidth, data, groupKey, valueKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...this.flatValues]);\n const testItem = data[0][groupKey];\n const range = [marginY, plotWidth - this.plotPadding];\n const domain = minMax(data, groupKey);\n\n if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {\n return scaleTime([domain[0] - radius, domain[1] + radius], range);\n }\n\n return scaleLinear([domain[0] - radius, domain[1] + radius], range);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight, valueKey } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = this.flatValues;\n const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...flatValues]);\n\n const max = Math.max(...flatValues) + radius;\n const min = Math.min(...flatValues) - radius;\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected get flatValues(): Set<number> {\n const { data, groupKey, valueKey } = this.asProps;\n\n const flatValues = data.reduce<Set<number>>((result, item) => {\n Object.entries(item).forEach(([key, value]) => {\n if (key !== groupKey && key !== valueKey && typeof value === 'number') {\n result.add(value);\n }\n });\n\n return result;\n }, new Set());\n\n return flatValues;\n }\n\n protected renderChart() {\n const { groupKey, valueKey, onClickScatterItem } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return dataDefinitions.map((item) => {\n return (\n item.checked && (\n <ScatterPlot onClick={onClickScatterItem} x={groupKey} y={item.id} key={item.id} color={item.color} value={valueKey} />\n )\n );\n });\n }\n\n protected renderTooltip() {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return dataDefinitions\n .filter((item) => item.checked)\n .map((item) => {\n return (\n <ScatterPlot.Tooltip key={item.id} x={groupKey} y={item.id} wMin={100}>\n {({ index, x, y }: any) => {\n return {\n children: (\n <>\n <ScatterPlot.Tooltip.Dot color={item.color}>Data</ScatterPlot.Tooltip.Dot>\n <Text tag='div'>\n X axis\n {this.tooltipValueFormatter(data[index][x])}\n </Text>\n <Text tag='div'>\n Y axis\n {this.tooltipValueFormatter(data[index][y])}\n </Text>\n </>\n ),\n };\n }}\n </ScatterPlot.Tooltip>\n );\n });\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'ScatterPlot' });\n }\n}\n\nexport const ScatterPlotChart: ScatterPlotChartType = createComponent(ScatterPlotChartComponent);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,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X,KAAI,CAACY,qBAAqB,CAAC3E,IAAI,CAACqE,KAAK,CAAC,CAACV,CAAC,CAAC,CACtC,CACN;UAEN,CAAC;QACH,CACmB,CAAC;MAE1B,CAAC,CAAC;IACN;EAAC;IAAA/D,GAAA;IAAAiD,KAAA,EAED,SAAU+B,kBAAkBA,CAAA,EAAW;MACrC,OAAO,IAAI,CAACrE,OAAO,CAACsE,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAc,CAAC,CAAC;IACjF;EAAC;AAAA,EA7HqCC,6BAAa;AAAA,IAAAC,gBAAA,aAA/C1F,yBAAyB,iBAKR,mBAAmB;AAAA,IAAA0F,gBAAA,aALpC1F,yBAAyB,kBAMmC;EAC9D2F,SAAS,EAAE,QAAQ;EACnBC,SAAS,EAAE,IAAI;EACfC,SAAS,EAAE,IAAI;EACflB,WAAW,EAAE,IAAI;EACjBmB,UAAU,EAAE;AACd,CAAC;AAAA,IAAAJ,gBAAA,aAZG1F,yBAAyB,aAcZ,CAAC,IAAA+F,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AAkH5C,IAAMC,gBAAsC,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,qBAAe,EAACnG,yBAAyB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterPlotChart.type.js","names":[],"sources":["../../../../src/component/Chart/ScatterPlotChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\n\nexport type ScatterPlotChartData = Array<Record<string, number | typeof interpolateValue | Date>>;\n\nexport type ScatterPlotChartProps = BaseChartProps<ScatterPlotChartData> & {\n groupKey: string;\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n yScale?: ScaleLinear<any, any>;\n valueKey?: string;\n};\n\nexport type ScatterPlotChartType = Intergalactic.Component<typeof Flex, ScatterPlotChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ScatterPlotChart.type.js","names":[],"sources":["../../../../src/component/Chart/ScatterPlotChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\n\nexport type ScatterPlotChartData = Array<Record<string, number | typeof interpolateValue | Date>>;\n\nexport type ScatterPlotChartProps = BaseChartProps<ScatterPlotChartData> & {\n groupKey: string;\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n yScale?: ScaleLinear<any, any>;\n valueKey?: string;\n /** Callback triggered when a user clicks on a scatter item */\n onClickScatterItem?: (index: number, event: React.SyntheticEvent) => void;\n};\n\nexport type ScatterPlotChartType = Intergalactic.Component<typeof Flex, ScatterPlotChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -65,7 +65,9 @@ var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
65
65
|
}, {
|
|
66
66
|
key: "renderChart",
|
|
67
67
|
value: function renderChart() {
|
|
68
|
-
var
|
|
68
|
+
var _this$asProps = this.asProps,
|
|
69
|
+
data = _this$asProps.data,
|
|
70
|
+
onClickVennItem = _this$asProps.onClickVennItem;
|
|
69
71
|
var _this$state = this.state,
|
|
70
72
|
dataDefinitions = _this$state.dataDefinitions,
|
|
71
73
|
highlightedLine = _this$state.highlightedLine;
|
|
@@ -83,7 +85,9 @@ var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
|
83
85
|
}
|
|
84
86
|
return result;
|
|
85
87
|
}, []);
|
|
86
|
-
return /*#__PURE__*/_react["default"].createElement(_.Venn,
|
|
88
|
+
return /*#__PURE__*/_react["default"].createElement(_.Venn, {
|
|
89
|
+
onClick: onClickVennItem
|
|
90
|
+
}, checkedLegendItems.map(function (item, index) {
|
|
87
91
|
return /*#__PURE__*/_react["default"].createElement(_.Venn.Circle, {
|
|
88
92
|
key: item.id,
|
|
89
93
|
dataKey: item.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VennChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart2","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","VennChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","get","xScale","asProps","scaleLinear","yScale","data","props","legendKeys","Object","keys","filter","item","isIntersection","test","value","defaultLegendProps","legendType","renderChart","_this$state","state","dataDefinitions","highlightedLine","checkedLegendItems","checked","checkedLegendItemsMap","reduce","result","id","intersections","dataKey","push","createElement","Venn","map","index","Circle","name","label","color","transparent","intersectionKey","intersectionKeys","split","hasDisabledItems","some","undefined","_dataDefinitions$find","find","legendItem","join","Intersection","renderTooltip","showTooltip","Tooltip","_ref","children","Fragment","Title","Text","bold","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","alignItems","marginY","marginX","i18nEnhance","localizedMessages","VennChart","exports","createComponent"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { scaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass VennChartComponent extends AbstractChart<\n VennChartData,\n VennChartProps,\n typeof VennChartComponent.enhance\n> {\n static displayName = 'Chart.Venn';\n\n static defaultProps: Partial<BaseChartProps<VennChartData>> = {\n direction: 'row-reverse',\n alignItems: 'flex-start',\n marginY: 0,\n marginX: 0,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return scaleLinear();\n }\n\n get yScale() {\n const { yScale } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return scaleLinear();\n }\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((item) => {\n const isIntersection = /\\//.test(item);\n\n return !isIntersection;\n });\n\n return legendKeys;\n }\n\n defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n };\n }\n\n renderChart() {\n const { data } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n const checkedLegendItems = dataDefinitions.filter((item) => item.checked);\n const checkedLegendItemsMap = checkedLegendItems.reduce<Record<string, LegendItem>>(\n (result, item) => {\n result[item.id] = item;\n\n return result;\n },\n {},\n );\n\n const intersections = Object.keys(data).reduce<string[]>((result, dataKey) => {\n const isIntersection = /\\//.test(dataKey);\n\n if (isIntersection) {\n result.push(dataKey);\n }\n\n return result;\n }, []);\n\n return (\n <Venn>\n {checkedLegendItems.map((item, index) => {\n return (\n <Venn.Circle\n key={item.id}\n dataKey={item.id}\n name={item.label}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n />\n );\n })}\n\n {intersections.map((intersectionKey) => {\n const intersectionKeys = intersectionKey.split('/');\n\n const hasDisabledItems = intersectionKeys.some((key) => {\n return checkedLegendItemsMap[key] === undefined;\n });\n\n if (hasDisabledItems) {\n return null;\n }\n\n const name = intersectionKeys\n .map((id) => {\n return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || '';\n })\n .join(' & ');\n\n return <Venn.Intersection key={intersectionKey} dataKey={intersectionKey} name={name} />;\n })}\n </Venn>\n );\n }\n\n renderTooltip() {\n const { showTooltip } = this.asProps;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Venn.Tooltip>\n {({ name, dataKey, data }: any) => {\n return {\n children: (\n <>\n <Venn.Tooltip.Title>{name}</Venn.Tooltip.Title>\n <Text bold>{data[dataKey]}</Text>\n </>\n ),\n };\n }}\n </Venn.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Venn' });\n }\n}\n\nexport const VennChart: VennChartType = createComponent(VennChartComponent);\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAIA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAEA,IAAAQ,4BAAA,GAAAR,OAAA;AAAuF,SAAAS,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,MAAAK,0BAAA,iBAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA,MAJvF;AAAA,IAOMQ,kBAAkB,0BAAAC,cAAA;EAAA,SAAAD,mBAAA;IAAA,IAAAE,gBAAA,mBAAAF,kBAAA;IAAA,OAAAX,UAAA,OAAAW,kBAAA,EAAAG,SAAA;EAAA;EAAA,IAAAC,UAAA,aAAAJ,kBAAA,EAAAC,cAAA;EAAA,WAAAI,aAAA,aAAAL,kBAAA;IAAAM,GAAA;IAAAC,GAAA,EAgBtB,SAAAA,IAAA,EAAa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Q,CAChC;QAEN,CAAC;MACH,CACY,CAAC;IAEnB;EAAC;IAAA9B,GAAA;IAAAe,KAAA,EAED,SAAU8C,kBAAkBA,CAAA,EAAW;MACrC,OAAO,IAAI,CAAC1D,OAAO,CAAC2D,WAAW,CAAC,gBAAgB,EAAE;QAAEC,SAAS,EAAE;MAAO,CAAC,CAAC;IAC1E;EAAC;AAAA,EA5I8BC,6BAAa;AAAA,IAAAC,gBAAA,aAAxCvE,kBAAkB,iBAKD,YAAY;AAAA,IAAAuE,gBAAA,aAL7BvE,kBAAkB,kBAOwC;EAC5DwE,SAAS,EAAE,aAAa;EACxBC,UAAU,EAAE,YAAY;EACxBC,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE;AACX,CAAC;AAAA,IAAAJ,gBAAA,aAZGvE,kBAAkB,aAcL,CAAC,IAAA4E,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AAiI5C,IAAMC,SAAwB,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,qBAAe,EAAChF,kBAAkB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"VennChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart2","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","VennChartComponent","_AbstractChart","_classCallCheck2","arguments","_inherits2","_createClass2","key","get","xScale","asProps","scaleLinear","yScale","data","props","legendKeys","Object","keys","filter","item","isIntersection","test","value","defaultLegendProps","legendType","renderChart","_this$asProps","onClickVennItem","_this$state","state","dataDefinitions","highlightedLine","checkedLegendItems","checked","checkedLegendItemsMap","reduce","result","id","intersections","dataKey","push","createElement","Venn","onClick","map","index","Circle","name","label","color","transparent","intersectionKey","intersectionKeys","split","hasDisabledItems","some","undefined","_dataDefinitions$find","find","legendItem","join","Intersection","renderTooltip","showTooltip","Tooltip","_ref","children","Fragment","Title","Text","bold","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","alignItems","marginY","marginX","i18nEnhance","localizedMessages","VennChart","exports","createComponent"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { scaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass VennChartComponent extends AbstractChart<\n VennChartData,\n VennChartProps,\n typeof VennChartComponent.enhance\n> {\n static displayName = 'Chart.Venn';\n\n static defaultProps: Partial<BaseChartProps<VennChartData>> = {\n direction: 'row-reverse',\n alignItems: 'flex-start',\n marginY: 0,\n marginX: 0,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return scaleLinear();\n }\n\n get yScale() {\n const { yScale } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return scaleLinear();\n }\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((item) => {\n const isIntersection = /\\//.test(item);\n\n return !isIntersection;\n });\n\n return legendKeys;\n }\n\n defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n };\n }\n\n renderChart() {\n const { data, onClickVennItem } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n const checkedLegendItems = dataDefinitions.filter((item) => item.checked);\n const checkedLegendItemsMap = checkedLegendItems.reduce<Record<string, LegendItem>>(\n (result, item) => {\n result[item.id] = item;\n\n return result;\n },\n {},\n );\n\n const intersections = Object.keys(data).reduce<string[]>((result, dataKey) => {\n const isIntersection = /\\//.test(dataKey);\n\n if (isIntersection) {\n result.push(dataKey);\n }\n\n return result;\n }, []);\n\n return (\n <Venn onClick={onClickVennItem}>\n {checkedLegendItems.map((item, index) => {\n return (\n <Venn.Circle\n key={item.id}\n dataKey={item.id}\n name={item.label}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n />\n );\n })}\n\n {intersections.map((intersectionKey) => {\n const intersectionKeys = intersectionKey.split('/');\n\n const hasDisabledItems = intersectionKeys.some((key) => {\n return checkedLegendItemsMap[key] === undefined;\n });\n\n if (hasDisabledItems) {\n return null;\n }\n\n const name = intersectionKeys\n .map((id) => {\n return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || '';\n })\n .join(' & ');\n\n return <Venn.Intersection key={intersectionKey} dataKey={intersectionKey} name={name} />;\n })}\n </Venn>\n );\n }\n\n renderTooltip() {\n const { showTooltip } = this.asProps;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Venn.Tooltip>\n {({ name, dataKey, data }: any) => {\n return {\n children: (\n <>\n <Venn.Tooltip.Title>{name}</Venn.Tooltip.Title>\n <Text bold>{data[dataKey]}</Text>\n </>\n ),\n };\n }}\n </Venn.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Venn' });\n }\n}\n\nexport const VennChart: VennChartType = createComponent(VennChartComponent);\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAIA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAEA,IAAAQ,4BAAA,GAAAR,OAAA;AAAuF,SAAAS,WAAAC,CAA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C,SAAwB,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,qBAAe,EAACnF,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type VennChartData = Record<
|
|
1
|
+
{"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type DataKey = string;\n\nexport type VennChartData = Record<DataKey, number>;\n\nexport type VennChartProps = BaseChartProps<VennChartData> & {\n groupKey?: never;\n xScale?: ScaleLinear<any, any>;\n yScale?: ScaleLinear<any, any>;\n /** Callback triggered when a user clicks on a circle */\n onClickVennItem?: (key: DataKey, e: React.SyntheticEvent) => void;\n};\n\nexport type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -24,12 +24,12 @@ var _BaseLegend2 = require("../BaseLegend");
|
|
|
24
24
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
25
25
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
26
26
|
/*!__reshadow-styles__:"./legend-flex.shadow.css"*/
|
|
27
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
27
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendFlex_mlz2v_gg_._direction_row_mlz2v_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_mlz2v_gg_._direction_column_mlz2v_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}", /*__inner_css_end__*/"mlz2v_gg_"),
|
|
28
28
|
/*__reshadow_css_end__*/
|
|
29
29
|
{
|
|
30
|
-
"__SLegendFlex": "
|
|
31
|
-
"_direction_row": "
|
|
32
|
-
"_direction_column": "
|
|
30
|
+
"__SLegendFlex": "___SLegendFlex_mlz2v_gg_",
|
|
31
|
+
"_direction_row": "_direction_row_mlz2v_gg_",
|
|
32
|
+
"_direction_column": "_direction_column_mlz2v_gg_"
|
|
33
33
|
});
|
|
34
34
|
var LegendFlexRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
35
35
|
function LegendFlexRoot() {
|
|
@@ -27,25 +27,25 @@ var _utils = require("../../../utils");
|
|
|
27
27
|
var _excluded = ["id", "checked", "color", "onChangeLegendItem", "shape"];
|
|
28
28
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
29
29
|
/*!__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
30
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
30
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendItem_u4e2c_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_u4e2c_gg_:hover{cursor:pointer}.___SLegendItem_u4e2c_gg_.__disabled_u4e2c_gg_:hover{cursor:default}}.___SPointShape_u4e2c_gg_.__color_u4e2c_gg_{background-color:var(--color_u4e2c);margin-right:8px;flex-shrink:0}.___SPointShape_u4e2c_gg_._shape_Circle_u4e2c_gg_._size_l_u4e2c_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_u4e2c_gg_._shape_Circle_u4e2c_gg_._size_m_u4e2c_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_u4e2c_gg_._shape_Line_u4e2c_gg_._size_l_u4e2c_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_u4e2c_gg_._shape_Line_u4e2c_gg_._size_m_u4e2c_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_u4e2c_gg_._shape_Square_u4e2c_gg_._size_l_u4e2c_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_u4e2c_gg_._shape_Square_u4e2c_gg_._size_m_u4e2c_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_u4e2c_gg_._shape_Pattern_u4e2c_gg_{background-color:transparent;margin-right:4px}.___SIcon_u4e2c_gg_{line-height:0;margin-right:4px}.___SIcon_u4e2c_gg_._size_l_u4e2c_gg_{margin-top:4px}.___SIcon_u4e2c_gg_._size_m_u4e2c_gg_{margin-top:2px}.___SLabel_u4e2c_gg_{min-width:0}.___SAdditionalLabel_u4e2c_gg_._size_l_u4e2c_gg_,.___SCount_u4e2c_gg_._size_l_u4e2c_gg_,.___SLabel_u4e2c_gg_._size_l_u4e2c_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_u4e2c_gg_._size_m_u4e2c_gg_,.___SCount_u4e2c_gg_._size_m_u4e2c_gg_,.___SLabel_u4e2c_gg_._size_m_u4e2c_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_u4e2c_gg_,.___SCount_u4e2c_gg_{margin-left:4px}.___SAdditionalLabel_u4e2c_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_u4e2c_gg_::before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary, #6c6e79);height:4px;width:4px;border-radius:2px;margin-right:4px}.___SAdditionalLabel_u4e2c_gg_._size_l_u4e2c_gg_::before{margin-top:10px}.___SAdditionalLabel_u4e2c_gg_._size_m_u4e2c_gg_::before{margin-top:8px}.___SPatternSymbol_u4e2c_gg_{transform:scale(.8)}", /*__inner_css_end__*/"u4e2c_gg_"),
|
|
31
31
|
/*__reshadow_css_end__*/
|
|
32
32
|
{
|
|
33
|
-
"__SLegendItem": "
|
|
34
|
-
"_disabled": "
|
|
35
|
-
"__SPointShape": "
|
|
36
|
-
"_color": "
|
|
37
|
-
"--color": "--
|
|
38
|
-
"_shape_Circle": "
|
|
39
|
-
"_size_l": "
|
|
40
|
-
"_size_m": "
|
|
41
|
-
"_shape_Line": "
|
|
42
|
-
"_shape_Square": "
|
|
43
|
-
"_shape_Pattern": "
|
|
44
|
-
"__SIcon": "
|
|
45
|
-
"__SLabel": "
|
|
46
|
-
"__SAdditionalLabel": "
|
|
47
|
-
"__SCount": "
|
|
48
|
-
"__SPatternSymbol": "
|
|
33
|
+
"__SLegendItem": "___SLegendItem_u4e2c_gg_",
|
|
34
|
+
"_disabled": "__disabled_u4e2c_gg_",
|
|
35
|
+
"__SPointShape": "___SPointShape_u4e2c_gg_",
|
|
36
|
+
"_color": "__color_u4e2c_gg_",
|
|
37
|
+
"--color": "--color_u4e2c",
|
|
38
|
+
"_shape_Circle": "_shape_Circle_u4e2c_gg_",
|
|
39
|
+
"_size_l": "_size_l_u4e2c_gg_",
|
|
40
|
+
"_size_m": "_size_m_u4e2c_gg_",
|
|
41
|
+
"_shape_Line": "_shape_Line_u4e2c_gg_",
|
|
42
|
+
"_shape_Square": "_shape_Square_u4e2c_gg_",
|
|
43
|
+
"_shape_Pattern": "_shape_Pattern_u4e2c_gg_",
|
|
44
|
+
"__SIcon": "___SIcon_u4e2c_gg_",
|
|
45
|
+
"__SLabel": "___SLabel_u4e2c_gg_",
|
|
46
|
+
"__SAdditionalLabel": "___SAdditionalLabel_u4e2c_gg_",
|
|
47
|
+
"__SCount": "___SCount_u4e2c_gg_",
|
|
48
|
+
"__SPatternSymbol": "___SPatternSymbol_u4e2c_gg_"
|
|
49
49
|
});
|
|
50
50
|
var enhance = [(0, _resolveColorEnhance["default"])(), (0, _uniqueID["default"])()];
|
|
51
51
|
var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
@@ -20,14 +20,14 @@ var _BaseLegend2 = require("../BaseLegend");
|
|
|
20
20
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
21
21
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
22
22
|
/*!__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
23
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
23
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendTable_io8tb_gg_.__columns-count_io8tb_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_io8tb_gg_._size_l_io8tb_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_io8tb_gg_._size_m_io8tb_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}", /*__inner_css_end__*/"io8tb_gg_"),
|
|
24
24
|
/*__reshadow_css_end__*/
|
|
25
25
|
{
|
|
26
|
-
"__SLegendTable": "
|
|
27
|
-
"_columns-count": "__columns-
|
|
28
|
-
"__SColumnItem": "
|
|
29
|
-
"_size_l": "
|
|
30
|
-
"_size_m": "
|
|
26
|
+
"__SLegendTable": "___SLegendTable_io8tb_gg_",
|
|
27
|
+
"_columns-count": "__columns-count_io8tb_gg_",
|
|
28
|
+
"__SColumnItem": "___SColumnItem_io8tb_gg_",
|
|
29
|
+
"_size_l": "_size_l_io8tb_gg_",
|
|
30
|
+
"_size_m": "_size_m_io8tb_gg_"
|
|
31
31
|
});
|
|
32
32
|
var LegendTableRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
33
33
|
function LegendTableRoot() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Area.d.js","names":[],"sources":["../../../src/types/Area.d.ts"],"sourcesContent":["import 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 IAreaProps extends AreaProps, UnknownProperties {}\nexport type AreaProps = 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};\n\n/** @deprecated */\nexport interface IAreaDotsProps extends AreaDotsProps, UnknownProperties {}\nexport type AreaDotsProps = Context & {\n /** Show dots */\n display?: boolean | ((index: number, active: boolean, single: boolean) => boolean);\n /** Hide property */\n hide?: boolean;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface IAreaDotsContext extends AreaDotsContext, UnknownProperties {}\nexport type AreaDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface IAreaNullProps extends AreaNullProps, UnknownProperties {}\nexport type AreaNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\ndeclare const Area: IntergalacticD3Component<'path', AreaProps, Context> & {\n Dots: IntergalacticD3Component<'circle', AreaDotsProps, AreaDotsContext>;\n Null: IntergalacticD3Component<'path', AreaNullProps, Context>;\n Line: IntergalacticD3Component<'path', Context, Context>;\n};\n\nexport default Area;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Area.d.js","names":[],"sources":["../../../src/types/Area.d.ts"],"sourcesContent":["import 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 IAreaProps extends AreaProps, UnknownProperties {}\nexport type AreaProps = 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 chart at a position corresponding to a data item */\n onClick?: (index: number, event: React.SyntheticEvent) => void;\n};\n\n/** @deprecated */\nexport interface IAreaDotsProps extends AreaDotsProps, UnknownProperties {}\nexport type AreaDotsProps = Context & {\n /** Show dots */\n display?: boolean | ((index: number, active: boolean, single: boolean) => boolean);\n /** Hide property */\n hide?: boolean;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface IAreaDotsContext extends AreaDotsContext, UnknownProperties {}\nexport type AreaDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface IAreaNullProps extends AreaNullProps, UnknownProperties {}\nexport type AreaNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\ndeclare const Area: IntergalacticD3Component<'path', AreaProps, Context> & {\n Dots: IntergalacticD3Component<'circle', AreaDotsProps, AreaDotsContext>;\n Null: IntergalacticD3Component<'path', AreaNullProps, Context>;\n Line: IntergalacticD3Component<'path', Context, Context>;\n};\n\nexport default Area;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bubble.d.js","names":[],"sources":["../../../src/types/Bubble.d.ts"],"sourcesContent":["import type { Intergalactic, 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 IBubbleProps extends BubbleProps, UnknownProperties {}\nexport type BubbleProps = 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 /** Field name from `data` array item for the circle radius */\n value: string;\n /** Field name from `data` array item for the circle label */\n label?: string;\n /** Circle color */\n color?: string;\n /** Cross in the center of the bubble\n * @default true\n */\n markedCross?: boolean;\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\n/** @deprecated */\nexport interface IBubbleContext extends BubbleContext, UnknownProperties {}\nexport type BubbleContext = {\n /** Index element of data */\n index: number;\n};\n\nexport type BubbleCircleProps = {\n /** Item data index */\n index: number;\n\n /** Item visibility */\n visible?: boolean;\n};\n\ndeclare const Bubble: IntergalacticD3Component<Intergalactic.Tag, BubbleProps, BubbleContext> & {\n Tooltip: TooltipType<\n BubbleProps & {\n /**\n * @deprecated Use `index` instead.\n */\n xIndex: number;\n /**\n * Index of item in the `data` array used to render related bubble.\n */\n index: number;\n }\n >;\n Circle: IntergalacticD3Component<\n 'g',\n BubbleCircleProps,\n Context\n >;\n};\n\nexport default Bubble;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Bubble.d.js","names":[],"sources":["../../../src/types/Bubble.d.ts"],"sourcesContent":["import type { Intergalactic, 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 IBubbleProps extends BubbleProps, UnknownProperties {}\nexport type BubbleProps = 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 /** Field name from `data` array item for the circle radius */\n value: string;\n /** Field name from `data` array item for the circle label */\n label?: string;\n /** Circle color */\n color?: string;\n /** Cross in the center of the bubble\n * @default true\n */\n markedCross?: boolean;\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 bubble */\n onClick?: (index: number, event: React.SyntheticEvent) => void;\n};\n\n/** @deprecated */\nexport interface IBubbleContext extends BubbleContext, UnknownProperties {}\nexport type BubbleContext = {\n /** Index element of data */\n index: number;\n};\n\nexport type BubbleCircleProps = {\n /** Item data index */\n index: number;\n\n /** Item visibility */\n visible?: boolean;\n};\n\ndeclare const Bubble: IntergalacticD3Component<Intergalactic.Tag, BubbleProps, BubbleContext> & {\n Tooltip: TooltipType<\n BubbleProps & {\n /**\n * @deprecated Use `index` instead.\n */\n xIndex: number;\n /**\n * Index of item in the `data` array used to render related bubble.\n */\n index: number;\n }\n >;\n Circle: IntergalacticD3Component<\n 'g',\n BubbleCircleProps,\n Context\n >;\n};\n\nexport default Bubble;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Donut.d.js","names":[],"sources":["../../../src/types/Donut.d.ts"],"sourcesContent":["import 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 IDonutProps extends DonutProps, UnknownProperties {}\nexport type DonutProps = Context & {\n /** Inner radius\n * @default 0\n * */\n innerRadius?: number;\n /** Outer radius\n * @default calculated by the formula from width, height\n * */\n outerRadius?: number;\n /** Semi donut */\n halfsize?: boolean;\n /** Animation duration in ms. Set `0` to disable animation.\n * @default 500\n */\n duration?: number;\n /** Additional padding between segments in radians.\n * @default 0\n */\n paddingAngle?: number;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\n/** @deprecated */\nexport interface IPieProps extends PieProps, UnknownProperties {}\nexport type PieProps = Context & {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /**\n * Human readable name of the segment\n * */\n name: string;\n /** Color pie **/\n color?: string;\n /**\n * Active sector\n * */\n active?: boolean;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface IEmptyDataProps extends EmptyDataProps, UnknownProperties {}\nexport type EmptyDataProps = Context & {};\n\n/** @deprecated */\nexport interface ILabelProps extends LabelProps, UnknownProperties {}\nexport type LabelProps = Context & {\n label?: string;\n};\n\ndeclare const Donut: IntergalacticD3Component<'g', DonutProps> & {\n Pie: IntergalacticD3Component<'path', PieProps>;\n EmptyData: IntergalacticD3Component<'path', EmptyDataProps>;\n Label: IntergalacticD3Component<'text', LabelProps>;\n Tooltip: TooltipType<PieProps>;\n};\n\nexport default Donut;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Donut.d.js","names":[],"sources":["../../../src/types/Donut.d.ts"],"sourcesContent":["import 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 IDonutProps extends DonutProps, UnknownProperties {}\nexport type DonutProps = Context & {\n /** Inner radius\n * @default 0\n * */\n innerRadius?: number;\n /** Outer radius\n * @default calculated by the formula from width, height\n * */\n outerRadius?: number;\n /** Semi donut */\n halfsize?: boolean;\n /** Animation duration in ms. Set `0` to disable animation.\n * @default 500\n */\n duration?: number;\n /** Additional padding between segments in radians.\n * @default 0\n */\n paddingAngle?: number;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n /** Callback triggered when a user clicks on a pie */\n onClick?: (key: string, event: React.SyntheticEvent) => void;\n};\n\n/** @deprecated */\nexport interface IPieProps extends PieProps, UnknownProperties {}\nexport type PieProps = Context & {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /**\n * Human readable name of the segment\n * */\n name: string;\n /** Color pie **/\n color?: string;\n /**\n * Active sector\n * */\n active?: boolean;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface IEmptyDataProps extends EmptyDataProps, UnknownProperties {}\nexport type EmptyDataProps = Context & {};\n\n/** @deprecated */\nexport interface ILabelProps extends LabelProps, UnknownProperties {}\nexport type LabelProps = Context & {\n label?: string;\n};\n\ndeclare const Donut: IntergalacticD3Component<'g', DonutProps> & {\n Pie: IntergalacticD3Component<'path', PieProps>;\n EmptyData: IntergalacticD3Component<'path', EmptyDataProps>;\n Label: IntergalacticD3Component<'text', LabelProps>;\n Tooltip: TooltipType<PieProps>;\n};\n\nexport default Donut;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import type { FadeInOutProps } from '@semcore/animation';\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};\n\n/** @deprecated */\nexport interface ILineDotsProps extends LineDotsProps, UnknownProperties {}\nexport type LineDotsProps = Context &\n Omit<FadeInOutProps, '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
|
+
{"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import type { FadeInOutProps } from '@semcore/animation';\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<FadeInOutProps, '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":"Radar.d.js","names":[],"sources":["../../../src/types/Radar.d.ts"],"sourcesContent":["import type { UnknownProperties } from '@semcore/core';\nimport type { BoxProps } from '@semcore/flex-box';\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};\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 = BoxProps & 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
|
+
{"version":3,"file":"Radar.d.js","names":[],"sources":["../../../src/types/Radar.d.ts"],"sourcesContent":["import type { UnknownProperties } from '@semcore/core';\nimport type { BoxProps } from '@semcore/flex-box';\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 = BoxProps & 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":"ScatterPlot.d.js","names":[],"sources":["../../../src/types/ScatterPlot.d.ts"],"sourcesContent":["import 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 IScatterPlotProps extends ScatterPlotProps, UnknownProperties {}\nexport type ScatterPlotProps = 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 /** Field name from `data` array item for the circle value */\n value?: string;\n /** Circle color */\n color?: string;\n /** Circle value color */\n valueColor?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of circles\n * @default 5.5 or 12 with value\n */\n r?: number;\n /** Enables element transparency */\n transparent?: boolean;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\ndeclare const ScatterPlot: IntergalacticD3Component<'g', ScatterPlotProps, Context> & {\n Tooltip: TooltipType<\n ScatterPlotProps & {\n /**\n * @deprecated Use `index` instead.\n */\n xIndex: number;\n /**\n * Index of item in the `data` array used to render related circle.\n */\n index: number;\n }\n >;\n};\n\nexport default ScatterPlot;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ScatterPlot.d.js","names":[],"sources":["../../../src/types/ScatterPlot.d.ts"],"sourcesContent":["import 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 IScatterPlotProps extends ScatterPlotProps, UnknownProperties {}\nexport type ScatterPlotProps = 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 /** Field name from `data` array item for the circle value */\n value?: string;\n /** Circle color */\n color?: string;\n /** Circle value color */\n valueColor?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of circles\n * @default 5.5 or 12 with value\n */\n r?: 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 scatter item */\n onClick?: (index: number, event: React.SyntheticEvent) => void;\n};\n\ndeclare const ScatterPlot: IntergalacticD3Component<'g', ScatterPlotProps, Context> & {\n Tooltip: TooltipType<\n ScatterPlotProps & {\n /**\n * @deprecated Use `index` instead.\n */\n xIndex: number;\n /**\n * Index of item in the `data` array used to render related circle.\n */\n index: number;\n }\n >;\n};\n\nexport default ScatterPlot;\n"],"mappings":"","ignoreList":[]}
|