@semcore/d3-chart 2.8.5 → 2.8.7
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 +8 -2
- package/lib/cjs/Area.js +10 -10
- package/lib/cjs/Axis.js +14 -14
- package/lib/cjs/Bar.js +9 -9
- package/lib/cjs/Bubble.js +11 -11
- package/lib/cjs/Donut.js +143 -156
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +10 -10
- package/lib/cjs/HorizontalBar.js +9 -9
- package/lib/cjs/Hover.js +4 -4
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +4 -4
- package/lib/cjs/RadialTree.js +48 -62
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/ReferenceLine.js +10 -10
- package/lib/cjs/ScatterPlot.js +8 -8
- package/lib/cjs/Tooltip.js +8 -8
- package/lib/cjs/Venn.js +8 -8
- package/lib/cjs/a11y/PlotA11yModule.js +3 -3
- package/lib/cjs/a11y/PlotA11yView.js +4 -4
- package/lib/cjs/style/area.shadow.css +2 -2
- package/lib/cjs/style/bar.shadow.css +1 -1
- package/lib/cjs/style/bubble.shadow.css +3 -3
- package/lib/cjs/style/donut.shadow.css +1 -1
- package/lib/cjs/style/dot.shadow.css +1 -1
- package/lib/cjs/style/line.shadow.css +1 -1
- package/lib/cjs/style/plot.shadow.css +1 -1
- package/lib/cjs/style/radial-tree.shadow.css +2 -2
- package/lib/cjs/style/scatterplot.shadow.css +2 -2
- package/lib/cjs/style/venn.shadow.css +1 -1
- package/lib/es6/Area.js +10 -10
- package/lib/es6/Axis.js +14 -14
- package/lib/es6/Bar.js +9 -9
- package/lib/es6/Bubble.js +11 -11
- package/lib/es6/Donut.js +145 -156
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +10 -10
- package/lib/es6/HorizontalBar.js +9 -9
- package/lib/es6/Hover.js +4 -4
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +4 -4
- package/lib/es6/RadialTree.js +48 -62
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/ReferenceLine.js +10 -10
- package/lib/es6/ScatterPlot.js +8 -8
- package/lib/es6/Tooltip.js +8 -8
- package/lib/es6/Venn.js +8 -8
- package/lib/es6/a11y/PlotA11yModule.js +3 -3
- package/lib/es6/a11y/PlotA11yView.js +4 -4
- package/lib/es6/style/area.shadow.css +2 -2
- package/lib/es6/style/bar.shadow.css +1 -1
- package/lib/es6/style/bubble.shadow.css +3 -3
- package/lib/es6/style/donut.shadow.css +1 -1
- package/lib/es6/style/dot.shadow.css +1 -1
- package/lib/es6/style/line.shadow.css +1 -1
- package/lib/es6/style/plot.shadow.css +1 -1
- package/lib/es6/style/radial-tree.shadow.css +2 -2
- package/lib/es6/style/scatterplot.shadow.css +2 -2
- package/lib/es6/style/venn.shadow.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [2.8.
|
|
5
|
+
## [2.8.7] - 2023-01-19
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed animation in React strict mode for `RadialTree` and `Donut`.
|
|
10
|
+
|
|
11
|
+
## [2.8.6] - 2023-01-19
|
|
6
12
|
|
|
7
13
|
### Changed
|
|
8
14
|
|
|
9
|
-
- Version patch update due to children dependencies update (`@semcore/
|
|
15
|
+
- Version patch update due to children dependencies update (`@semcore/animation` [1.8.8 ~> 1.8.9], `@semcore/utils` [3.44.3 ~> 3.45.0]).
|
|
10
16
|
|
|
11
17
|
## [2.8.3] - 2022-01-10
|
|
12
18
|
|
package/lib/cjs/Area.js
CHANGED
|
@@ -48,19 +48,19 @@ var style = (
|
|
|
48
48
|
/*__reshadow_css_start__*/
|
|
49
49
|
_core.sstyled.insert(
|
|
50
50
|
/*__inner_css_start__*/
|
|
51
|
-
".
|
|
51
|
+
".___SArea_1x0pg_gg_{fill:var(--intergalactic-chart-palette-order-1,#2bb3ff);fill-opacity:.2}.___SArea_1x0pg_gg_.__color_1x0pg_gg_{fill:var(--color_1x0pg)}.___SArea_1x0pg_gg_.__transparent_1x0pg_gg_{opacity:.3}.___SAreaLine_1x0pg_gg_{stroke:var(--intergalactic-chart-palette-order-1,#2bb3ff);stroke-width:3;fill:transparent}.___SAreaLine_1x0pg_gg_.__color_1x0pg_gg_{stroke:var(--color_1x0pg)}.___SAreaLine_1x0pg_gg_.__transparent_1x0pg_gg_{opacity:.3}.___SArea_1x0pg_gg_,.___SAreaLine_1x0pg_gg_{transition-property:d;transition-duration:var(--duration_1x0pg);transition-timing-function:ease-in-out}.___SNull_1x0pg_gg_{fill:transparent;stroke:var(--intergalactic-chart-grid-x-axis,#c4c7cf);stroke-dasharray:4}.___SNull_1x0pg_gg_.__hide_1x0pg_gg_{display:none}"
|
|
52
52
|
/*__inner_css_end__*/
|
|
53
|
-
, "
|
|
53
|
+
, "1x0pg_gg_")
|
|
54
54
|
/*__reshadow_css_end__*/
|
|
55
55
|
, {
|
|
56
|
-
"__SArea": "
|
|
57
|
-
"_color": "
|
|
58
|
-
"--color": "--
|
|
59
|
-
"_transparent": "
|
|
60
|
-
"__SAreaLine": "
|
|
61
|
-
"--duration": "--
|
|
62
|
-
"__SNull": "
|
|
63
|
-
"_hide": "
|
|
56
|
+
"__SArea": "___SArea_1x0pg_gg_",
|
|
57
|
+
"_color": "__color_1x0pg_gg_",
|
|
58
|
+
"--color": "--color_1x0pg",
|
|
59
|
+
"_transparent": "__transparent_1x0pg_gg_",
|
|
60
|
+
"__SAreaLine": "___SAreaLine_1x0pg_gg_",
|
|
61
|
+
"--duration": "--duration_1x0pg",
|
|
62
|
+
"__SNull": "___SNull_1x0pg_gg_",
|
|
63
|
+
"_hide": "__hide_1x0pg_gg_"
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
var AreaRoot = /*#__PURE__*/function (_Component) {
|
package/lib/cjs/Axis.js
CHANGED
|
@@ -44,23 +44,23 @@ var style = (
|
|
|
44
44
|
/*__reshadow_css_start__*/
|
|
45
45
|
_core.sstyled.insert(
|
|
46
46
|
/*__inner_css_start__*/
|
|
47
|
-
".
|
|
47
|
+
".___SAxis_86vbu_gg_{stroke:var(--intergalactic-chart-grid-x-axis,#c4c7cf)}.___SAxis_86vbu_gg_.__hide_86vbu_gg_{display:none}.___STick_86vbu_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-chart-grid-text-label,#6c6e79)}.___STick_86vbu_gg_.__hide_86vbu_gg_{display:none}.___SGrid_86vbu_gg_{fill:transparent;stroke:var(--intergalactic-border-secondary,#e0e1e9)}.___STitle_86vbu_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-text-hint,#6c6e79);transform-origin:var(--transform-origin_86vbu)}.___STitle_86vbu_gg_._position_top_86vbu_gg_{text-anchor:middle}.___STitle_86vbu_gg_._position_bottom_86vbu_gg_{text-anchor:middle;alignment-baseline:hanging}.___STitle_86vbu_gg_._position_right_86vbu_gg_{transform:rotate(-90deg);alignment-baseline:middle;text-anchor:middle}.___STitle_86vbu_gg_._position_left_86vbu_gg_{transform:rotate(-90deg);text-anchor:middle;alignment-baseline:middle}.___STick_86vbu_gg_._position_top_86vbu_gg_{transform:translateY(-12px);text-anchor:middle}.___STick_86vbu_gg_._position_bottom_86vbu_gg_{transform:translateY(12px);text-anchor:middle;alignment-baseline:hanging}.___STick_86vbu_gg_._position_right_86vbu_gg_{transform:translateX(16px);text-anchor:start;alignment-baseline:middle}.___STick_86vbu_gg_._position_left_86vbu_gg_{transform:translateX(-16px);text-anchor:end;alignment-baseline:middle}.___STick_86vbu_gg_._position_custom_0_86vbu_gg_{transform:translateY(12px);text-anchor:middle;alignment-baseline:hanging}.___STick_86vbu_gg_._position_custom_1_86vbu_gg_{transform:translateX(-16px);text-anchor:end;alignment-baseline:middle}"
|
|
48
48
|
/*__inner_css_end__*/
|
|
49
|
-
, "
|
|
49
|
+
, "86vbu_gg_")
|
|
50
50
|
/*__reshadow_css_end__*/
|
|
51
51
|
, {
|
|
52
|
-
"__SAxis": "
|
|
53
|
-
"_hide": "
|
|
54
|
-
"__STick": "
|
|
55
|
-
"__SGrid": "
|
|
56
|
-
"__STitle": "
|
|
57
|
-
"--transform-origin": "--transform-
|
|
58
|
-
"_position_top": "
|
|
59
|
-
"_position_bottom": "
|
|
60
|
-
"_position_right": "
|
|
61
|
-
"_position_left": "
|
|
62
|
-
"_position_custom_0": "
|
|
63
|
-
"_position_custom_1": "
|
|
52
|
+
"__SAxis": "___SAxis_86vbu_gg_",
|
|
53
|
+
"_hide": "__hide_86vbu_gg_",
|
|
54
|
+
"__STick": "___STick_86vbu_gg_",
|
|
55
|
+
"__SGrid": "___SGrid_86vbu_gg_",
|
|
56
|
+
"__STitle": "___STitle_86vbu_gg_",
|
|
57
|
+
"--transform-origin": "--transform-origin_86vbu",
|
|
58
|
+
"_position_top": "_position_top_86vbu_gg_",
|
|
59
|
+
"_position_bottom": "_position_bottom_86vbu_gg_",
|
|
60
|
+
"_position_right": "_position_right_86vbu_gg_",
|
|
61
|
+
"_position_left": "_position_left_86vbu_gg_",
|
|
62
|
+
"_position_custom_0": "_position_custom_0_86vbu_gg_",
|
|
63
|
+
"_position_custom_1": "_position_custom_1_86vbu_gg_"
|
|
64
64
|
});
|
|
65
65
|
var CUSTOM_0 = Symbol('custom_0');
|
|
66
66
|
var CUSTOM_1 = Symbol('custom_1');
|
package/lib/cjs/Bar.js
CHANGED
|
@@ -44,18 +44,18 @@ var style = (
|
|
|
44
44
|
/*__reshadow_css_start__*/
|
|
45
45
|
_core.sstyled.insert(
|
|
46
46
|
/*__inner_css_start__*/
|
|
47
|
-
".
|
|
47
|
+
".___SBar_342tx_gg_{fill:var(--intergalactic-chart-palette-order-1,#2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_342tx);transition-timing-function:ease-in-out}.___SBar_342tx_gg_.__color_342tx_gg_{fill:var(--color_342tx)}.___SBar_342tx_gg_.__hide_342tx_gg_{display:none}.___SBar_342tx_gg_.__transparent_342tx_gg_{opacity:.3}.___SBackground_342tx_gg_{fill:var(--intergalactic-chart-palette-order-other-data,#c4c7cf)}"
|
|
48
48
|
/*__inner_css_end__*/
|
|
49
|
-
, "
|
|
49
|
+
, "342tx_gg_")
|
|
50
50
|
/*__reshadow_css_end__*/
|
|
51
51
|
, {
|
|
52
|
-
"__SBar": "
|
|
53
|
-
"--duration": "--
|
|
54
|
-
"_color": "
|
|
55
|
-
"--color": "--
|
|
56
|
-
"_hide": "
|
|
57
|
-
"_transparent": "
|
|
58
|
-
"__SBackground": "
|
|
52
|
+
"__SBar": "___SBar_342tx_gg_",
|
|
53
|
+
"--duration": "--duration_342tx",
|
|
54
|
+
"_color": "__color_342tx_gg_",
|
|
55
|
+
"--color": "--color_342tx",
|
|
56
|
+
"_hide": "__hide_342tx_gg_",
|
|
57
|
+
"_transparent": "__transparent_342tx_gg_",
|
|
58
|
+
"__SBackground": "___SBackground_342tx_gg_"
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
var BarRoot = /*#__PURE__*/function (_Component) {
|
package/lib/cjs/Bubble.js
CHANGED
|
@@ -56,20 +56,20 @@ var style = (
|
|
|
56
56
|
/*__reshadow_css_start__*/
|
|
57
57
|
_core.sstyled.insert(
|
|
58
58
|
/*__inner_css_start__*/
|
|
59
|
-
".
|
|
59
|
+
".___SBubble_6qrbu_gg_{fill:var(--intergalactic-chart-palette-order-1,#2bb3ff);stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_6qrbu);transition-timing-function:ease-in-out;opacity:.5}@media (hover: hover){.___SBubble_6qrbu_gg_:hover{opacity:.8}}.___SBubble_6qrbu_gg_.__color_6qrbu_gg_{fill:var(--color_6qrbu)}.___SBubble_6qrbu_gg_.__transparent_6qrbu_gg_{opacity:.3}.___SCenter_6qrbu_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1,#2bb3ff)}.___SCenter_6qrbu_gg_.__color_6qrbu_gg_{stroke:var(--color_6qrbu)}.___SCenter_6qrbu_gg_.__transparent_6qrbu_gg_{opacity:.3}.___SLabel_6qrbu_gg_{fill:var(--intergalactic-chart-palette-order-1,#2bb3ff)}.___SLabel_6qrbu_gg_._position_right_6qrbu_gg_{text-anchor:end}.___SLabel_6qrbu_gg_._position_left_6qrbu_gg_{text-anchor:start}.___SLabel_6qrbu_gg_.__color_6qrbu_gg_{fill:var(--color_6qrbu)}.___SLabel_6qrbu_gg_.__transparent_6qrbu_gg_{opacity:.3}"
|
|
60
60
|
/*__inner_css_end__*/
|
|
61
|
-
, "
|
|
61
|
+
, "6qrbu_gg_")
|
|
62
62
|
/*__reshadow_css_end__*/
|
|
63
63
|
, {
|
|
64
|
-
"__SBubble": "
|
|
65
|
-
"--duration": "--
|
|
66
|
-
"_color": "
|
|
67
|
-
"--color": "--
|
|
68
|
-
"_transparent": "
|
|
69
|
-
"__SCenter": "
|
|
70
|
-
"__SLabel": "
|
|
71
|
-
"_position_right": "
|
|
72
|
-
"_position_left": "
|
|
64
|
+
"__SBubble": "___SBubble_6qrbu_gg_",
|
|
65
|
+
"--duration": "--duration_6qrbu",
|
|
66
|
+
"_color": "__color_6qrbu_gg_",
|
|
67
|
+
"--color": "--color_6qrbu",
|
|
68
|
+
"_transparent": "__transparent_6qrbu_gg_",
|
|
69
|
+
"__SCenter": "___SCenter_6qrbu_gg_",
|
|
70
|
+
"__SLabel": "___SLabel_6qrbu_gg_",
|
|
71
|
+
"_position_right": "_position_right_6qrbu_gg_",
|
|
72
|
+
"_position_left": "_position_left_6qrbu_gg_"
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
var BubbleRoot = /*#__PURE__*/function (_Component) {
|
package/lib/cjs/Donut.js
CHANGED
|
@@ -53,10 +53,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
53
53
|
|
|
54
54
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
55
55
|
|
|
56
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
57
|
-
|
|
58
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
59
|
-
|
|
60
56
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
61
57
|
|
|
62
58
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -66,97 +62,79 @@ var style = (
|
|
|
66
62
|
/*__reshadow_css_start__*/
|
|
67
63
|
_core.sstyled.insert(
|
|
68
64
|
/*__inner_css_start__*/
|
|
69
|
-
".
|
|
65
|
+
".___SPie_1gk9a_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,#2bb3ff)}.___SPie_1gk9a_gg_.__color_1gk9a_gg_{fill:var(--color_1gk9a)}.___SPie_1gk9a_gg_.__transparent_1gk9a_gg_{opacity:.3}.___SEmptyData_1gk9a_gg_{fill:var(--intergalactic-chart-palette-order-null,#e0e1e9)}.___SEmptyData_1gk9a_gg_.__color_1gk9a_gg_{fill:var(--color_1gk9a)}.___SLabel_1gk9a_gg_{text-anchor:middle;vertical-anchor:middle}"
|
|
70
66
|
/*__inner_css_end__*/
|
|
71
|
-
, "
|
|
67
|
+
, "1gk9a_gg_")
|
|
72
68
|
/*__reshadow_css_end__*/
|
|
73
69
|
, {
|
|
74
|
-
"__SPie": "
|
|
75
|
-
"_color": "
|
|
76
|
-
"--color": "--
|
|
77
|
-
"_transparent": "
|
|
78
|
-
"__SEmptyData": "
|
|
79
|
-
"__SLabel": "
|
|
70
|
+
"__SPie": "___SPie_1gk9a_gg_",
|
|
71
|
+
"_color": "__color_1gk9a_gg_",
|
|
72
|
+
"--color": "--color_1gk9a",
|
|
73
|
+
"_transparent": "__transparent_1gk9a_gg_",
|
|
74
|
+
"__SEmptyData": "___SEmptyData_1gk9a_gg_",
|
|
75
|
+
"__SLabel": "___SLabel_1gk9a_gg_"
|
|
80
76
|
});
|
|
81
77
|
var DEFAULT_INSTANCE = Symbol('DEFAULT_INSTANCE');
|
|
82
78
|
|
|
83
|
-
function
|
|
84
|
-
var
|
|
79
|
+
function transitionAnglePie(_ref4) {
|
|
80
|
+
var selector = _ref4.selector,
|
|
81
|
+
duration = _ref4.duration,
|
|
82
|
+
halfsize = _ref4.halfsize,
|
|
85
83
|
d3Arc = _ref4.d3Arc,
|
|
86
84
|
d3ArcOut = _ref4.d3ArcOut,
|
|
87
85
|
arcs = _ref4.arcs,
|
|
88
86
|
activeIndexPie = _ref4.activeIndexPie;
|
|
89
|
-
return function (_, ind) {
|
|
90
|
-
|
|
91
|
-
if (!d) return function () {
|
|
87
|
+
return (0, _d3Transition.transition)().selection().selectAll(selector).interrupt().transition().duration(duration).attrTween('d', function (_, ind) {
|
|
88
|
+
if (!arcs[ind]) return function () {
|
|
92
89
|
return '';
|
|
93
90
|
};
|
|
94
|
-
var
|
|
95
|
-
var
|
|
91
|
+
var d = Object.assign({}, arcs[ind]);
|
|
92
|
+
var self = this;
|
|
93
|
+
var initAngle = halfsize ? -Math.PI / 2 : 0;
|
|
94
|
+
var prevStartAngle = initAngle;
|
|
95
|
+
var prevEndAngle = initAngle;
|
|
96
|
+
|
|
97
|
+
if (self.arc) {
|
|
98
|
+
prevStartAngle = self.arc.startAngle;
|
|
99
|
+
prevEndAngle = self.arc.endAngle;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var iStartAngle = (0, _d3Interpolate.interpolate)(prevStartAngle, d.startAngle);
|
|
103
|
+
var iEndAngle = (0, _d3Interpolate.interpolate)(prevEndAngle, d.endAngle);
|
|
96
104
|
return function (t) {
|
|
97
|
-
d.startAngle =
|
|
98
|
-
d.endAngle =
|
|
99
|
-
|
|
105
|
+
d.startAngle = iStartAngle(t);
|
|
106
|
+
d.endAngle = iEndAngle(t);
|
|
107
|
+
self.arc = d;
|
|
108
|
+
return ind === activeIndexPie ? d3ArcOut(self.arc) : d3Arc(self.arc);
|
|
100
109
|
};
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function animationUpdatePie(_ref5) {
|
|
105
|
-
var halfsize = _ref5.halfsize,
|
|
106
|
-
arcs = _ref5.arcs,
|
|
107
|
-
d3Arc = _ref5.d3Arc;
|
|
108
|
-
return function (_, ind) {
|
|
109
|
-
var d = arcs[ind];
|
|
110
|
-
|
|
111
|
-
if (this._current) {
|
|
112
|
-
var i = (0, _d3Interpolate.interpolate)(this._current, d);
|
|
113
|
-
this._current = i(0);
|
|
114
|
-
return function (t) {
|
|
115
|
-
return d3Arc(i(t));
|
|
116
|
-
};
|
|
117
|
-
} else {
|
|
118
|
-
this._current = d;
|
|
119
|
-
return animationInitialPie({
|
|
120
|
-
halfsize: halfsize,
|
|
121
|
-
arcs: arcs,
|
|
122
|
-
d3Arc: d3Arc
|
|
123
|
-
})(_, ind);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
110
|
+
});
|
|
126
111
|
}
|
|
127
112
|
|
|
128
|
-
function
|
|
129
|
-
var
|
|
130
|
-
selector =
|
|
131
|
-
duration =
|
|
132
|
-
innerRadius =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
var
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
var i = (0, _d3Interpolate.interpolate)(min, max);
|
|
146
|
-
return function (t) {
|
|
147
|
-
var d3ArcOut = (0, _d3Shape.arc)().innerRadius(innerRadius).outerRadius(i(t));
|
|
148
|
-
return d3ArcOut(d);
|
|
149
|
-
};
|
|
150
|
-
});
|
|
151
|
-
}
|
|
113
|
+
function transitionRadiusPie(_ref5) {
|
|
114
|
+
var data = _ref5.data,
|
|
115
|
+
selector = _ref5.selector,
|
|
116
|
+
duration = _ref5.duration,
|
|
117
|
+
innerRadius = _ref5.innerRadius,
|
|
118
|
+
outerRadiusMinMax = _ref5.outerRadiusMinMax;
|
|
119
|
+
return (0, _d3Transition.transition)().selection().select(selector).interrupt().transition(t).duration(duration).attrTween('d', function () {
|
|
120
|
+
var _outerRadiusMinMax = (0, _slicedToArray2["default"])(outerRadiusMinMax, 2),
|
|
121
|
+
min = _outerRadiusMinMax[0],
|
|
122
|
+
max = _outerRadiusMinMax[1];
|
|
123
|
+
|
|
124
|
+
var iOuterRadius = (0, _d3Interpolate.interpolate)(min, max);
|
|
125
|
+
return function (t) {
|
|
126
|
+
var d3ArcOut = (0, _d3Shape.arc)().innerRadius(innerRadius).outerRadius(iOuterRadius(t));
|
|
127
|
+
return d3ArcOut(data);
|
|
128
|
+
};
|
|
129
|
+
});
|
|
152
130
|
}
|
|
153
131
|
|
|
154
132
|
var increaseFactor = 8;
|
|
155
133
|
|
|
156
|
-
function getOuterRadius(
|
|
157
|
-
var size =
|
|
158
|
-
halfsize =
|
|
159
|
-
outerRadius =
|
|
134
|
+
function getOuterRadius(_ref6) {
|
|
135
|
+
var size = _ref6.size,
|
|
136
|
+
halfsize = _ref6.halfsize,
|
|
137
|
+
outerRadius = _ref6.outerRadius;
|
|
160
138
|
|
|
161
139
|
var _size = (0, _slicedToArray2["default"])(size, 2),
|
|
162
140
|
width = _size[0],
|
|
@@ -183,37 +161,68 @@ var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
|
183
161
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
184
162
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "virtualElement", (0, _canUseDOM["default"])() ? document.createElement('div') : {});
|
|
185
163
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "activeIndexPie", undefined);
|
|
164
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "canAnimatedHover", false);
|
|
186
165
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "bindHandlerTooltip", function (visible, props) {
|
|
187
|
-
return function (
|
|
188
|
-
var x =
|
|
189
|
-
y =
|
|
166
|
+
return function (_ref7) {
|
|
167
|
+
var x = _ref7.clientX,
|
|
168
|
+
y = _ref7.clientY;
|
|
190
169
|
var eventEmitter = _this.asProps.eventEmitter;
|
|
191
170
|
_this.virtualElement.getBoundingClientRect = _this.generateGetBoundingClientRect(x, y);
|
|
192
171
|
_this.virtualElement[_utils.CONSTANT.VIRTUAL_ELEMENT] = true;
|
|
193
172
|
eventEmitter.emit('onTooltipVisible', visible, props, _this.virtualElement);
|
|
194
173
|
};
|
|
195
174
|
});
|
|
196
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "animationActivePie", function (
|
|
175
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "animationActivePie", function (_ref8) {
|
|
176
|
+
var data = _ref8.data,
|
|
177
|
+
active = _ref8.active,
|
|
178
|
+
selector = _ref8.selector;
|
|
197
179
|
var _this$asProps = _this.asProps,
|
|
198
180
|
duration = _this$asProps.duration,
|
|
199
|
-
innerRadius = _this$asProps.innerRadius
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
var outerRadius = getOuterRadius(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
duration: duration === 0 ? 0 : 300,
|
|
208
|
-
innerRadius: innerRadius,
|
|
209
|
-
outerRadius: [outerRadius, outerRadius + increaseFactor]
|
|
210
|
-
}) : animationHoverPie({
|
|
211
|
-
d: data,
|
|
212
|
-
selector: "#".concat(_this.id, " ").concat(selector),
|
|
213
|
-
duration: duration === 0 ? 0 : 300,
|
|
214
|
-
innerRadius: innerRadius,
|
|
215
|
-
outerRadius: [outerRadius + increaseFactor, outerRadius]
|
|
181
|
+
innerRadius = _this$asProps.innerRadius,
|
|
182
|
+
_outerRadius = _this$asProps.outerRadius,
|
|
183
|
+
size = _this$asProps.size,
|
|
184
|
+
halfsize = _this$asProps.halfsize;
|
|
185
|
+
var outerRadius = getOuterRadius({
|
|
186
|
+
size: size,
|
|
187
|
+
halfsize: halfsize,
|
|
188
|
+
outerRadius: _outerRadius
|
|
216
189
|
});
|
|
190
|
+
|
|
191
|
+
if (_this.canAnimatedHover) {
|
|
192
|
+
if (duration > 0) {
|
|
193
|
+
transitionRadiusPie({
|
|
194
|
+
data: data,
|
|
195
|
+
selector: "#".concat(_this.id, " ").concat(selector),
|
|
196
|
+
duration: duration === 0 ? 0 : 300,
|
|
197
|
+
innerRadius: innerRadius,
|
|
198
|
+
outerRadiusMinMax: active ? [outerRadius, outerRadius + increaseFactor] : [outerRadius + increaseFactor, outerRadius]
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "animationUpdatePie", function () {
|
|
204
|
+
var _this$asProps2 = _this.asProps,
|
|
205
|
+
duration = _this$asProps2.duration,
|
|
206
|
+
d3Arc = _this$asProps2.d3Arc,
|
|
207
|
+
halfsize = _this$asProps2.halfsize,
|
|
208
|
+
d3ArcOut = _this$asProps2.d3ArcOut;
|
|
209
|
+
_this.canAnimatedHover = false;
|
|
210
|
+
|
|
211
|
+
if (duration > 0) {
|
|
212
|
+
transitionAnglePie({
|
|
213
|
+
selector: "#".concat(_this.id, " [data-ui-name=\"Donut.Pie\"]"),
|
|
214
|
+
duration: duration,
|
|
215
|
+
arcs: _this.arcs,
|
|
216
|
+
halfsize: halfsize,
|
|
217
|
+
d3Arc: d3Arc,
|
|
218
|
+
d3ArcOut: d3ArcOut,
|
|
219
|
+
activeIndexPie: _this.activeIndexPie
|
|
220
|
+
}).on('end', function () {
|
|
221
|
+
_this.canAnimatedHover = true;
|
|
222
|
+
});
|
|
223
|
+
} else {
|
|
224
|
+
_this.canAnimatedHover = true;
|
|
225
|
+
}
|
|
217
226
|
});
|
|
218
227
|
return _this;
|
|
219
228
|
}
|
|
@@ -221,9 +230,9 @@ var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
|
221
230
|
(0, _createClass2["default"])(DonutRoot, [{
|
|
222
231
|
key: "id",
|
|
223
232
|
get: function get() {
|
|
224
|
-
var _this$
|
|
225
|
-
uid = _this$
|
|
226
|
-
id = _this$
|
|
233
|
+
var _this$asProps3 = this.asProps,
|
|
234
|
+
uid = _this$asProps3.uid,
|
|
235
|
+
id = _this$asProps3.id;
|
|
227
236
|
return id || uid;
|
|
228
237
|
}
|
|
229
238
|
}, {
|
|
@@ -245,10 +254,10 @@ var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
|
245
254
|
}, {
|
|
246
255
|
key: "getArcs",
|
|
247
256
|
value: function getArcs() {
|
|
248
|
-
var _this$
|
|
249
|
-
Children = _this$
|
|
250
|
-
data = _this$
|
|
251
|
-
d3Pie = _this$
|
|
257
|
+
var _this$asProps4 = this.asProps,
|
|
258
|
+
Children = _this$asProps4.Children,
|
|
259
|
+
data = _this$asProps4.data,
|
|
260
|
+
d3Pie = _this$asProps4.d3Pie;
|
|
252
261
|
var pieData = Object.entries(data);
|
|
253
262
|
|
|
254
263
|
if (d3Pie[DEFAULT_INSTANCE]) {
|
|
@@ -291,9 +300,9 @@ var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
|
291
300
|
value: function getPieProps(props, ind) {
|
|
292
301
|
var _this2 = this;
|
|
293
302
|
|
|
294
|
-
var _this$
|
|
295
|
-
d3Arc = _this$
|
|
296
|
-
d3ArcOut = _this$
|
|
303
|
+
var _this$asProps5 = this.asProps,
|
|
304
|
+
d3Arc = _this$asProps5.d3Arc,
|
|
305
|
+
d3ArcOut = _this$asProps5.d3ArcOut;
|
|
297
306
|
var active = props.active;
|
|
298
307
|
var data = this.arcs.find(function (arc) {
|
|
299
308
|
return arc.data[0] === props.dataKey;
|
|
@@ -311,18 +320,22 @@ var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
|
311
320
|
onMouseMove: this.bindHandlerTooltip(true, props),
|
|
312
321
|
onMouseLeave: this.bindHandlerTooltip(false, props),
|
|
313
322
|
onMouseOver: function onMouseOver(e) {
|
|
314
|
-
!active
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
323
|
+
if (!active) {
|
|
324
|
+
_this2.animationActivePie({
|
|
325
|
+
active: true,
|
|
326
|
+
data: data,
|
|
327
|
+
selector: "[d=\"".concat(e.target.getAttribute('d'), "\"]")
|
|
328
|
+
});
|
|
329
|
+
}
|
|
319
330
|
},
|
|
320
331
|
onMouseOut: function onMouseOut(e) {
|
|
321
|
-
!active
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
332
|
+
if (!active) {
|
|
333
|
+
_this2.animationActivePie({
|
|
334
|
+
active: false,
|
|
335
|
+
data: data,
|
|
336
|
+
selector: "[d=\"".concat(e.target.getAttribute('d'), "\"]")
|
|
337
|
+
});
|
|
338
|
+
}
|
|
326
339
|
}
|
|
327
340
|
};
|
|
328
341
|
}
|
|
@@ -337,49 +350,23 @@ var DonutRoot = /*#__PURE__*/function (_Component) {
|
|
|
337
350
|
}, {
|
|
338
351
|
key: "componentDidUpdate",
|
|
339
352
|
value: function componentDidUpdate(prevProps) {
|
|
340
|
-
var
|
|
341
|
-
data = _this$asProps5.data,
|
|
342
|
-
duration = _this$asProps5.duration,
|
|
343
|
-
d3Arc = _this$asProps5.d3Arc,
|
|
344
|
-
halfsize = _this$asProps5.halfsize;
|
|
345
|
-
var arcs = this.arcs;
|
|
353
|
+
var data = this.asProps.data;
|
|
346
354
|
|
|
347
|
-
if (prevProps.$rootProps.data !== data
|
|
348
|
-
|
|
349
|
-
d3Arc: d3Arc,
|
|
350
|
-
arcs: arcs,
|
|
351
|
-
halfsize: halfsize
|
|
352
|
-
}));
|
|
355
|
+
if (prevProps.$rootProps.data !== data) {
|
|
356
|
+
this.animationUpdatePie();
|
|
353
357
|
}
|
|
354
358
|
}
|
|
355
359
|
}, {
|
|
356
360
|
key: "componentDidMount",
|
|
357
361
|
value: function componentDidMount() {
|
|
358
|
-
|
|
359
|
-
duration = _this$asProps6.duration,
|
|
360
|
-
d3Arc = _this$asProps6.d3Arc,
|
|
361
|
-
halfsize = _this$asProps6.halfsize,
|
|
362
|
-
d3ArcOut = _this$asProps6.d3ArcOut;
|
|
363
|
-
var arcs = this.arcs;
|
|
364
|
-
|
|
365
|
-
if (duration > 0) {
|
|
366
|
-
(0, _d3Transition.transition)().selection().selectAll("#".concat(this.id, " [data-ui-name=\"Donut.Pie\"]")).each(function (_, ind) {
|
|
367
|
-
this._current = arcs[ind];
|
|
368
|
-
}).transition().duration(duration).attrTween('d', animationInitialPie({
|
|
369
|
-
halfsize: halfsize,
|
|
370
|
-
d3Arc: d3Arc,
|
|
371
|
-
d3ArcOut: d3ArcOut,
|
|
372
|
-
arcs: arcs,
|
|
373
|
-
activeIndexPie: this.activeIndexPie
|
|
374
|
-
}));
|
|
375
|
-
}
|
|
362
|
+
this.animationUpdatePie();
|
|
376
363
|
}
|
|
377
364
|
}, {
|
|
378
365
|
key: "render",
|
|
379
366
|
value: function render() {
|
|
380
|
-
var _this$
|
|
381
|
-
halfsize = _this$
|
|
382
|
-
size = _this$
|
|
367
|
+
var _this$asProps6 = this.asProps,
|
|
368
|
+
halfsize = _this$asProps6.halfsize,
|
|
369
|
+
size = _this$asProps6.size;
|
|
383
370
|
this.asProps.dataHintsHandler.establishDataType('values-set');
|
|
384
371
|
|
|
385
372
|
var _size2 = (0, _slicedToArray2["default"])(size, 2),
|
|
@@ -471,17 +458,17 @@ function Pie(_ref15) {
|
|
|
471
458
|
}
|
|
472
459
|
|
|
473
460
|
if (active !== undefined && active !== null) {
|
|
474
|
-
$animationActivePie(
|
|
461
|
+
$animationActivePie({
|
|
475
462
|
active: active,
|
|
476
463
|
data: data,
|
|
477
464
|
selector: "[name=\"".concat(other.name, "\"]")
|
|
478
|
-
})
|
|
465
|
+
});
|
|
479
466
|
}
|
|
480
467
|
}, [active]);
|
|
481
468
|
dataHintsHandler.establishDataType('values-set');
|
|
482
469
|
dataHintsHandler.describeValueEntity(dataKey, name);
|
|
483
470
|
return _ref = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SPie, _ref.cn("SPie", {
|
|
484
|
-
"render":
|
|
471
|
+
"render": 'path',
|
|
485
472
|
"color": color,
|
|
486
473
|
"d": active ? d3ArcOut(data) : d3Arc(data),
|
|
487
474
|
"transparent": transparent
|
|
@@ -496,7 +483,7 @@ function EmptyData(_ref16) {
|
|
|
496
483
|
d3Arc = _ref16.d3Arc,
|
|
497
484
|
color = _ref16.color;
|
|
498
485
|
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SEmptyData, _ref2.cn("SEmptyData", {
|
|
499
|
-
"render":
|
|
486
|
+
"render": 'path',
|
|
500
487
|
"color": color,
|
|
501
488
|
"d": d3Arc({
|
|
502
489
|
endAngle: Math.PI * 2,
|
|
@@ -515,9 +502,9 @@ function Label(_ref17) {
|
|
|
515
502
|
dataHintsHandler = _ref17.dataHintsHandler;
|
|
516
503
|
dataHintsHandler.setTitle('vertical', children);
|
|
517
504
|
return _ref3 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SLabel, _ref3.cn("SLabel", {
|
|
518
|
-
"render":
|
|
519
|
-
"x":
|
|
520
|
-
"y":
|
|
505
|
+
"render": 'text',
|
|
506
|
+
"x": '0',
|
|
507
|
+
"y": '0',
|
|
521
508
|
"aria-hidden": true
|
|
522
509
|
}), /*#__PURE__*/_react["default"].createElement(Children, _ref3.cn("Children", {})));
|
|
523
510
|
}
|