@elastic/charts 46.1.0 → 46.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/chart_types/flame_chart/flame_api.d.ts +52 -0
  3. package/dist/chart_types/flame_chart/flame_api.d.ts.map +1 -0
  4. package/dist/chart_types/flame_chart/flame_api.js +34 -0
  5. package/dist/chart_types/flame_chart/flame_api.js.map +1 -0
  6. package/dist/chart_types/flame_chart/flame_chart.d.ts +2 -0
  7. package/dist/chart_types/flame_chart/flame_chart.d.ts.map +1 -0
  8. package/dist/chart_types/flame_chart/flame_chart.js +701 -0
  9. package/dist/chart_types/flame_chart/flame_chart.js.map +1 -0
  10. package/dist/chart_types/flame_chart/internal_chart_state.d.ts +2 -0
  11. package/dist/chart_types/flame_chart/internal_chart_state.d.ts.map +1 -0
  12. package/dist/chart_types/flame_chart/internal_chart_state.js +33 -0
  13. package/dist/chart_types/flame_chart/internal_chart_state.js.map +1 -0
  14. package/dist/chart_types/flame_chart/render/common.d.ts +2 -0
  15. package/dist/chart_types/flame_chart/render/common.d.ts.map +1 -0
  16. package/dist/chart_types/flame_chart/render/common.js +11 -0
  17. package/dist/chart_types/flame_chart/render/common.js.map +1 -0
  18. package/dist/chart_types/flame_chart/render/draw_a_frame.d.ts +2 -0
  19. package/dist/chart_types/flame_chart/render/draw_a_frame.d.ts.map +1 -0
  20. package/dist/chart_types/flame_chart/render/draw_a_frame.js +61 -0
  21. package/dist/chart_types/flame_chart/render/draw_a_frame.js.map +1 -0
  22. package/dist/chart_types/flame_chart/render/draw_canvas.d.ts +2 -0
  23. package/dist/chart_types/flame_chart/render/draw_canvas.d.ts.map +1 -0
  24. package/dist/chart_types/flame_chart/render/draw_canvas.js +115 -0
  25. package/dist/chart_types/flame_chart/render/draw_canvas.js.map +1 -0
  26. package/dist/chart_types/flame_chart/render/draw_webgl.d.ts +2 -0
  27. package/dist/chart_types/flame_chart/render/draw_webgl.d.ts.map +1 -0
  28. package/dist/chart_types/flame_chart/render/draw_webgl.js +42 -0
  29. package/dist/chart_types/flame_chart/render/draw_webgl.js.map +1 -0
  30. package/dist/chart_types/flame_chart/render/ensure_webgl.d.ts +2 -0
  31. package/dist/chart_types/flame_chart/render/ensure_webgl.d.ts.map +1 -0
  32. package/dist/chart_types/flame_chart/render/ensure_webgl.js +34 -0
  33. package/dist/chart_types/flame_chart/render/ensure_webgl.js.map +1 -0
  34. package/dist/chart_types/flame_chart/shaders.d.ts +2 -0
  35. package/dist/chart_types/flame_chart/shaders.d.ts.map +1 -0
  36. package/dist/chart_types/flame_chart/shaders.js +14 -0
  37. package/dist/chart_types/flame_chart/shaders.js.map +1 -0
  38. package/dist/chart_types/flame_chart/types.d.ts +2 -0
  39. package/dist/chart_types/flame_chart/types.d.ts.map +1 -0
  40. package/dist/chart_types/flame_chart/types.js +18 -0
  41. package/dist/chart_types/flame_chart/types.js.map +1 -0
  42. package/dist/chart_types/index.d.ts +1 -0
  43. package/dist/chart_types/index.d.ts.map +1 -1
  44. package/dist/chart_types/index.js +1 -0
  45. package/dist/chart_types/index.js.map +1 -1
  46. package/dist/chart_types/partition_chart/layout/types/config_types.d.ts +1 -9
  47. package/dist/chart_types/partition_chart/layout/types/config_types.d.ts.map +1 -1
  48. package/dist/chart_types/partition_chart/layout/types/viewmodel_types.d.ts.map +1 -1
  49. package/dist/chart_types/partition_chart/layout/types/viewmodel_types.js.map +1 -1
  50. package/dist/chart_types/partition_chart/layout/viewmodel/picked_shapes.js.map +1 -1
  51. package/dist/chart_types/partition_chart/renderer/dom/highlighter.js +1 -2
  52. package/dist/chart_types/partition_chart/renderer/dom/highlighter.js.map +1 -1
  53. package/dist/chart_types/partition_chart/specs/index.d.ts +4 -3
  54. package/dist/chart_types/partition_chart/specs/index.d.ts.map +1 -1
  55. package/dist/chart_types/partition_chart/specs/index.js.map +1 -1
  56. package/dist/chart_types/partition_chart/state/selectors/geometries.js.map +1 -1
  57. package/dist/chart_types/xy_chart/renderer/canvas/animations/index.js +1 -1
  58. package/dist/chart_types/xy_chart/renderer/canvas/animations/index.js.map +1 -1
  59. package/dist/common/animation.d.ts +9 -0
  60. package/dist/common/animation.d.ts.map +1 -0
  61. package/dist/common/animation.js +3 -0
  62. package/dist/common/animation.js.map +1 -0
  63. package/dist/common/event_handler_selectors.js +3 -7
  64. package/dist/common/event_handler_selectors.js.map +1 -1
  65. package/dist/common/kingly.d.ts +2 -0
  66. package/dist/common/kingly.d.ts.map +1 -0
  67. package/dist/common/kingly.js +481 -0
  68. package/dist/common/kingly.js.map +1 -0
  69. package/dist/common/webgl_constants.d.ts +2 -0
  70. package/dist/common/webgl_constants.d.ts.map +1 -0
  71. package/dist/common/webgl_constants.js +559 -0
  72. package/dist/common/webgl_constants.js.map +1 -0
  73. package/dist/components/chart_container.js +2 -2
  74. package/dist/components/chart_container.js.map +1 -1
  75. package/dist/components/chart_resizer.js +2 -4
  76. package/dist/components/chart_resizer.js.map +1 -1
  77. package/dist/components/tooltip/tooltip.js +17 -18
  78. package/dist/components/tooltip/tooltip.js.map +1 -1
  79. package/dist/index.d.ts +2 -0
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +1 -0
  82. package/dist/index.js.map +1 -1
  83. package/dist/specs/constants.d.ts +1 -1
  84. package/dist/specs/settings.d.ts +11 -2
  85. package/dist/specs/settings.d.ts.map +1 -1
  86. package/dist/specs/settings.js.map +1 -1
  87. package/dist/state/chart_state.js +2 -0
  88. package/dist/state/chart_state.js.map +1 -1
  89. package/dist/state/reducers/interactions.js +20 -21
  90. package/dist/state/reducers/interactions.js.map +1 -1
  91. package/dist/state/selectors/get_chart_container_dimensions.js +15 -17
  92. package/dist/state/selectors/get_chart_container_dimensions.js.map +1 -1
  93. package/dist/theme.scss +1 -0
  94. package/dist/theme_dark.css +1 -1
  95. package/dist/theme_dark.css.map +1 -1
  96. package/dist/theme_light.css +1 -1
  97. package/dist/theme_light.css.map +1 -1
  98. package/dist/theme_only_dark.css +1 -1
  99. package/dist/theme_only_dark.css.map +1 -1
  100. package/dist/theme_only_light.css +1 -1
  101. package/dist/theme_only_light.css.map +1 -1
  102. package/package.json +1 -1
