@semcore/d3-chart 16.4.2 → 16.5.0-prerelease.2
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 +12 -0
- package/README.md +4 -4
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +15 -15
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +15 -15
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +21 -19
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +12 -11
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +8 -8
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +7 -7
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +3 -3
- package/lib/cjs/Radar.js +21 -21
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +24 -24
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ScatterPlot.js +12 -11
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/Tooltip.js +9 -9
- package/lib/cjs/Venn.js +12 -11
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +5 -5
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +119 -35
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +5 -29
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +5 -29
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +0 -4
- 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/CigaretteChart.js +96 -59
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +1 -6
- 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/HistogramChart.js +4 -28
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +5 -29
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +1 -5
- 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 +0 -4
- 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/style/abstract-chart.shadow.css +12 -0
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +15 -15
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +15 -15
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +21 -19
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +12 -11
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +8 -8
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +7 -7
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +3 -3
- package/lib/es6/Radar.js +21 -21
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +24 -24
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ScatterPlot.js +12 -11
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/Tooltip.js +9 -9
- package/lib/es6/Venn.js +12 -11
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +4 -4
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +119 -31
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +5 -29
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +5 -29
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +0 -4
- 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/CigaretteChart.js +100 -61
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +1 -6
- 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/HistogramChart.js +4 -28
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +5 -29
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +1 -5
- 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 +0 -4
- 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/style/abstract-chart.shadow.css +12 -0
- package/lib/esm/Area.mjs +12 -12
- package/lib/esm/Axis.mjs +16 -16
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +16 -16
- package/lib/esm/CompactHorizontalBar.mjs +21 -20
- package/lib/esm/Donut.mjs +12 -12
- package/lib/esm/Dots.mjs +9 -9
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +8 -8
- package/lib/esm/Line.mjs +10 -10
- package/lib/esm/Plot.mjs +4 -4
- package/lib/esm/Radar.mjs +22 -22
- package/lib/esm/RadialTree.mjs +27 -27
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ScatterPlot.mjs +12 -12
- package/lib/esm/Tooltip.mjs +10 -10
- package/lib/esm/Venn.mjs +12 -12
- package/lib/esm/a11y/PlotA11yModule.mjs +5 -5
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +103 -19
- package/lib/esm/component/Chart/AreaChart.mjs +5 -27
- package/lib/esm/component/Chart/BarChart.mjs +6 -28
- package/lib/esm/component/Chart/BubbleChart.mjs +0 -4
- package/lib/esm/component/Chart/CigaretteChart.mjs +78 -45
- package/lib/esm/component/Chart/DonutChart.mjs +1 -4
- package/lib/esm/component/Chart/HistogramChart.mjs +5 -27
- package/lib/esm/component/Chart/LineChart.mjs +5 -27
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +1 -4
- package/lib/esm/component/Chart/VennChart.mjs +0 -4
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +18 -18
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +7 -7
- package/lib/esm/style/abstract-chart.shadow.css +12 -0
- package/lib/types/a11y/PlotA11yModule.d.ts +1 -1
- package/lib/types/component/Chart/AbstractChart.d.ts +11 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +2 -0
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/package.json +5 -5
package/lib/cjs/Tooltip.js
CHANGED
|
@@ -23,17 +23,17 @@ var _Pattern = require("./Pattern");
|
|
|
23
23
|
var _utils = require("./utils");
|
|
24
24
|
var _excluded = ["Children", "children", "tag", "forcedAdvancedMode", "onClick"];
|
|
25
25
|
/*!__reshadow-styles__:"./style/tooltip.shadow.css"*/
|
|
26
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
26
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___STooltip_gj0h7_gg_{font-size:var(--intergalactic-fs-100, 12px);line-height:var(--intergalactic-lh-100, 133%);position:relative;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);border-radius:var(--intergalactic-popper-rounded, 6px);border:1px solid var(--intergalactic-border-secondary, #e0e1e9);box-sizing:border-box;box-shadow:var(--intergalactic-box-shadow-popper, 0px 1px 12px 0px rgba(25, 27, 35, 0.15));padding:var(--intergalactic-spacing-3x, 12px)}.___STitle_gj0h7_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-bottom:var(--intergalactic-spacing-2x, 8px)}.___SDotGroup_gj0h7_gg_{display:flex;align-items:center}.___SDot_gj0h7_gg_{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SDotCircle_gj0h7_gg_.__color_gj0h7_gg_{background-color:var(--color_gj0h7);width:8px;height:8px;border-radius:50%}.___SFooter_gj0h7_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9);padding:var(--intergalactic-spacing-1x, 4px) var(--intergalactic-spacing-3x, 12px);border-radius:0 0 var(--intergalactic-rounded-medium, 6px) var(--intergalactic-rounded-medium, 6px);margin:var(--intergalactic-spacing-3x, 12px) calc(-1*var(--intergalactic-spacing-3x, 12px)) calc(-1*var(--intergalactic-spacing-3x, 12px))}", /*__inner_css_end__*/"gj0h7_gg_"),
|
|
27
27
|
/*__reshadow_css_end__*/
|
|
28
28
|
{
|
|
29
|
-
"__STooltip": "
|
|
30
|
-
"__STitle": "
|
|
31
|
-
"__SDotGroup": "
|
|
32
|
-
"__SDot": "
|
|
33
|
-
"__SDotCircle": "
|
|
34
|
-
"_color": "
|
|
35
|
-
"--color": "--
|
|
36
|
-
"__SFooter": "
|
|
29
|
+
"__STooltip": "___STooltip_gj0h7_gg_",
|
|
30
|
+
"__STitle": "___STitle_gj0h7_gg_",
|
|
31
|
+
"__SDotGroup": "___SDotGroup_gj0h7_gg_",
|
|
32
|
+
"__SDot": "___SDot_gj0h7_gg_",
|
|
33
|
+
"__SDotCircle": "___SDotCircle_gj0h7_gg_",
|
|
34
|
+
"_color": "__color_gj0h7_gg_",
|
|
35
|
+
"--color": "--color_gj0h7",
|
|
36
|
+
"__SFooter": "___SFooter_gj0h7_gg_"
|
|
37
37
|
});
|
|
38
38
|
/**
|
|
39
39
|
* `TooltipDotRenderContext` is a hack to bypass problem that getDotProps doesn't work for D3 tooltip.
|
package/lib/cjs/Venn.js
CHANGED
|
@@ -25,17 +25,17 @@ var _Pattern = require("./Pattern");
|
|
|
25
25
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
26
26
|
var _utils = require("./utils");
|
|
27
27
|
/*!__reshadow-styles__:"./style/venn.shadow.css"*/
|
|
28
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
28
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SCircle_fyipu_gg_,.___SIntersection_fyipu_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:2px}.___SCircle_fyipu_gg_{fill:var(--intergalactic-chart-palette-order-2, #59ddaa);fill-opacity:.5;transition-property:cx,cy;transition-duration:var(--duration_fyipu);transition-timing-function:ease-in-out}@media (hover:hover){.___SCircle_fyipu_gg_:hover{fill-opacity:.7}}.___SCircle_fyipu_gg_.__color_fyipu_gg_{fill:var(--color_fyipu)}.___SCircle_fyipu_gg_.__pattern_fyipu_gg_.__color_fyipu_gg_{fill:var(--pattern_fyipu);fill-opacity:.7;stroke:var(--color_fyipu);stroke-width:1px}@media (hover:hover){.___SCircle_fyipu_gg_.__pattern_fyipu_gg_.__color_fyipu_gg_:hover{fill-opacity:.85}}.___SCircle_fyipu_gg_.__transparent_fyipu_gg_{opacity:.3}.___SIntersection_fyipu_gg_{fill-opacity:0}@media (hover:hover){.___SIntersection_fyipu_gg_:hover{fill-opacity:.1}}.___SIntersection_fyipu_gg_.__transparent_fyipu_gg_{opacity:.3}", /*__inner_css_end__*/"fyipu_gg_"),
|
|
29
29
|
/*__reshadow_css_end__*/
|
|
30
30
|
{
|
|
31
|
-
"__SCircle": "
|
|
32
|
-
"_color": "
|
|
33
|
-
"--color": "--
|
|
34
|
-
"_transparent": "
|
|
35
|
-
"__SIntersection": "
|
|
36
|
-
"--duration": "--
|
|
37
|
-
"_pattern": "
|
|
38
|
-
"--pattern": "--
|
|
31
|
+
"__SCircle": "___SCircle_fyipu_gg_",
|
|
32
|
+
"_color": "__color_fyipu_gg_",
|
|
33
|
+
"--color": "--color_fyipu",
|
|
34
|
+
"_transparent": "__transparent_fyipu_gg_",
|
|
35
|
+
"__SIntersection": "___SIntersection_fyipu_gg_",
|
|
36
|
+
"--duration": "--duration_fyipu",
|
|
37
|
+
"_pattern": "__pattern_fyipu_gg_",
|
|
38
|
+
"--pattern": "--pattern_fyipu"
|
|
39
39
|
});
|
|
40
40
|
var VennRoot = /*#__PURE__*/function (_Component) {
|
|
41
41
|
function VennRoot() {
|
|
@@ -271,14 +271,15 @@ function Intersection(props) {
|
|
|
271
271
|
"onClickCapture": (0, _assignProps2.callAllEventHandlers)(onClickIntersectionRoot, onClick)
|
|
272
272
|
}));
|
|
273
273
|
}
|
|
274
|
-
|
|
274
|
+
function VennTooltip(props) {
|
|
275
275
|
var _ref = arguments[0],
|
|
276
276
|
_ref4;
|
|
277
277
|
var SVennTooltip = _Tooltip["default"];
|
|
278
278
|
return _ref4 = (0, _core.sstyled)(props.styles), /*#__PURE__*/_react["default"].createElement(SVennTooltip, _ref4.cn("SVennTooltip", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
279
279
|
"excludeAnchorProps": true
|
|
280
280
|
}, _ref))));
|
|
281
|
-
}
|
|
281
|
+
}
|
|
282
|
+
;
|
|
282
283
|
var Venn = (0, _createElement["default"])(VennRoot, {
|
|
283
284
|
Circle: Circle,
|
|
284
285
|
Intersection: Intersection,
|
package/lib/cjs/Venn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Venn.js","names":["_core","require","_animation","_assignProps2","_canUseDOM","_interopRequireDefault","_uniqueID","_venn","_react","_createElement","_Pattern","_Tooltip","_utils","style","sstyled","insert","VennRoot","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","canUseDOM","document","createElement","visible","props","tooltipProps","_ref5","clientX","clientY","_this$asProps","asProps","eventEmitter","plotId","emit","React","forwardRef","ref","FadeInOut","_extends2","tag","_inherits2","_createClass2","key","value","generateGetBoundingClientRect","x","undefined","y","width","height","top","right","bottom","left","getVennData","_this$asProps2","data","orientation","orientationOrder","size","_size","_slicedToArray2","vennData","Object","entries","map","_ref6","_ref7","dataKey","sets","split","scaleSolution","normalizeSolution","venn","getTooltipProps","uniqId","uid","getCircleProps","index","colorBackwardCapabilityOffset","color","getChartDefaultColorName","name","patterns","duration","originalData","onMouseMove","bindHandlerTooltip","onMouseLeave","transparent","resolveColor","minRadius","onClickCircleRoot","handlerOnClick","bind","getIntersectionProps","_this$asProps3","dataKeys","delay","values","filter","d","includes","setid","onClickIntersectionRoot","_this2","e","stopPropagation","onClick","render","Element","dataHintsHandler","establishDataType","renderElement","childrenPosition","Component","Math","PI","c1","c2","radius","uniqueIDEnhancement","Circle","_ref8","_ref2","SCircle","styles","describeValueEntity","Fragment","cn","callAllEventHandlers","PatternFill","Intersection","_ref3","SIntersection","renderIntersection","useCallback","intersectionAreaPath","VennTooltip","_ref","arguments[0]","_ref4","SVennTooltip","Tooltip","_objectSpread2","assignProps","Venn","_______childrenComponents","_default","exports"],"sources":["../../src/Venn.jsx"],"sourcesContent":["import { FadeInOut } from '@semcore/animation';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport canUseDOM from '@semcore/core/lib/utils/canUseDOM';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport { venn, normalizeSolution, scaleSolution, intersectionAreaPath } from '@upsetjs/venn.js';\nimport React from 'react';\n\nimport createElement from './createElement';\nimport { PatternFill } from './Pattern';\nimport style from './style/venn.shadow.css';\nimport Tooltip from './Tooltip';\nimport { getChartDefaultColorName } from './utils';\n\nclass VennRoot extends Component {\n static displayName = 'Venn';\n static style = style;\n\n static defaultProps = {\n orientation: Math.PI / 2,\n orientationOrder: (c1, c2) => c2.radius - c1.radius,\n duration: 500,\n minRadius: 6,\n };\n\n static enhance = [uniqueIDEnhancement()];\n\n virtualElement = canUseDOM() ? document.createElement('div') : {};\n\n generateGetBoundingClientRect(x = 0, y = 0) {\n return () => ({ width: 0, height: 0, top: y, right: x, bottom: y, left: x });\n }\n\n bindHandlerTooltip = (visible, props, tooltipProps) => ({ clientX, clientY }) => {\n const { eventEmitter, plotId } = this.asProps;\n\n eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);\n eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, props, tooltipProps);\n eventEmitter.emit(`setTooltipVisible_${plotId}`, visible);\n };\n\n getVennData() {\n const { data, orientation, orientationOrder, size } = this.asProps;\n const [width, height] = size;\n const vennData = Object.entries(data).map(([dataKey, size]) => ({\n sets: dataKey.split('/'),\n size,\n }));\n return scaleSolution(\n normalizeSolution(venn(vennData), orientation, orientationOrder),\n width,\n height,\n 10,\n );\n }\n\n getTooltipProps() {\n return {\n uniqId: this.asProps.uid,\n };\n }\n\n getCircleProps(props, index) {\n const colorBackwardCapabilityOffset = 1;\n const color = props.color || getChartDefaultColorName(index + colorBackwardCapabilityOffset);\n const tooltipProps = {\n dataKey: props.dataKey,\n name: props.name,\n color,\n patterns: this.asProps.patterns,\n };\n\n return {\n duration: this.asProps.duration,\n data: this.vennData[props.dataKey],\n originalData: this.asProps.data[props.dataKey],\n onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),\n onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),\n transparent: this.asProps.transparent,\n resolveColor: this.asProps.resolveColor,\n color,\n uid: `${this.asProps.uid}-${index}`,\n patterns: this.asProps.patterns,\n minRadius: this.asProps.minRadius,\n onClickCircleRoot: this.handlerOnClick(props.dataKey).bind(this),\n };\n }\n\n getIntersectionProps(props) {\n const { duration, transparent } = this.asProps;\n const dataKeys = props.dataKey.split('/');\n const tooltipProps = {\n dataKey: props.dataKey,\n name: props.name,\n color: props.color,\n duration: props.duration,\n transparent: props.transparent,\n };\n\n return {\n duration,\n delay: duration,\n data: Object.values(this.vennData).filter((d) => dataKeys.includes(d.setid)),\n originalData: this.asProps.data[props.dataKey],\n onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),\n onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),\n transparent,\n resolveColor: this.asProps.resolveColor,\n onClickIntersectionRoot: this.handlerOnClick(props.dataKey).bind(this),\n };\n }\n\n renderElement = React.forwardRef((props, ref) => {\n return <FadeInOut aria-hidden ref={ref} tag='g' visible {...props} />;\n });\n\n handlerOnClick(dataKey) {\n return (e) => {\n e.stopPropagation();\n\n const { onClick } = this.asProps;\n\n if (!onClick) return;\n\n onClick(dataKey, e);\n };\n }\n\n render() {\n const Element = this.Element;\n this.asProps.dataHintsHandler.establishDataType('values-set');\n this.vennData = this.getVennData();\n return (\n <Element\n aria-hidden\n render={this.renderElement}\n childrenPosition='inside'\n vennData={this.vennData}\n />\n );\n }\n}\n\nfunction Circle({\n Element: SCircle,\n styles,\n color,\n resolveColor,\n data,\n duration,\n name,\n dataKey,\n dataHintsHandler,\n transparent,\n uid,\n patterns,\n minRadius,\n onClick,\n onClickCircleRoot,\n}) {\n dataHintsHandler.describeValueEntity(dataKey, name);\n\n const radius = data.radius < minRadius ? minRadius : data.radius;\n if (data.radius === 0) return null;\n\n return (\n <>\n {sstyled(styles)(\n <SCircle\n aria-hidden\n render='circle'\n color={resolveColor(color)}\n pattern={patterns ? `url(#${uid}-pattern)` : undefined}\n cx={data.x}\n cy={data.y}\n r={radius}\n transparent={transparent}\n use:duration={`${duration}ms`}\n onClickCapture={callAllEventHandlers(onClickCircleRoot, onClick)}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </>\n );\n}\n\nfunction Intersection(props) {\n const {\n Element: SIntersection,\n styles,\n data,\n name,\n dataKey,\n dataHintsHandler,\n transparent,\n onClick,\n onClickIntersectionRoot,\n } = props;\n dataHintsHandler.describeValueEntity(dataKey, name);\n\n const renderIntersection = React.useCallback(\n React.forwardRef((props, ref) => {\n return <FadeInOut aria-hidden ref={ref} tag='path' visible {...props} />;\n }),\n [props],\n );\n return sstyled(styles)(\n <SIntersection\n aria-hidden\n render={renderIntersection}\n d={intersectionAreaPath(data)}\n transparent={transparent}\n onClickCapture={callAllEventHandlers(onClickIntersectionRoot, onClick)}\n />,\n );\n}\n\nconst VennTooltip = (props) => {\n const SVennTooltip = Root;\n return sstyled(props.styles)(<SVennTooltip render={Tooltip} excludeAnchorProps />);\n};\n\nconst Venn = createElement(VennRoot, {\n Circle,\n Intersection,\n Tooltip: [VennTooltip, Tooltip._______childrenComponents],\n});\n\nexport default Venn;\n"],"mappings":";;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAEA,IAAAQ,cAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAEA,IAAAU,QAAA,GAAAN,sBAAA,CAAAJ,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAmD;AAAA,IAAAY,KAAA,8BAAAb,KAAA,CAAAc,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAE7CC,QAAQ,0BAAAC,UAAA;EAAA,SAAAD,SAAA;IAAA,IAAAE,KAAA;IAAA,IAAAC,gBAAA,mBAAAH,QAAA;IAAA,SAAAI,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,E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;EACNU,YAAY,EAAZA,YAAY;EACZW,OAAO,EAAE,CAACL,WAAW,EAAEK,mBAAO,CAACI,yBAAyB;AAC1D,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEYH,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Venn.js","names":["_core","require","_animation","_assignProps2","_canUseDOM","_interopRequireDefault","_uniqueID","_venn","_react","_createElement","_Pattern","_Tooltip","_utils","style","sstyled","insert","VennRoot","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","canUseDOM","document","createElement","visible","props","tooltipProps","_ref5","clientX","clientY","_this$asProps","asProps","eventEmitter","plotId","emit","React","forwardRef","ref","FadeInOut","_extends2","tag","_inherits2","_createClass2","key","value","generateGetBoundingClientRect","x","undefined","y","width","height","top","right","bottom","left","getVennData","_this$asProps2","data","orientation","orientationOrder","size","_size","_slicedToArray2","vennData","Object","entries","map","_ref6","_ref7","dataKey","sets","split","scaleSolution","normalizeSolution","venn","getTooltipProps","uniqId","uid","getCircleProps","index","colorBackwardCapabilityOffset","color","getChartDefaultColorName","name","patterns","duration","originalData","onMouseMove","bindHandlerTooltip","onMouseLeave","transparent","resolveColor","minRadius","onClickCircleRoot","handlerOnClick","bind","getIntersectionProps","_this$asProps3","dataKeys","delay","values","filter","d","includes","setid","onClickIntersectionRoot","_this2","e","stopPropagation","onClick","render","Element","dataHintsHandler","establishDataType","renderElement","childrenPosition","Component","Math","PI","c1","c2","radius","uniqueIDEnhancement","Circle","_ref8","_ref2","SCircle","styles","describeValueEntity","Fragment","cn","callAllEventHandlers","PatternFill","Intersection","_ref3","SIntersection","renderIntersection","useCallback","intersectionAreaPath","VennTooltip","_ref","arguments[0]","_ref4","SVennTooltip","Tooltip","_objectSpread2","assignProps","Venn","_______childrenComponents","_default","exports"],"sources":["../../src/Venn.jsx"],"sourcesContent":["import { FadeInOut } from '@semcore/animation';\nimport { Component, Root, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport canUseDOM from '@semcore/core/lib/utils/canUseDOM';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport { venn, normalizeSolution, scaleSolution, intersectionAreaPath } from '@upsetjs/venn.js';\nimport React from 'react';\n\nimport createElement from './createElement';\nimport { PatternFill } from './Pattern';\nimport style from './style/venn.shadow.css';\nimport Tooltip from './Tooltip';\nimport { getChartDefaultColorName } from './utils';\n\nclass VennRoot extends Component {\n static displayName = 'Venn';\n static style = style;\n\n static defaultProps = {\n orientation: Math.PI / 2,\n orientationOrder: (c1, c2) => c2.radius - c1.radius,\n duration: 500,\n minRadius: 6,\n };\n\n static enhance = [uniqueIDEnhancement()];\n\n virtualElement = canUseDOM() ? document.createElement('div') : {};\n\n generateGetBoundingClientRect(x = 0, y = 0) {\n return () => ({ width: 0, height: 0, top: y, right: x, bottom: y, left: x });\n }\n\n bindHandlerTooltip = (visible, props, tooltipProps) => ({ clientX, clientY }) => {\n const { eventEmitter, plotId } = this.asProps;\n\n eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);\n eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, props, tooltipProps);\n eventEmitter.emit(`setTooltipVisible_${plotId}`, visible);\n };\n\n getVennData() {\n const { data, orientation, orientationOrder, size } = this.asProps;\n const [width, height] = size;\n const vennData = Object.entries(data).map(([dataKey, size]) => ({\n sets: dataKey.split('/'),\n size,\n }));\n return scaleSolution(\n normalizeSolution(venn(vennData), orientation, orientationOrder),\n width,\n height,\n 10,\n );\n }\n\n getTooltipProps() {\n return {\n uniqId: this.asProps.uid,\n };\n }\n\n getCircleProps(props, index) {\n const colorBackwardCapabilityOffset = 1;\n const color = props.color || getChartDefaultColorName(index + colorBackwardCapabilityOffset);\n const tooltipProps = {\n dataKey: props.dataKey,\n name: props.name,\n color,\n patterns: this.asProps.patterns,\n };\n\n return {\n duration: this.asProps.duration,\n data: this.vennData[props.dataKey],\n originalData: this.asProps.data[props.dataKey],\n onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),\n onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),\n transparent: this.asProps.transparent,\n resolveColor: this.asProps.resolveColor,\n color,\n uid: `${this.asProps.uid}-${index}`,\n patterns: this.asProps.patterns,\n minRadius: this.asProps.minRadius,\n onClickCircleRoot: this.handlerOnClick(props.dataKey).bind(this),\n };\n }\n\n getIntersectionProps(props) {\n const { duration, transparent } = this.asProps;\n const dataKeys = props.dataKey.split('/');\n const tooltipProps = {\n dataKey: props.dataKey,\n name: props.name,\n color: props.color,\n duration: props.duration,\n transparent: props.transparent,\n };\n\n return {\n duration,\n delay: duration,\n data: Object.values(this.vennData).filter((d) => dataKeys.includes(d.setid)),\n originalData: this.asProps.data[props.dataKey],\n onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),\n onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),\n transparent,\n resolveColor: this.asProps.resolveColor,\n onClickIntersectionRoot: this.handlerOnClick(props.dataKey).bind(this),\n };\n }\n\n renderElement = React.forwardRef((props, ref) => {\n return <FadeInOut aria-hidden ref={ref} tag='g' visible {...props} />;\n });\n\n handlerOnClick(dataKey) {\n return (e) => {\n e.stopPropagation();\n\n const { onClick } = this.asProps;\n\n if (!onClick) return;\n\n onClick(dataKey, e);\n };\n }\n\n render() {\n const Element = this.Element;\n this.asProps.dataHintsHandler.establishDataType('values-set');\n this.vennData = this.getVennData();\n return (\n <Element\n aria-hidden\n render={this.renderElement}\n childrenPosition='inside'\n vennData={this.vennData}\n />\n );\n }\n}\n\nfunction Circle({\n Element: SCircle,\n styles,\n color,\n resolveColor,\n data,\n duration,\n name,\n dataKey,\n dataHintsHandler,\n transparent,\n uid,\n patterns,\n minRadius,\n onClick,\n onClickCircleRoot,\n}) {\n dataHintsHandler.describeValueEntity(dataKey, name);\n\n const radius = data.radius < minRadius ? minRadius : data.radius;\n if (data.radius === 0) return null;\n\n return (\n <>\n {sstyled(styles)(\n <SCircle\n aria-hidden\n render='circle'\n color={resolveColor(color)}\n pattern={patterns ? `url(#${uid}-pattern)` : undefined}\n cx={data.x}\n cy={data.y}\n r={radius}\n transparent={transparent}\n use:duration={`${duration}ms`}\n onClickCapture={callAllEventHandlers(onClickCircleRoot, onClick)}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </>\n );\n}\n\nfunction Intersection(props) {\n const {\n Element: SIntersection,\n styles,\n data,\n name,\n dataKey,\n dataHintsHandler,\n transparent,\n onClick,\n onClickIntersectionRoot,\n } = props;\n dataHintsHandler.describeValueEntity(dataKey, name);\n\n const renderIntersection = React.useCallback(\n React.forwardRef((props, ref) => {\n return <FadeInOut aria-hidden ref={ref} tag='path' visible {...props} />;\n }),\n [props],\n );\n return sstyled(styles)(\n <SIntersection\n aria-hidden\n render={renderIntersection}\n d={intersectionAreaPath(data)}\n transparent={transparent}\n onClickCapture={callAllEventHandlers(onClickIntersectionRoot, onClick)}\n />,\n );\n}\n\nfunction VennTooltip(props) {\n const SVennTooltip = Root;\n return sstyled(props.styles)(<SVennTooltip render={Tooltip} excludeAnchorProps />);\n};\n\nconst Venn = createElement(VennRoot, {\n Circle,\n Intersection,\n Tooltip: [VennTooltip, Tooltip._______childrenComponents],\n});\n\nexport default Venn;\n"],"mappings":";;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAEA,IAAAQ,cAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,QAAA,GAAAT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S8B,WAAWA,CAAClH,KAAK,EAAE;EAAA,IAAAmH,IAAA,GAAAC,YAAA;IAAAC,KAAA;EAC1B,IAAMC,YAAY,GACiCC,mBAAO;EAA1D,OAAAF,KAAA,GAAO,IAAAxI,aAAO,EAACmB,KAAK,CAACsG,MAAM,CAAC,eAAC/H,MAAA,YAAAuB,aAAA,CAACwH,YAAY,EAAAD,KAAA,CAAAZ,EAAA,qBAAAe,cAAA,qBAAAzJ,KAAA,CAAA0J,WAAA;IAAA;EAAA,GAAAN,IAAA,GAAsC,CAAC;AACnF;AAAC;AAED,IAAMO,IAAI,GAAG,IAAA5H,yBAAa,EAACf,QAAQ,EAAE;EACnCmH,MAAM,EAANA,MAAM;EACNU,YAAY,EAAZA,YAAY;EACZW,OAAO,EAAE,CAACL,WAAW,EAAEK,mBAAO,CAACI,yBAAyB;AAC1D,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEYH,IAAI","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.PlotA11yModule =
|
|
7
|
+
exports.PlotA11yModule = PlotA11yModule;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _interopRequireWildcard2 = _interopRequireDefault(require("@babel/runtime/helpers/interopRequireWildcard"));
|
|
@@ -16,14 +16,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _locale = require("./locale");
|
|
17
17
|
var _intergalacticDynamicLocales = require("./translations/module/__intergalactic-dynamic-locales");
|
|
18
18
|
/*!__reshadow-styles__:"../style/plotA11yModule.shadow.css"*/
|
|
19
|
-
var styles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
19
|
+
var styles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SPlotA11yModule_1jy6a_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0}.___SPlotA11yModule_1jy6a_gg_:focus{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1}", /*__inner_css_end__*/"1jy6a_gg_"),
|
|
20
20
|
/*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SPlotA11yModule": "
|
|
22
|
+
"__SPlotA11yModule": "___SPlotA11yModule_1jy6a_gg_"
|
|
23
23
|
});
|
|
24
24
|
var globalWasFocused = false;
|
|
25
25
|
var globalNavWithKeyboard = false;
|
|
26
|
-
|
|
26
|
+
function PlotA11yModule(props) {
|
|
27
27
|
var _ref = arguments[0],
|
|
28
28
|
_ref5;
|
|
29
29
|
var SPlotA11yModule = _flexBox.Box;
|
|
@@ -131,5 +131,5 @@ var PlotA11yModule = exports.PlotA11yModule = function PlotA11yModule(props) {
|
|
|
131
131
|
"tabIndex": 0,
|
|
132
132
|
"onFocus": hadnleHiddenElementsFocus
|
|
133
133
|
}, _ref))), t('disabled'));
|
|
134
|
-
}
|
|
134
|
+
}
|
|
135
135
|
//# sourceMappingURL=PlotA11yModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlotA11yModule.js","names":["_core","require","_WithI18n","_flexBox","_react","_interopRequireDefault","_locale","_intergalacticDynamicLocales","styles","sstyled","insert","globalWasFocused","globalNavWithKeyboard","PlotA11yModule","
|
|
1
|
+
{"version":3,"file":"PlotA11yModule.js","names":["_core","require","_WithI18n","_flexBox","_react","_interopRequireDefault","_locale","_intergalacticDynamicLocales","styles","sstyled","insert","globalWasFocused","globalNavWithKeyboard","PlotA11yModule","props","_ref","arguments[0]","_ref5","SPlotA11yModule","Box","_React$useState","React","useState","_React$useState2","_slicedToArray2","wasFocused","setWasFocused","_React$useState3","_React$useState4","navWithKeyboard","setNavWithKeyboard","_React$useState5","_React$useState6","plotA11yView","setPlotA11yView","hadnleHiddenElementsFocus","useCallback","_React$useState7","_React$useState8","loading","setLoading","_React$useState9","_React$useState0","error","setError","contextLocale","useContext","I18nContext","locale","useMemo","_props$locale","normalizeLocale","localizedMessages","t","useI18n","useEffect","_props$plotRef$curren","focusListener","plotRef","current","addEventListener","_props$plotRef$curren2","removeEventListener","_document$body","keyboardListener","event","navigationKeys","includes","key","document","body","_document$body2","shouldDisplayView","Promise","resolve","then","_interopRequireWildcard2","_ref6","PlotA11yView","Component","console","_ref2","createElement","_extends2","_ref3","cn","_objectSpread2","assignProps","_ref4"],"sources":["../../../src/a11y/PlotA11yModule.tsx"],"sourcesContent":["import { Root, sstyled } from '@semcore/core';\nimport { Context as I18nContext, useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport { Box } from '@semcore/flex-box';\nimport React from 'react';\n\nimport type { DataStructureHints, PartialDataSummarizationConfig } from './hints';\nimport { normalizeLocale } from './locale';\nimport styles from '../style/plotA11yModule.shadow.css';\nimport { localizedMessages } from './translations/module/__intergalactic-dynamic-locales';\n\nlet globalWasFocused = false;\nlet globalNavWithKeyboard = false;\n\nexport type A11yViewProps = {\n id: string;\n data: Record<string, unknown>[];\n hints: DataStructureHints;\n plotLabel: string;\n locale: NavigatorLanguage['language'];\n config: PartialDataSummarizationConfig;\n\n plotRef: React.RefObject<HTMLElement>;\n};\n\nexport function PlotA11yModule(props: A11yViewProps) {\n const SPlotA11yModule = Root;\n const [wasFocused, setWasFocused] = React.useState(globalWasFocused);\n const [navWithKeyboard, setNavWithKeyboard] = React.useState(globalNavWithKeyboard);\n const [plotA11yView, setPlotA11yView] = React.useState<{\n Component: React.FC<A11yViewProps>;\n } | null>(null);\n\n const hadnleHiddenElementsFocus = React.useCallback(() => {\n setWasFocused(true);\n setNavWithKeyboard(true);\n }, []);\n\n const [loading, setLoading] = React.useState(false);\n const [error, setError] = React.useState<Error | null>(null);\n\n const contextLocale = React.useContext(I18nContext);\n const locale = React.useMemo(\n () => normalizeLocale(props.locale ?? contextLocale, localizedMessages),\n [props.locale],\n );\n const t = useI18n(localizedMessages, locale!);\n\n React.useEffect(() => {\n if (wasFocused) return;\n const focusListener = () => {\n globalWasFocused = true;\n setWasFocused(true);\n };\n\n props.plotRef.current?.addEventListener('focus', focusListener);\n return () => props.plotRef.current?.removeEventListener('focus', focusListener);\n }, [wasFocused, props.plotRef]);\n React.useEffect(() => {\n if (navWithKeyboard) return;\n const keyboardListener = (event: Event) => {\n const navigationKeys = [\n 'Tab',\n 'ArrowUp',\n 'ArrowLeft',\n 'ArrowDown',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowLeft',\n ];\n if ('key' in event && navigationKeys.includes((event as KeyboardEvent).key)) {\n setNavWithKeyboard(true);\n globalNavWithKeyboard = true;\n }\n };\n document.body?.addEventListener('keydown', keyboardListener);\n return () => document.body?.removeEventListener('keydown', keyboardListener);\n }, [navWithKeyboard]);\n\n const shouldDisplayView = wasFocused && navWithKeyboard;\n\n React.useEffect(() => {\n if (!shouldDisplayView) return;\n if (plotA11yView) return;\n if (loading) return;\n\n setLoading(true);\n\n import('./PlotA11yView')\n .then(({ PlotA11yView }) => {\n setPlotA11yView({ Component: PlotA11yView });\n setLoading(false);\n setError(null);\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.error(error);\n setError(error);\n });\n }, [plotA11yView, shouldDisplayView, loading, setLoading]);\n\n if (plotA11yView) {\n return sstyled(styles)(\n <plotA11yView.Component {...props} locale={locale!} />,\n ) as React.ReactElement;\n }\n\n if (error) {\n return sstyled(styles)(\n <SPlotA11yModule render={Box} tabIndex={0} aria-live='assertive'>\n {t('failed')}\n </SPlotA11yModule>,\n ) as React.ReactElement;\n }\n if (loading) {\n return sstyled(styles)(\n <SPlotA11yModule render={Box} tabIndex={0} aria-live='polite'>\n {t('loading')}\n </SPlotA11yModule>,\n ) as React.ReactElement;\n }\n\n return sstyled(styles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CAAC;MAAA,aAAY;IAAQ,GAAAxE,IAAA,KAC1DsC,CAAC,CAAC,SAAS,CACG,CAAC;EAEtB;EAEA,OAAApC,KAAA,GAAO,IAAAR,aAAO,EAACD,MAAM,CAAC,eACpBJ,MAAA,YAAA8E,aAAA,CAAChE,eAAe,EAAAD,KAAA,CAAAoE,EAAA,wBAAAC,cAAA,qBAAAtF,KAAA,CAAAuF,WAAA;IAAA,YAAwB,CAAC;IAAA,WAAWpD;EAAyB,GAAApB,IAAA,KAC1EsC,CAAC,CAAC,UAAU,CACE,CAAC;AAEtB","ignoreList":[]}
|
|
@@ -18,10 +18,10 @@ var _intl = require("./intl");
|
|
|
18
18
|
var _summarize = require("./summarize");
|
|
19
19
|
var _intergalacticDynamicLocales = require("./translations/view/__intergalactic-dynamic-locales");
|
|
20
20
|
/*!__reshadow-styles__:"../style/plotA11yView.shadow.css"*/
|
|
21
|
-
var styles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
21
|
+
var styles = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SPlotA11yView_5y734_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);color:var(--intergalactic-text-primary, #191b23);border:3px solid var(--intergalactic-border-primary, #c4c7cf);font-size:var(--intergalactic-fs-50, 10px);padding:2px;width:200px;height:200px;max-width:80%;max-height:80%;overflow:auto}.___SPlotA11yView_5y734_gg_:focus,.___SPlotA11yView_5y734_gg_:focus-within{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1;z-index:var(--intergalactic-z-index-overlay, 500);position:relative;display:block}.___SPlotA11yView_5y734_gg_ a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline;margin-bottom:var(--intergalactic-spacing-2x, 8px);display:block}.___SPlotA11yView_5y734_gg_ table,.___SPlotA11yView_5y734_gg_ td,.___SPlotA11yView_5y734_gg_ th{border:1px solid var(--intergalactic-border-primary, #c4c7cf)}", /*__inner_css_end__*/"5y734_gg_"),
|
|
22
22
|
/*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SPlotA11yView": "
|
|
24
|
+
"__SPlotA11yView": "___SPlotA11yView_5y734_gg_"
|
|
25
25
|
});
|
|
26
26
|
var PlotA11yView = exports.PlotA11yView = function PlotA11yView(_ref3) {
|
|
27
27
|
var _ref = arguments[0],
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.AbstractChart = void 0;
|
|
8
|
+
exports.NOT_A_VALUE = exports.AbstractChart = void 0;
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
10
|
var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -17,15 +17,25 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _core = require("@semcore/core");
|
|
19
19
|
var _ariaProps = require("@semcore/core/lib/utils/ariaProps");
|
|
20
|
-
var
|
|
20
|
+
var _assignProps3 = require("@semcore/core/lib/utils/assignProps");
|
|
21
21
|
var _flexBox = require("@semcore/flex-box");
|
|
22
22
|
var _typography = require("@semcore/typography");
|
|
23
|
-
var _react =
|
|
23
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
24
24
|
var _ = require("../..");
|
|
25
25
|
var _hints = require("../../a11y/hints");
|
|
26
26
|
var _utils = require("../../utils");
|
|
27
27
|
var _ChartLegend = _interopRequireWildcard(require("../ChartLegend"));
|
|
28
28
|
// @ts-ignore
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
/*!__reshadow-styles__:"../../style/abstract-chart.shadow.css"*/
|
|
31
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___STooltipChildrenWrapper_1xuth_gg_{display:grid;grid-column-gap:var(--intergalactic-spacing-2x, 8px);-moz-column-gap:var(--intergalactic-spacing-2x, 8px);column-gap:var(--intergalactic-spacing-2x, 8px)}.___STooltipChildrenWrapper_1xuth_gg_._columnsCount_2_1xuth_gg_{grid-template-columns:auto minmax(28px,max-content)}.___STooltipChildrenWrapper_1xuth_gg_._columnsCount_3_1xuth_gg_{grid-template-columns:auto minmax(28px,max-content) minmax(28px,max-content)}", /*__inner_css_end__*/"1xuth_gg_"),
|
|
32
|
+
/*__reshadow_css_end__*/
|
|
33
|
+
{
|
|
34
|
+
"__STooltipChildrenWrapper": "___STooltipChildrenWrapper_1xuth_gg_",
|
|
35
|
+
"_columnsCount_2": "_columnsCount_2_1xuth_gg_",
|
|
36
|
+
"_columnsCount_3": "_columnsCount_3_1xuth_gg_"
|
|
37
|
+
});
|
|
38
|
+
var NOT_A_VALUE = exports.NOT_A_VALUE = 'n/a';
|
|
29
39
|
var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
30
40
|
function AbstractChart(props) {
|
|
31
41
|
var _this;
|
|
@@ -109,7 +119,7 @@ var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
|
109
119
|
}, percent !== undefined ? "".concat(percent, "%") : ''), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
110
120
|
key: "".concat(key, "_value"),
|
|
111
121
|
use: value ? 'primary' : 'secondary'
|
|
112
|
-
}, value !== null && value !== void 0 ? value :
|
|
122
|
+
}, value !== null && value !== void 0 ? value : NOT_A_VALUE)];
|
|
113
123
|
}
|
|
114
124
|
return dataDefinition;
|
|
115
125
|
});
|
|
@@ -179,10 +189,10 @@ var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
|
179
189
|
if (!groupKey && typeof item === 'number') {
|
|
180
190
|
result.add(item);
|
|
181
191
|
} else {
|
|
182
|
-
Object.entries(item).forEach(function (
|
|
183
|
-
var
|
|
184
|
-
key =
|
|
185
|
-
value =
|
|
192
|
+
Object.entries(item).forEach(function (_ref5) {
|
|
193
|
+
var _ref6 = (0, _slicedToArray2["default"])(_ref5, 2),
|
|
194
|
+
key = _ref6[0],
|
|
195
|
+
value = _ref6[1];
|
|
186
196
|
if (key !== groupKey && typeof value === 'number') {
|
|
187
197
|
result.add(value);
|
|
188
198
|
}
|
|
@@ -208,10 +218,10 @@ var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
|
208
218
|
return _max;
|
|
209
219
|
}
|
|
210
220
|
var max = data.reduce(function (max, item) {
|
|
211
|
-
var barSum = Object.entries(item).reduce(function (sum,
|
|
212
|
-
var
|
|
213
|
-
key =
|
|
214
|
-
val =
|
|
221
|
+
var barSum = Object.entries(item).reduce(function (sum, _ref7) {
|
|
222
|
+
var _ref8 = (0, _slicedToArray2["default"])(_ref7, 2),
|
|
223
|
+
key = _ref8[0],
|
|
224
|
+
val = _ref8[1];
|
|
215
225
|
if (key === groupKey) {
|
|
216
226
|
return sum;
|
|
217
227
|
}
|
|
@@ -234,18 +244,42 @@ var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
|
234
244
|
key: "totalValue",
|
|
235
245
|
value: function totalValue(data) {
|
|
236
246
|
var dataDefinitions = this.state.dataDefinitions;
|
|
247
|
+
var allNotAValue = true;
|
|
237
248
|
var total = dataDefinitions.reduce(function (sum, legendItem) {
|
|
238
249
|
var item = data[legendItem.id];
|
|
250
|
+
if (item === null) {
|
|
251
|
+
allNotAValue = false;
|
|
252
|
+
return sum;
|
|
253
|
+
}
|
|
239
254
|
if (typeof item === 'number') {
|
|
255
|
+
allNotAValue = false;
|
|
240
256
|
return sum + item;
|
|
241
257
|
}
|
|
242
258
|
if (item instanceof Date && !Number.isNaN(item.getMilliseconds())) {
|
|
259
|
+
allNotAValue = false;
|
|
243
260
|
return sum + item.getMilliseconds();
|
|
244
261
|
}
|
|
245
262
|
return sum;
|
|
246
263
|
}, 0);
|
|
264
|
+
if (allNotAValue) {
|
|
265
|
+
return Number.NaN;
|
|
266
|
+
}
|
|
247
267
|
return total;
|
|
248
268
|
}
|
|
269
|
+
}, {
|
|
270
|
+
key: "percentValue",
|
|
271
|
+
value: function percentValue(data, key) {
|
|
272
|
+
var total = this.totalValue(data);
|
|
273
|
+
var value = data[key];
|
|
274
|
+
if (typeof value === 'number' && total !== 0) {
|
|
275
|
+
var percent = Math.round(100 * value / total);
|
|
276
|
+
return "".concat(percent, "%");
|
|
277
|
+
}
|
|
278
|
+
if (value === null) {
|
|
279
|
+
return "0%";
|
|
280
|
+
}
|
|
281
|
+
return NOT_A_VALUE;
|
|
282
|
+
}
|
|
249
283
|
}, {
|
|
250
284
|
key: "getValueScale",
|
|
251
285
|
value: function getValueScale(values) {
|
|
@@ -311,7 +345,7 @@ var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
|
311
345
|
return tooltipValueFormatter(value);
|
|
312
346
|
}
|
|
313
347
|
if (value === undefined || value === _utils.interpolateValue) {
|
|
314
|
-
return
|
|
348
|
+
return NOT_A_VALUE;
|
|
315
349
|
}
|
|
316
350
|
if (value === null) {
|
|
317
351
|
return '0';
|
|
@@ -355,9 +389,9 @@ var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
|
355
389
|
'h': lProps.h,
|
|
356
390
|
patterns: patterns,
|
|
357
391
|
'direction': (_lProps$direction = lProps.direction) !== null && _lProps$direction !== void 0 ? _lProps$direction : direction === 'row' || direction === 'row-reverse' ? 'column' : 'row',
|
|
358
|
-
'onChangeVisibleItem': lProps.disableSelectItems ? undefined : (0,
|
|
359
|
-
'onMouseEnterItem': lProps.disableHoverItems ? undefined : (0,
|
|
360
|
-
'onMouseLeaveItem': lProps.disableHoverItems ? undefined : (0,
|
|
392
|
+
'onChangeVisibleItem': lProps.disableSelectItems ? undefined : (0, _assignProps3.callAllEventHandlers)(lProps.onChangeVisibleItem, this.handleChangeVisible),
|
|
393
|
+
'onMouseEnterItem': lProps.disableHoverItems ? undefined : (0, _assignProps3.callAllEventHandlers)(lProps.onMouseEnterItem, this.handleMouseEnter),
|
|
394
|
+
'onMouseLeaveItem': lProps.disableHoverItems ? undefined : (0, _assignProps3.callAllEventHandlers)(lProps.onMouseLeaveItem, this.handleMouseLeave),
|
|
361
395
|
'aria-label': this.getLegendAriaLabel()
|
|
362
396
|
};
|
|
363
397
|
if (lProps.legendType === 'Table') {
|
|
@@ -391,14 +425,14 @@ var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
|
391
425
|
}
|
|
392
426
|
var xTicks = this.xTicks;
|
|
393
427
|
var yTicks = this.yTicks;
|
|
394
|
-
var childrenX = axisXValueFormatter ? function (
|
|
395
|
-
var value =
|
|
428
|
+
var childrenX = axisXValueFormatter ? function (_ref9) {
|
|
429
|
+
var value = _ref9.value;
|
|
396
430
|
return {
|
|
397
431
|
children: axisXValueFormatter(value)
|
|
398
432
|
};
|
|
399
433
|
} : undefined;
|
|
400
|
-
var childrenY = axisYValueFormatter ? function (
|
|
401
|
-
var value =
|
|
434
|
+
var childrenY = axisYValueFormatter ? function (_ref0) {
|
|
435
|
+
var value = _ref0.value;
|
|
402
436
|
return {
|
|
403
437
|
children: axisYValueFormatter(value)
|
|
404
438
|
};
|
|
@@ -420,27 +454,77 @@ var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
|
420
454
|
}) : /*#__PURE__*/_react["default"].createElement(_.XAxis.Grid, null))));
|
|
421
455
|
}
|
|
422
456
|
}, {
|
|
423
|
-
key: "
|
|
424
|
-
value: function
|
|
457
|
+
key: "getTooltipChildren",
|
|
458
|
+
value: function getTooltipChildren(options) {
|
|
425
459
|
var _ref = this.asProps,
|
|
426
|
-
|
|
427
|
-
|
|
460
|
+
_ref3,
|
|
461
|
+
_dataItem,
|
|
462
|
+
_this3 = this;
|
|
463
|
+
var STooltipChildrenWrapper = _flexBox.Box;
|
|
464
|
+
var Tooltip = options.Tooltip,
|
|
465
|
+
dataItem = options.dataItem;
|
|
428
466
|
var _this$asProps7 = this.asProps,
|
|
429
467
|
styles = _this$asProps7.styles,
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
468
|
+
groupKey = _this$asProps7.groupKey;
|
|
469
|
+
var dataDefinitions = this.state.dataDefinitions;
|
|
470
|
+
var title = (_dataItem = dataItem[groupKey]) === null || _dataItem === void 0 ? void 0 : _dataItem.toString();
|
|
471
|
+
return _ref3 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, _ref3.cn("Flex", {
|
|
472
|
+
"direction": 'column'
|
|
473
|
+
}), title && /*#__PURE__*/_react["default"].createElement(Tooltip.Title, null, title), /*#__PURE__*/_react["default"].createElement(STooltipChildrenWrapper, _ref3.cn("STooltipChildrenWrapper", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
474
|
+
"columnsCount": '2',
|
|
475
|
+
"__excludeProps": ['data']
|
|
476
|
+
}, _ref))), dataDefinitions.map(function (item) {
|
|
477
|
+
return item.checked && /*#__PURE__*/_react["default"].createElement(_react.Fragment, {
|
|
478
|
+
key: item.id
|
|
479
|
+
}, /*#__PURE__*/_react["default"].createElement(Tooltip.Dot, {
|
|
480
|
+
mr: 2,
|
|
481
|
+
color: item.color
|
|
482
|
+
}, item.label), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
483
|
+
textAlign: "end",
|
|
484
|
+
bold: true
|
|
485
|
+
}, _this3.tooltipValueFormatter(dataItem[item.id])));
|
|
486
|
+
}), this.renderTooltipTotalLine(dataItem)));
|
|
487
|
+
}
|
|
488
|
+
}, {
|
|
489
|
+
key: "renderTooltipTotalLine",
|
|
490
|
+
value: function renderTooltipTotalLine(dataItem) {
|
|
491
|
+
var showTotalInTooltip = this.asProps.showTotalInTooltip;
|
|
492
|
+
if (!showTotalInTooltip) {
|
|
493
|
+
return null;
|
|
494
|
+
}
|
|
495
|
+
var total = this.totalValue(dataItem);
|
|
496
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_flexBox.Box, {
|
|
497
|
+
mt: 2,
|
|
498
|
+
mr: 2
|
|
499
|
+
}, "Total"), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
500
|
+
mt: 2,
|
|
501
|
+
textAlign: "end",
|
|
502
|
+
bold: true
|
|
503
|
+
}, Number.isNaN(total) ? NOT_A_VALUE : total));
|
|
504
|
+
}
|
|
505
|
+
}, {
|
|
506
|
+
key: "render",
|
|
507
|
+
value: function render() {
|
|
508
|
+
var _ref2 = this.asProps,
|
|
509
|
+
_ref4;
|
|
510
|
+
var SChart = _flexBox.Flex;
|
|
511
|
+
var _this$asProps8 = this.asProps,
|
|
512
|
+
styles = _this$asProps8.styles,
|
|
513
|
+
plotWidth = _this$asProps8.plotWidth,
|
|
514
|
+
plotHeight = _this$asProps8.plotHeight,
|
|
515
|
+
data = _this$asProps8.data,
|
|
516
|
+
patterns = _this$asProps8.patterns,
|
|
517
|
+
a11yAltTextConfig = _this$asProps8.a11yAltTextConfig,
|
|
518
|
+
duration = _this$asProps8.duration,
|
|
519
|
+
eventEmitter = _this$asProps8.eventEmitter,
|
|
520
|
+
showTooltip = _this$asProps8.showTooltip;
|
|
437
521
|
var _extractAriaProps = (0, _ariaProps.extractAriaProps)(this.asProps),
|
|
438
522
|
extractedAriaProps = _extractAriaProps.extractedAriaProps;
|
|
439
|
-
return
|
|
523
|
+
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SChart, _ref4.cn("SChart", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
440
524
|
"gap": 5,
|
|
441
525
|
"__excludeProps": ['data', 'eventEmitter'],
|
|
442
526
|
"role": 'group'
|
|
443
|
-
},
|
|
527
|
+
}, _ref2))), this.renderLegend(), /*#__PURE__*/_react["default"].createElement(_.Plot, _ref4.cn("Plot", (0, _objectSpread2["default"])({
|
|
444
528
|
"data": data,
|
|
445
529
|
"scale": [this.xScale, this.yScale],
|
|
446
530
|
"width": plotWidth,
|
|
@@ -450,11 +534,11 @@ var AbstractChart = exports.AbstractChart = /*#__PURE__*/function (_Component) {
|
|
|
450
534
|
"patterns": patterns,
|
|
451
535
|
"duration": duration,
|
|
452
536
|
"eventEmitter": eventEmitter
|
|
453
|
-
}, extractedAriaProps)), this.renderAxis(), this.renderTooltip(), this.renderChart()));
|
|
537
|
+
}, extractedAriaProps)), this.renderAxis(), !showTooltip ? null : this.renderTooltip(), this.renderChart()));
|
|
454
538
|
}
|
|
455
539
|
}]);
|
|
456
540
|
}(_core.Component);
|
|
457
|
-
(0, _defineProperty2["default"])(AbstractChart, "style",
|
|
541
|
+
(0, _defineProperty2["default"])(AbstractChart, "style", style);
|
|
458
542
|
(0, _defineProperty2["default"])(AbstractChart, "defaultProps", {
|
|
459
543
|
direction: 'column',
|
|
460
544
|
showXAxis: true,
|