@progress/kendo-charts 1.22.0 → 1.23.0-dev.202201170838

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 (59) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +119 -79
  3. package/dist/cdn/js/kendo-charts.js +1 -1
  4. package/dist/cdn/main.js +1 -1
  5. package/dist/es/common/keys.js +25 -0
  6. package/dist/es/common.js +1 -0
  7. package/dist/es/drawing-utils.js +27 -3
  8. package/dist/es/main.js +1 -0
  9. package/dist/es/map/attribution.js +158 -0
  10. package/dist/es/map/crs.js +277 -0
  11. package/dist/es/map/datums.js +16 -0
  12. package/dist/es/map/extent.js +129 -0
  13. package/dist/es/map/layers/bubble.js +185 -0
  14. package/dist/es/map/layers/layer.js +140 -0
  15. package/dist/es/map/layers/marker.js +347 -0
  16. package/dist/es/map/layers/shape.js +389 -0
  17. package/dist/es/map/layers/tile.js +491 -0
  18. package/dist/es/map/location.js +201 -0
  19. package/dist/es/map/map.js +945 -0
  20. package/dist/es/map/navigator.js +175 -0
  21. package/dist/es/map/scroller/draggable.js +454 -0
  22. package/dist/es/map/scroller/fx.js +119 -0
  23. package/dist/es/map/scroller/observable.js +175 -0
  24. package/dist/es/map/scroller/scroller.js +746 -0
  25. package/dist/es/map/scroller/user-events.js +713 -0
  26. package/dist/es/map/utils.js +450 -0
  27. package/dist/es/map/zoom.js +139 -0
  28. package/dist/es/map.js +1 -0
  29. package/dist/es/services/map-service.js +15 -0
  30. package/dist/es2015/common/keys.js +25 -0
  31. package/dist/es2015/common.js +1 -0
  32. package/dist/es2015/drawing-utils.js +43 -3
  33. package/dist/es2015/main.js +1 -0
  34. package/dist/es2015/map/attribution.js +148 -0
  35. package/dist/es2015/map/crs.js +233 -0
  36. package/dist/es2015/map/datums.js +16 -0
  37. package/dist/es2015/map/extent.js +115 -0
  38. package/dist/es2015/map/layers/bubble.js +167 -0
  39. package/dist/es2015/map/layers/layer.js +134 -0
  40. package/dist/es2015/map/layers/marker.js +327 -0
  41. package/dist/es2015/map/layers/shape.js +369 -0
  42. package/dist/es2015/map/layers/tile.js +465 -0
  43. package/dist/es2015/map/location.js +193 -0
  44. package/dist/es2015/map/map.js +915 -0
  45. package/dist/es2015/map/navigator.js +170 -0
  46. package/dist/es2015/map/scroller/draggable.js +418 -0
  47. package/dist/es2015/map/scroller/fx.js +112 -0
  48. package/dist/es2015/map/scroller/observable.js +165 -0
  49. package/dist/es2015/map/scroller/scroller.js +716 -0
  50. package/dist/es2015/map/scroller/user-events.js +695 -0
  51. package/dist/es2015/map/utils.js +450 -0
  52. package/dist/es2015/map/zoom.js +134 -0
  53. package/dist/es2015/map.js +1 -0
  54. package/dist/es2015/services/map-service.js +15 -0
  55. package/dist/npm/main.d.ts +1 -0
  56. package/dist/npm/main.js +6218 -342
  57. package/dist/npm/map.d.ts +4 -0
  58. package/dist/systemjs/kendo-charts.js +1 -1
  59. package/package.json +1 -1
