@semcore/d3-chart 3.60.0 → 3.60.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/cjs/Area.js +14 -12
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +17 -15
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +19 -17
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +15 -13
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +19 -17
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +12 -10
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +11 -9
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +19 -17
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +6 -4
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +12 -10
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Plot.js +6 -4
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +22 -20
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +15 -13
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +15 -13
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +12 -10
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/Tooltip.js +12 -10
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +12 -10
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +5 -3
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +5 -3
- package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +7 -5
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +20 -18
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +9 -7
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/Area.js +14 -12
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +17 -15
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +19 -17
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +15 -13
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +19 -17
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +12 -10
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +11 -9
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/HorizontalBar.js +19 -17
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +6 -4
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +12 -10
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Plot.js +6 -4
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +22 -20
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +15 -13
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +15 -13
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ScatterPlot.js +12 -10
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/Tooltip.js +12 -10
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +12 -10
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +5 -3
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +5 -3
- package/lib/es6/a11y/PlotA11yView.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +7 -5
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +20 -18
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +9 -7
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +54 -0
- package/lib/esm/Area.mjs +189 -0
- package/lib/esm/Axis.mjs +406 -0
- package/lib/esm/Bar.mjs +201 -0
- package/lib/esm/Bubble.mjs +216 -0
- package/lib/esm/CompactHorizontalBar.mjs +518 -0
- package/lib/esm/Donut.mjs +415 -0
- package/lib/esm/Dots.mjs +120 -0
- package/lib/esm/GroupBar.mjs +94 -0
- package/lib/esm/HorizontalBar.mjs +181 -0
- package/lib/esm/Hover.mjs +217 -0
- package/lib/esm/Line.mjs +199 -0
- package/lib/esm/Pattern.mjs +520 -0
- package/lib/esm/Plot.mjs +137 -0
- package/lib/esm/Radar.mjs +706 -0
- package/lib/esm/RadialTree.mjs +565 -0
- package/lib/esm/Reference.mjs +243 -0
- package/lib/esm/ResponsiveContainer.mjs +99 -0
- package/lib/esm/ScatterPlot.mjs +194 -0
- package/lib/esm/StackBar.mjs +177 -0
- package/lib/esm/StackedArea.mjs +84 -0
- package/lib/esm/Tooltip.mjs +255 -0
- package/lib/esm/Venn.mjs +234 -0
- package/lib/esm/a11y/DataAccessibilityTable.mjs +100 -0
- package/lib/esm/a11y/PlotA11yModule.mjs +117 -0
- package/lib/esm/a11y/PlotA11yView.mjs +146 -0
- package/lib/esm/a11y/bezier.mjs +32 -0
- package/lib/esm/a11y/focus.mjs +44 -0
- package/lib/esm/a11y/hints.mjs +122 -0
- package/lib/esm/a11y/insights.mjs +700 -0
- package/lib/esm/a11y/intl.mjs +17 -0
- package/lib/esm/a11y/locale.mjs +39 -0
- package/lib/esm/a11y/serialize.mjs +363 -0
- package/lib/esm/a11y/summarize.mjs +14 -0
- package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +33 -0
- package/lib/esm/a11y/translations/module/de.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/en.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/es.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/fr.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/it.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/ja.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/ko.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/nl.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/pl.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/pt.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/sv.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/tr.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/vi.json.mjs +14 -0
- package/lib/esm/a11y/translations/module/zh.json.mjs +14 -0
- package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +33 -0
- package/lib/esm/a11y/translations/view/de.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/en.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/es.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/fr.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/it.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/ja.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/ko.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/nl.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/pl.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/pt.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/sv.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/tr.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/vi.json.mjs +48 -0
- package/lib/esm/a11y/translations/view/zh.json.mjs +48 -0
- package/lib/esm/color.mjs +127 -0
- package/lib/esm/component/Chart/AbstractChart.mjs +408 -0
- package/lib/esm/component/Chart/AreaChart.mjs +145 -0
- package/lib/esm/component/Chart/BarChart.mjs +240 -0
- package/lib/esm/component/Chart/BubbleChart.mjs +135 -0
- package/lib/esm/component/Chart/CigaretteChart.mjs +294 -0
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +113 -0
- package/lib/esm/component/Chart/DonutChart.mjs +113 -0
- package/lib/esm/component/Chart/HistogramChart.mjs +166 -0
- package/lib/esm/component/Chart/LineChart.mjs +131 -0
- package/lib/esm/component/Chart/RadarChart.mjs +115 -0
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +144 -0
- package/lib/esm/component/Chart/VennChart.mjs +141 -0
- package/lib/esm/component/Chart/index.mjs +27 -0
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +91 -0
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +86 -0
- package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +12 -0
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +240 -0
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +4 -0
- package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +129 -0
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +90 -0
- package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +19 -0
- package/lib/esm/component/ChartLegend/index.mjs +5 -0
- package/lib/esm/component/Cigarette/Cigarette.mjs +139 -0
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +141 -0
- package/lib/esm/createElement.mjs +104 -0
- package/lib/esm/index.mjs +70 -0
- package/lib/esm/style/area.shadow.css +50 -0
- package/lib/esm/style/axis.shadow.css +88 -0
- package/lib/esm/style/bar.shadow.css +66 -0
- package/lib/esm/style/bubble.shadow.css +64 -0
- package/lib/esm/style/donut.shadow.css +36 -0
- package/lib/esm/style/dot.shadow.css +27 -0
- package/lib/esm/style/hover.shadow.css +9 -0
- package/lib/esm/style/line.shadow.css +43 -0
- package/lib/esm/style/plot.shadow.css +19 -0
- package/lib/esm/style/plotA11yModule.shadow.css +12 -0
- package/lib/esm/style/plotA11yView.shadow.css +39 -0
- package/lib/esm/style/radar.shadow.css +80 -0
- package/lib/esm/style/radial-tree.shadow.css +54 -0
- package/lib/esm/style/reference.shadow.css +43 -0
- package/lib/esm/style/scatterplot.shadow.css +41 -0
- package/lib/esm/style/tooltip.shadow.css +42 -0
- package/lib/esm/style/venn.shadow.css +48 -0
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +31 -0
- package/lib/esm/translations/en.json.mjs +12 -0
- package/lib/esm/translations/es.json.mjs +11 -0
- package/lib/esm/translations/fr.json.mjs +11 -0
- package/lib/esm/translations/it.json.mjs +11 -0
- package/lib/esm/translations/ja.json.mjs +11 -0
- package/lib/esm/translations/ko.json.mjs +11 -0
- package/lib/esm/translations/nl.json.mjs +11 -0
- package/lib/esm/translations/pl.json.mjs +11 -0
- package/lib/esm/translations/pt.json.mjs +11 -0
- package/lib/esm/translations/sv.json.mjs +11 -0
- package/lib/esm/translations/tr.json.mjs +11 -0
- package/lib/esm/translations/vi.json.mjs +11 -0
- package/lib/esm/translations/zh.json.mjs +11 -0
- package/lib/esm/utils.mjs +266 -0
- package/package.json +11 -11
- package/vite.config.ts +2 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
+
import { sstyled } from "@semcore/utils/lib/core/index";
|
|
10
|
+
import { sstyled as sstyled$1, Component, assignProps } from "@semcore/core";
|
|
11
|
+
import React from "react";
|
|
12
|
+
import { transition } from "d3-transition";
|
|
13
|
+
import uniqueIDEnhancement from "@semcore/utils/lib/uniqueID";
|
|
14
|
+
import createElement from "./createElement.mjs";
|
|
15
|
+
import { getBubbleChartValueScale, measureText } from "./utils.mjs";
|
|
16
|
+
import Tooltip from "./Tooltip.mjs";
|
|
17
|
+
import { PatternFill } from "./Pattern.mjs";
|
|
18
|
+
/*!__reshadow-styles__:"./style/bubble.shadow.css"*/
|
|
19
|
+
var style = (
|
|
20
|
+
/*__reshadow_css_start__*/
|
|
21
|
+
(sstyled.insert(
|
|
22
|
+
/*__inner_css_start__*/
|
|
23
|
+
".___SBubble_lk086_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_lk086);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_lk086_gg_:hover{opacity:.8}}.___SBubble_lk086_gg_.__color_lk086_gg_{fill:var(--color_lk086)}.___SBubble_lk086_gg_.__pattern_lk086_gg_.__color_lk086_gg_{fill:var(--pattern_lk086);stroke:var(--color_lk086);stroke-width:1px}.___SBubble_lk086_gg_.__transparent_lk086_gg_{opacity:.3}.___SCenter_lk086_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SCenter_lk086_gg_.__color_lk086_gg_{stroke:var(--color_lk086)}.___SCenter_lk086_gg_.__transparent_lk086_gg_{opacity:.3}.___SLabel_lk086_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SLabel_lk086_gg_._position_right_lk086_gg_{text-anchor:end}.___SLabel_lk086_gg_._position_left_lk086_gg_{text-anchor:start}.___SLabel_lk086_gg_.__color_lk086_gg_{fill:var(--color_lk086)}.___SLabel_lk086_gg_.__transparent_lk086_gg_{opacity:.3}",
|
|
24
|
+
/*__inner_css_end__*/
|
|
25
|
+
"lk086_gg_"
|
|
26
|
+
), /*__reshadow_css_end__*/
|
|
27
|
+
{
|
|
28
|
+
"__SBubble": "___SBubble_lk086_gg_",
|
|
29
|
+
"_color": "__color_lk086_gg_",
|
|
30
|
+
"--color": "--color_lk086",
|
|
31
|
+
"_pattern": "__pattern_lk086_gg_",
|
|
32
|
+
"--pattern": "--pattern_lk086",
|
|
33
|
+
"_transparent": "__transparent_lk086_gg_",
|
|
34
|
+
"__SCenter": "___SCenter_lk086_gg_",
|
|
35
|
+
"__SLabel": "___SLabel_lk086_gg_",
|
|
36
|
+
"_position_right": "_position_right_lk086_gg_",
|
|
37
|
+
"_position_left": "_position_left_lk086_gg_",
|
|
38
|
+
"--duration": "--duration_lk086"
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
var BubbleRoot = /* @__PURE__ */ function(_Component) {
|
|
42
|
+
_inherits(BubbleRoot2, _Component);
|
|
43
|
+
var _super = _createSuper(BubbleRoot2);
|
|
44
|
+
function BubbleRoot2() {
|
|
45
|
+
var _this;
|
|
46
|
+
_classCallCheck(this, BubbleRoot2);
|
|
47
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
48
|
+
args[_key] = arguments[_key];
|
|
49
|
+
}
|
|
50
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
51
|
+
_defineProperty(_assertThisInitialized(_this), "bindHandlerTooltip", function(visible, props, tooltipProps) {
|
|
52
|
+
return function(_ref4) {
|
|
53
|
+
var clientX = _ref4.clientX, clientY = _ref4.clientY;
|
|
54
|
+
var eventEmitter = _this.asProps.eventEmitter;
|
|
55
|
+
eventEmitter.emit("setTooltipPosition", clientX, clientY);
|
|
56
|
+
eventEmitter.emit("setTooltipRenderingProps", props, tooltipProps);
|
|
57
|
+
eventEmitter.emit("setTooltipVisible", visible);
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
return _this;
|
|
61
|
+
}
|
|
62
|
+
_createClass(BubbleRoot2, [{
|
|
63
|
+
key: "generateGetBoundingClientRect",
|
|
64
|
+
value: function generateGetBoundingClientRect() {
|
|
65
|
+
var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
66
|
+
var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
67
|
+
return function() {
|
|
68
|
+
return {
|
|
69
|
+
width: 0,
|
|
70
|
+
height: 0,
|
|
71
|
+
top: y,
|
|
72
|
+
right: x,
|
|
73
|
+
bottom: y,
|
|
74
|
+
left: x
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "animationCircle",
|
|
80
|
+
value: function animationCircle() {
|
|
81
|
+
var _this$asProps = this.asProps, duration = _this$asProps.duration, uid = _this$asProps.uid, data = _this$asProps.data, value = _this$asProps.value;
|
|
82
|
+
var z = getBubbleChartValueScale(data, value);
|
|
83
|
+
var selectRect = transition().selection().selectAll("[id^=".concat(uid).concat(uid, "]")).attr("r", 0);
|
|
84
|
+
var selectRectNode = selectRect.node();
|
|
85
|
+
if (selectRectNode) {
|
|
86
|
+
selectRect.transition().duration(duration).attr("r", function(_, ind) {
|
|
87
|
+
var _data$ind;
|
|
88
|
+
return z((_data$ind = data[ind]) === null || _data$ind === void 0 ? void 0 : _data$ind[value]);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "componentDidUpdate",
|
|
94
|
+
value: function componentDidUpdate(prevProps) {
|
|
95
|
+
var _this$asProps2 = this.asProps, data = _this$asProps2.data, x = _this$asProps2.x, y = _this$asProps2.y, value = _this$asProps2.value;
|
|
96
|
+
var prevX = prevProps.x, prevY = prevProps.y, prevValue = prevProps.value;
|
|
97
|
+
var prevData = prevProps.$rootProps.data;
|
|
98
|
+
if (data !== prevData || x !== prevX || y !== prevY || value !== prevValue) {
|
|
99
|
+
this.animationCircle();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "componentDidMount",
|
|
104
|
+
value: function componentDidMount() {
|
|
105
|
+
this.animationCircle();
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
key: "renderCircle",
|
|
109
|
+
value: function renderCircle(d, i) {
|
|
110
|
+
var _ref2, _d$color;
|
|
111
|
+
var _this$asProps3 = this.asProps, color = _this$asProps3.color, scale = _this$asProps3.scale, x = _this$asProps3.x, y = _this$asProps3.y, offset = _this$asProps3.offset, styles = _this$asProps3.styles, uid = _this$asProps3.uid, duration = _this$asProps3.duration, value = _this$asProps3.value, label = _this$asProps3.label, markedCross = _this$asProps3.markedCross, size = _this$asProps3.size, data = _this$asProps3.data, transparent = _this$asProps3.transparent, resolveColor = _this$asProps3.resolveColor, patterns = _this$asProps3.patterns;
|
|
112
|
+
var _scale = _slicedToArray(scale, 2), xScale = _scale[0], yScale = _scale[1];
|
|
113
|
+
var SBubble = this.Element;
|
|
114
|
+
var SCenter = "text";
|
|
115
|
+
var SLabel = "text";
|
|
116
|
+
var z = getBubbleChartValueScale(data, value);
|
|
117
|
+
var margin = Math.min(xScale.range()[0], xScale.range()[1]);
|
|
118
|
+
var labelPosition = size[0] - 2 * margin - (xScale(d[x]) + offset[0] + z(d[value])) < measureText(d[label]) ? "right" : "left";
|
|
119
|
+
var labelDistance = {
|
|
120
|
+
right: xScale(d[x]) + offset[0] - z(d[value]),
|
|
121
|
+
left: xScale(d[x]) + offset[0] + z(d[value])
|
|
122
|
+
}[labelPosition];
|
|
123
|
+
return _ref2 = sstyled$1(styles), /* @__PURE__ */ React.createElement("g", _ref2.cn("g", {
|
|
124
|
+
"key": "circle(#".concat(i, ")"),
|
|
125
|
+
"onMouseMove": this.bindHandlerTooltip(true, this.props, {
|
|
126
|
+
xIndex: i,
|
|
127
|
+
index: i,
|
|
128
|
+
patterns
|
|
129
|
+
}),
|
|
130
|
+
"onMouseLeave": this.bindHandlerTooltip(false, this.props, {
|
|
131
|
+
xIndex: i,
|
|
132
|
+
index: i,
|
|
133
|
+
patterns
|
|
134
|
+
})
|
|
135
|
+
}), markedCross && /* @__PURE__ */ React.createElement(SCenter, _ref2.cn("SCenter", {
|
|
136
|
+
"aria-hidden": true,
|
|
137
|
+
"x": xScale(d[x]) + offset[0],
|
|
138
|
+
"y": yScale(d[y]) + offset[1],
|
|
139
|
+
"dy": ".3em",
|
|
140
|
+
"clipPath": "url(#".concat(uid, ")"),
|
|
141
|
+
"color": resolveColor((_d$color = d[color]) !== null && _d$color !== void 0 ? _d$color : color),
|
|
142
|
+
"transparent": transparent
|
|
143
|
+
}), "+"), /* @__PURE__ */ React.createElement(SBubble, _ref2.cn("SBubble", {
|
|
144
|
+
"aria-hidden": true,
|
|
145
|
+
"id": "".concat(uid).concat(uid),
|
|
146
|
+
"index": i,
|
|
147
|
+
"render": "circle",
|
|
148
|
+
"clipPath": "url(#".concat(uid, ")"),
|
|
149
|
+
"cx": xScale(d[x]) + offset[0],
|
|
150
|
+
"cy": yScale(d[y]) + offset[1],
|
|
151
|
+
"color": resolveColor(d[color]),
|
|
152
|
+
"pattern": patterns ? "url(#".concat(uid, "-").concat(i, "-pattern)") : void 0,
|
|
153
|
+
"r": z(d[value]),
|
|
154
|
+
"use:duration": "".concat(duration, "ms"),
|
|
155
|
+
"transparent": transparent
|
|
156
|
+
})), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref2.cn("PatternFill", {
|
|
157
|
+
"id": "".concat(uid, "-").concat(i, "-pattern"),
|
|
158
|
+
"patternKey": d[color],
|
|
159
|
+
"color": resolveColor(d[color]),
|
|
160
|
+
"patterns": patterns
|
|
161
|
+
})), d[label] && /* @__PURE__ */ React.createElement(SLabel, _ref2.cn("SLabel", {
|
|
162
|
+
"aria-hidden": true,
|
|
163
|
+
"x": labelDistance,
|
|
164
|
+
"y": yScale(d[y]) + offset[1],
|
|
165
|
+
"dy": ".3em",
|
|
166
|
+
"clipPath": "url(#".concat(uid, ")"),
|
|
167
|
+
"position": labelPosition,
|
|
168
|
+
"color": resolveColor(d[color]),
|
|
169
|
+
"transparent": transparent
|
|
170
|
+
}), d[label]));
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
key: "render",
|
|
174
|
+
value: function render() {
|
|
175
|
+
var _this$asProps4 = this.asProps, data = _this$asProps4.data, uid = _this$asProps4.uid, scale = _this$asProps4.scale, x = _this$asProps4.x, y = _this$asProps4.y, value = _this$asProps4.value;
|
|
176
|
+
var _scale2 = _slicedToArray(scale, 2), xScale = _scale2[0], yScale = _scale2[1];
|
|
177
|
+
var xSize = Math.abs(xScale.range()[0] - xScale.range()[1]);
|
|
178
|
+
var ySize = Math.abs(yScale.range()[0] - yScale.range()[1]);
|
|
179
|
+
var xMargin = Math.min(xScale.range()[0], xScale.range()[1]);
|
|
180
|
+
var yMargin = Math.min(yScale.range()[0], yScale.range()[1]);
|
|
181
|
+
this.asProps.dataHintsHandler.specifyDataRowFields(x, y, value);
|
|
182
|
+
this.asProps.dataHintsHandler.establishDataType("points-cloud");
|
|
183
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, data.map(this.renderCircle.bind(this)), /* @__PURE__ */ React.createElement("clipPath", {
|
|
184
|
+
"aria-hidden": true,
|
|
185
|
+
id: uid
|
|
186
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
187
|
+
x: xMargin,
|
|
188
|
+
y: yMargin,
|
|
189
|
+
width: "".concat(xSize, "px"),
|
|
190
|
+
height: "".concat(ySize, "px")
|
|
191
|
+
}), " "));
|
|
192
|
+
}
|
|
193
|
+
}]);
|
|
194
|
+
return BubbleRoot2;
|
|
195
|
+
}(Component);
|
|
196
|
+
_defineProperty(BubbleRoot, "displayName", "Bubble");
|
|
197
|
+
_defineProperty(BubbleRoot, "style", style);
|
|
198
|
+
_defineProperty(BubbleRoot, "enhance", [uniqueIDEnhancement()]);
|
|
199
|
+
_defineProperty(BubbleRoot, "defaultProps", {
|
|
200
|
+
offset: [0, 0],
|
|
201
|
+
duration: 500,
|
|
202
|
+
markedCross: true
|
|
203
|
+
});
|
|
204
|
+
var BubbleTooltip = function BubbleTooltip2(props) {
|
|
205
|
+
var _ref = arguments[0], _ref3;
|
|
206
|
+
var SBubbleTooltip = Tooltip;
|
|
207
|
+
return _ref3 = sstyled$1(props.styles), /* @__PURE__ */ React.createElement(SBubbleTooltip, _ref3.cn("SBubbleTooltip", _objectSpread({}, assignProps({
|
|
208
|
+
"excludeAnchorProps": true
|
|
209
|
+
}, _ref))));
|
|
210
|
+
};
|
|
211
|
+
var Bubble = createElement(BubbleRoot, {
|
|
212
|
+
Tooltip: [BubbleTooltip, Tooltip._______childrenComponents]
|
|
213
|
+
});
|
|
214
|
+
export {
|
|
215
|
+
Bubble as default
|
|
216
|
+
};
|