@progress/kendo-charts 1.30.0 → 1.31.0-dev.202308280454

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.
@@ -247,6 +247,8 @@ var funnelSeries = function () { return ({
247
247
  }
248
248
  }); };
249
249
 
250
+ var pyramidSeries = funnelSeries;
251
+
250
252
  var heatmapSeries = function () { return ({
251
253
  labels: {
252
254
  color: '',
@@ -281,6 +283,7 @@ var seriesDefaults = function (options) { return ({
281
283
  pie: pieSeries(),
282
284
  donut: donutSeries(),
283
285
  funnel: funnelSeries(),
286
+ pyramid: pyramidSeries(),
284
287
  horizontalWaterfall: waterfallSeries(),
285
288
  line: lineSeries(),
286
289
  notes: notes(),
@@ -28,7 +28,7 @@ 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,
31
+ RENDER, CATEGORY, PIE, DONUT, FUNNEL, PYRAMID, COLUMN, MOUSEWHEEL, MOUSEWHEEL_DELAY, MOUSEWHEEL_ZOOM_RATE, SHOW_TOOLTIP, SERIES_HOVER,
32
32
  SERIES_OVER, SERIES_LEAVE, SERIES_CLICK, DRILLDOWN } from './constants';
33
33
 
34
34
  import './animations';
@@ -202,7 +202,7 @@ var Chart = (function (Class) {
202
202
 
203
203
  if (firstSeries.type === DONUT) {
204
204
  points = pointByCategoryName(plotArea.pointsBySeriesName(seriesName), categoryName);
205
- } else if (firstSeries.type === PIE || firstSeries.type === FUNNEL) {
205
+ } else if (inArray(firstSeries.type, [ PIE, FUNNEL, PYRAMID ])) {
206
206
  points = pointByCategoryName((plotArea.charts[0] || {}).points, categoryName);
207
207
  } else {
208
208
  points = plotArea.pointsBySeriesName(seriesName);
@@ -638,6 +638,11 @@ var Chart = (function (Class) {
638
638
  this._plotAreaHovered = false;
639
639
  this.trigger(PLOT_AREA_LEAVE);
640
640
  }
641
+
642
+ if (this._hasInactiveOpacity() && this._activeChartInstance) {
643
+ this._applySeriesOpacity(this._activeChartInstance.children, null, true);
644
+ this._updateSeriesOpacity(null, true);
645
+ }
641
646
  };
642
647
 
643
648
  Chart.prototype._cancelDomEvents = function _cancelDomEvents () {
@@ -1574,7 +1579,7 @@ var Chart = (function (Class) {
1574
1579
  var currentSeries = (plotArea.srcSeries || plotArea.series)[seriesIndex];
1575
1580
  var items;
1576
1581
 
1577
- if (inArray(currentSeries.type, [ PIE, DONUT, FUNNEL ])) {
1582
+ if (inArray(currentSeries.type, [ PIE, DONUT, FUNNEL, PYRAMID ])) {
1578
1583
  items = plotArea.findPoint(function(point) {
1579
1584
  return point.series.index === seriesIndex && point.index === pointIndex;
1580
1585
  });
@@ -34,6 +34,7 @@ var CANDLESTICK = "candlestick";
34
34
  var COLUMN = "column";
35
35
  var DONUT = "donut";
36
36
  var FUNNEL = "funnel";
37
+ var PYRAMID = "pyramid";
37
38
  var HEATMAP = "heatmap";
38
39
  var HORIZONTAL_WATERFALL = "horizontalWaterfall";
39
40
  var LINE = "line";
@@ -108,7 +109,7 @@ export {
108
109
  X_ERROR_LOW_FIELD, X_ERROR_HIGH_FIELD,
109
110
  Y_ERROR_LOW_FIELD, Y_ERROR_HIGH_FIELD,
110
111
  LINE_MARKER_SIZE, INTERPOLATE, ZERO,
111
- SMOOTH, STEP, CATEGORY, FUNNEL,
112
+ SMOOTH, STEP, CATEGORY, FUNNEL, PYRAMID,
112
113
  BAR, CANDLESTICK, PIE, COLUMN, AREA,
113
114
  VERTICAL_BULLET, BOX_PLOT, OHLC, WATERFALL, LINE,
114
115
  BULLET, VERTICAL_LINE, VERTICAL_AREA, RANGE_AREA, VERTICAL_RANGE_AREA,
@@ -0,0 +1,20 @@
1
+ import FunnelChart from './funnel-chart';
2
+
3
+ var MAX_NECK_RATIO = 1e6;
4
+
5
+ var PyramidChart = (function (FunnelChart) {
6
+ function PyramidChart(plotArea, options) {
7
+ options.dynamicSlope = false;
8
+ options.neckRatio = MAX_NECK_RATIO;
9
+
10
+ FunnelChart.call(this, plotArea, options);
11
+ }
12
+
13
+ if ( FunnelChart ) PyramidChart.__proto__ = FunnelChart;
14
+ PyramidChart.prototype = Object.create( FunnelChart && FunnelChart.prototype );
15
+ PyramidChart.prototype.constructor = PyramidChart;
16
+
17
+ return PyramidChart;
18
+ }(FunnelChart));
19
+
20
+ export default PyramidChart;
@@ -1,7 +1,11 @@
1
1
  import PlotAreaBase from './plotarea-base';
2
2
  import FunnelChart from '../funnel-chart/funnel-chart';
3
+ import PyramidChart from '../funnel-chart/pyramid-chart';
3
4
 
4
5
  import { append } from '../../common';
6
+ import { filterSeriesByType } from '../utils';
7
+
8
+ import { FUNNEL, PYRAMID } from '../constants';
5
9
 
6
10
  var FunnelPlotArea = (function (PlotAreaBase) {
7
11
  function FunnelPlotArea () {
@@ -13,12 +17,17 @@ var FunnelPlotArea = (function (PlotAreaBase) {
13
17
  FunnelPlotArea.prototype.constructor = FunnelPlotArea;
14
18
 
15
19
  FunnelPlotArea.prototype.render = function render () {
16
- this.createFunnelChart(this.series);
20
+ this.createChart(FunnelChart, filterSeriesByType(this.series, [ FUNNEL ]));
21
+ this.createChart(PyramidChart, filterSeriesByType(this.series, [ PYRAMID ]));
17
22
  };
18
23
 
19
- FunnelPlotArea.prototype.createFunnelChart = function createFunnelChart (series) {
24
+ FunnelPlotArea.prototype.createChart = function createChart (chartType, series) {
20
25
  var firstSeries = series[0];
21
- var funnelChart = new FunnelChart(this, {
26
+ if (!firstSeries) {
27
+ return;
28
+ }
29
+
30
+ var chart = new chartType(this, {
22
31
  series: series,
23
32
  legend: this.options.legend,
24
33
  neckRatio: firstSeries.neckRatio,
@@ -28,7 +37,7 @@ var FunnelPlotArea = (function (PlotAreaBase) {
28
37
  highlight: firstSeries.highlight
29
38
  });
30
39
 
31
- this.appendChart(funnelChart);
40
+ this.appendChart(chart);
32
41
  };
33
42
 
34
43
  FunnelPlotArea.prototype.appendChart = function appendChart (chart, pane) {
@@ -39,4 +48,4 @@ var FunnelPlotArea = (function (PlotAreaBase) {
39
48
  return FunnelPlotArea;
40
49
  }(PlotAreaBase));
41
50
 
42
- export default FunnelPlotArea;
51
+ export default FunnelPlotArea;
@@ -10,7 +10,7 @@ import RadarPlotArea from './plotarea/radar-plotarea';
10
10
  import FunnelPlotArea from './plotarea/funnel-plotarea';
11
11
  import HeatmapPlotArea from './plotarea/heatmap-plotarea';
12
12
 
13
- import { COLUMN, DONUT, PIE, FUNNEL, BAR, LINE, VERTICAL_LINE, AREA, VERTICAL_AREA,
13
+ import { COLUMN, DONUT, PIE, FUNNEL, PYRAMID, BAR, LINE, VERTICAL_LINE, AREA, VERTICAL_AREA,
14
14
  CANDLESTICK, OHLC, BULLET, VERTICAL_BULLET, BOX_PLOT, VERTICAL_BOX_PLOT, RANGE_COLUMN,
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,
@@ -39,7 +39,7 @@ PlotAreaFactory.current.register(XYPlotArea, [
39
39
 
40
40
  PlotAreaFactory.current.register(PiePlotArea, [ PIE ]);
41
41
  PlotAreaFactory.current.register(DonutPlotArea, [ DONUT ]);
42
- PlotAreaFactory.current.register(FunnelPlotArea, [ FUNNEL ]);
42
+ PlotAreaFactory.current.register(FunnelPlotArea, [ FUNNEL, PYRAMID ]);
43
43
 
44
44
  PlotAreaFactory.current.register(PolarPlotArea, [ POLAR_AREA, POLAR_LINE, POLAR_SCATTER ]);
45
45
  PlotAreaFactory.current.register(RadarPlotArea, [ RADAR_AREA, RADAR_COLUMN, RADAR_LINE ]);
@@ -65,7 +65,7 @@ SeriesBinder.current.register([ POLAR_AREA, POLAR_LINE, POLAR_SCATTER ], [ X, Y
65
65
  SeriesBinder.current.register([ RADAR_AREA, RADAR_COLUMN, RADAR_LINE ], [ VALUE ], [ COLOR, DRILLDOWN_FIELD ]);
66
66
 
67
67
  SeriesBinder.current.register(
68
- [ FUNNEL ],
68
+ [ FUNNEL, PYRAMID ],
69
69
  [ VALUE ], [ CATEGORY, COLOR, "visibleInLegend", "visible", DRILLDOWN_FIELD ]
70
70
  );
71
71
 
@@ -114,6 +114,7 @@ var Selection = (function (Class) {
114
114
  top: (selectionStyles.height - rightHandleHeight) / 2
115
115
  });
116
116
 
117
+ /* eslint no-self-assign: "off" */
117
118
  wrapper.style.cssText = wrapper.style.cssText;
118
119
  };
119
120
 
@@ -587,7 +588,7 @@ var Selection = (function (Class) {
587
588
  limitValue(to + delta, range.from + 1, max),
588
589
  min,
589
590
  max
590
- );
591
+ );
591
592
  }
592
593
 
593
594
  if (range.from !== oldRange.from || range.to !== oldRange.to) {
@@ -48,7 +48,7 @@ var HTMLFontIcon = (function (HTMLBaseIcon) {
48
48
  HTMLFontIcon.prototype.constructor = HTMLFontIcon;
49
49
 
50
50
  HTMLFontIcon.prototype.wrapper = function wrapper () {
51
- // Find if there is an existing k-i- class appended to the element.
51
+ // Find if there is an existing k-i- class appended to the element.
52
52
  var currentIconClass = this.element.className.split(" ").find(function (x) { return x.startsWith(KI_PREFFIX); });
53
53
  var className = this.options.icon ? ("" + (this.options.icon.startsWith(KI_PREFFIX) ? "" : KI_PREFFIX) + (this.options.icon)) : "";
54
54
 
@@ -1,6 +1,6 @@
1
1
  import { Chart } from '../chart';
2
2
  import { BAR, BULLET, PIE, COLUMN, VERTICAL_BULLET } from '../chart/constants';
3
- import{ addClass, deepExtend, elementSize, getSpacing, inArray, isArray, isNumber, setDefaultOptions } from '../common';
3
+ import { addClass, deepExtend, elementSize, getSpacing, inArray, isArray, isNumber, setDefaultOptions } from '../common';
4
4
  import SharedTooltip from './shared-tooltip';
5
5
 
6
6
  var DEAULT_BAR_WIDTH = 150;
@@ -247,6 +247,8 @@ const funnelSeries = () => ({
247
247
  }
248
248
  });
249
249
 
250
+ const pyramidSeries = funnelSeries;
251
+
250
252
  const heatmapSeries = () => ({
251
253
  labels: {
252
254
  color: '',
@@ -281,6 +283,7 @@ const seriesDefaults = (options) => ({
281
283
  pie: pieSeries(),
282
284
  donut: donutSeries(),
283
285
  funnel: funnelSeries(),
286
+ pyramid: pyramidSeries(),
284
287
  horizontalWaterfall: waterfallSeries(),
285
288
  line: lineSeries(),
286
289
  notes: notes(),
@@ -28,7 +28,7 @@ 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,
31
+ RENDER, CATEGORY, PIE, DONUT, FUNNEL, PYRAMID, COLUMN, MOUSEWHEEL, MOUSEWHEEL_DELAY, MOUSEWHEEL_ZOOM_RATE, SHOW_TOOLTIP, SERIES_HOVER,
32
32
  SERIES_OVER, SERIES_LEAVE, SERIES_CLICK, DRILLDOWN } from './constants';
33
33
 
34
34
  import './animations';
@@ -195,7 +195,7 @@ class Chart extends Class {
195
195
 
196
196
  if (firstSeries.type === DONUT) {
197
197
  points = pointByCategoryName(plotArea.pointsBySeriesName(seriesName), categoryName);
198
- } else if (firstSeries.type === PIE || firstSeries.type === FUNNEL) {
198
+ } else if (inArray(firstSeries.type, [ PIE, FUNNEL, PYRAMID ])) {
199
199
  points = pointByCategoryName((plotArea.charts[0] || {}).points, categoryName);
200
200
  } else {
201
201
  points = plotArea.pointsBySeriesName(seriesName);
@@ -625,6 +625,11 @@ class Chart extends Class {
625
625
  this._plotAreaHovered = false;
626
626
  this.trigger(PLOT_AREA_LEAVE);
627
627
  }
628
+
629
+ if (this._hasInactiveOpacity() && this._activeChartInstance) {
630
+ this._applySeriesOpacity(this._activeChartInstance.children, null, true);
631
+ this._updateSeriesOpacity(null, true);
632
+ }
628
633
  }
629
634
 
630
635
  _cancelDomEvents() {
@@ -1526,7 +1531,7 @@ class Chart extends Class {
1526
1531
  const currentSeries = (plotArea.srcSeries || plotArea.series)[seriesIndex];
1527
1532
  let items;
1528
1533
 
1529
- if (inArray(currentSeries.type, [ PIE, DONUT, FUNNEL ])) {
1534
+ if (inArray(currentSeries.type, [ PIE, DONUT, FUNNEL, PYRAMID ])) {
1530
1535
  items = plotArea.findPoint(function(point) {
1531
1536
  return point.series.index === seriesIndex && point.index === pointIndex;
1532
1537
  });
@@ -34,6 +34,7 @@ const CANDLESTICK = "candlestick";
34
34
  const COLUMN = "column";
35
35
  const DONUT = "donut";
36
36
  const FUNNEL = "funnel";
37
+ const PYRAMID = "pyramid";
37
38
  const HEATMAP = "heatmap";
38
39
  const HORIZONTAL_WATERFALL = "horizontalWaterfall";
39
40
  const LINE = "line";
@@ -108,7 +109,7 @@ export {
108
109
  X_ERROR_LOW_FIELD, X_ERROR_HIGH_FIELD,
109
110
  Y_ERROR_LOW_FIELD, Y_ERROR_HIGH_FIELD,
110
111
  LINE_MARKER_SIZE, INTERPOLATE, ZERO,
111
- SMOOTH, STEP, CATEGORY, FUNNEL,
112
+ SMOOTH, STEP, CATEGORY, FUNNEL, PYRAMID,
112
113
  BAR, CANDLESTICK, PIE, COLUMN, AREA,
113
114
  VERTICAL_BULLET, BOX_PLOT, OHLC, WATERFALL, LINE,
114
115
  BULLET, VERTICAL_LINE, VERTICAL_AREA, RANGE_AREA, VERTICAL_RANGE_AREA,
@@ -0,0 +1,14 @@
1
+ import FunnelChart from './funnel-chart';
2
+
3
+ const MAX_NECK_RATIO = 1e6;
4
+
5
+ class PyramidChart extends FunnelChart {
6
+ constructor(plotArea, options) {
7
+ options.dynamicSlope = false;
8
+ options.neckRatio = MAX_NECK_RATIO;
9
+
10
+ super(plotArea, options);
11
+ }
12
+ }
13
+
14
+ export default PyramidChart;
@@ -1,16 +1,25 @@
1
1
  import PlotAreaBase from './plotarea-base';
2
2
  import FunnelChart from '../funnel-chart/funnel-chart';
3
+ import PyramidChart from '../funnel-chart/pyramid-chart';
3
4
 
4
5
  import { append } from '../../common';
6
+ import { filterSeriesByType } from '../utils';
7
+
8
+ import { FUNNEL, PYRAMID } from '../constants';
5
9
 
6
10
  class FunnelPlotArea extends PlotAreaBase {
7
11
  render() {
8
- this.createFunnelChart(this.series);
12
+ this.createChart(FunnelChart, filterSeriesByType(this.series, [ FUNNEL ]));
13
+ this.createChart(PyramidChart, filterSeriesByType(this.series, [ PYRAMID ]));
9
14
  }
10
15
 
11
- createFunnelChart(series) {
16
+ createChart(chartType, series) {
12
17
  const firstSeries = series[0];
13
- const funnelChart = new FunnelChart(this, {
18
+ if (!firstSeries) {
19
+ return;
20
+ }
21
+
22
+ const chart = new chartType(this, {
14
23
  series: series,
15
24
  legend: this.options.legend,
16
25
  neckRatio: firstSeries.neckRatio,
@@ -20,7 +29,7 @@ class FunnelPlotArea extends PlotAreaBase {
20
29
  highlight: firstSeries.highlight
21
30
  });
22
31
 
23
- this.appendChart(funnelChart);
32
+ this.appendChart(chart);
24
33
  }
25
34
 
26
35
  appendChart(chart, pane) {
@@ -29,4 +38,4 @@ class FunnelPlotArea extends PlotAreaBase {
29
38
  }
30
39
  }
31
40
 
32
- export default FunnelPlotArea;
41
+ export default FunnelPlotArea;
@@ -10,7 +10,7 @@ import RadarPlotArea from './plotarea/radar-plotarea';
10
10
  import FunnelPlotArea from './plotarea/funnel-plotarea';
11
11
  import HeatmapPlotArea from './plotarea/heatmap-plotarea';
12
12
 
13
- import { COLUMN, DONUT, PIE, FUNNEL, BAR, LINE, VERTICAL_LINE, AREA, VERTICAL_AREA,
13
+ import { COLUMN, DONUT, PIE, FUNNEL, PYRAMID, BAR, LINE, VERTICAL_LINE, AREA, VERTICAL_AREA,
14
14
  CANDLESTICK, OHLC, BULLET, VERTICAL_BULLET, BOX_PLOT, VERTICAL_BOX_PLOT, RANGE_COLUMN,
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,
@@ -39,7 +39,7 @@ PlotAreaFactory.current.register(XYPlotArea, [
39
39
 
40
40
  PlotAreaFactory.current.register(PiePlotArea, [ PIE ]);
41
41
  PlotAreaFactory.current.register(DonutPlotArea, [ DONUT ]);
42
- PlotAreaFactory.current.register(FunnelPlotArea, [ FUNNEL ]);
42
+ PlotAreaFactory.current.register(FunnelPlotArea, [ FUNNEL, PYRAMID ]);
43
43
 
44
44
  PlotAreaFactory.current.register(PolarPlotArea, [ POLAR_AREA, POLAR_LINE, POLAR_SCATTER ]);
45
45
  PlotAreaFactory.current.register(RadarPlotArea, [ RADAR_AREA, RADAR_COLUMN, RADAR_LINE ]);
@@ -65,7 +65,7 @@ SeriesBinder.current.register([ POLAR_AREA, POLAR_LINE, POLAR_SCATTER ], [ X, Y
65
65
  SeriesBinder.current.register([ RADAR_AREA, RADAR_COLUMN, RADAR_LINE ], [ VALUE ], [ COLOR, DRILLDOWN_FIELD ]);
66
66
 
67
67
  SeriesBinder.current.register(
68
- [ FUNNEL ],
68
+ [ FUNNEL, PYRAMID ],
69
69
  [ VALUE ], [ CATEGORY, COLOR, "visibleInLegend", "visible", DRILLDOWN_FIELD ]
70
70
  );
71
71
 
@@ -110,6 +110,7 @@ class Selection extends Class {
110
110
  top: (selectionStyles.height - rightHandleHeight) / 2
111
111
  });
112
112
 
113
+ /* eslint no-self-assign: "off" */
113
114
  wrapper.style.cssText = wrapper.style.cssText;
114
115
  }
115
116
 
@@ -565,7 +566,7 @@ class Selection extends Class {
565
566
  limitValue(to + delta, range.from + 1, max),
566
567
  min,
567
568
  max
568
- );
569
+ );
569
570
  }
570
571
 
571
572
  if (range.from !== oldRange.from || range.to !== oldRange.to) {
@@ -46,7 +46,7 @@ class HTMLFontIcon extends HTMLBaseIcon {
46
46
  }
47
47
 
48
48
  wrapper() {
49
- // Find if there is an existing k-i- class appended to the element.
49
+ // Find if there is an existing k-i- class appended to the element.
50
50
  let currentIconClass = this.element.className.split(" ").find(x => x.startsWith(KI_PREFFIX));
51
51
  let className = this.options.icon ? `${this.options.icon.startsWith(KI_PREFFIX) ? "" : KI_PREFFIX}${this.options.icon}` : "";
52
52
 
@@ -1,6 +1,6 @@
1
1
  import { Chart } from '../chart';
2
2
  import { BAR, BULLET, PIE, COLUMN, VERTICAL_BULLET } from '../chart/constants';
3
- import{ addClass, deepExtend, elementSize, getSpacing, inArray, isArray, isNumber, setDefaultOptions } from '../common';
3
+ import { addClass, deepExtend, elementSize, getSpacing, inArray, isArray, isNumber, setDefaultOptions } from '../common';
4
4
  import SharedTooltip from './shared-tooltip';
5
5
 
6
6
  const DEAULT_BAR_WIDTH = 150;