@progress/kendo-charts 1.28.0 → 1.29.0-dev.202305231642

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.
@@ -46,7 +46,6 @@ var BarChart = (function (CategoricalChart) {
46
46
 
47
47
  BarChart.prototype.createPoint = function createPoint (data, fields) {
48
48
  var categoryIx = fields.categoryIx;
49
- var category = fields.category;
50
49
  var series = fields.series;
51
50
  var seriesIx = fields.seriesIx;
52
51
  var ref = this;
@@ -70,10 +69,7 @@ var BarChart = (function (CategoricalChart) {
70
69
  color = pointOptions.negativeColor;
71
70
  }
72
71
 
73
- pointOptions = this.evalPointOptions(
74
- pointOptions, value, category, categoryIx, series, seriesIx
75
- );
76
-
72
+ pointOptions = this.evalPointOptions(pointOptions, value, fields);
77
73
  if (isFunction(series.color)) {
78
74
  color = pointOptions.color;
79
75
  }
@@ -205,4 +201,4 @@ setDefaultOptions(BarChart, {
205
201
  }
206
202
  });
207
203
 
208
- export default BarChart;
204
+ export default BarChart;
@@ -39,9 +39,7 @@ var BulletChart = (function (CategoricalChart) {
39
39
 
40
40
  BulletChart.prototype.createPoint = function createPoint (data, fields) {
41
41
  var categoryIx = fields.categoryIx;
42
- var category = fields.category;
43
42
  var series = fields.series;
44
- var seriesIx = fields.seriesIx;
45
43
  var ref = this;
46
44
  var options = ref.options;
47
45
  var children = ref.children;
@@ -55,10 +53,7 @@ var BulletChart = (function (CategoricalChart) {
55
53
  }, series);
56
54
 
57
55
  var color = data.fields.color || series.color;
58
- bulletOptions = this.evalPointOptions(
59
- bulletOptions, value, category, categoryIx, series, seriesIx
60
- );
61
-
56
+ bulletOptions = this.evalPointOptions(bulletOptions, value, fields);
62
57
  if (isFunction(series.color)) {
63
58
  color = bulletOptions.color;
64
59
  }
@@ -148,4 +143,4 @@ function wrapData(options) {
148
143
  }
149
144
  }
150
145
 
151
- export default BulletChart;
146
+ export default BulletChart;
@@ -84,18 +84,13 @@ var CandlestickChart = (function (CategoricalChart) {
84
84
  };
85
85
 
86
86
  CandlestickChart.prototype.createPoint = function createPoint (data, fields) {
87
- var categoryIx = fields.categoryIx;
88
- var category = fields.category;
89
87
  var series = fields.series;
90
- var seriesIx = fields.seriesIx;
91
88
  var pointType = this.pointType();
92
89
  var value = data.valueFields;
93
90
  var pointOptions = deepExtend({}, series);
94
91
  var color = data.fields.color || series.color;
95
92
 
96
- pointOptions = this.evalPointOptions(
97
- pointOptions, value, category, categoryIx, series, seriesIx
98
- );
93
+ pointOptions = this.evalPointOptions(pointOptions, value, fields);
99
94
 
100
95
  if (series.type === CANDLESTICK) {
101
96
  if (value.open > value.close) {
@@ -151,4 +146,4 @@ var CandlestickChart = (function (CategoricalChart) {
151
146
 
152
147
  deepExtend(CandlestickChart.prototype, ClipAnimationMixin);
153
148
 
154
- export default CandlestickChart;
149
+ export default CandlestickChart;
@@ -318,8 +318,19 @@ var CategoricalChart = (function (ChartElement) {
318
318
  this.updateRange(data.valueFields, fields);
319
319
  };
320
320
 
321
- CategoricalChart.prototype.evalPointOptions = function evalPointOptions (options, value, category, categoryIx, series, seriesIx) {
322
- var state = { defaults: series._defaults, excluded: [ "data", "aggregate", "_events", "tooltip", "content", "template", "visual", "toggle", "_outOfRangeMinPoint", "_outOfRangeMaxPoint" ] };
321
+ CategoricalChart.prototype.evalPointOptions = function evalPointOptions (options, value, fields) {
322
+ var categoryIx = fields.categoryIx;
323
+ var category = fields.category;
324
+ var series = fields.series;
325
+ var seriesIx = fields.seriesIx;
326
+ var state = {
327
+ defaults: series._defaults,
328
+ excluded: [
329
+ "data", "aggregate", "_events", "tooltip", "content", "template",
330
+ "visual", "toggle", "_outOfRangeMinPoint", "_outOfRangeMaxPoint",
331
+ "drilldownSeriesFactory"
332
+ ]
333
+ };
323
334
 
324
335
  var doEval = this._evalSeries[seriesIx];
325
336
  if (!defined(doEval)) {
@@ -28,7 +28,8 @@ import { addClass, Class, setDefaultOptions, deepExtend, defined, find, isObject
28
28
  import { dateComparer } from '../date-utils';
29
29
 
30
30
  import { DRAG_START, DRAG, DRAG_END, ZOOM_START, ZOOM, ZOOM_END, SELECT_START, SELECT, SELECT_END, PLOT_AREA_HOVER, PLOT_AREA_LEAVE,
31
- RENDER, CATEGORY, PIE, DONUT, FUNNEL, COLUMN, MOUSEWHEEL, MOUSEWHEEL_DELAY, MOUSEWHEEL_ZOOM_RATE, SHOW_TOOLTIP, SERIES_HOVER } from './constants';
31
+ RENDER, CATEGORY, PIE, DONUT, FUNNEL, COLUMN, MOUSEWHEEL, MOUSEWHEEL_DELAY, MOUSEWHEEL_ZOOM_RATE, SHOW_TOOLTIP, SERIES_HOVER,
32
+ SERIES_OVER, SERIES_LEAVE, SERIES_CLICK, DRILLDOWN } from './constants';
32
33
 
33
34
  import './animations';
34
35
  import './register-charts';
@@ -578,10 +579,17 @@ var Chart = (function (Class) {
578
579
  Chart.prototype.trigger = function trigger (name, args) {
579
580
  if ( args === void 0 ) args = {};
580
581
 
582
+ args.sender = this;
583
+
581
584
  if (name === SHOW_TOOLTIP) {
582
585
  args.anchor.point = this._toDocumentCoordinates(args.anchor.point);
586
+ } else if (name === SERIES_OVER) {
587
+ this._updateDrilldownPoint(args.point);
588
+ } else if (name === SERIES_LEAVE) {
589
+ this._resetDrilldownPoint();
590
+ } else if (name === SERIES_CLICK) {
591
+ this._startDrilldown(args.point);
583
592
  }
584
- args.sender = this;
585
593
 
586
594
  var observers = this.observers;
587
595
  var isDefaultPrevented = false;
@@ -1138,6 +1146,41 @@ var Chart = (function (Class) {
1138
1146
  }
1139
1147
  };
1140
1148
 
1149
+ Chart.prototype._updateDrilldownPoint = function _updateDrilldownPoint (point) {
1150
+ if (!point || !point.series) {
1151
+ return;
1152
+ }
1153
+
1154
+ var ref = SeriesBinder.current.bindPoint(point.series, null, point.dataItem);
1155
+ var fields = ref.fields;
1156
+ if (fields.drilldown) {
1157
+ this._drilldownState = { cursor: this.element.style.cursor };
1158
+ this.element.style.cursor = 'pointer';
1159
+ }
1160
+ };
1161
+
1162
+ Chart.prototype._resetDrilldownPoint = function _resetDrilldownPoint () {
1163
+ if (this._drilldownState) {
1164
+ this.element.style.cursor = this._drilldownState.cursor;
1165
+ this._drilldownState = null;
1166
+ }
1167
+ };
1168
+
1169
+ Chart.prototype._startDrilldown = function _startDrilldown (point) {
1170
+ if (!point || !point.series) {
1171
+ return;
1172
+ }
1173
+
1174
+ var series = point.series;
1175
+ var ref = SeriesBinder.current.bindPoint(series, null, point.dataItem);
1176
+ var fields = ref.fields;
1177
+ var value = fields.drilldown;
1178
+ if (value) {
1179
+ var args = { series: series, point: point, value: value, sender: this };
1180
+ this.trigger(DRILLDOWN, args);
1181
+ }
1182
+ };
1183
+
1141
1184
  Chart.prototype._updateSeriesOpacity = function _updateSeriesOpacity (point, resetOpacity) {
1142
1185
  var this$1 = this;
1143
1186
 
@@ -1652,7 +1695,7 @@ var Chart = (function (Class) {
1652
1695
  }
1653
1696
 
1654
1697
  this._unsetActivePoint();
1655
-
1698
+ this._resetDrilldownPoint();
1656
1699
  this._destroySelections();
1657
1700
 
1658
1701
  if (this._tooltip) {
@@ -96,11 +96,14 @@ var MOUSEWHEEL = "wheel";
96
96
  var MOUSEWHEEL_DELAY = 150;
97
97
  var MOUSEWHEEL_ZOOM_RATE = 0.3;
98
98
 
99
+ var DRILLDOWN = "drilldown";
100
+ var DRILLDOWN_FIELD = "drilldown";
101
+
99
102
  export {
100
103
  INITIAL_ANIMATION_DURATION, FADEIN,
101
104
  LEGEND_ITEM_CLICK, LEGEND_ITEM_HOVER, LEGEND_ITEM_LEAVE,
102
- SERIES_CLICK, SERIES_HOVER, SERIES_OVER, SERIES_LEAVE, GLASS,
103
- BORDER_BRIGHTNESS, TOOLTIP_OFFSET,
105
+ SERIES_CLICK, SERIES_HOVER, SERIES_OVER, SERIES_LEAVE,
106
+ GLASS, BORDER_BRIGHTNESS, TOOLTIP_OFFSET,
104
107
  START_SCALE, ERROR_LOW_FIELD, ERROR_HIGH_FIELD,
105
108
  X_ERROR_LOW_FIELD, X_ERROR_HIGH_FIELD,
106
109
  Y_ERROR_LOW_FIELD, Y_ERROR_HIGH_FIELD,
@@ -119,5 +122,6 @@ export {
119
122
  MOUSEWHEEL, MOUSEWHEEL_DELAY, MOUSEWHEEL_ZOOM_RATE,
120
123
  SHOW_TOOLTIP, HIDE_TOOLTIP,
121
124
  EQUALLY_SPACED_SERIES, ABOVE, BELOW,
122
- HEATMAP
125
+ HEATMAP,
126
+ DRILLDOWN, DRILLDOWN_FIELD
123
127
  };
@@ -68,7 +68,13 @@ var HeatmapChart = (function (ChartElement) {
68
68
  HeatmapChart.prototype.evalPointOptions = function evalPointOptions (options, value, fields) {
69
69
  var series = fields.series;
70
70
  var seriesIx = fields.seriesIx;
71
- var state = { defaults: series._defaults, excluded: [ "data", "tooltip", "content", "template", "visual", "toggle" ] };
71
+ var state = {
72
+ defaults: series._defaults,
73
+ excluded: [
74
+ "data", "tooltip", "content", "template",
75
+ "visual", "toggle", "drilldownSeriesFactory"
76
+ ]
77
+ };
72
78
 
73
79
  var doEval = this._evalSeries[seriesIx];
74
80
  if (!defined(doEval)) {
@@ -32,8 +32,6 @@ var LineChart = (function (CategoricalChart) {
32
32
  };
33
33
 
34
34
  LineChart.prototype.createPoint = function createPoint (data, fields) {
35
- var categoryIx = fields.categoryIx;
36
- var category = fields.category;
37
35
  var series = fields.series;
38
36
  var seriesIx = fields.seriesIx;
39
37
  var missingValues = this.seriesMissingValues(series);
@@ -48,9 +46,7 @@ var LineChart = (function (CategoricalChart) {
48
46
  }
49
47
 
50
48
  var pointOptions = this.pointOptions(series, seriesIx);
51
- pointOptions = this.evalPointOptions(
52
- pointOptions, value, category, categoryIx, series, seriesIx
53
- );
49
+ pointOptions = this.evalPointOptions(pointOptions, value, fields);
54
50
 
55
51
  var color = data.fields.color || series.color;
56
52
  if (isFunction(series.color)) {
@@ -33,8 +33,6 @@ var RangeAreaChart = (function (CategoricalChart) {
33
33
  };
34
34
 
35
35
  RangeAreaChart.prototype.createPoint = function createPoint (data, fields) {
36
- var categoryIx = fields.categoryIx;
37
- var category = fields.category;
38
36
  var series = fields.series;
39
37
  var seriesIx = fields.seriesIx;
40
38
  var value = data.valueFields;
@@ -51,9 +49,7 @@ var RangeAreaChart = (function (CategoricalChart) {
51
49
  }
52
50
 
53
51
  var pointOptions = this.pointOptions(series, seriesIx);
54
- pointOptions = this.evalPointOptions(
55
- pointOptions, value, category, categoryIx, series, seriesIx
56
- );
52
+ pointOptions = this.evalPointOptions(pointOptions, value, fields);
57
53
 
58
54
  var color = data.fields.color || series.color;
59
55
  if (isFunction(series.color)) {
@@ -15,7 +15,7 @@ import { COLUMN, DONUT, PIE, FUNNEL, BAR, LINE, VERTICAL_LINE, AREA, VERTICAL_AR
15
15
  RANGE_BAR, WATERFALL, HORIZONTAL_WATERFALL, SCATTER, SCATTER_LINE, BUBBLE,
16
16
  POLAR_AREA, POLAR_LINE, POLAR_SCATTER, RADAR_AREA, RADAR_COLUMN, RADAR_LINE, CATEGORY,
17
17
  RANGE_AREA, VERTICAL_RANGE_AREA, X_ERROR_LOW_FIELD, X_ERROR_HIGH_FIELD, Y_ERROR_LOW_FIELD, Y_ERROR_HIGH_FIELD,
18
- ERROR_LOW_FIELD, ERROR_HIGH_FIELD, HEATMAP } from './constants';
18
+ ERROR_LOW_FIELD, ERROR_HIGH_FIELD, HEATMAP, DRILLDOWN_FIELD } from './constants';
19
19
  import { X, Y, VALUE } from '../common/constants';
20
20
 
21
21
  var COLOR = "color";
@@ -48,25 +48,25 @@ PlotAreaFactory.current.register(HeatmapPlotArea, [ HEATMAP ]);
48
48
 
49
49
  SeriesBinder.current.register(
50
50
  [ BAR, COLUMN, LINE, VERTICAL_LINE, AREA, VERTICAL_AREA ],
51
- [ VALUE ], [ CATEGORY, COLOR, NOTE_TEXT, ERROR_LOW_FIELD, ERROR_HIGH_FIELD ]
51
+ [ VALUE ], [ CATEGORY, COLOR, NOTE_TEXT, ERROR_LOW_FIELD, ERROR_HIGH_FIELD, DRILLDOWN_FIELD ]
52
52
  );
53
53
 
54
54
  SeriesBinder.current.register(
55
55
  [ RANGE_COLUMN, RANGE_BAR, RANGE_AREA, VERTICAL_RANGE_AREA ],
56
- [ FROM, TO ], [ CATEGORY, COLOR, NOTE_TEXT ]
56
+ [ FROM, TO ], [ CATEGORY, COLOR, NOTE_TEXT, DRILLDOWN_FIELD ]
57
57
  );
58
58
 
59
59
  SeriesBinder.current.register(
60
60
  [ WATERFALL, HORIZONTAL_WATERFALL ],
61
- [ VALUE ], [ CATEGORY, COLOR, NOTE_TEXT, SUMMARY_FIELD ]
61
+ [ VALUE ], [ CATEGORY, COLOR, NOTE_TEXT, SUMMARY_FIELD, DRILLDOWN_FIELD ]
62
62
  );
63
63
 
64
- SeriesBinder.current.register([ POLAR_AREA, POLAR_LINE, POLAR_SCATTER ], [ X, Y ], [ COLOR ]);
65
- SeriesBinder.current.register([ RADAR_AREA, RADAR_COLUMN, RADAR_LINE ], [ VALUE ], [ COLOR ]);
64
+ SeriesBinder.current.register([ POLAR_AREA, POLAR_LINE, POLAR_SCATTER ], [ X, Y ], [ COLOR, DRILLDOWN_FIELD ]);
65
+ SeriesBinder.current.register([ RADAR_AREA, RADAR_COLUMN, RADAR_LINE ], [ VALUE ], [ COLOR, DRILLDOWN_FIELD ]);
66
66
 
67
67
  SeriesBinder.current.register(
68
68
  [ FUNNEL ],
69
- [ VALUE ], [ CATEGORY, COLOR, "visibleInLegend", "visible" ]
69
+ [ VALUE ], [ CATEGORY, COLOR, "visibleInLegend", "visible", DRILLDOWN_FIELD ]
70
70
  );
71
71
 
72
72
  DefaultAggregates.current.register(
@@ -111,7 +111,7 @@ DefaultAggregates.current.register(
111
111
 
112
112
  SeriesBinder.current.register(
113
113
  [ BOX_PLOT, VERTICAL_BOX_PLOT ],
114
- [ "lower", "q1", "median", "q3", "upper", "mean", "outliers" ], [ CATEGORY, COLOR, NOTE_TEXT ]
114
+ [ "lower", "q1", "median", "q3", "upper", "mean", "outliers" ], [ CATEGORY, COLOR, NOTE_TEXT, DRILLDOWN_FIELD ]
115
115
  );
116
116
 
117
117
  DefaultAggregates.current.register(
@@ -122,7 +122,7 @@ DefaultAggregates.current.register(
122
122
 
123
123
  SeriesBinder.current.register(
124
124
  [ BULLET, VERTICAL_BULLET ],
125
- [ "current", "target" ], [ CATEGORY, COLOR, "visibleInLegend", NOTE_TEXT ]
125
+ [ "current", "target" ], [ CATEGORY, COLOR, "visibleInLegend", NOTE_TEXT, DRILLDOWN_FIELD ]
126
126
  );
127
127
 
128
128
  DefaultAggregates.current.register(
@@ -132,5 +132,5 @@ DefaultAggregates.current.register(
132
132
 
133
133
  SeriesBinder.current.register(
134
134
  [ PIE, DONUT ],
135
- [ VALUE ], [ CATEGORY, COLOR, "explode", "visibleInLegend", "visible" ]
135
+ [ VALUE ], [ CATEGORY, COLOR, "explode", "visibleInLegend", "visible", DRILLDOWN_FIELD ]
136
136
  );
@@ -169,7 +169,14 @@ var ScatterChart = (function (ChartElement) {
169
169
  ScatterChart.prototype.evalPointOptions = function evalPointOptions (options, value, fields) {
170
170
  var series = fields.series;
171
171
  var seriesIx = fields.seriesIx;
172
- var state = { defaults: series._defaults, excluded: [ "data", "tooltip", "content", "template", "visual", "toggle", "_outOfRangeMinPoint", "_outOfRangeMaxPoint" ] };
172
+ var state = {
173
+ defaults: series._defaults,
174
+ excluded: [
175
+ "data", "tooltip", "content", "template", "visual", "toggle",
176
+ "_outOfRangeMinPoint", "_outOfRangeMaxPoint",
177
+ "drilldownSeriesFactory"
178
+ ]
179
+ };
173
180
 
174
181
  var doEval = this._evalSeries[seriesIx];
175
182
  if (!defined(doEval)) {
@@ -344,4 +351,4 @@ deepExtend(ScatterChart.prototype, ClipAnimationMixin, {
344
351
  _bindPoint: CategoricalChart.prototype._bindPoint
345
352
  });
346
353
 
347
- export default ScatterChart;
354
+ export default ScatterChart;
@@ -38,7 +38,7 @@ class BarChart extends CategoricalChart {
38
38
  }
39
39
 
40
40
  createPoint(data, fields) {
41
- const { categoryIx, category, series, seriesIx } = fields;
41
+ const { categoryIx, series, seriesIx } = fields;
42
42
  const { options, children } = this;
43
43
  const isStacked = options.isStacked;
44
44
  const value = this.pointValue(data);
@@ -58,10 +58,7 @@ class BarChart extends CategoricalChart {
58
58
  color = pointOptions.negativeColor;
59
59
  }
60
60
 
61
- pointOptions = this.evalPointOptions(
62
- pointOptions, value, category, categoryIx, series, seriesIx
63
- );
64
-
61
+ pointOptions = this.evalPointOptions(pointOptions, value, fields);
65
62
  if (isFunction(series.color)) {
66
63
  color = pointOptions.color;
67
64
  }
@@ -189,4 +186,4 @@ setDefaultOptions(BarChart, {
189
186
  }
190
187
  });
191
188
 
192
- export default BarChart;
189
+ export default BarChart;
@@ -34,7 +34,7 @@ class BulletChart extends CategoricalChart {
34
34
  }
35
35
 
36
36
  createPoint(data, fields) {
37
- const { categoryIx, category, series, seriesIx } = fields;
37
+ const { categoryIx, series } = fields;
38
38
  const { options, children } = this;
39
39
  const value = data.valueFields;
40
40
 
@@ -46,10 +46,7 @@ class BulletChart extends CategoricalChart {
46
46
  }, series);
47
47
 
48
48
  let color = data.fields.color || series.color;
49
- bulletOptions = this.evalPointOptions(
50
- bulletOptions, value, category, categoryIx, series, seriesIx
51
- );
52
-
49
+ bulletOptions = this.evalPointOptions(bulletOptions, value, fields);
53
50
  if (isFunction(series.color)) {
54
51
  color = bulletOptions.color;
55
52
  }
@@ -134,4 +131,4 @@ function wrapData(options) {
134
131
  }
135
132
  }
136
133
 
137
- export default BulletChart;
134
+ export default BulletChart;
@@ -72,15 +72,13 @@ class CandlestickChart extends CategoricalChart {
72
72
  }
73
73
 
74
74
  createPoint(data, fields) {
75
- const { categoryIx, category, series, seriesIx } = fields;
75
+ const { series } = fields;
76
76
  const pointType = this.pointType();
77
77
  const value = data.valueFields;
78
78
  let pointOptions = deepExtend({}, series);
79
79
  let color = data.fields.color || series.color;
80
80
 
81
- pointOptions = this.evalPointOptions(
82
- pointOptions, value, category, categoryIx, series, seriesIx
83
- );
81
+ pointOptions = this.evalPointOptions(pointOptions, value, fields);
84
82
 
85
83
  if (series.type === CANDLESTICK) {
86
84
  if (value.open > value.close) {
@@ -134,4 +132,4 @@ class CandlestickChart extends CategoricalChart {
134
132
 
135
133
  deepExtend(CandlestickChart.prototype, ClipAnimationMixin);
136
134
 
137
- export default CandlestickChart;
135
+ export default CandlestickChart;
@@ -299,8 +299,19 @@ class CategoricalChart extends ChartElement {
299
299
  this.updateRange(data.valueFields, fields);
300
300
  }
301
301
 
302
- evalPointOptions(options, value, category, categoryIx, series, seriesIx) {
303
- const state = { defaults: series._defaults, excluded: [ "data", "aggregate", "_events", "tooltip", "content", "template", "visual", "toggle", "_outOfRangeMinPoint", "_outOfRangeMaxPoint" ] };
302
+ evalPointOptions(options, value, fields) {
303
+ const categoryIx = fields.categoryIx;
304
+ const category = fields.category;
305
+ const series = fields.series;
306
+ const seriesIx = fields.seriesIx;
307
+ const state = {
308
+ defaults: series._defaults,
309
+ excluded: [
310
+ "data", "aggregate", "_events", "tooltip", "content", "template",
311
+ "visual", "toggle", "_outOfRangeMinPoint", "_outOfRangeMaxPoint",
312
+ "drilldownSeriesFactory"
313
+ ]
314
+ };
304
315
 
305
316
  let doEval = this._evalSeries[seriesIx];
306
317
  if (!defined(doEval)) {
@@ -28,7 +28,8 @@ import { addClass, Class, setDefaultOptions, deepExtend, defined, find, isObject
28
28
  import { dateComparer } from '../date-utils';
29
29
 
30
30
  import { DRAG_START, DRAG, DRAG_END, ZOOM_START, ZOOM, ZOOM_END, SELECT_START, SELECT, SELECT_END, PLOT_AREA_HOVER, PLOT_AREA_LEAVE,
31
- RENDER, CATEGORY, PIE, DONUT, FUNNEL, COLUMN, MOUSEWHEEL, MOUSEWHEEL_DELAY, MOUSEWHEEL_ZOOM_RATE, SHOW_TOOLTIP, SERIES_HOVER } from './constants';
31
+ RENDER, CATEGORY, PIE, DONUT, FUNNEL, COLUMN, MOUSEWHEEL, MOUSEWHEEL_DELAY, MOUSEWHEEL_ZOOM_RATE, SHOW_TOOLTIP, SERIES_HOVER,
32
+ SERIES_OVER, SERIES_LEAVE, SERIES_CLICK, DRILLDOWN } from './constants';
32
33
 
33
34
  import './animations';
34
35
  import './register-charts';
@@ -563,10 +564,17 @@ class Chart extends Class {
563
564
  }
564
565
 
565
566
  trigger(name, args = {}) {
567
+ args.sender = this;
568
+
566
569
  if (name === SHOW_TOOLTIP) {
567
570
  args.anchor.point = this._toDocumentCoordinates(args.anchor.point);
571
+ } else if (name === SERIES_OVER) {
572
+ this._updateDrilldownPoint(args.point);
573
+ } else if (name === SERIES_LEAVE) {
574
+ this._resetDrilldownPoint();
575
+ } else if (name === SERIES_CLICK) {
576
+ this._startDrilldown(args.point);
568
577
  }
569
- args.sender = this;
570
578
 
571
579
  const observers = this.observers;
572
580
  let isDefaultPrevented = false;
@@ -1113,6 +1121,39 @@ class Chart extends Class {
1113
1121
  }
1114
1122
  }
1115
1123
 
1124
+ _updateDrilldownPoint(point) {
1125
+ if (!point || !point.series) {
1126
+ return;
1127
+ }
1128
+
1129
+ const { fields } = SeriesBinder.current.bindPoint(point.series, null, point.dataItem);
1130
+ if (fields.drilldown) {
1131
+ this._drilldownState = { cursor: this.element.style.cursor };
1132
+ this.element.style.cursor = 'pointer';
1133
+ }
1134
+ }
1135
+
1136
+ _resetDrilldownPoint() {
1137
+ if (this._drilldownState) {
1138
+ this.element.style.cursor = this._drilldownState.cursor;
1139
+ this._drilldownState = null;
1140
+ }
1141
+ }
1142
+
1143
+ _startDrilldown(point) {
1144
+ if (!point || !point.series) {
1145
+ return;
1146
+ }
1147
+
1148
+ const series = point.series;
1149
+ const { fields } = SeriesBinder.current.bindPoint(series, null, point.dataItem);
1150
+ const value = fields.drilldown;
1151
+ if (value) {
1152
+ const args = { series, point, value, sender: this };
1153
+ this.trigger(DRILLDOWN, args);
1154
+ }
1155
+ }
1156
+
1116
1157
  _updateSeriesOpacity(point, resetOpacity) {
1117
1158
  const plotArea = this._plotArea;
1118
1159
  const length = plotArea.series.length;
@@ -1613,7 +1654,7 @@ class Chart extends Class {
1613
1654
  }
1614
1655
 
1615
1656
  this._unsetActivePoint();
1616
-
1657
+ this._resetDrilldownPoint();
1617
1658
  this._destroySelections();
1618
1659
 
1619
1660
  if (this._tooltip) {
@@ -96,11 +96,14 @@ const MOUSEWHEEL = "wheel";
96
96
  const MOUSEWHEEL_DELAY = 150;
97
97
  const MOUSEWHEEL_ZOOM_RATE = 0.3;
98
98
 
99
+ const DRILLDOWN = "drilldown";
100
+ const DRILLDOWN_FIELD = "drilldown";
101
+
99
102
  export {
100
103
  INITIAL_ANIMATION_DURATION, FADEIN,
101
104
  LEGEND_ITEM_CLICK, LEGEND_ITEM_HOVER, LEGEND_ITEM_LEAVE,
102
- SERIES_CLICK, SERIES_HOVER, SERIES_OVER, SERIES_LEAVE, GLASS,
103
- BORDER_BRIGHTNESS, TOOLTIP_OFFSET,
105
+ SERIES_CLICK, SERIES_HOVER, SERIES_OVER, SERIES_LEAVE,
106
+ GLASS, BORDER_BRIGHTNESS, TOOLTIP_OFFSET,
104
107
  START_SCALE, ERROR_LOW_FIELD, ERROR_HIGH_FIELD,
105
108
  X_ERROR_LOW_FIELD, X_ERROR_HIGH_FIELD,
106
109
  Y_ERROR_LOW_FIELD, Y_ERROR_HIGH_FIELD,
@@ -119,5 +122,6 @@ export {
119
122
  MOUSEWHEEL, MOUSEWHEEL_DELAY, MOUSEWHEEL_ZOOM_RATE,
120
123
  SHOW_TOOLTIP, HIDE_TOOLTIP,
121
124
  EQUALLY_SPACED_SERIES, ABOVE, BELOW,
122
- HEATMAP
125
+ HEATMAP,
126
+ DRILLDOWN, DRILLDOWN_FIELD
123
127
  };
@@ -59,7 +59,13 @@ class HeatmapChart extends ChartElement {
59
59
 
60
60
  evalPointOptions(options, value, fields) {
61
61
  const { series, seriesIx } = fields;
62
- const state = { defaults: series._defaults, excluded: [ "data", "tooltip", "content", "template", "visual", "toggle" ] };
62
+ const state = {
63
+ defaults: series._defaults,
64
+ excluded: [
65
+ "data", "tooltip", "content", "template",
66
+ "visual", "toggle", "drilldownSeriesFactory"
67
+ ]
68
+ };
63
69
 
64
70
  let doEval = this._evalSeries[seriesIx];
65
71
  if (!defined(doEval)) {
@@ -24,7 +24,7 @@ class LineChart extends CategoricalChart {
24
24
  }
25
25
 
26
26
  createPoint(data, fields) {
27
- const { categoryIx, category, series, seriesIx } = fields;
27
+ const { series, seriesIx } = fields;
28
28
  const missingValues = this.seriesMissingValues(series);
29
29
  let value = data.valueFields.value;
30
30
 
@@ -37,9 +37,7 @@ class LineChart extends CategoricalChart {
37
37
  }
38
38
 
39
39
  let pointOptions = this.pointOptions(series, seriesIx);
40
- pointOptions = this.evalPointOptions(
41
- pointOptions, value, category, categoryIx, series, seriesIx
42
- );
40
+ pointOptions = this.evalPointOptions(pointOptions, value, fields);
43
41
 
44
42
  let color = data.fields.color || series.color;
45
43
  if (isFunction(series.color)) {
@@ -26,7 +26,7 @@ class RangeAreaChart extends CategoricalChart {
26
26
  }
27
27
 
28
28
  createPoint(data, fields) {
29
- const { categoryIx, category, series, seriesIx } = fields;
29
+ const { series, seriesIx } = fields;
30
30
  let value = data.valueFields;
31
31
 
32
32
  if (!hasValue(value.from) && !hasValue(value.to)) {
@@ -41,9 +41,7 @@ class RangeAreaChart extends CategoricalChart {
41
41
  }
42
42
 
43
43
  let pointOptions = this.pointOptions(series, seriesIx);
44
- pointOptions = this.evalPointOptions(
45
- pointOptions, value, category, categoryIx, series, seriesIx
46
- );
44
+ pointOptions = this.evalPointOptions(pointOptions, value, fields);
47
45
 
48
46
  let color = data.fields.color || series.color;
49
47
  if (isFunction(series.color)) {