@semcore/d3-chart 3.38.1 → 3.39.1-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 +22 -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 +17 -19
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/Donut.js +14 -14
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +8 -8
- package/lib/cjs/HorizontalBar.js +10 -10
- package/lib/cjs/Hover.js +7 -23
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +7 -5
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +28 -34
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +11 -11
- package/lib/cjs/ReferenceLine.js +9 -9
- package/lib/cjs/ScatterPlot.js +14 -14
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/Tooltip.js +56 -31
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +14 -14
- 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/AbstractChart.js +4 -2
- 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/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/index.js +6 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/reference-line.shadow.css +1 -1
- package/lib/cjs/types/Plot.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +8 -0
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +4 -5
- 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 +18 -20
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/Donut.js +15 -15
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +8 -8
- package/lib/es6/HorizontalBar.js +10 -10
- package/lib/es6/Hover.js +8 -24
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +7 -5
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +29 -35
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +11 -11
- package/lib/es6/ReferenceLine.js +9 -9
- package/lib/es6/ScatterPlot.js +15 -15
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/Tooltip.js +57 -32
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +15 -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/AbstractChart.js +4 -2
- 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/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/index.js +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/reference-line.shadow.css +1 -1
- package/lib/es6/types/Plot.d.js.map +1 -1
- package/lib/es6/types/index.d.js +2 -1
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/es6/utils.js +2 -4
- package/lib/es6/utils.js.map +1 -1
- package/lib/types/Plot.d.ts +2 -2
- package/lib/types/component/Chart/AbstractChart.type.d.ts +4 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/utils.d.ts +12 -4
- package/package.json +7 -7
|
@@ -10,10 +10,10 @@ import React from 'react';
|
|
|
10
10
|
import createComponent, { sstyled, Root } from '@semcore/core';
|
|
11
11
|
import { Flex } from '@semcore/flex-box';
|
|
12
12
|
/*__reshadow-styles__:"./legend-flex.shadow.css"*/
|
|
13
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
14
|
-
"__SLegendFlex": "
|
|
15
|
-
"_direction_row": "
|
|
16
|
-
"_direction_column": "
|
|
13
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SLegendFlex_oq150_gg_._direction_row_oq150_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_oq150_gg_._direction_column_oq150_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}" /*__inner_css_end__*/, "oq150_gg_") /*__reshadow_css_end__*/, {
|
|
14
|
+
"__SLegendFlex": "___SLegendFlex_oq150_gg_",
|
|
15
|
+
"_direction_row": "_direction_row_oq150_gg_",
|
|
16
|
+
"_direction_column": "_direction_column_oq150_gg_"
|
|
17
17
|
});
|
|
18
18
|
import { LegendItemComponent } from '../LegendItem/LegendItem';
|
|
19
19
|
import Divider from '@semcore/divider';
|
|
@@ -19,23 +19,23 @@ import { Flex, Box } from '@semcore/flex-box';
|
|
|
19
19
|
import Checkbox from '@semcore/checkbox';
|
|
20
20
|
import { Text as TypographyText } from '@semcore/typography';
|
|
21
21
|
/*__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
22
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
23
|
-
"__SLegendItem": "
|
|
24
|
-
"_disabled": "
|
|
25
|
-
"__SPointShape": "
|
|
26
|
-
"_color": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"_shape_Circle": "
|
|
29
|
-
"_size_l": "
|
|
30
|
-
"_size_m": "
|
|
31
|
-
"_shape_Line": "
|
|
32
|
-
"_shape_Square": "
|
|
33
|
-
"_shape_Pattern": "
|
|
34
|
-
"__SIcon": "
|
|
35
|
-
"__SLabel": "
|
|
36
|
-
"__SAdditionalLabel": "
|
|
37
|
-
"__SCount": "
|
|
38
|
-
"__SPatternSymbol": "
|
|
22
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SLegendItem_uedv0_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_uedv0_gg_:hover{cursor:pointer}.___SLegendItem_uedv0_gg_.__disabled_uedv0_gg_:hover{cursor:default}}.___SPointShape_uedv0_gg_.__color_uedv0_gg_{background-color:var(--color_uedv0);margin-right:8px;flex-shrink:0}.___SPointShape_uedv0_gg_._shape_Circle_uedv0_gg_._size_l_uedv0_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_uedv0_gg_._shape_Circle_uedv0_gg_._size_m_uedv0_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_uedv0_gg_._shape_Line_uedv0_gg_._size_l_uedv0_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_uedv0_gg_._shape_Line_uedv0_gg_._size_m_uedv0_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_uedv0_gg_._shape_Square_uedv0_gg_._size_l_uedv0_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_uedv0_gg_._shape_Square_uedv0_gg_._size_m_uedv0_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_uedv0_gg_._shape_Pattern_uedv0_gg_{background-color:transparent;margin-right:4px}.___SIcon_uedv0_gg_{line-height:0;margin-right:4px}.___SIcon_uedv0_gg_._size_l_uedv0_gg_{margin-top:4px}.___SIcon_uedv0_gg_._size_m_uedv0_gg_{margin-top:2px}.___SLabel_uedv0_gg_{min-width:0}.___SAdditionalLabel_uedv0_gg_._size_l_uedv0_gg_,.___SCount_uedv0_gg_._size_l_uedv0_gg_,.___SLabel_uedv0_gg_._size_l_uedv0_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_uedv0_gg_._size_m_uedv0_gg_,.___SCount_uedv0_gg_._size_m_uedv0_gg_,.___SLabel_uedv0_gg_._size_m_uedv0_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_uedv0_gg_,.___SCount_uedv0_gg_{margin-left:4px}.___SAdditionalLabel_uedv0_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_uedv0_gg_::before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary, #6c6e79);height:4px;width:4px;border-radius:2px;margin-right:4px}.___SAdditionalLabel_uedv0_gg_._size_l_uedv0_gg_::before{margin-top:10px}.___SAdditionalLabel_uedv0_gg_._size_m_uedv0_gg_::before{margin-top:8px}.___SPatternSymbol_uedv0_gg_{transform:scale(.8)}" /*__inner_css_end__*/, "uedv0_gg_") /*__reshadow_css_end__*/, {
|
|
23
|
+
"__SLegendItem": "___SLegendItem_uedv0_gg_",
|
|
24
|
+
"_disabled": "__disabled_uedv0_gg_",
|
|
25
|
+
"__SPointShape": "___SPointShape_uedv0_gg_",
|
|
26
|
+
"_color": "__color_uedv0_gg_",
|
|
27
|
+
"--color": "--color_uedv0",
|
|
28
|
+
"_shape_Circle": "_shape_Circle_uedv0_gg_",
|
|
29
|
+
"_size_l": "_size_l_uedv0_gg_",
|
|
30
|
+
"_size_m": "_size_m_uedv0_gg_",
|
|
31
|
+
"_shape_Line": "_shape_Line_uedv0_gg_",
|
|
32
|
+
"_shape_Square": "_shape_Square_uedv0_gg_",
|
|
33
|
+
"_shape_Pattern": "_shape_Pattern_uedv0_gg_",
|
|
34
|
+
"__SIcon": "___SIcon_uedv0_gg_",
|
|
35
|
+
"__SLabel": "___SLabel_uedv0_gg_",
|
|
36
|
+
"__SAdditionalLabel": "___SAdditionalLabel_uedv0_gg_",
|
|
37
|
+
"__SCount": "___SCount_uedv0_gg_",
|
|
38
|
+
"__SPatternSymbol": "___SPatternSymbol_uedv0_gg_"
|
|
39
39
|
});
|
|
40
40
|
import { StaticShapes } from './LegendItem.type';
|
|
41
41
|
import resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';
|
|
@@ -11,12 +11,12 @@ import React from 'react';
|
|
|
11
11
|
import createComponent, { sstyled, Root } from '@semcore/core';
|
|
12
12
|
import { Box } from '@semcore/flex-box';
|
|
13
13
|
/*__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
14
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
15
|
-
"__SLegendTable": "
|
|
16
|
-
"_columns-count": "__columns-
|
|
17
|
-
"__SColumnItem": "
|
|
18
|
-
"_size_l": "
|
|
19
|
-
"_size_m": "
|
|
14
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SLegendTable_6ho3s_gg_.__columns-count_6ho3s_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_6ho3s_gg_._size_l_6ho3s_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_6ho3s_gg_._size_m_6ho3s_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}" /*__inner_css_end__*/, "6ho3s_gg_") /*__reshadow_css_end__*/, {
|
|
15
|
+
"__SLegendTable": "___SLegendTable_6ho3s_gg_",
|
|
16
|
+
"_columns-count": "__columns-count_6ho3s_gg_",
|
|
17
|
+
"__SColumnItem": "___SColumnItem_6ho3s_gg_",
|
|
18
|
+
"_size_l": "_size_l_6ho3s_gg_",
|
|
19
|
+
"_size_m": "_size_m_6ho3s_gg_"
|
|
20
20
|
});
|
|
21
21
|
import { LegendItemComponent } from '../LegendItem/LegendItem';
|
|
22
22
|
import { BaseLegend } from '../BaseLegend';
|
package/lib/es6/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export { default as Tooltip } from './Tooltip';
|
|
|
19
19
|
export { default as ResponsiveContainer } from './ResponsiveContainer';
|
|
20
20
|
export { default as ReferenceLine } from './ReferenceLine';
|
|
21
21
|
export { HoverLine, HoverRect } from './Hover';
|
|
22
|
-
export { minMax, interpolateValue, getBubbleChartValueScale, getScatterPlotRadius, calculateBubbleDomain } from './utils';
|
|
22
|
+
export { minMax, interpolateValue, getBubbleChartValueScale, getScatterPlotRadius, calculateBubbleDomain, PlotEventEmitter } from './utils';
|
|
23
23
|
export { colors } from './color';
|
|
24
24
|
export { makeDataHintsContainer } from './a11y/hints';
|
|
25
25
|
export { PatternFill, PatternSymbol, getPatternSymbolSize } from './Pattern';
|
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","Plot","ChartLegend","ChartLegendTable","Chart","XAxis","YAxis","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","ScatterPlot","Bubble","RadialTree","Donut","Venn","Radar","getLabelOffsetPosition","Tooltip","ResponsiveContainer","ReferenceLine","HoverLine","HoverRect","minMax","interpolateValue","getBubbleChartValueScale","getScatterPlotRadius","calculateBubbleDomain","colors","makeDataHintsContainer","PatternFill","PatternSymbol","getPatternSymbolSize"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { default as Chart } from './component/Chart';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { default as ReferenceLine } from './ReferenceLine';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport {\n minMax,\n interpolateValue,\n getBubbleChartValueScale,\n getScatterPlotRadius,\n calculateBubbleDomain,\n} from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\nexport { PatternFill, PatternSymbol, getPatternSymbolSize } from './Pattern';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;AACvE,SAASH,OAAO,IAAII,KAAK,QAAQ,mBAAmB;AACpD,SAASC,KAAK,EAAEC,KAAK,QAAQ,QAAQ;AAErC,SAASN,OAAO,IAAIO,IAAI,QAAQ,QAAQ;AAExC,SAASP,OAAO,IAAIQ,GAAG,QAAQ,OAAO;AACtC,SAASR,OAAO,IAAIS,aAAa,QAAQ,iBAAiB;AAC1D,SAAST,OAAO,IAAIU,QAAQ,QAAQ,YAAY;AAChD,SAASV,OAAO,IAAIW,QAAQ,QAAQ,YAAY;AAChD,SAASX,OAAO,IAAIY,IAAI,QAAQ,QAAQ;AACxC,SAASZ,OAAO,IAAIa,WAAW,QAAQ,eAAe;AACtD,SAASb,OAAO,IAAIc,WAAW,QAAQ,eAAe;AACtD,SAASd,OAAO,IAAIe,MAAM,QAAQ,UAAU;AAC5C,SAASf,OAAO,IAAIgB,UAAU,QAAQ,cAAc;AACpD,SAAShB,OAAO,IAAIiB,KAAK,QAAQ,SAAS;AAC1C,SAASjB,OAAO,IAAIkB,IAAI,QAAQ,QAAQ;AACxC,SAASlB,OAAO,IAAImB,KAAK,EAAEC,sBAAsB,QAAQ,SAAS;AAElE,SAASpB,OAAO,IAAIqB,OAAO,QAAQ,WAAW;AAE9C,SAASrB,OAAO,IAAIsB,mBAAmB,QAAQ,uBAAuB;AACtE,SAAStB,OAAO,IAAIuB,aAAa,QAAQ,iBAAiB;AAE1D,SAASC,SAAS,EAAEC,SAAS,QAAQ,SAAS;AAE9C,SACEC,MAAM,EACNC,gBAAgB,EAChBC,wBAAwB,EACxBC,oBAAoB,EACpBC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","Plot","ChartLegend","ChartLegendTable","Chart","XAxis","YAxis","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","ScatterPlot","Bubble","RadialTree","Donut","Venn","Radar","getLabelOffsetPosition","Tooltip","ResponsiveContainer","ReferenceLine","HoverLine","HoverRect","minMax","interpolateValue","getBubbleChartValueScale","getScatterPlotRadius","calculateBubbleDomain","PlotEventEmitter","colors","makeDataHintsContainer","PatternFill","PatternSymbol","getPatternSymbolSize"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { default as Chart } from './component/Chart';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { default as ReferenceLine } from './ReferenceLine';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport {\n minMax,\n interpolateValue,\n getBubbleChartValueScale,\n getScatterPlotRadius,\n calculateBubbleDomain,\n PlotEventEmitter,\n} from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\nexport { PatternFill, PatternSymbol, getPatternSymbolSize } from './Pattern';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;AACvE,SAASH,OAAO,IAAII,KAAK,QAAQ,mBAAmB;AACpD,SAASC,KAAK,EAAEC,KAAK,QAAQ,QAAQ;AAErC,SAASN,OAAO,IAAIO,IAAI,QAAQ,QAAQ;AAExC,SAASP,OAAO,IAAIQ,GAAG,QAAQ,OAAO;AACtC,SAASR,OAAO,IAAIS,aAAa,QAAQ,iBAAiB;AAC1D,SAAST,OAAO,IAAIU,QAAQ,QAAQ,YAAY;AAChD,SAASV,OAAO,IAAIW,QAAQ,QAAQ,YAAY;AAChD,SAASX,OAAO,IAAIY,IAAI,QAAQ,QAAQ;AACxC,SAASZ,OAAO,IAAIa,WAAW,QAAQ,eAAe;AACtD,SAASb,OAAO,IAAIc,WAAW,QAAQ,eAAe;AACtD,SAASd,OAAO,IAAIe,MAAM,QAAQ,UAAU;AAC5C,SAASf,OAAO,IAAIgB,UAAU,QAAQ,cAAc;AACpD,SAAShB,OAAO,IAAIiB,KAAK,QAAQ,SAAS;AAC1C,SAASjB,OAAO,IAAIkB,IAAI,QAAQ,QAAQ;AACxC,SAASlB,OAAO,IAAImB,KAAK,EAAEC,sBAAsB,QAAQ,SAAS;AAElE,SAASpB,OAAO,IAAIqB,OAAO,QAAQ,WAAW;AAE9C,SAASrB,OAAO,IAAIsB,mBAAmB,QAAQ,uBAAuB;AACtE,SAAStB,OAAO,IAAIuB,aAAa,QAAQ,iBAAiB;AAE1D,SAASC,SAAS,EAAEC,SAAS,QAAQ,SAAS;AAE9C,SACEC,MAAM,EACNC,gBAAgB,EAChBC,wBAAwB,EACxBC,oBAAoB,EACpBC,qBAAqB,EACrBC,gBAAgB,QACX,SAAS;AAChB,SAASC,MAAM,QAAQ,SAAS;AAEhC,SAASC,sBAAsB,QAAQ,cAAc;AAErD,SAASC,WAAW,EAAEC,aAAa,EAAEC,oBAAoB,QAAQ,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plot.d.js","names":[],"sources":["../../../src/types/Plot.d.ts"],"sourcesContent":["import { BoxProps } from '@semcore/flex-box';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Context } from './context';\nimport { DataStructureHints } from './a11y/hints';\nimport { PatternsConfig } from './Pattern';\n\n/** @deprecated */\nexport interface IPlotProps extends PlotProps, UnknownProperties {}\nexport type PlotProps = Context &\n BoxProps & {\n /** Width of the svg element\n * @default 0*/\n width?: number;\n /** Height of the svg element\n * @default 0*/\n height?: number;\n /** Human readable chart name (e.g \"Last market trends\") */\n label?: string;\n /**\n * Locale for displaying the days of a week and months, to be transferred to `Intl`\n * @default en\n * */\n locale?: NavigatorLanguage['language'];\n /**\n * Optional container for data hints (use it if you have a legend component upper in tree)\n */\n dataHints?: DataStructureHints;\n /** Optional prop to tune up alt text generating for charts */\n a11yAltTextConfig?: PlotSummarizerConfig;\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n\n
|
|
1
|
+
{"version":3,"file":"Plot.d.js","names":[],"sources":["../../../src/types/Plot.d.ts"],"sourcesContent":["import { BoxProps } from '@semcore/flex-box';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Context } from './context';\nimport { DataStructureHints } from './a11y/hints';\nimport { PatternsConfig } from './Pattern';\nimport { PlotEventEmitter } from './utils';\n\n/** @deprecated */\nexport interface IPlotProps extends PlotProps, UnknownProperties {}\nexport type PlotProps = Context &\n BoxProps & {\n /** Width of the svg element\n * @default 0*/\n width?: number;\n /** Height of the svg element\n * @default 0*/\n height?: number;\n /** Human readable chart name (e.g \"Last market trends\") */\n label?: string;\n /**\n * Locale for displaying the days of a week and months, to be transferred to `Intl`\n * @default en\n * */\n locale?: NavigatorLanguage['language'];\n /**\n * Optional container for data hints (use it if you have a legend component upper in tree)\n */\n dataHints?: DataStructureHints;\n /** Optional prop to tune up alt text generating for charts */\n a11yAltTextConfig?: PlotSummarizerConfig;\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n\n eventEmitter?: InstanceType<typeof PlotEventEmitter>;\n };\n\nexport type PlotSummarizerConfig = {\n /** Totally disable automatic data summarization */\n disable?: boolean;\n /** Disable automatic data summarization and use provided text */\n override?: string;\n /** Tuning up time series trends analyzing. Represents angle tangens of time series change of different strength */\n trendTangens?: {\n /** Angle tangens of time series that have meaningful trending change\n * @default 1/15\n */\n static?: number;\n /** Angle tangens of time series that have weak trending change\n * @default 1/10\n */\n weak?: number;\n /** Angle tangens of time series that have medium trending change\n * @default 1/5\n */\n medium?: number;\n /** Angle tangens of time series that have strong trending change\n * @default Infinity\n */\n strong?: number;\n };\n /** Tuning up time series local trends detection based on moving averages */\n movingAverage?: {\n /** Frame size of long moving average\n * @default Math.sqrt(data.length)\n */\n longSize?: number;\n /** Frame size of short moving average\n * @default Math.sqrt(data.length)/2\n */\n shortSize?: number;\n /** Absolute difference between values on moving averages crossing to\n * be handled as local trend change.\n * @default StandardDeviation/10\n */\n notableDiff?: number;\n };\n /** The way data to be interpreted as. By default is based on used used Plot elements and data structure.\n */\n dataType?: 'time-series' | 'points-cloud' | 'values-set';\n /** Grid size to split data of point clouds into clusters.\n */\n clustersGridSize?: number;\n /** Limits some output lists in chart alt text\n * @default 100\n * **/\n maxListSymbols?: number;\n /** Always add time to dates in chart alt text **/\n datesWithTime?: boolean;\n /** Described clusters count before text \"and X more\"\n * @default false\n * **/\n clustersLimit?: number;\n /** Described values count before text \"and X more\"\n * @default false\n * **/\n valuesLimit?: number;\n /** Described grouped value groups count before text \"and X more\"\n * @default false\n * **/\n groupsLimit?: number;\n /** Additional field for extra text description to the data\n * **/\n additionalFields?: string[];\n /** Allows to format titles (e.g. axes) in alt text and data table */\n titlesFormatter?: (key: string | number | null) => string | undefined;\n /** Allows to format values in alt text and data table */\n valuesFormatter?: (value: unknown, key: string | number | null) => string | undefined;\n};\n\n/** @deprecated */\nexport type MapProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?:\n | ((props: Props & Ctx, handlers: UCProps) => Props | React.PropsWithChildren)\n | React.ReactNode;\n};\n\nexport type IntergalacticD3Component<BaseTag extends Intergalactic.Tag, Props, Context = {}> = (<\n Tag extends Intergalactic.Tag = BaseTag,\n>(\n props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<Tag, Props, Context>,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\n Intergalactic.InternalTypings.ComponentAdditive<BaseTag, BaseTag, Props>;\n\ndeclare const Plot: IntergalacticD3Component<'svg', PlotProps, Context>;\nexport default Plot;\n"],"mappings":""}
|
package/lib/es6/types/index.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":["makeDataHintsContainer","default","Plot","ResponsiveContainer","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","Radar","Donut","Tooltip","ScatterPlot","Bubble","ReferenceLine","Venn","RadialTree","ChartLegend","ChartLegendTable","Chart"],"sources":["../../../src/types/index.d.ts"],"sourcesContent":["// Utils\n// @ts-ignore\nimport { interpolateValue as intValue } from './utils';\n\nexport declare const interpolateValue: typeof intValue;\nexport declare function minMax(data: any, key: string | number): any;\nexport declare function calculateBubbleDomain(\n data: Array<{ value: number; x: number; y: number }>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number];\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\n// Color\n/**\n * @deprecated\n * This export will be removed in the next major release.\n */\nexport declare const colors: { [key: string]: string };\n\nexport { default as Plot } from './Plot';\nexport * from './Plot';\n\nexport * from './Axis';\nexport * from './Hover';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport * from './ResponsiveContainer';\n\nexport { default as Line } from './Line';\nexport * from './Line';\n\nexport { default as Bar } from './Bar';\nexport * from './Bar';\n\nexport { default as HorizontalBar } from './HorizontalBar';\nexport * from './HorizontalBar';\n\nexport { default as GroupBar } from './GroupBar';\nexport * from './GroupBar';\n\nexport { default as StackBar } from './StackBar';\nexport * from './StackBar';\n\nexport { default as Area } from './Area';\nexport * from './Area';\n\nexport { default as StackedArea } from './StackedArea';\nexport * from './StackedArea';\n\nexport { default as Radar } from './Radar';\nexport * from './Radar';\n\nexport { default as Donut } from './Donut';\nexport * from './Donut';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as ScatterPlot } from './ScatterPlot';\nexport * from './ScatterPlot';\n\nexport { default as Bubble } from './Bubble';\nexport * from './Bubble';\n\nexport { default as ReferenceLine } from './ReferenceLine';\nexport * from './ReferenceLine';\n\nexport { default as Venn } from './Venn';\nexport * from './Venn';\n\n/** It becomes resolvable after building and moving file to lib dir */\n\n// @ts-ignore\nexport { default as RadialTree } from './RadialTree';\n\n// @ts-ignore\nexport * from './RadialTree';\n\n// @ts-ignore\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\n\n// @ts-ignore\nexport * from './component/ChartLegend/LegendFlex/LegendFlex.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendTable/LegendTable.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendItem/LegendItem.type';\n\n// @ts-ignore\nexport * from './Pattern';\n\nexport { default as Chart } from './component/Chart';\nexport * from './component/Chart/AbstractChart.type';\nexport * from './component/Chart/LineChart.type';\nexport * from './component/Chart/BarChart.type';\nexport * from './component/Chart/HistogramChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/AreaChart.type';\nexport * from './component/Chart/BubbleChart.type';\nexport * from './component/Chart/DonutChart.type';\nexport * from './component/Chart/VennChart.type';\nexport * from './component/Chart/RadarChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/CigaretteChart.type';\n"],"mappings":"AAAA;AACA
|
|
1
|
+
{"version":3,"file":"index.d.js","names":["PlotEventEmitter","makeDataHintsContainer","default","Plot","ResponsiveContainer","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","Radar","Donut","Tooltip","ScatterPlot","Bubble","ReferenceLine","Venn","RadialTree","ChartLegend","ChartLegendTable","Chart"],"sources":["../../../src/types/index.d.ts"],"sourcesContent":["// Utils\n// @ts-ignore\nimport { interpolateValue as intValue, PlotEventEmitter } from './utils';\n\nexport declare const interpolateValue: typeof intValue;\nexport declare function minMax(data: any, key: string | number): any;\nexport declare function calculateBubbleDomain(\n data: Array<{ value: number; x: number; y: number }>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number];\nexport { PlotEventEmitter };\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\n// Color\n/**\n * @deprecated\n * This export will be removed in the next major release.\n */\nexport declare const colors: { [key: string]: string };\n\nexport { default as Plot } from './Plot';\nexport * from './Plot';\n\nexport * from './Axis';\nexport * from './Hover';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport * from './ResponsiveContainer';\n\nexport { default as Line } from './Line';\nexport * from './Line';\n\nexport { default as Bar } from './Bar';\nexport * from './Bar';\n\nexport { default as HorizontalBar } from './HorizontalBar';\nexport * from './HorizontalBar';\n\nexport { default as GroupBar } from './GroupBar';\nexport * from './GroupBar';\n\nexport { default as StackBar } from './StackBar';\nexport * from './StackBar';\n\nexport { default as Area } from './Area';\nexport * from './Area';\n\nexport { default as StackedArea } from './StackedArea';\nexport * from './StackedArea';\n\nexport { default as Radar } from './Radar';\nexport * from './Radar';\n\nexport { default as Donut } from './Donut';\nexport * from './Donut';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as ScatterPlot } from './ScatterPlot';\nexport * from './ScatterPlot';\n\nexport { default as Bubble } from './Bubble';\nexport * from './Bubble';\n\nexport { default as ReferenceLine } from './ReferenceLine';\nexport * from './ReferenceLine';\n\nexport { default as Venn } from './Venn';\nexport * from './Venn';\n\n/** It becomes resolvable after building and moving file to lib dir */\n\n// @ts-ignore\nexport { default as RadialTree } from './RadialTree';\n\n// @ts-ignore\nexport * from './RadialTree';\n\n// @ts-ignore\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\n\n// @ts-ignore\nexport * from './component/ChartLegend/LegendFlex/LegendFlex.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendTable/LegendTable.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendItem/LegendItem.type';\n\n// @ts-ignore\nexport * from './Pattern';\n\nexport { default as Chart } from './component/Chart';\nexport * from './component/Chart/AbstractChart.type';\nexport * from './component/Chart/LineChart.type';\nexport * from './component/Chart/BarChart.type';\nexport * from './component/Chart/HistogramChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/AreaChart.type';\nexport * from './component/Chart/BubbleChart.type';\nexport * from './component/Chart/DonutChart.type';\nexport * from './component/Chart/VennChart.type';\nexport * from './component/Chart/RadarChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/CigaretteChart.type';\n"],"mappings":"AAAA;AACA;AACA,SAAuCA,gBAAgB,QAAQ,SAAS;AASxE,SAASA,gBAAgB;AAEzB,SAASC,sBAAsB,QAAQ,cAAc;;AAErD;AACA;AACA;AACA;AACA;;AAGA,SAASC,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,cAAc,QAAQ;AACtB,cAAc,SAAS;AAEvB,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,uBAAuB;AACtE,cAAc,uBAAuB;AAErC,SAASF,OAAO,IAAIG,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,S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AAc,yCAAyC;AACvD,cAAc,kCAAkC;AAChD,cAAc,oCAAoC;AAClD,cAAc,mCAAmC;AACjD,cAAc,kCAAkC;AAChD,cAAc,mCAAmC;AACjD,cAAc,yCAAyC;AACvD,cAAc,uCAAuC"}
|
package/lib/es6/utils.js
CHANGED
|
@@ -3,12 +3,9 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
3
3
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper";
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
+
import EventEmitter from '@semcore/utils/lib/eventEmitter';
|
|
6
7
|
import { extent, bisector } from 'd3-array';
|
|
7
8
|
import { scaleQuantize, scaleBand, scaleSqrt } from 'd3-scale';
|
|
8
|
-
var CONSTANT = {
|
|
9
|
-
VIRTUAL_ELEMENT: Symbol('VIRTUAL_ELEMENT')
|
|
10
|
-
};
|
|
11
|
-
export { CONSTANT };
|
|
12
9
|
export var eventToPoint = function eventToPoint(event, svgRoot) {
|
|
13
10
|
var node = event.currentTarget || event.target;
|
|
14
11
|
var rect = svgRoot.getBoundingClientRect();
|
|
@@ -258,4 +255,5 @@ export var calculateBubbleDomain = function calculateBubbleDomain(data, key, ran
|
|
|
258
255
|
max += maxValueShift * 2;
|
|
259
256
|
return [min, max];
|
|
260
257
|
};
|
|
258
|
+
export var PlotEventEmitter = EventEmitter;
|
|
261
259
|
//# sourceMappingURL=utils.js.map
|
package/lib/es6/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["extent","bisector","scaleQuantize","scaleBand","scaleSqrt","CONSTANT","VIRTUAL_ELEMENT","Symbol","eventToPoint","event","svgRoot","node","currentTarget","target","rect","getBoundingClientRect","clientX","left","clientLeft","clientY","top","clientTop","invert","scale","value","range","domain","paddingOuter","step","slice","reverse","definedNullData","x","y","plot","definedData","undefined","scaleOfBandwidth","bandwidth","minMax","data","key","d","getNullData","defined","name","reduce","acc","i","push","_defineProperty","prev","next","defNext","find","_objectSpread","length","defPrev","getIndexFromData","Array","isArray","bisect","center","index","findIndex","keys","Object","map","item","interpolateValue","lastKeyIndex","console","warn","roundedPath","w","h","r","tl","arguments","tr","bl","br","result","concat","scaleToBand","band","memoize","func","results","_len","args","_key2","argsKey","join","apply","measureText","text","fontSize","span","document","createElement","style","_iterator","_createForOfIteratorHelper","split","_step","s","n","done","line","append","createTextNode","err","e","f","display","body","textWidth","offsetWidth","textHeight","offsetHeight","remove","Math","max","idCounter","uniqueId","prefix","getChartDefaultColorName","getBubbleChartValueScale","z","_toConsumableArray","el","getScatterPlotRadius","valueKey","calculateBubbleDomain","miniestValue","min","maxestValue","_minMax","_minMax2","_slicedToArray","pixelRatio","abs","valueScale","minValueShift","maxValueShift"],"sources":["../../src/utils.ts"],"sourcesContent":["import { extent, bisector, Numeric } from 'd3-array';\nimport {\n scaleQuantize,\n ScaleIdentity,\n ScaleTime,\n ScaleContinuousNumeric,\n ScaleBand,\n ScalePoint,\n NumberValue,\n scaleBand,\n scaleSqrt,\n} from 'd3-scale';\nimport React from 'react';\n\nconst CONSTANT = {\n VIRTUAL_ELEMENT: Symbol('VIRTUAL_ELEMENT'),\n} as const;\n\nexport { CONSTANT };\n\nexport const eventToPoint = (event: React.MouseEvent<HTMLElement>, svgRoot: SVGElement) => {\n const node = (event.currentTarget || event.target) as HTMLElement;\n const rect = svgRoot.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n};\n\ntype InvertableScale =\n | ScaleIdentity\n | ScaleBand<{}>\n | ScaleTime<unknown, unknown>\n | ScaleContinuousNumeric<unknown, unknown>;\nexport const invert = <Scale extends InvertableScale = InvertableScale>(\n scale: Scale,\n value: number,\n) => {\n if ('invert' in scale && scale.invert) return scale.invert(value);\n\n const range = scale.range() as [number, number];\n const domain = scale.domain();\n if ('paddingOuter' in scale) {\n range[0] += scale.paddingOuter() * scale.step();\n range[1] -= scale.paddingOuter() * scale.step();\n }\n\n return scaleQuantize()\n .domain((range[0] <= range[1] ? range : range.slice().reverse()) as NumberValue[])\n .range((range[0] <= range[1] ? domain : domain.slice().reverse()) as number[])(value);\n};\n\nexport const definedNullData = (x: number, y: number) => (plot: { [xOrY: number]: unknown }) =>\n plot[x] !== null && plot[y] !== null;\n\nexport const definedData = (x: number, y: number) => (plot: { [xOrY: number]: unknown }) =>\n plot[x] !== null && plot[x] !== undefined && plot[y] !== null && plot[y] !== undefined;\n\nexport const scaleOfBandwidth = <Scale extends ScaleBand<{}>>(scale: Scale, value: number) =>\n scale.bandwidth ? scale(value)! + scale.bandwidth() / 2 : scale(value);\n\nexport const minMax = <\n Key extends string = string,\n Data extends { [key: string]: Numeric | null | undefined }[] = {\n [key: string]: Numeric | null | undefined;\n }[],\n>(\n data: Data,\n key: Key,\n): [min: Data[0][Key], max: Data[0][Key]] => {\n if (typeof key === 'string') {\n return extent(data, (d) => d[key]) as any;\n }\n return extent(data, key) as any;\n};\n\nexport const getNullData = <\n Name extends string = string,\n Data extends { [name in Name]?: unknown | null } = {},\n>(\n data: Data[],\n defined: (data: Data) => boolean,\n name: Name,\n) =>\n data.reduce((acc, d, i, data) => {\n if (defined(d)) {\n acc.push({\n [name]: null,\n } as Data);\n } else {\n const prev = data[i - 1];\n const next = data[i + 1];\n\n if (i === 0) {\n const defNext = data.find(defined);\n acc.push({\n ...d,\n [name]: defNext ? defNext[name] : null,\n });\n }\n\n // prev\n if (prev && defined(prev)) {\n acc.push(prev);\n }\n\n // next\n if (next && defined(next)) {\n acc.push(next);\n }\n\n if (data.length - 1 === i) {\n const defPrev = data.slice().reverse().find(defined);\n acc.push({\n ...d,\n [name]: defPrev ? defPrev[name] : null,\n });\n }\n }\n return acc;\n }, [] as Data[]);\n\ntype IndexFromDataScale =\n | ScaleIdentity\n | ScaleTime<unknown, unknown>\n | ScaleContinuousNumeric<unknown, unknown>\n | ScaleBand<{}>\n | ScalePoint<{}>;\nexport const getIndexFromData = <\n Key extends string,\n Data extends {\n [key in Key]: number;\n } = { [key in Key]: number },\n Scale extends IndexFromDataScale = IndexFromDataScale,\n>(\n data: Data[],\n scale: Scale,\n key: Key,\n value: number,\n) => {\n // detect line chart\n if ('invert' in scale && typeof scale.invert === 'function' && Array.isArray(data)) {\n const bisect = bisector((d: { [key: string]: number }) => d[key]).center;\n return bisect(data, value);\n }\n // detect bar chart\n else if ('step' in scale && typeof scale.step !== 'undefined' && Array.isArray(data)) {\n const index = data.findIndex((d) => d[key] === value);\n return index >= 0 ? index : null;\n }\n // detect cigarette chart\n else if ('invert' in scale && typeof scale.invert === 'function' && !Array.isArray(data)) {\n const keys = Object.keys(data);\n const domain = keys.map((key, index) => {\n return keys.slice(0, index).reduce((acc, item) => {\n if (data[item] !== interpolateValue) {\n acc = acc + data[item];\n }\n\n return acc;\n }, 0);\n });\n\n let key = null;\n\n const lastKeyIndex = keys.length - 1;\n\n if (value > domain[lastKeyIndex]) {\n key = keys[lastKeyIndex];\n } else {\n for (let i = 0; i < lastKeyIndex; i++) {\n if (i === 0 && value < domain[i]) {\n break;\n }\n\n if (value > domain[i] && value < domain[i + 1]) {\n key = keys[i];\n break;\n }\n }\n }\n\n return key;\n } else {\n console.warn('[d3-chart/utils/getIndexFromData] encountered incompatible scale type');\n return null;\n }\n};\n\nexport const roundedPath = (\n x: number,\n y: number,\n w: number,\n h: number,\n r: number,\n tl = false,\n tr = false,\n bl = false,\n br = false,\n) => {\n let result = `M${x + r},${y}`;\n result += `h${w - 2 * r}`;\n if (tr) {\n result += `a${r},${r} 0 0 1 ${r},${r}`;\n } else {\n result += `h${r}`;\n result += `v${r}`;\n }\n result += `v${h - 2 * r}`;\n if (br) {\n result += `a${r},${r} 0 0 1 ${-r},${r}`;\n } else {\n result += `v${r}`;\n result += `h${-r}`;\n }\n result += `h${2 * r - w}`;\n if (bl) {\n result += `a${r},${r} 0 0 1 ${-r},${-r}`;\n } else {\n result += `h${-r}`;\n result += `v${-r}`;\n }\n result += `v${2 * r - h}`;\n if (tl) {\n result += `a${r},${r} 0 0 1 ${r},${-r}`;\n } else {\n result += `v${-r}`;\n result += `h${r}`;\n }\n result += 'z';\n return result;\n};\n\nexport const scaleToBand = (scale: ScaleBand<{}>) => {\n if ('bandwidth' in scale) {\n return scale;\n }\n\n const band = scaleBand()\n .range((scale as any).range())\n .domain((scale as any).domain());\n\n return band;\n};\n\nexport const memoize = <Func extends (...args: any[]) => any>(func: Func): Func => {\n const results: { [cacheKey: string]: any } = {};\n return ((...args: any[]) => {\n const argsKey = args.join(',');\n if (!results[argsKey]) {\n results[argsKey] = func(...args);\n }\n return results[argsKey];\n }) as Func;\n};\n\nexport const measureText = memoize((text: string, fontSize?: number) => {\n if (!text) return 0;\n\n const span = document.createElement('span');\n if (fontSize) {\n span.style.fontSize = `${fontSize}px`;\n }\n for (const line of text.split('\\n')) {\n span.append(document.createTextNode(line));\n span.append(document.createElement('br'));\n }\n span.style.display = 'inline-block';\n document.body.append(span);\n const textWidth = span.offsetWidth;\n const textHeight = span.offsetHeight;\n span.remove();\n return Math.max(textWidth, textHeight);\n});\n\nlet idCounter = 0;\nexport const uniqueId = (prefix = 'id-') => `${prefix}${idCounter++}`;\n\nexport const interpolateValue = Symbol('intergalactic-d3-chart-line-interpolate');\n\nexport const getChartDefaultColorName = (index: number) => {\n index++;\n if (index < 1) index = 1;\n if (index > 24) index %= 24;\n\n return `chart-palette-order-${index}`;\n};\n\nexport const getBubbleChartValueScale = (data: any[], key: string) => {\n const z = scaleSqrt()\n .domain([0, Math.max(...data.map((el) => el[key]))])\n .range([5.5, 50.5]);\n\n return z;\n};\n\nexport const getScatterPlotRadius = (valueKey?: string): number => {\n return valueKey !== undefined ? 12 : 5.5;\n};\n\ntype BubbleChartDataItem = {\n value: number;\n x: number;\n y: number;\n};\n\nexport const calculateBubbleDomain = (\n data: Array<BubbleChartDataItem>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number] => {\n const miniestValue = data.reduce(\n (acc, item) => {\n if (item[key] - item.value < acc.min) {\n acc.min = item[key] - item.value;\n acc.value = item.value;\n }\n return acc;\n },\n { value: data[0].value, min: data[0][key] - data[0].value },\n ).value;\n const maxestValue = data.reduce(\n (acc, item) => {\n if (item.value + item[key] > acc.max) {\n acc.max = item.value + item.x;\n acc.value = item.value;\n }\n return acc;\n },\n { value: data[0].value, max: data[0].value + data[0][key] },\n ).value;\n\n let [min, max] = minMax(data, key);\n\n const pixelRatio = Math.abs(max - min) / Math.abs(range[0] - range[1]);\n const valueScale = getBubbleChartValueScale(data, 'value');\n const minValueShift = valueScale(miniestValue) * pixelRatio;\n const maxValueShift = valueScale(maxestValue) * pixelRatio;\n min -= minValueShift * 2;\n max += maxValueShift * 2;\n\n return [min, max];\n};\n"],"mappings":";;;;;AAAA,SAASA,MAAM,EAAEC,QAAQ,QAAiB,UAAU;AACpD,SACEC,aAAa,EAObC,SAAS,EACTC,SAAS,QACJ,UAAU;AAGjB,IAAMC,QAAQ,GAAG;EACfC,eAAe,EAAEC,MAAM,CAAC,iBAAiB;AAC3C,CAAU;AAEV,SAASF,QAAQ;AAEjB,OAAO,IAAMG,YAAY,GAAG,SAAfA,YAAYA,CAAIC,KAAoC,EAAEC,OAAmB,EAAK;EACzF,IAAMC,IAAI,GAAIF,KAAK,CAACG,aAAa,IAAIH,KAAK,CAACI,MAAsB;EACjE,IAAMC,IAAI,GAAGJ,OAAO,CAACK,qBAAqB,EAAE;EAC5C,OAAO,CAACN,KAAK,CAACO,OAAO,GAAGF,IAAI,CAACG,IAAI,GAAGN,IAAI,CAACO,UAAU,EAAET,KAAK,CAACU,OAAO,GAAGL,IAAI,CAACM,GAAG,GAAGT,IAAI,CAACU,SAAS,CAAC;AACjG,CAAC;AAOD,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAMA,CACjBC,KAAY,EACZC,KAAa,EACV;EACH,IAAI,QAAQ,IAAID,KAAK,I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scaleQuantize","scaleBand","scaleSqrt","eventToPoint","event","svgRoot","node","currentTarget","target","rect","getBoundingClientRect","clientX","left","clientLeft","clientY","top","clientTop","invert","scale","value","range","domain","paddingOuter","step","slice","reverse","definedNullData","x","y","plot","definedData","undefined","scaleOfBandwidth","bandwidth","minMax","data","key","d","getNullData","defined","name","reduce","acc","i","push","_defineProperty","prev","next","defNext","find","_objectSpread","length","defPrev","getIndexFromData","Array","isArray","bisect","center","index","findIndex","keys","Object","map","item","interpolateValue","lastKeyIndex","console","warn","roundedPath","w","h","r","tl","arguments","tr","bl","br","result","concat","scaleToBand","band","memoize","func","results","_len","args","_key2","argsKey","join","apply","measureText","text","fontSize","span","document","createElement","style","_iterator","_createForOfIteratorHelper","split","_step","s","n","done","line","append","createTextNode","err","e","f","display","body","textWidth","offsetWidth","textHeight","offsetHeight","remove","Math","max","idCounter","uniqueId","prefix","Symbol","getChartDefaultColorName","getBubbleChartValueScale","z","_toConsumableArray","el","getScatterPlotRadius","valueKey","calculateBubbleDomain","miniestValue","min","maxestValue","_minMax","_minMax2","_slicedToArray","pixelRatio","abs","valueScale","minValueShift","maxValueShift","PlotEventEmitter"],"sources":["../../src/utils.ts"],"sourcesContent":["import EventEmitter from '@semcore/utils/lib/eventEmitter';\nimport { extent, bisector, Numeric } from 'd3-array';\nimport {\n scaleQuantize,\n ScaleIdentity,\n ScaleTime,\n ScaleContinuousNumeric,\n ScaleBand,\n ScalePoint,\n NumberValue,\n scaleBand,\n scaleSqrt,\n} from 'd3-scale';\nimport React from 'react';\n\nexport const eventToPoint = (event: React.MouseEvent<HTMLElement>, svgRoot: SVGElement) => {\n const node = (event.currentTarget || event.target) as HTMLElement;\n const rect = svgRoot.getBoundingClientRect();\n return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];\n};\n\ntype InvertableScale =\n | ScaleIdentity\n | ScaleBand<{}>\n | ScaleTime<unknown, unknown>\n | ScaleContinuousNumeric<unknown, unknown>;\nexport const invert = <Scale extends InvertableScale = InvertableScale>(\n scale: Scale,\n value: number,\n) => {\n if ('invert' in scale && scale.invert) return scale.invert(value);\n\n const range = scale.range() as [number, number];\n const domain = scale.domain();\n if ('paddingOuter' in scale) {\n range[0] += scale.paddingOuter() * scale.step();\n range[1] -= scale.paddingOuter() * scale.step();\n }\n\n return scaleQuantize()\n .domain((range[0] <= range[1] ? range : range.slice().reverse()) as NumberValue[])\n .range((range[0] <= range[1] ? domain : domain.slice().reverse()) as number[])(value);\n};\n\nexport const definedNullData = (x: number, y: number) => (plot: { [xOrY: number]: unknown }) =>\n plot[x] !== null && plot[y] !== null;\n\nexport const definedData = (x: number, y: number) => (plot: { [xOrY: number]: unknown }) =>\n plot[x] !== null && plot[x] !== undefined && plot[y] !== null && plot[y] !== undefined;\n\nexport const scaleOfBandwidth = <Scale extends ScaleBand<{}>>(scale: Scale, value: number) =>\n scale.bandwidth ? scale(value)! + scale.bandwidth() / 2 : scale(value);\n\nexport const minMax = <\n Key extends string = string,\n Data extends { [key: string]: Numeric | null | undefined }[] = {\n [key: string]: Numeric | null | undefined;\n }[],\n>(\n data: Data,\n key: Key,\n): [min: Data[0][Key], max: Data[0][Key]] => {\n if (typeof key === 'string') {\n return extent(data, (d) => d[key]) as any;\n }\n return extent(data, key) as any;\n};\n\nexport const getNullData = <\n Name extends string = string,\n Data extends { [name in Name]?: unknown | null } = {},\n>(\n data: Data[],\n defined: (data: Data) => boolean,\n name: Name,\n) =>\n data.reduce((acc, d, i, data) => {\n if (defined(d)) {\n acc.push({\n [name]: null,\n } as Data);\n } else {\n const prev = data[i - 1];\n const next = data[i + 1];\n\n if (i === 0) {\n const defNext = data.find(defined);\n acc.push({\n ...d,\n [name]: defNext ? defNext[name] : null,\n });\n }\n\n // prev\n if (prev && defined(prev)) {\n acc.push(prev);\n }\n\n // next\n if (next && defined(next)) {\n acc.push(next);\n }\n\n if (data.length - 1 === i) {\n const defPrev = data.slice().reverse().find(defined);\n acc.push({\n ...d,\n [name]: defPrev ? defPrev[name] : null,\n });\n }\n }\n return acc;\n }, [] as Data[]);\n\ntype IndexFromDataScale =\n | ScaleIdentity\n | ScaleTime<unknown, unknown>\n | ScaleContinuousNumeric<unknown, unknown>\n | ScaleBand<{}>\n | ScalePoint<{}>;\nexport const getIndexFromData = <\n Key extends string,\n Data extends {\n [key in Key]: number;\n } = { [key in Key]: number },\n Scale extends IndexFromDataScale = IndexFromDataScale,\n>(\n data: Data[],\n scale: Scale,\n key: Key,\n value: number,\n) => {\n // detect line chart\n if ('invert' in scale && typeof scale.invert === 'function' && Array.isArray(data)) {\n const bisect = bisector((d: { [key: string]: number }) => d[key]).center;\n return bisect(data, value);\n }\n // detect bar chart\n else if ('step' in scale && typeof scale.step !== 'undefined' && Array.isArray(data)) {\n const index = data.findIndex((d) => d[key] === value);\n return index >= 0 ? index : null;\n }\n // detect cigarette chart\n else if ('invert' in scale && typeof scale.invert === 'function' && !Array.isArray(data)) {\n const keys = Object.keys(data);\n const domain = keys.map((key, index) => {\n return keys.slice(0, index).reduce((acc, item) => {\n if (data[item] !== interpolateValue) {\n acc = acc + data[item];\n }\n\n return acc;\n }, 0);\n });\n\n let key = null;\n\n const lastKeyIndex = keys.length - 1;\n\n if (value > domain[lastKeyIndex]) {\n key = keys[lastKeyIndex];\n } else {\n for (let i = 0; i < lastKeyIndex; i++) {\n if (i === 0 && value < domain[i]) {\n break;\n }\n\n if (value > domain[i] && value < domain[i + 1]) {\n key = keys[i];\n break;\n }\n }\n }\n\n return key;\n } else {\n console.warn('[d3-chart/utils/getIndexFromData] encountered incompatible scale type');\n return null;\n }\n};\n\nexport const roundedPath = (\n x: number,\n y: number,\n w: number,\n h: number,\n r: number,\n tl = false,\n tr = false,\n bl = false,\n br = false,\n) => {\n let result = `M${x + r},${y}`;\n result += `h${w - 2 * r}`;\n if (tr) {\n result += `a${r},${r} 0 0 1 ${r},${r}`;\n } else {\n result += `h${r}`;\n result += `v${r}`;\n }\n result += `v${h - 2 * r}`;\n if (br) {\n result += `a${r},${r} 0 0 1 ${-r},${r}`;\n } else {\n result += `v${r}`;\n result += `h${-r}`;\n }\n result += `h${2 * r - w}`;\n if (bl) {\n result += `a${r},${r} 0 0 1 ${-r},${-r}`;\n } else {\n result += `h${-r}`;\n result += `v${-r}`;\n }\n result += `v${2 * r - h}`;\n if (tl) {\n result += `a${r},${r} 0 0 1 ${r},${-r}`;\n } else {\n result += `v${-r}`;\n result += `h${r}`;\n }\n result += 'z';\n return result;\n};\n\nexport const scaleToBand = (scale: ScaleBand<{}>) => {\n if ('bandwidth' in scale) {\n return scale;\n }\n\n const band = scaleBand()\n .range((scale as any).range())\n .domain((scale as any).domain());\n\n return band;\n};\n\nexport const memoize = <Func extends (...args: any[]) => any>(func: Func): Func => {\n const results: { [cacheKey: string]: any } = {};\n return ((...args: any[]) => {\n const argsKey = args.join(',');\n if (!results[argsKey]) {\n results[argsKey] = func(...args);\n }\n return results[argsKey];\n }) as Func;\n};\n\nexport const measureText = memoize((text: string, fontSize?: number) => {\n if (!text) return 0;\n\n const span = document.createElement('span');\n if (fontSize) {\n span.style.fontSize = `${fontSize}px`;\n }\n for (const line of text.split('\\n')) {\n span.append(document.createTextNode(line));\n span.append(document.createElement('br'));\n }\n span.style.display = 'inline-block';\n document.body.append(span);\n const textWidth = span.offsetWidth;\n const textHeight = span.offsetHeight;\n span.remove();\n return Math.max(textWidth, textHeight);\n});\n\nlet idCounter = 0;\nexport const uniqueId = (prefix = 'id-') => `${prefix}${idCounter++}`;\n\nexport const interpolateValue = Symbol('intergalactic-d3-chart-line-interpolate');\n\nexport const getChartDefaultColorName = (index: number) => {\n index++;\n if (index < 1) index = 1;\n if (index > 24) index %= 24;\n\n return `chart-palette-order-${index}`;\n};\n\nexport const getBubbleChartValueScale = (data: any[], key: string) => {\n const z = scaleSqrt()\n .domain([0, Math.max(...data.map((el) => el[key]))])\n .range([5.5, 50.5]);\n\n return z;\n};\n\nexport const getScatterPlotRadius = (valueKey?: string): number => {\n return valueKey !== undefined ? 12 : 5.5;\n};\n\ntype BubbleChartDataItem = {\n value: number;\n x: number;\n y: number;\n};\n\nexport const calculateBubbleDomain = (\n data: Array<BubbleChartDataItem>,\n key: 'x' | 'y',\n range: [number, number],\n): [min: number, max: number] => {\n const miniestValue = data.reduce(\n (acc, item) => {\n if (item[key] - item.value < acc.min) {\n acc.min = item[key] - item.value;\n acc.value = item.value;\n }\n return acc;\n },\n { value: data[0].value, min: data[0][key] - data[0].value },\n ).value;\n const maxestValue = data.reduce(\n (acc, item) => {\n if (item.value + item[key] > acc.max) {\n acc.max = item.value + item.x;\n acc.value = item.value;\n }\n return acc;\n },\n { value: data[0].value, max: data[0].value + data[0][key] },\n ).value;\n\n let [min, max] = minMax(data, key);\n\n const pixelRatio = Math.abs(max - min) / Math.abs(range[0] - range[1]);\n const valueScale = getBubbleChartValueScale(data, 'value');\n const minValueShift = valueScale(miniestValue) * pixelRatio;\n const maxValueShift = valueScale(maxestValue) * pixelRatio;\n min -= minValueShift * 2;\n max += maxValueShift * 2;\n\n return [min, max];\n};\n\ninterface PlotEventEmitterEmit {\n (event: 'setTooltipVisible', visible: boolean): void;\n (event: 'setTooltipPosition', x: number, y: number): void;\n}\ntype Unsubscribe = () => void;\ninterface PlotEventEmitterSubscribe {\n (event: 'setTooltipVisible', callback: (visible: boolean) => void): Unsubscribe;\n (event: 'setTooltipPosition', callback: (x: number, y: number) => void): Unsubscribe;\n}\nexport const PlotEventEmitter = EventEmitter as typeof EventEmitter<\n PlotEventEmitterEmit,\n PlotEventEmitterSubscribe\n>;\n"],"mappings":";;;;;AAAA,OAAOA,YAAY,MAAM,iCAAiC;AAC1D,SAASC,MAAM,EAAEC,QAAQ,QAAiB,UAAU;AACpD,SACEC,aAAa,EAObC,SAAS,EACTC,SAAS,QACJ,UAAU;AAGjB,OAAO,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,KAAoC,EAAEC,OAAmB,EAAK;EACzF,IAAMC,IAAI,GAAIF,KAAK,CAACG,aAAa,IAAI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,wBAAwB,CAACzF,IAAI,EAAE,OAAO,CAAC;EAC1D,IAAMyG,aAAa,GAAGD,UAAU,CAACR,YAAY,CAAC,GAAGM,UAAU;EAC3D,IAAMI,aAAa,GAAGF,UAAU,CAACN,WAAW,CAAC,GAAGI,UAAU;EAC1DL,GAAG,IAAIQ,aAAa,GAAG,CAAC;EACxBtB,GAAG,IAAIuB,aAAa,GAAG,CAAC;EAExB,OAAO,CAACT,GAAG,EAAEd,GAAG,CAAC;AACnB,CAAC;AAWD,OAAO,IAAMwB,gBAAgB,GAAGjJ,YAG/B"}
|
package/lib/types/Plot.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { UnknownProperties, Intergalactic } from '@semcore/core';
|
|
|
3
3
|
import { Context } from './context';
|
|
4
4
|
import { DataStructureHints } from './a11y/hints';
|
|
5
5
|
import { PatternsConfig } from './Pattern';
|
|
6
|
+
import { PlotEventEmitter } from './utils';
|
|
6
7
|
|
|
7
8
|
/** @deprecated */
|
|
8
9
|
export interface IPlotProps extends PlotProps, UnknownProperties {}
|
|
@@ -31,8 +32,7 @@ export type PlotProps = Context &
|
|
|
31
32
|
/** Enables charts patterns that enhances charts accessibility */
|
|
32
33
|
patterns?: PatternsConfig;
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
eventEmitter?: unknown;
|
|
35
|
+
eventEmitter?: InstanceType<typeof PlotEventEmitter>;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export type PlotSummarizerConfig = {
|
|
@@ -119,6 +119,10 @@ export type BaseChartProps<T extends ListData | ObjectData> = FlexProps & {
|
|
|
119
119
|
* Config for a11y summary
|
|
120
120
|
*/
|
|
121
121
|
a11yAltTextConfig?: PlotSummarizerConfig;
|
|
122
|
+
/**
|
|
123
|
+
* Animations duration, set 0 to disable animations
|
|
124
|
+
*/
|
|
125
|
+
duration?: number;
|
|
122
126
|
} /**
|
|
123
127
|
* By default, we show the Legend for all charts with more the one data item.
|
|
124
128
|
* For hide the Legend, you should set showLegend prop to `false`.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Utils
|
|
2
2
|
// @ts-ignore
|
|
3
|
-
import { interpolateValue as intValue } from './utils';
|
|
3
|
+
import { interpolateValue as intValue, PlotEventEmitter } from './utils';
|
|
4
4
|
|
|
5
5
|
export declare const interpolateValue: typeof intValue;
|
|
6
6
|
export declare function minMax(data: any, key: string | number): any;
|
|
@@ -9,6 +9,7 @@ export declare function calculateBubbleDomain(
|
|
|
9
9
|
key: 'x' | 'y',
|
|
10
10
|
range: [number, number],
|
|
11
11
|
): [min: number, max: number];
|
|
12
|
+
export { PlotEventEmitter };
|
|
12
13
|
|
|
13
14
|
export { makeDataHintsContainer } from './a11y/hints';
|
|
14
15
|
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import EventEmitter from '@semcore/utils/lib/eventEmitter';
|
|
1
2
|
import { Numeric } from 'd3-array';
|
|
2
3
|
import { ScaleIdentity, ScaleTime, ScaleContinuousNumeric, ScaleBand, ScalePoint } from 'd3-scale';
|
|
3
4
|
import React from 'react';
|
|
4
|
-
declare const CONSTANT: {
|
|
5
|
-
readonly VIRTUAL_ELEMENT: symbol;
|
|
6
|
-
};
|
|
7
|
-
export { CONSTANT };
|
|
8
5
|
export declare const eventToPoint: (event: React.MouseEvent<HTMLElement>, svgRoot: SVGElement) => number[];
|
|
9
6
|
type InvertableScale = ScaleIdentity | ScaleBand<{}> | ScaleTime<unknown, unknown> | ScaleContinuousNumeric<unknown, unknown>;
|
|
10
7
|
export declare const invert: <Scale extends InvertableScale = InvertableScale>(scale: Scale, value: number) => number | Date;
|
|
@@ -38,3 +35,14 @@ type BubbleChartDataItem = {
|
|
|
38
35
|
y: number;
|
|
39
36
|
};
|
|
40
37
|
export declare const calculateBubbleDomain: (data: Array<BubbleChartDataItem>, key: 'x' | 'y', range: [number, number]) => [min: number, max: number];
|
|
38
|
+
interface PlotEventEmitterEmit {
|
|
39
|
+
(event: 'setTooltipVisible', visible: boolean): void;
|
|
40
|
+
(event: 'setTooltipPosition', x: number, y: number): void;
|
|
41
|
+
}
|
|
42
|
+
type Unsubscribe = () => void;
|
|
43
|
+
interface PlotEventEmitterSubscribe {
|
|
44
|
+
(event: 'setTooltipVisible', callback: (visible: boolean) => void): Unsubscribe;
|
|
45
|
+
(event: 'setTooltipPosition', callback: (x: number, y: number) => void): Unsubscribe;
|
|
46
|
+
}
|
|
47
|
+
export declare const PlotEventEmitter: typeof EventEmitter<PlotEventEmitterEmit, PlotEventEmitterSubscribe>;
|
|
48
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/d3-chart",
|
|
3
3
|
"description": "Semrush D3 Chart Component",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.39.1-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@formatjs/intl": "2.3.0",
|
|
18
|
-
"@semcore/animation": "2.
|
|
19
|
-
"@semcore/divider": "4.
|
|
20
|
-
"@semcore/flex-box": "5.
|
|
21
|
-
"@semcore/popper": "5.
|
|
22
|
-
"@semcore/utils": "4.
|
|
18
|
+
"@semcore/animation": "2.23.0-prerelease.0",
|
|
19
|
+
"@semcore/divider": "4.22.0-prerelease.0",
|
|
20
|
+
"@semcore/flex-box": "5.23.0-prerelease.0",
|
|
21
|
+
"@semcore/popper": "5.29.0-prerelease.0",
|
|
22
|
+
"@semcore/utils": "4.24.0-prerelease.0",
|
|
23
23
|
"@types/d3-shape": "^3.1.0",
|
|
24
24
|
"@upsetjs/venn.js": "1.4.2",
|
|
25
25
|
"d3-array": "3.1.6",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"hoist-non-react-statics": "3.3.2"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@semcore/core": "^2.
|
|
36
|
+
"@semcore/core": "^2.21.0-prerelease.0",
|
|
37
37
|
"react": "16.8 - 18",
|
|
38
38
|
"react-dom": "16.8 - 18"
|
|
39
39
|
},
|