@@ -0,0 +1,175 @@
1
+ import {
2
+ deepExtend,
3
+ addClass,
4
+ keys,
5
+ setDefaultOptions
6
+ } from '../common';
7
+
8
+ import {
9
+ Observable
10
+ } from './scroller/observable';
11
+
12
+ import {
13
+ proxy,
14
+ on,
15
+ off,
16
+ setDefaultEvents,
17
+ convertToHtml
18
+ } from './utils';
19
+
20
+ var PAN = "pan";
21
+
22
+ var directionsMap = {
23
+ up: {
24
+ className: "k-navigator-n",
25
+ iconClass: "k-i-arrow-n"
26
+ },
27
+ down: {
28
+ className: "k-navigator-s",
29
+ iconClass: "k-i-arrow-s"
30
+ },
31
+ right: {
32
+ className: "k-navigator-e",
33
+ iconClass: "k-i-arrow-e"
34
+ },
35
+ left: {
36
+ className: "k-navigator-w",
37
+ iconClass: "k-i-arrow-w"
38
+ }
39
+ };
40
+
41
+ function createButton(direction) {
42
+ var html =
43
+ '<button class="k-button k-button-square k-rounded-full k-button-flat k-button-flat-base k-icon-button ' +
44
+ directionsMap[direction].className +
45
+ '" aria-label="move ' + direction + '">' +
46
+ '<span class="k-icon ' + directionsMap[direction].iconClass + '" />' +
47
+ '</button>';
48
+
49
+ return convertToHtml(html);
50
+ }
51
+
52
+ export var Navigator = (function (Observable) {
53
+ function Navigator(element, options) {
54
+ Observable.call(this);
55
+
56
+ this.element = element;
57
+ this._initOptions(options);
58
+
59
+ var navigateUpButton = createButton("up");
60
+ var navigateRightlButton = createButton("right");
61
+ var navigateDownButton = createButton("down");
62
+ var navigateLeftButton = createButton("left");
63
+
64
+ this.element.appendChild(navigateUpButton);
65
+ this.element.appendChild(navigateRightlButton);
66
+ this.element.appendChild(navigateDownButton);
67
+ this.element.appendChild(navigateLeftButton);
68
+
69
+ addClass(this.element, 'k-widget k-navigator');
70
+
71
+ on(this.element, "click", ".k-button", proxy(this._click, this));
72
+
73
+ var parentElement = this.element.parentNode.closest("[data-role]");
74
+
75
+ this._keyroot = parentElement ? parentElement : this.element;
76
+ this._tabindex(this._keyroot);
77
+
78
+ this._keydownHandler = proxy(this._keydown, this);
79
+ on(this._keyroot, "keydown", this._keydownHandler);
80
+ }
81
+
82
+ if ( Observable ) Navigator.__proto__ = Observable;
83
+ Navigator.prototype = Object.create( Observable && Observable.prototype );
84
+ Navigator.prototype.constructor = Navigator;
85
+
86
+ Navigator.prototype.destroy = function destroy () {
87
+ this.dispose();
88
+ };
89
+
90
+ // originates from the kendo.jquery version
91
+ Navigator.prototype.dispose = function dispose () {
92
+ off(this._keyroot, "keydown", this._keydownHandler);
93
+ };
94
+
95
+ Navigator.prototype._tabindex = function _tabindex (target) {
96
+ var targetElement = target || this.wrapper || this.element;
97
+
98
+ var element = this.element,
99
+ TABINDEX = "tabindex",
100
+ tabindex = targetElement.getAttribute(TABINDEX) || element.getAttribute(TABINDEX);
101
+
102
+ element.removeAttribute(TABINDEX);
103
+
104
+ targetElement.setAttribute(TABINDEX, !isNaN(tabindex) ? tabindex : 0);
105
+ };
106
+
107
+ Navigator.prototype._initOptions = function _initOptions (options) {
108
+ this.options = deepExtend({}, this.options, options);
109
+ };
110
+
111
+ Navigator.prototype._pan = function _pan (x, y) {
112
+ var panStep = this.options.panStep;
113
+
114
+ this.trigger(PAN, {
115
+ x: x * panStep,
116
+ y: y * panStep
117
+ });
118
+ };
119
+
120
+ Navigator.prototype._click = function _click (e) {
121
+ var x = 0;
122
+ var y = 0;
123
+ var button = e.currentTarget;
124
+
125
+ if (button.matches('.k-navigator-n')) {
126
+ y = 1;
127
+ } else if (button.matches('.k-navigator-s')) {
128
+ y = -1;
129
+ } else if (button.matches('.k-navigator-e')) {
130
+ x = 1;
131
+ } else if (button.matches('.k-navigator-w')) {
132
+ x = -1;
133
+ }
134
+
135
+ this._pan(x, y);
136
+
137
+ e.preventDefault();
138
+ };
139
+
140
+ /* eslint-disable indent */
141
+ Navigator.prototype._keydown = function _keydown (e) {
142
+ switch (e.which) {
143
+ case keys.UP:
144
+ this._pan(0, 1);
145
+ e.preventDefault();
146
+ break;
147
+ case keys.DOWN:
148
+ this._pan(0, -1);
149
+ e.preventDefault();
150
+ break;
151
+ case keys.RIGHT:
152
+ this._pan(1, 0);
153
+ e.preventDefault();
154
+ break;
155
+ case keys.LEFT:
156
+ this._pan(-1, 0);
157
+ e.preventDefault();
158
+ break;
159
+ default:
160
+ break;
161
+ }
162
+ };
163
+
164
+ return Navigator;
165
+ }(Observable));
166
+
167
+ setDefaultOptions(Navigator, {
168
+ name: 'Navigator',
169
+ panStep: 1
170
+ });
171
+
172
+
173
+ setDefaultEvents(Navigator, [
174
+ PAN
175
+ ]);
@@ -0,0 +1,454 @@
1
+ import {
2
+ Class,
3
+ elementOffset
4
+ } from '../../common';
5
+
6
+ import {
7
+ Observable
8
+ } from './observable';
9
+
10
+ import {
11
+ getEventMap,
12
+ proxy,
13
+ getSupportedFeatures
14
+ } from '../utils';
15
+
16
+ var extend = Object.assign;
17
+
18
+ var CHANGE = 'change';
19
+
20
+ export var TapCapture = (function (Observable) {
21
+ function TapCapture(element, options) {
22
+ Observable.call(this);
23
+ var that = this,
24
+ domElement = element[0] || element;
25
+
26
+ that.capture = false;
27
+
28
+ var eventMap = getEventMap(navigator.userAgent);
29
+
30
+ if (domElement.addEventListener) {
31
+ eventMap.down.split(' ').forEach(function(event) {
32
+ domElement.addEventListener(event, proxy(that._press, that), true);
33
+ });
34
+ eventMap.up.split(' ').forEach(function(event) {
35
+ domElement.addEventListener(event, proxy(that._release, that), true);
36
+ });
37
+ } else {
38
+ eventMap.down.split(' ').forEach(function(event) {
39
+ domElement.attachEvent(event, proxy(that._press, that));
40
+ });
41
+ eventMap.up.split(' ').forEach(function(event) {
42
+ domElement.attachEvent(event, proxy(that._release, that));
43
+ });
44
+ }
45
+
46
+ that.bind([
47
+ 'press',
48
+ 'release'
49
+ ], options || {});
50
+ }
51
+
52
+ if ( Observable ) TapCapture.__proto__ = Observable;
53
+ TapCapture.prototype = Object.create( Observable && Observable.prototype );
54
+ TapCapture.prototype.constructor = TapCapture;
55
+
56
+ TapCapture.prototype.captureNext = function captureNext () {
57
+ this.capture = true;
58
+ };
59
+
60
+ TapCapture.prototype.cancelCapture = function cancelCapture () {
61
+ this.capture = false;
62
+ };
63
+
64
+ TapCapture.prototype._press = function _press (e) {
65
+ var that = this;
66
+
67
+ that.trigger('press');
68
+
69
+ if (that.capture) {
70
+ e.preventDefault();
71
+ }
72
+ };
73
+
74
+ TapCapture.prototype._release = function _release (e) {
75
+ var that = this;
76
+
77
+ that.trigger('release');
78
+
79
+ if (that.capture) {
80
+ e.preventDefault();
81
+ that.cancelCapture();
82
+ }
83
+ };
84
+
85
+ return TapCapture;
86
+ }(Observable));
87
+
88
+ export var PaneDimension = (function (Observable) {
89
+ function PaneDimension(options) {
90
+ Observable.call(this);
91
+ var that = this;
92
+ that.forcedEnabled = false;
93
+ extend(that, options);
94
+ that.scale = 1;
95
+
96
+ if (that.horizontal) {
97
+ that.measure = 'offsetWidth';
98
+ that.scrollSize = 'scrollWidth';
99
+ that.axis = 'x';
100
+ } else {
101
+ that.measure = 'offsetHeight';
102
+ that.scrollSize = 'scrollHeight';
103
+ that.axis = 'y';
104
+ }
105
+ }
106
+
107
+ if ( Observable ) PaneDimension.__proto__ = Observable;
108
+ PaneDimension.prototype = Object.create( Observable && Observable.prototype );
109
+ PaneDimension.prototype.constructor = PaneDimension;
110
+
111
+ PaneDimension.prototype.makeVirtual = function makeVirtual () {
112
+ extend(this, {
113
+ virtual: true,
114
+ forcedEnabled: true,
115
+ _virtualMin: 0,
116
+ _virtualMax: 0
117
+ });
118
+ };
119
+
120
+ PaneDimension.prototype.virtualSize = function virtualSize (min, max) {
121
+ if (this._virtualMin !== min || this._virtualMax !== max) {
122
+ this._virtualMin = min;
123
+ this._virtualMax = max;
124
+ this.update();
125
+ }
126
+ };
127
+
128
+ PaneDimension.prototype.outOfBounds = function outOfBounds (offset) {
129
+ return offset > this.max || offset < this.min;
130
+ };
131
+
132
+ PaneDimension.prototype.forceEnabled = function forceEnabled () {
133
+ this.forcedEnabled = true;
134
+ };
135
+
136
+ PaneDimension.prototype.getSize = function getSize () {
137
+ return this.container[this.measure];
138
+ };
139
+
140
+ PaneDimension.prototype.getTotal = function getTotal () {
141
+ return this.element[this.scrollSize];
142
+ };
143
+
144
+ PaneDimension.prototype.rescale = function rescale (scale) {
145
+ this.scale = scale;
146
+ };
147
+
148
+ PaneDimension.prototype.update = function update (silent) {
149
+ var that = this,
150
+ total = that.virtual ? that._virtualMax : that.getTotal(),
151
+ scaledTotal = total * that.scale,
152
+ size = that.getSize();
153
+
154
+ if (total === 0 && !that.forcedEnabled) {
155
+ return;
156
+ }
157
+
158
+ that.max = that.virtual ? -that._virtualMin : 0;
159
+ that.size = size;
160
+ that.total = scaledTotal;
161
+ that.min = Math.min(that.max, size - scaledTotal);
162
+ that.minScale = size / total;
163
+ that.centerOffset = (scaledTotal - size) / 2;
164
+ that.enabled = that.forcedEnabled || scaledTotal > size;
165
+
166
+ if (!silent) {
167
+ that.trigger(CHANGE, that);
168
+ }
169
+ };
170
+
171
+ return PaneDimension;
172
+ }(Observable));
173
+
174
+ export var PaneDimensions = (function (Observable) {
175
+ function PaneDimensions(options) {
176
+ Observable.call(this);
177
+ var that = this;
178
+
179
+ that.x = new PaneDimension(extend({
180
+ horizontal: true
181
+ }, options));
182
+
183
+ that.y = new PaneDimension(extend({
184
+ horizontal: false
185
+ }, options));
186
+
187
+ that.container = options.container;
188
+ that.forcedMinScale = options.minScale;
189
+ that.maxScale = options.maxScale || 100;
190
+ that.bind(CHANGE, options);
191
+ }
192
+
193
+ if ( Observable ) PaneDimensions.__proto__ = Observable;
194
+ PaneDimensions.prototype = Object.create( Observable && Observable.prototype );
195
+ PaneDimensions.prototype.constructor = PaneDimensions;
196
+
197
+ PaneDimensions.prototype.rescale = function rescale (newScale) {
198
+ this.x.rescale(newScale);
199
+ this.y.rescale(newScale);
200
+ this.refresh();
201
+ };
202
+
203
+ PaneDimensions.prototype.centerCoordinates = function centerCoordinates () {
204
+ return {
205
+ x: Math.min(0, -this.x.centerOffset),
206
+ y: Math.min(0, -this.y.centerOffset)
207
+ };
208
+ };
209
+
210
+ PaneDimensions.prototype.refresh = function refresh () {
211
+ var that = this;
212
+ that.x.update();
213
+ that.y.update();
214
+ that.enabled = that.x.enabled || that.y.enabled;
215
+ that.minScale = that.forcedMinScale || Math.min(that.x.minScale, that.y.minScale);
216
+ that.fitScale = Math.max(that.x.minScale, that.y.minScale);
217
+ that.trigger(CHANGE);
218
+ };
219
+
220
+ return PaneDimensions;
221
+ }(Observable));
222
+
223
+ export var PaneAxis = (function (Observable) {
224
+ function PaneAxis(options) {
225
+ Observable.call(this);
226
+ extend(this, options);
227
+ }
228
+
229
+ if ( Observable ) PaneAxis.__proto__ = Observable;
230
+ PaneAxis.prototype = Object.create( Observable && Observable.prototype );
231
+ PaneAxis.prototype.constructor = PaneAxis;
232
+
233
+ PaneAxis.prototype.outOfBounds = function outOfBounds () {
234
+ return this.dimension.outOfBounds(this.movable[this.axis]);
235
+ };
236
+
237
+ PaneAxis.prototype.dragMove = function dragMove (delta) {
238
+ var that = this,
239
+ dimension = that.dimension,
240
+ axis = that.axis,
241
+ movable = that.movable,
242
+ position = movable[axis] + delta;
243
+
244
+ if (!dimension.enabled) {
245
+ return;
246
+ }
247
+
248
+ var dragDelta = delta;
249
+
250
+ if (position < dimension.min && delta < 0 || position > dimension.max && delta > 0) {
251
+ dragDelta *= that.resistance;
252
+ }
253
+
254
+ movable.translateAxis(axis, dragDelta);
255
+ that.trigger(CHANGE, that);
256
+ };
257
+
258
+ return PaneAxis;
259
+ }(Observable));
260
+
261
+ export var Pane = (function (Class) {
262
+ function Pane(options) {
263
+ Class.call(this);
264
+
265
+ var that = this,
266
+ x, y,
267
+ resistance,
268
+ movable;
269
+
270
+ extend(that, {
271
+ elastic: true
272
+ }, options);
273
+
274
+ resistance = that.elastic ? 0.5 : 0;
275
+ movable = that.movable;
276
+
277
+ that.x = x = new PaneAxis({
278
+ axis: 'x',
279
+ dimension: that.dimensions.x,
280
+ resistance: resistance,
281
+ movable: movable
282
+ });
283
+
284
+ that.y = y = new PaneAxis({
285
+ axis: 'y',
286
+ dimension: that.dimensions.y,
287
+ resistance: resistance,
288
+ movable: movable
289
+ });
290
+
291
+ that.userEvents.bind([
292
+ 'press',
293
+ 'move',
294
+ 'end',
295
+ 'gesturestart',
296
+ 'gesturechange'
297
+ ], {
298
+ gesturestart: function gesturestart(e) {
299
+ that.gesture = e;
300
+
301
+ that.offset = elementOffset(that.dimensions.container);
302
+ },
303
+ press: function press(e) {
304
+ var closestAnchor = e.event.target.closest('a');
305
+
306
+ if (closestAnchor && closestAnchor.matches('[data-navigate-on-press=true]')) {
307
+ e.sender.cancel();
308
+ }
309
+ },
310
+ gesturechange: function gesturechange(e) {
311
+ var previousGesture = that.gesture,
312
+ previousCenter = previousGesture.center,
313
+ center = e.center,
314
+ scaleDelta = e.distance / previousGesture.distance,
315
+ minScale = that.dimensions.minScale,
316
+ maxScale = that.dimensions.maxScale,
317
+ coordinates;
318
+ if (movable.scale <= minScale && scaleDelta < 1) {
319
+ scaleDelta += (1 - scaleDelta) * 0.8;
320
+ }
321
+
322
+ if (movable.scale * scaleDelta >= maxScale) {
323
+ scaleDelta = maxScale / movable.scale;
324
+ }
325
+
326
+ var offsetX = movable.x + that.offset.left,
327
+ offsetY = movable.y + that.offset.top;
328
+ coordinates = {
329
+ x: (offsetX - previousCenter.x) * scaleDelta + center.x - offsetX,
330
+ y: (offsetY - previousCenter.y) * scaleDelta + center.y - offsetY
331
+ };
332
+
333
+ movable.scaleWith(scaleDelta);
334
+
335
+ x.dragMove(coordinates.x);
336
+ y.dragMove(coordinates.y);
337
+
338
+ that.dimensions.rescale(movable.scale);
339
+ that.gesture = e;
340
+
341
+ e.preventDefault();
342
+ },
343
+ move: function move(e) {
344
+ if (e.event.target.tagName.match(/textarea|input/i)) {
345
+ return;
346
+ }
347
+
348
+ if (x.dimension.enabled || y.dimension.enabled) {
349
+ x.dragMove(e.x.delta);
350
+ y.dragMove(e.y.delta);
351
+ e.preventDefault();
352
+ } else {
353
+ e.touch.skip();
354
+ }
355
+ },
356
+ end: function end(e) {
357
+ e.preventDefault();
358
+ }
359
+ });
360
+ }
361
+
362
+ if ( Class ) Pane.__proto__ = Class;
363
+ Pane.prototype = Object.create( Class && Class.prototype );
364
+ Pane.prototype.constructor = Pane;
365
+
366
+ return Pane;
367
+ }(Class));
368
+
369
+ var translate = function(x, y, scale) {
370
+ return 'translate3d(' + x + 'px,' + y + 'px,0) scale(' + scale + ')';
371
+ };
372
+
373
+ export var Movable = (function (Observable) {
374
+ function Movable(element) {
375
+ Observable.call(this);
376
+
377
+ var that = this;
378
+
379
+ that.support = getSupportedFeatures();
380
+ this.transformStyle = this.support.transitions.prefix + 'Transform';
381
+ that.element = element;
382
+ that.element.style.webkitTransformOrigin = 'left top';
383
+ that.x = 0;
384
+ that.y = 0;
385
+ that.scale = 1;
386
+
387
+ var coordinates = translate(that.x, that.y, that.scale);
388
+ that.element.style[this.transformStyle] = coordinates;
389
+
390
+ that._saveCoordinates(coordinates);
391
+ }
392
+
393
+ if ( Observable ) Movable.__proto__ = Observable;
394
+ Movable.prototype = Object.create( Observable && Observable.prototype );
395
+ Movable.prototype.constructor = Movable;
396
+
397
+ Movable.prototype.translateAxis = function translateAxis (axis, by) {
398
+ this[axis] += by;
399
+ this.refresh();
400
+ };
401
+
402
+ Movable.prototype.scaleTo = function scaleTo (scale) {
403
+ this.scale = scale;
404
+ this.refresh();
405
+ };
406
+
407
+ Movable.prototype.scaleWith = function scaleWith (scaleDelta) {
408
+ this.scale *= scaleDelta;
409
+ this.refresh();
410
+ };
411
+
412
+ Movable.prototype.translate = function translate (coordinates) {
413
+ this.x += coordinates.x;
414
+ this.y += coordinates.y;
415
+ this.refresh();
416
+ };
417
+
418
+ Movable.prototype.moveAxis = function moveAxis (axis, value) {
419
+ this[axis] = value;
420
+ this.refresh();
421
+ };
422
+
423
+ Movable.prototype.moveTo = function moveTo (coordinates) {
424
+ extend(this, coordinates);
425
+ this.refresh();
426
+ };
427
+
428
+ Movable.prototype.refresh = function refresh () {
429
+ var that = this,
430
+ x = that.x,
431
+ y = that.y,
432
+ newCoordinates;
433
+
434
+ if (that.round) {
435
+ x = Math.round(x);
436
+ y = Math.round(y);
437
+ }
438
+
439
+ newCoordinates = translate(x, y, that.scale);
440
+
441
+ if (newCoordinates !== that.coordinates) {
442
+ that.element.style[this.transformStyle] = newCoordinates;
443
+
444
+ that._saveCoordinates(newCoordinates);
445
+ that.trigger(CHANGE);
446
+ }
447
+ };
448
+
449
+ Movable.prototype._saveCoordinates = function _saveCoordinates (coordinates) {
450
+ this.coordinates = coordinates;
451
+ };
452
+
453
+ return Movable;
454
+ }(Observable));