@@ -0,0 +1,701 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
29
+ if (k2 === undefined) k2 = k;
30
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
31
+ }) : (function(o, m, k, k2) {
32
+ if (k2 === undefined) k2 = k;
33
+ o[k2] = m[k];
34
+ }));
35
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
36
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
37
+ }) : function(o, v) {
38
+ o["default"] = v;
39
+ });
40
+ var __importStar = (this && this.__importStar) || function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.FlameWithTooltip = void 0;
49
+ var react_1 = __importStar(require("react"));
50
+ var react_redux_1 = require("react-redux");
51
+ var redux_1 = require("redux");
52
+ var __1 = require("..");
53
+ var constants_1 = require("../../common/constants");
54
+ var kingly_1 = require("../../common/kingly");
55
+ var tooltip_1 = require("../../components/tooltip/tooltip");
56
+ var specs_1 = require("../../specs");
57
+ var chart_1 = require("../../state/actions/chart");
58
+ var mouse_1 = require("../../state/actions/mouse");
59
+ var get_accessibility_config_1 = require("../../state/selectors/get_accessibility_config");
60
+ var get_settings_specs_1 = require("../../state/selectors/get_settings_specs");
61
+ var utils_1 = require("../../state/utils");
62
+ var common_1 = require("../../utils/common");
63
+ var common_2 = require("./render/common");
64
+ var draw_a_frame_1 = require("./render/draw_a_frame");
65
+ var ensure_webgl_1 = require("./render/ensure_webgl");
66
+ var shaders_1 = require("./shaders");
67
+ var types_1 = require("./types");
68
+ var PINCH_ZOOM_CHECK_INTERVAL_MS = 100;
69
+ var SIDE_OVERSHOOT_RATIO = 0.05;
70
+ var RECURRENCE_ALPHA_PER_MS_X = 0.01;
71
+ var RECURRENCE_ALPHA_PER_MS_Y = 0.0062;
72
+ var SINGLE_CLICK_EMPTY_FOCUS = true;
73
+ var IS_META_REQUIRED_FOR_ZOOM = false;
74
+ var ZOOM_SPEED = 0.0015;
75
+ var DEEPEST_ZOOM_RATIO = 1e-7;
76
+ var ZOOM_FROM_EDGE_BAND = 16;
77
+ var ZOOM_FROM_EDGE_BAND_LEFT = ZOOM_FROM_EDGE_BAND + draw_a_frame_1.PADDING_LEFT;
78
+ var ZOOM_FROM_EDGE_BAND_RIGHT = ZOOM_FROM_EDGE_BAND + draw_a_frame_1.PADDING_RIGHT;
79
+ var ZOOM_FROM_EDGE_BAND_TOP = ZOOM_FROM_EDGE_BAND + draw_a_frame_1.PADDING_TOP;
80
+ var ZOOM_FROM_EDGE_BAND_BOTTOM = ZOOM_FROM_EDGE_BAND + draw_a_frame_1.PADDING_BOTTOM;
81
+ var LEFT_MOUSE_BUTTON = 1;
82
+ var MINIMAP_SIZE_RATIO_X = 3;
83
+ var MINIMAP_SIZE_RATIO_Y = 3;
84
+ var unitRowPitch = function (position) { return (position.length >= 4 ? position[1] - position[3] : 1); };
85
+ var initialPixelRowPitch = function () { return 16; };
86
+ var specValueFormatter = function (d) { return d; };
87
+ var browserRootWindow = function () {
88
+ var rootWindow = window;
89
+ while (window.parent && window.parent.window !== rootWindow)
90
+ rootWindow = rootWindow.parent.window;
91
+ return rootWindow;
92
+ };
93
+ var columnToRowPositions = function (_a, i) {
94
+ var position1 = _a.position1, size1 = _a.size1;
95
+ return ({
96
+ x0: position1[i * 2],
97
+ x1: position1[i * 2] + size1[i],
98
+ y0: position1[i * 2 + 1],
99
+ y1: position1[i * 2 + 1] + unitRowPitch(position1),
100
+ });
101
+ };
102
+ var focusForArea = function (chartHeight, _a) {
103
+ var x0 = _a.x0, x1 = _a.x1, y0 = _a.y0, y1 = _a.y1;
104
+ var sideOvershoot = SIDE_OVERSHOOT_RATIO * (x1 - x0);
105
+ var unitHeight = (chartHeight / initialPixelRowPitch()) * (y1 - y0);
106
+ var intendedY0 = y1 - unitHeight;
107
+ var bottomOvershoot = Math.max(0, -intendedY0);
108
+ var top = Math.min(1, y1 + bottomOvershoot);
109
+ return {
110
+ x0: Math.max(0, x0 - sideOvershoot),
111
+ x1: Math.min(1, x1 + sideOvershoot),
112
+ y0: Math.max(0, intendedY0),
113
+ y1: Math.min(1, top),
114
+ };
115
+ };
116
+ var focusRect = function (columnarViewModel, chartHeight, drilldownDatumIndex, drilldownTimestamp) { return (__assign({ timestamp: drilldownTimestamp }, focusForArea(chartHeight, columnToRowPositions(columnarViewModel, drilldownDatumIndex || 0)))); };
117
+ var getColor = function (c, i) {
118
+ var r = Math.round(255 * c[4 * i]);
119
+ var g = Math.round(255 * c[4 * i + 1]);
120
+ var b = Math.round(255 * c[4 * i + 2]);
121
+ var a = c[4 * i + 3];
122
+ return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
123
+ };
124
+ var colorToDatumIndex = function (pixel) {
125
+ var isEmptyArea = pixel[0] + pixel[1] + pixel[2] + pixel[3] < shaders_1.GEOM_INDEX_OFFSET;
126
+ return isEmptyArea ? NaN : pixel[3] + 256 * (pixel[2] + 256 * (pixel[1] + 256 * pixel[0])) - shaders_1.GEOM_INDEX_OFFSET;
127
+ };
128
+ var getRegExp = function (searchString) {
129
+ var regex;
130
+ try {
131
+ regex = new RegExp(searchString);
132
+ }
133
+ catch (_a) {
134
+ return new RegExp('iIUiUYIuiGjhG678987gjhgfytr678576');
135
+ }
136
+ return regex;
137
+ };
138
+ var FlameComponent = (function (_super) {
139
+ __extends(FlameComponent, _super);
140
+ function FlameComponent(props) {
141
+ var _this = _super.call(this, props) || this;
142
+ _this.startOfDragX = NaN;
143
+ _this.startOfDragY = NaN;
144
+ _this.startOfDragFocusLeft = NaN;
145
+ _this.startOfDragFocusTop = NaN;
146
+ _this.currentSearchString = '';
147
+ _this.currentSearchHitCount = 0;
148
+ _this.caseSensitive = false;
149
+ _this.useRegex = false;
150
+ _this.focusedMatchIndex = NaN;
151
+ _this.setupDevicePixelRatioChangeListener = function () {
152
+ window.matchMedia("(resolution: " + window.devicePixelRatio + "dppx)").addEventListener('change', function () {
153
+ _this.setState({});
154
+ _this.setupDevicePixelRatioChangeListener();
155
+ }, { once: true });
156
+ };
157
+ _this.setupViewportScaleChangeListener = function () {
158
+ window.clearInterval(_this.pinchZoomSetInterval);
159
+ _this.pinchZoomSetInterval = window.setInterval(function () {
160
+ var pinchZoomScale = browserRootWindow().visualViewport.scale;
161
+ if (pinchZoomScale !== _this.pinchZoomScale) {
162
+ _this.pinchZoomScale = pinchZoomScale;
163
+ _this.setState({});
164
+ }
165
+ }, PINCH_ZOOM_CHECK_INTERVAL_MS);
166
+ };
167
+ _this.componentDidMount = function () {
168
+ var _a;
169
+ _this.tryCanvasContext();
170
+ _this.drawCanvas();
171
+ _this.props.onChartRendered();
172
+ _this.setupDevicePixelRatioChangeListener();
173
+ (_a = _this.props.containerRef().current) === null || _a === void 0 ? void 0 : _a.addEventListener('wheel', _this.preventScroll, { passive: false });
174
+ };
175
+ _this.componentDidUpdate = function () {
176
+ if (!_this.ctx)
177
+ _this.tryCanvasContext();
178
+ _this.ensurePickTexture();
179
+ _this.drawCanvas();
180
+ };
181
+ _this.pointerInMinimap = function (x, y) {
182
+ return x === (0, common_1.clamp)(x, _this.getMinimapLeft(), _this.getMinimapLeft() + _this.getMinimapWidth()) &&
183
+ y === (0, common_1.clamp)(y, _this.getMinimapTop(), _this.getMinimapTop() + _this.getMinimapHeight());
184
+ };
185
+ _this.datumAtXY = function (x, y) {
186
+ return _this.glContext ? colorToDatumIndex((0, kingly_1.readPixel)(_this.glContext, x, y)) : NaN;
187
+ };
188
+ _this.getHoveredDatumIndex = function (e) {
189
+ var pr = window.devicePixelRatio * _this.pinchZoomScale;
190
+ return {
191
+ datumIndex: _this.datumAtXY(pr * _this.pointerX, pr * (_this.props.chartDimensions.height - _this.pointerY)),
192
+ timestamp: e.timeStamp,
193
+ };
194
+ };
195
+ _this.getDragDistanceX = function () { return _this.pointerX - _this.startOfDragX; };
196
+ _this.getDragDistanceY = function () { return -(_this.pointerY - _this.startOfDragY); };
197
+ _this.isDragging = function (_a) {
198
+ var buttons = _a.buttons;
199
+ return buttons & LEFT_MOUSE_BUTTON;
200
+ };
201
+ _this.handleMouseHoverMove = function (e) {
202
+ if (!_this.isDragging(e)) {
203
+ e.stopPropagation();
204
+ _this.updatePointerLocation(e);
205
+ if (_this.pointerInMinimap(_this.pointerX, _this.pointerY))
206
+ return;
207
+ var hovered = _this.getHoveredDatumIndex(e);
208
+ var prevHoverIndex = _this.hoverIndex >= 0 ? _this.hoverIndex : NaN;
209
+ if (hovered) {
210
+ _this.hoverIndex = hovered.datumIndex;
211
+ if (!Object.is(_this.hoverIndex, prevHoverIndex)) {
212
+ if (Number.isFinite(hovered.datumIndex)) {
213
+ _this.props.onElementOver([{ vmIndex: hovered.datumIndex }]);
214
+ }
215
+ else {
216
+ _this.hoverIndex = NaN;
217
+ _this.props.onElementOut();
218
+ }
219
+ }
220
+ _this.setState({});
221
+ }
222
+ }
223
+ };
224
+ _this.handleMouseDragMove = function (e) {
225
+ e.stopPropagation();
226
+ _this.updatePointerLocation(e);
227
+ if (_this.isDragging(e)) {
228
+ var dragInMinimap = _this.pointerInMinimap(_this.startOfDragX, _this.startOfDragY);
229
+ var focusMoveDirection = dragInMinimap ? 1 : -1;
230
+ var _a = _this.currentFocus, x0 = _a.x0, x1 = _a.x1, y0 = _a.y0, y1 = _a.y1;
231
+ var focusWidth = x1 - x0;
232
+ var focusHeight = y1 - y0;
233
+ if (Number.isNaN(_this.startOfDragFocusLeft))
234
+ _this.startOfDragFocusLeft = x0;
235
+ if (Number.isNaN(_this.startOfDragFocusTop))
236
+ _this.startOfDragFocusTop = y0;
237
+ var dragDistanceX = _this.getDragDistanceX();
238
+ var dragDistanceY = _this.getDragDistanceY();
239
+ var _b = _this.props.chartDimensions, chartWidth = _b.width, chartHeight = _b.height;
240
+ var focusChartWidth = chartWidth - draw_a_frame_1.PADDING_LEFT - draw_a_frame_1.PADDING_RIGHT;
241
+ var focusChartHeight = chartHeight - draw_a_frame_1.PADDING_TOP - draw_a_frame_1.PADDING_BOTTOM;
242
+ var dragSpeedX = (dragInMinimap ? MINIMAP_SIZE_RATIO_X / focusWidth : 1) / focusChartWidth;
243
+ var dragSpeedY = (dragInMinimap ? MINIMAP_SIZE_RATIO_Y / focusHeight : 1) / focusChartHeight;
244
+ var deltaIntentX = focusMoveDirection * dragDistanceX * dragSpeedX * focusWidth;
245
+ var deltaIntentY = focusMoveDirection * dragDistanceY * dragSpeedY * focusHeight;
246
+ var deltaCorrectionX = deltaIntentX > 0
247
+ ? Math.min(0, 1 - (_this.startOfDragFocusLeft + focusWidth + deltaIntentX))
248
+ : -Math.min(0, _this.startOfDragFocusLeft + deltaIntentX);
249
+ var deltaCorrectionY = deltaIntentY > 0
250
+ ? Math.min(0, 1 - (_this.startOfDragFocusTop + focusHeight + deltaIntentY))
251
+ : -Math.min(0, _this.startOfDragFocusTop + deltaIntentY);
252
+ var deltaX = deltaIntentX + deltaCorrectionX;
253
+ var deltaY = deltaIntentY + deltaCorrectionY;
254
+ var newX0 = (0, common_1.clamp)(_this.startOfDragFocusLeft + deltaX, 0, 1);
255
+ var newX1 = (0, common_1.clamp)(_this.startOfDragFocusLeft + focusWidth + deltaX, 0, 1);
256
+ var newY0 = (0, common_1.clamp)(_this.startOfDragFocusTop + deltaY, 0, 1);
257
+ var newY1 = (0, common_1.clamp)(_this.startOfDragFocusTop + focusHeight + deltaY, 0, 1);
258
+ var newFocus = { x0: newX0, x1: newX1, y0: newY0, y1: newY1, timestamp: e.timeStamp };
259
+ _this.currentFocus = newFocus;
260
+ _this.targetFocus = newFocus;
261
+ _this.smartDraw();
262
+ }
263
+ };
264
+ _this.clearDrag = function () {
265
+ _this.startOfDragX = NaN;
266
+ _this.startOfDragY = NaN;
267
+ _this.startOfDragFocusLeft = NaN;
268
+ _this.startOfDragFocusTop = NaN;
269
+ };
270
+ _this.resetDrag = function () {
271
+ _this.startOfDragX = _this.pointerX;
272
+ _this.startOfDragY = _this.pointerY;
273
+ };
274
+ _this.handleMouseDown = function (e) {
275
+ e.stopPropagation();
276
+ if (Number.isNaN(_this.pointerX + _this.pointerY))
277
+ return;
278
+ _this.resetDrag();
279
+ window.addEventListener('mousemove', _this.handleMouseDragMove, { passive: true });
280
+ window.addEventListener('mouseup', _this.handleMouseUp, { passive: true });
281
+ };
282
+ _this.handleMouseUp = function (e) {
283
+ e.stopPropagation();
284
+ window.removeEventListener('mousemove', _this.handleMouseDragMove);
285
+ window.removeEventListener('mouseup', _this.handleMouseUp);
286
+ _this.updatePointerLocation(e);
287
+ var dragDistanceX = _this.getDragDistanceX();
288
+ var dragDistanceY = _this.getDragDistanceY();
289
+ if (!dragDistanceX && !dragDistanceY) {
290
+ var hovered = _this.getHoveredDatumIndex(e);
291
+ var isDoubleClick = e.detail > 1;
292
+ var hasClickedOnRectangle = Number.isFinite(hovered === null || hovered === void 0 ? void 0 : hovered.datumIndex);
293
+ var mustFocus = SINGLE_CLICK_EMPTY_FOCUS || isDoubleClick !== hasClickedOnRectangle;
294
+ if (mustFocus && !_this.pointerInMinimap(_this.pointerX, _this.pointerY)) {
295
+ _this.targetFocus = focusRect(_this.props.columnarViewModel, _this.props.chartDimensions.height, hovered.datumIndex, hovered.timestamp);
296
+ _this.prevT = NaN;
297
+ _this.hoverIndex = NaN;
298
+ _this.setState({});
299
+ _this.props.onElementClick([{ vmIndex: hovered.datumIndex }]);
300
+ }
301
+ }
302
+ _this.clearDrag();
303
+ _this.setState({});
304
+ };
305
+ _this.handleMouseLeave = function (e) {
306
+ e.stopPropagation();
307
+ _this.smartDraw();
308
+ };
309
+ _this.preventScroll = function (e) { return e.metaKey === IS_META_REQUIRED_FOR_ZOOM && e.preventDefault(); };
310
+ _this.handleWheel = function (e) {
311
+ if (e.metaKey !== IS_META_REQUIRED_FOR_ZOOM)
312
+ return;
313
+ _this.updatePointerLocation(e);
314
+ var _a = _this.currentFocus, x0 = _a.x0, x1 = _a.x1, y0 = _a.y0, y1 = _a.y1;
315
+ var wheelDelta = -e.deltaY;
316
+ var delta = wheelDelta * ZOOM_SPEED;
317
+ var unitX = _this.pointerX / _this.props.chartDimensions.width;
318
+ var unitY = (_this.props.chartDimensions.height - _this.pointerY) / _this.props.chartDimensions.height;
319
+ var zoomOut = delta <= 0;
320
+ var midX = Math.abs(x0) < draw_a_frame_1.EPSILON && (zoomOut || _this.pointerX < ZOOM_FROM_EDGE_BAND_LEFT)
321
+ ? 0
322
+ : Math.abs(x1 - 1) < draw_a_frame_1.EPSILON &&
323
+ (zoomOut || _this.pointerX > _this.props.chartDimensions.width - ZOOM_FROM_EDGE_BAND_RIGHT)
324
+ ? 1
325
+ : (0, common_1.clamp)(x0 + unitX * Math.abs(x1 - x0), 0, 1);
326
+ var midY = Math.abs(y0) < draw_a_frame_1.EPSILON &&
327
+ (zoomOut || _this.pointerY > _this.props.chartDimensions.height - ZOOM_FROM_EDGE_BAND_BOTTOM)
328
+ ? 0
329
+ : Math.abs(y1 - 1) < draw_a_frame_1.EPSILON && (zoomOut || _this.pointerY < ZOOM_FROM_EDGE_BAND_TOP)
330
+ ? 1
331
+ : (0, common_1.clamp)(y0 + unitY * Math.abs(y1 - y0), 0, 1);
332
+ var targetX0 = (0, common_1.clamp)(x0 - delta * (x0 - midX), 0, 1);
333
+ var targetX1 = (0, common_1.clamp)(x1 + delta * (midX - x1), 0, 1);
334
+ var targetY0 = (0, common_1.clamp)(y0 - delta * (y0 - midY), 0, 1);
335
+ var targetY1 = (0, common_1.clamp)(y1 + delta * (midY - y1), 0, 1);
336
+ var newX0 = Math.min(targetX0, midX);
337
+ var newX1 = Math.max(targetX1, midX);
338
+ var newY0 = Math.min(targetY0, midY);
339
+ var newY1 = Math.max(targetY1, midY);
340
+ var xZoom = (e.ctrlKey || !e.altKey) && newX1 - newX0 >= DEEPEST_ZOOM_RATIO;
341
+ var yZoom = (e.ctrlKey || e.altKey) && newY1 - newY0 >= unitRowPitch(_this.props.columnarViewModel.position1);
342
+ if (xZoom || yZoom) {
343
+ var newFocus = {
344
+ x0: xZoom ? newX0 : x0,
345
+ x1: xZoom ? newX1 : x1,
346
+ y0: yZoom ? newY0 : y0,
347
+ y1: yZoom ? newY1 : y1,
348
+ timestamp: e.timeStamp,
349
+ };
350
+ _this.currentFocus = newFocus;
351
+ _this.targetFocus = newFocus;
352
+ }
353
+ _this.smartDraw();
354
+ };
355
+ _this.focusOnAllMatches = function () {
356
+ _this.currentSearchHitCount = 0;
357
+ var searchString = _this.currentSearchString;
358
+ var customizedSearchString = _this.caseSensitive ? searchString : searchString.toLowerCase();
359
+ var regex = _this.useRegex && getRegExp(searchString);
360
+ var columns = _this.props.columnarViewModel;
361
+ _this.currentColor = new Float32Array(columns.color);
362
+ var labels = columns.label;
363
+ var size = columns.size1;
364
+ var position = columns.position1;
365
+ var rowHeight = unitRowPitch(position);
366
+ var datumCount = labels.length;
367
+ var x0 = Infinity;
368
+ var x1 = -Infinity;
369
+ var y0 = Infinity;
370
+ var y1 = -Infinity;
371
+ for (var i = 0; i < datumCount; i++) {
372
+ var label = _this.caseSensitive ? labels[i] : labels[i].toLowerCase();
373
+ if (regex ? label.match(regex) : label.includes(customizedSearchString)) {
374
+ _this.currentSearchHitCount++;
375
+ x0 = Math.min(x0, position[2 * i]);
376
+ x1 = Math.max(x1, position[2 * i] + size[i]);
377
+ y0 = Math.min(y0, position[2 * i + 1]);
378
+ y1 = Math.max(y1, position[2 * i + 1] + rowHeight);
379
+ }
380
+ else {
381
+ _this.currentColor[4 * i + 3] *= 0.25;
382
+ }
383
+ }
384
+ if (Number.isFinite(x0)) {
385
+ Object.assign(_this.targetFocus, focusForArea(_this.props.chartDimensions.height, { x0: x0, x1: x1, y0: y0, y1: y1 }));
386
+ }
387
+ };
388
+ _this.searchForText = function (force) {
389
+ var input = _this.searchInputRef.current;
390
+ var searchString = input === null || input === void 0 ? void 0 : input.value;
391
+ if (!input || typeof searchString !== 'string' || (searchString === _this.currentSearchString && !force))
392
+ return;
393
+ _this.currentSearchString = searchString;
394
+ _this.focusOnAllMatches();
395
+ var colorSetter = _this.glResources.attributes.get('color');
396
+ if (_this.glContext && colorSetter) {
397
+ (0, ensure_webgl_1.uploadToWebgl)(_this.glContext, new Map([['color', colorSetter]]), { color: _this.currentColor });
398
+ }
399
+ _this.focusedMatchIndex = NaN;
400
+ _this.setState({});
401
+ };
402
+ _this.handleKeyPress = function (e) {
403
+ e.stopPropagation();
404
+ _this.searchForText(false);
405
+ };
406
+ _this.focusOnHit = function (timestamp) {
407
+ if (Number.isNaN(_this.focusedMatchIndex)) {
408
+ _this.focusOnAllMatches();
409
+ }
410
+ else {
411
+ var datumIndex = NaN;
412
+ var hitEnumerator = -1;
413
+ var searchString = _this.currentSearchString;
414
+ var customizedSearchString = _this.caseSensitive ? searchString : searchString.toLowerCase();
415
+ var regex = _this.useRegex && getRegExp(searchString);
416
+ var labels = _this.props.columnarViewModel.label;
417
+ for (var i = 0; i < labels.length; i++) {
418
+ var label = _this.caseSensitive ? labels[i] : labels[i].toLowerCase();
419
+ if (regex ? label.match(regex) : label.includes(customizedSearchString)) {
420
+ datumIndex = i;
421
+ hitEnumerator++;
422
+ if (hitEnumerator === _this.focusedMatchIndex)
423
+ break;
424
+ }
425
+ }
426
+ if (hitEnumerator >= 0) {
427
+ _this.targetFocus = focusRect(_this.props.columnarViewModel, _this.props.chartDimensions.height, datumIndex, timestamp);
428
+ _this.prevT = NaN;
429
+ _this.hoverIndex = NaN;
430
+ }
431
+ }
432
+ };
433
+ _this.render = function () {
434
+ var _a = _this.props, forwardStageRef = _a.forwardStageRef, _b = _a.chartDimensions, requestedWidth = _b.width, requestedHeight = _b.height, a11ySettings = _a.a11ySettings;
435
+ var width = (0, common_2.roundUpSize)(requestedWidth);
436
+ var height = (0, common_2.roundUpSize)(requestedHeight);
437
+ var style = {
438
+ width: width,
439
+ height: height,
440
+ top: 0,
441
+ left: 0,
442
+ padding: 0,
443
+ margin: 0,
444
+ border: 0,
445
+ position: 'absolute',
446
+ cursor: _this.startOfDragX ? 'grab' : _this.hoverIndex >= 0 ? 'pointer' : constants_1.DEFAULT_CSS_CURSOR,
447
+ };
448
+ var dpr = window.devicePixelRatio * _this.pinchZoomScale;
449
+ var canvasWidth = width * dpr;
450
+ var canvasHeight = height * dpr;
451
+ var columns = _this.props.columnarViewModel;
452
+ var hitCount = _this.currentSearchHitCount;
453
+ return (react_1.default.createElement(react_1.default.Fragment, null,
454
+ react_1.default.createElement("figure", { "aria-labelledby": a11ySettings.labelId, "aria-describedby": a11ySettings.descriptionId },
455
+ react_1.default.createElement("canvas", { ref: _this.glCanvasRef, className: "echCanvasRenderer", width: canvasWidth, height: canvasHeight, style: style, role: "presentation" }),
456
+ react_1.default.createElement("canvas", { ref: forwardStageRef, tabIndex: 0, className: "echCanvasRenderer", width: canvasWidth, height: canvasHeight, onMouseMove: _this.handleMouseHoverMove, onMouseDown: _this.handleMouseDown, onMouseLeave: _this.handleMouseLeave, onWheel: _this.handleWheel, style: style, role: "presentation" })),
457
+ react_1.default.createElement("div", { style: {
458
+ position: 'absolute',
459
+ transform: "translateY(" + (_this.props.chartDimensions.height - draw_a_frame_1.PADDING_BOTTOM + 4) + "px)",
460
+ } },
461
+ react_1.default.createElement("input", { ref: _this.searchInputRef, title: "Search string or regex pattern", type: "text", tabIndex: 0, placeholder: "Enter search string", onKeyPress: _this.handleKeyPress, onKeyUp: _this.handleKeyPress, style: {
462
+ border: '0px solid lightgray',
463
+ padding: 3,
464
+ outline: 'none',
465
+ background: 'rgba(255,0,255,0)',
466
+ } }),
467
+ react_1.default.createElement("label", { title: "Case sensitivity (highlighted: case sensitive)", style: {
468
+ color: _this.caseSensitive && !_this.useRegex ? 'black' : 'darkgrey',
469
+ backgroundColor: 'rgb(228, 228, 228)',
470
+ fontWeight: 'bolder',
471
+ paddingInline: 4,
472
+ marginInline: 4,
473
+ borderRadius: 4,
474
+ opacity: _this.currentSearchString ? 1 : 0,
475
+ transition: 'opacity 250ms ease-in-out',
476
+ } },
477
+ "Cc",
478
+ react_1.default.createElement("input", { type: "checkbox", tabIndex: 0, onClick: function () {
479
+ if (!_this.currentSearchString)
480
+ return;
481
+ _this.caseSensitive = !_this.caseSensitive;
482
+ _this.searchForText(true);
483
+ }, style: { display: 'none' } })),
484
+ react_1.default.createElement("label", { title: "Regex matching (highlighted: use regex)", style: {
485
+ color: _this.useRegex ? 'black' : 'darkgrey',
486
+ backgroundColor: 'rgb(228, 228, 228)',
487
+ fontWeight: 'bolder',
488
+ paddingInline: 4,
489
+ marginInline: 4,
490
+ borderRadius: 4,
491
+ opacity: _this.currentSearchString ? 1 : 0,
492
+ transition: 'opacity 250ms ease-in-out',
493
+ } },
494
+ ". *",
495
+ react_1.default.createElement("input", { type: "checkbox", tabIndex: 0, onClick: function () {
496
+ if (!_this.currentSearchString)
497
+ return;
498
+ _this.useRegex = !_this.useRegex;
499
+ _this.searchForText(true);
500
+ }, style: { display: 'none' } })),
501
+ react_1.default.createElement("label", { title: "Previous hit", style: {
502
+ color: hitCount ? 'black' : 'darkgrey',
503
+ fontWeight: 'bolder',
504
+ paddingLeft: 16,
505
+ paddingRight: 4,
506
+ opacity: _this.currentSearchString ? 1 : 0,
507
+ transition: 'opacity 250ms ease-in-out',
508
+ } },
509
+ "\u25C0",
510
+ react_1.default.createElement("input", { type: "checkbox", tabIndex: 0, onClick: function (e) {
511
+ if (!_this.currentSearchString)
512
+ return;
513
+ _this.focusedMatchIndex = Number.isNaN(_this.focusedMatchIndex)
514
+ ? hitCount - 1
515
+ : _this.focusedMatchIndex === 0
516
+ ? NaN
517
+ : _this.focusedMatchIndex - 1;
518
+ _this.focusOnHit(e.timeStamp);
519
+ _this.setState({});
520
+ }, style: { display: 'none' } })),
521
+ react_1.default.createElement("label", { title: "Next hit", style: {
522
+ color: hitCount ? 'black' : 'darkgrey',
523
+ fontWeight: 'bolder',
524
+ paddingInline: 4,
525
+ opacity: _this.currentSearchString ? 1 : 0,
526
+ transition: 'opacity 250ms ease-in-out',
527
+ } },
528
+ "\u25B6",
529
+ react_1.default.createElement("input", { type: "checkbox", tabIndex: 0, onClick: function (e) {
530
+ if (!_this.currentSearchString)
531
+ return;
532
+ _this.focusedMatchIndex = _this.focusedMatchIndex = Number.isNaN(_this.focusedMatchIndex)
533
+ ? 0
534
+ : _this.focusedMatchIndex === hitCount - 1
535
+ ? NaN
536
+ : _this.focusedMatchIndex + 1;
537
+ _this.focusOnHit(e.timeStamp);
538
+ _this.setState({});
539
+ }, style: { display: 'none' } })),
540
+ react_1.default.createElement("p", { style: {
541
+ float: 'right',
542
+ padding: 3,
543
+ opacity: _this.currentSearchString ? 1 : 0,
544
+ transition: 'opacity 250ms ease-in-out',
545
+ } }, "Match" + (Number.isNaN(_this.focusedMatchIndex) ? 'es:' : ": " + (_this.focusedMatchIndex + 1) + " /") + " " + hitCount)),
546
+ react_1.default.createElement(tooltip_1.BasicTooltip, { onPointerMove: function () { return ({ type: mouse_1.ON_POINTER_MOVE, position: { x: NaN, y: NaN }, time: NaN }); }, position: { x: _this.pointerX, y: _this.pointerY, width: 0, height: 0 }, visible: _this.props.tooltipRequired && _this.hoverIndex >= 0, info: {
547
+ header: null,
548
+ values: _this.hoverIndex >= 0
549
+ ? [
550
+ {
551
+ label: columns.label[_this.hoverIndex],
552
+ color: getColor(columns.color, _this.hoverIndex),
553
+ isHighlighted: false,
554
+ isVisible: true,
555
+ seriesIdentifier: { specId: '', key: '' },
556
+ value: columns.value[_this.hoverIndex],
557
+ formattedValue: "" + specValueFormatter(columns.value[_this.hoverIndex]),
558
+ valueAccessor: _this.hoverIndex,
559
+ },
560
+ ]
561
+ : [],
562
+ }, getChartContainerRef: _this.props.containerRef })));
563
+ };
564
+ _this.drawCanvas = function () {
565
+ if (!_this.ctx || !_this.glContext || !_this.pickTexture)
566
+ return;
567
+ var renderFrame = (0, draw_a_frame_1.drawFrame)(_this.ctx, _this.glContext, _this.props.chartDimensions.width, _this.props.chartDimensions.height, _this.getMinimapWidth(), _this.getMinimapHeight(), _this.getMinimapLeft(), _this.getMinimapTop(), window.devicePixelRatio * _this.pinchZoomScale, _this.props.columnarViewModel, _this.pickTexture, _this.glResources.pickTextureRenderer, _this.glResources.roundedRectRenderer, _this.hoverIndex, unitRowPitch(_this.props.columnarViewModel.position1), _this.currentColor);
568
+ var anim = function (t) {
569
+ var msDeltaT = Number.isNaN(_this.prevT) ? 0 : t - _this.prevT;
570
+ _this.prevT = t;
571
+ var dx0 = _this.targetFocus.x0 - _this.currentFocus.x0;
572
+ var dx1 = _this.targetFocus.x1 - _this.currentFocus.x1;
573
+ var dy0 = _this.targetFocus.y0 - _this.currentFocus.y0;
574
+ var dy1 = _this.targetFocus.y1 - _this.currentFocus.y1;
575
+ var currentExtentX = _this.currentFocus.x1 - _this.currentFocus.x0;
576
+ var currentExtentY = _this.currentFocus.y1 - _this.currentFocus.y0;
577
+ var relativeExpansionX = Math.max(1, (currentExtentX + dx1 - dx0) / currentExtentX);
578
+ var relativeExpansionY = Math.max(1, (currentExtentX + dy1 - dy0) / currentExtentY);
579
+ var jointRelativeExpansion = (relativeExpansionX + relativeExpansionY) / 2;
580
+ var convergenceRateX = Math.min(1, msDeltaT * RECURRENCE_ALPHA_PER_MS_X) / jointRelativeExpansion;
581
+ var convergenceRateY = Math.min(1, msDeltaT * RECURRENCE_ALPHA_PER_MS_Y) / jointRelativeExpansion;
582
+ _this.currentFocus.x0 += convergenceRateX * dx0;
583
+ _this.currentFocus.x1 += convergenceRateX * dx1;
584
+ _this.currentFocus.y0 += convergenceRateY * dy0;
585
+ _this.currentFocus.y1 += convergenceRateY * dy1;
586
+ renderFrame([_this.currentFocus.x0, _this.currentFocus.x1, _this.currentFocus.y0, _this.currentFocus.y1]);
587
+ var maxDiff = Math.max(Math.abs(dx0), Math.abs(dx1), Math.abs(dy0), Math.abs(dy1));
588
+ if (maxDiff > 1e-12) {
589
+ _this.animationRafId = window.requestAnimationFrame(anim);
590
+ }
591
+ else {
592
+ _this.prevT = NaN;
593
+ }
594
+ };
595
+ window.cancelAnimationFrame(_this.animationRafId);
596
+ _this.animationRafId = window.requestAnimationFrame(anim);
597
+ _this.props.onRenderChange(true);
598
+ };
599
+ _this.getMinimapWidth = function () { return _this.props.chartDimensions.width / MINIMAP_SIZE_RATIO_X; };
600
+ _this.getMinimapHeight = function () { return _this.props.chartDimensions.height / MINIMAP_SIZE_RATIO_Y; };
601
+ _this.getMinimapLeft = function () { return _this.props.chartDimensions.width - _this.getMinimapWidth(); };
602
+ _this.getMinimapTop = function () { return _this.props.chartDimensions.height - _this.getMinimapHeight(); };
603
+ _this.ensurePickTexture = function () {
604
+ var _a;
605
+ var _b = _this.props.chartDimensions, width = _b.width, height = _b.height;
606
+ var pr = window.devicePixelRatio * _this.pinchZoomScale;
607
+ var textureWidth = pr * width;
608
+ var textureHeight = pr * height;
609
+ var current = _this.pickTexture;
610
+ if (_this.glContext &&
611
+ (current === kingly_1.NullTexture || current.width !== textureWidth || current.height !== textureHeight)) {
612
+ current.delete();
613
+ _this.pickTexture =
614
+ (_a = (0, kingly_1.createTexture)(_this.glContext, {
615
+ textureIndex: 0,
616
+ width: textureWidth,
617
+ height: textureHeight,
618
+ internalFormat: _this.glContext.RGBA8,
619
+ data: null,
620
+ })) !== null && _a !== void 0 ? _a : kingly_1.NullTexture;
621
+ (0, kingly_1.bindFramebuffer)(_this.glContext, kingly_1.GL_READ_FRAMEBUFFER, _this.pickTexture.target());
622
+ }
623
+ };
624
+ _this.tryCanvasContext = function () {
625
+ var canvas = _this.props.forwardStageRef.current;
626
+ var glCanvas = _this.glCanvasRef.current;
627
+ _this.ctx = canvas && canvas.getContext('2d');
628
+ _this.glContext = glCanvas && glCanvas.getContext('webgl2');
629
+ _this.ensurePickTexture();
630
+ if (_this.glContext && _this.glResources === types_1.NULL_GL_RESOURCES) {
631
+ _this.glResources = (0, ensure_webgl_1.ensureWebgl)(_this.glContext, Object.keys(_this.props.columnarViewModel));
632
+ (0, ensure_webgl_1.uploadToWebgl)(_this.glContext, _this.glResources.attributes, _this.props.columnarViewModel);
633
+ }
634
+ };
635
+ _this.ctx = null;
636
+ _this.glContext = null;
637
+ _this.pickTexture = kingly_1.NullTexture;
638
+ _this.glResources = types_1.NULL_GL_RESOURCES;
639
+ _this.glCanvasRef = (0, react_1.createRef)();
640
+ _this.searchInputRef = (0, react_1.createRef)();
641
+ _this.animationRafId = NaN;
642
+ _this.prevT = NaN;
643
+ _this.currentFocus = focusRect(_this.props.columnarViewModel, props.chartDimensions.height, 0, -Infinity);
644
+ _this.targetFocus = __assign({}, _this.currentFocus);
645
+ _this.hoverIndex = NaN;
646
+ _this.pointerX = NaN;
647
+ _this.pointerY = NaN;
648
+ _this.pinchZoomSetInterval = NaN;
649
+ _this.pinchZoomScale = browserRootWindow().visualViewport.scale;
650
+ _this.setupViewportScaleChangeListener();
651
+ _this.currentColor = _this.props.columnarViewModel.color;
652
+ return _this;
653
+ }
654
+ FlameComponent.prototype.componentWillUnmount = function () {
655
+ var _a;
656
+ (_a = this.props.containerRef().current) === null || _a === void 0 ? void 0 : _a.removeEventListener('wheel', this.preventScroll);
657
+ };
658
+ FlameComponent.prototype.updatePointerLocation = function (e) {
659
+ if (!this.props.forwardStageRef.current || !this.ctx)
660
+ return;
661
+ var box = this.props.forwardStageRef.current.getBoundingClientRect();
662
+ this.pointerX = e.clientX - box.left;
663
+ this.pointerY = e.clientY - box.top;
664
+ };
665
+ FlameComponent.prototype.smartDraw = function () {
666
+ if (Number.isFinite(this.hoverIndex)) {
667
+ this.hoverIndex = NaN;
668
+ this.setState({});
669
+ }
670
+ else {
671
+ this.drawCanvas();
672
+ }
673
+ };
674
+ FlameComponent.displayName = 'Flame';
675
+ return FlameComponent;
676
+ }(react_1.default.Component));
677
+ var mapStateToProps = function (state) {
678
+ var _a, _b, _c, _d, _e, _f;
679
+ var flameSpec = (0, utils_1.getSpecsFromStore)(state.specs, __1.ChartType.Flame, specs_1.SpecType.Series)[0];
680
+ var settingsSpec = (0, get_settings_specs_1.getSettingsSpecSelector)(state);
681
+ return {
682
+ columnarViewModel: (_a = flameSpec === null || flameSpec === void 0 ? void 0 : flameSpec.columnarData) !== null && _a !== void 0 ? _a : types_1.nullColumnarViewModel,
683
+ animationDuration: (_b = flameSpec === null || flameSpec === void 0 ? void 0 : flameSpec.animation.duration) !== null && _b !== void 0 ? _b : 0,
684
+ chartDimensions: state.parentDimensions,
685
+ a11ySettings: (0, get_accessibility_config_1.getA11ySettingsSelector)(state),
686
+ tooltipRequired: (0, specs_1.getTooltipType)(settingsSpec) !== specs_1.TooltipType.None,
687
+ onElementOver: (_c = settingsSpec.onElementOver) !== null && _c !== void 0 ? _c : (function () { }),
688
+ onElementClick: (_d = settingsSpec.onElementClick) !== null && _d !== void 0 ? _d : (function () { }),
689
+ onElementOut: (_e = settingsSpec.onElementOut) !== null && _e !== void 0 ? _e : (function () { }),
690
+ onRenderChange: (_f = settingsSpec.onRenderChange) !== null && _f !== void 0 ? _f : (function () { }),
691
+ };
692
+ };
693
+ var mapDispatchToProps = function (dispatch) {
694
+ return (0, redux_1.bindActionCreators)({
695
+ onChartRendered: chart_1.onChartRendered,
696
+ }, dispatch);
697
+ };
698
+ var FlameChartLayers = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(FlameComponent);
699
+ var FlameWithTooltip = function (containerRef, forwardStageRef) { return (react_1.default.createElement(FlameChartLayers, { forwardStageRef: forwardStageRef, containerRef: containerRef })); };
700
+ exports.FlameWithTooltip = FlameWithTooltip;
701
+ //# sourceMappingURL=flame_chart.js.map