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

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);
@@ -1574,7 +1574,7 @@ var Chart = (function (Class) {
1574
1574
  var currentSeries = (plotArea.srcSeries || plotArea.series)[seriesIndex];
1575
1575
  var items;
1576
1576
 
1577
- if (inArray(currentSeries.type, [ PIE, DONUT, FUNNEL ])) {
1577
+ if (inArray(currentSeries.type, [ PIE, DONUT, FUNNEL, PYRAMID ])) {
1578
1578
  items = plotArea.findPoint(function(point) {
1579
1579
  return point.series.index === seriesIndex && point.index === pointIndex;
1580
1580
  });
@@ -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
 
@@ -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);
@@ -1526,7 +1526,7 @@ class Chart extends Class {
1526
1526
  const currentSeries = (plotArea.srcSeries || plotArea.series)[seriesIndex];
1527
1527
  let items;
1528
1528
 
1529
- if (inArray(currentSeries.type, [ PIE, DONUT, FUNNEL ])) {
1529
+ if (inArray(currentSeries.type, [ PIE, DONUT, FUNNEL, PYRAMID ])) {
1530
1530
  items = plotArea.findPoint(function(point) {
1531
1531
  return point.series.index === seriesIndex && point.index === pointIndex;
1532
1532
  });
@@ -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