@progress/kendo-charts 1.19.1 → 1.20.0-dev.202111121622

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 (61) hide show
  1. package/dist/cdn/js/kendo-charts.js +1 -1
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/chart/chart.js +15 -6
  4. package/dist/es/chart/constants.js +3 -1
  5. package/dist/es/chart/pan-and-zoom/mousewheel-zoom.js +8 -4
  6. package/dist/es/chart/selection.js +41 -1
  7. package/dist/es/common/mousewheel-delta.js +4 -7
  8. package/dist/es/core/axis.js +47 -0
  9. package/dist/es/core/category-axis.js +62 -20
  10. package/dist/es/core/date-category-axis.js +26 -38
  11. package/dist/es/core/date-value-axis.js +37 -40
  12. package/dist/es/core/logarithmic-axis.js +62 -88
  13. package/dist/es/core/numeric-axis.js +57 -81
  14. package/dist/es/main.js +1 -0
  15. package/dist/es/qrcode/encodings/data-modes/alpha-numeric-data-mode.js +103 -0
  16. package/dist/es/qrcode/encodings/data-modes/byte-data-mode.js +51 -0
  17. package/dist/es/qrcode/encodings/data-modes/data-mode-instances.js +12 -0
  18. package/dist/es/qrcode/encodings/data-modes/numeric-data-mode.js +49 -0
  19. package/dist/es/qrcode/encodings/data-modes/qr-data-mode.js +50 -0
  20. package/dist/es/qrcode/encodings/encoders/iso-encoder.js +29 -0
  21. package/dist/es/qrcode/encodings/encoders/utf8-encoder.js +91 -0
  22. package/dist/es/qrcode/encodings/encoding-result.js +16 -0
  23. package/dist/es/qrcode/encodings/encoding.js +701 -0
  24. package/dist/es/qrcode/encodings/free-cell-visitor.js +57 -0
  25. package/dist/es/qrcode/encodings/version-codewords.js +1289 -0
  26. package/dist/es/qrcode/qrcode.js +403 -0
  27. package/dist/es/qrcode/utils.js +28 -0
  28. package/dist/es/qrcode.js +1 -0
  29. package/dist/es/stock/navigator.js +3 -2
  30. package/dist/es2015/chart/chart.js +15 -6
  31. package/dist/es2015/chart/constants.js +3 -1
  32. package/dist/es2015/chart/pan-and-zoom/mousewheel-zoom.js +6 -4
  33. package/dist/es2015/chart/selection.js +40 -1
  34. package/dist/es2015/common/mousewheel-delta.js +4 -7
  35. package/dist/es2015/core/axis.js +39 -0
  36. package/dist/es2015/core/category-axis.js +56 -18
  37. package/dist/es2015/core/date-category-axis.js +27 -36
  38. package/dist/es2015/core/date-value-axis.js +35 -40
  39. package/dist/es2015/core/logarithmic-axis.js +52 -83
  40. package/dist/es2015/core/numeric-axis.js +47 -78
  41. package/dist/es2015/main.js +1 -0
  42. package/dist/es2015/qrcode/encodings/data-modes/alpha-numeric-data-mode.js +91 -0
  43. package/dist/es2015/qrcode/encodings/data-modes/byte-data-mode.js +41 -0
  44. package/dist/es2015/qrcode/encodings/data-modes/data-mode-instances.js +13 -0
  45. package/dist/es2015/qrcode/encodings/data-modes/numeric-data-mode.js +39 -0
  46. package/dist/es2015/qrcode/encodings/data-modes/qr-data-mode.js +44 -0
  47. package/dist/es2015/qrcode/encodings/encoders/iso-encoder.js +19 -0
  48. package/dist/es2015/qrcode/encodings/encoders/utf8-encoder.js +83 -0
  49. package/dist/es2015/qrcode/encodings/encoding-result.js +10 -0
  50. package/dist/es2015/qrcode/encodings/encoding.js +701 -0
  51. package/dist/es2015/qrcode/encodings/free-cell-visitor.js +49 -0
  52. package/dist/es2015/qrcode/encodings/version-codewords.js +1289 -0
  53. package/dist/es2015/qrcode/qrcode.js +395 -0
  54. package/dist/es2015/qrcode/utils.js +28 -0
  55. package/dist/es2015/qrcode.js +1 -0
  56. package/dist/es2015/stock/navigator.js +3 -2
  57. package/dist/npm/main.d.ts +1 -0
  58. package/dist/npm/main.js +3172 -283
  59. package/dist/npm/qrcode.d.ts +5 -0
  60. package/dist/systemjs/kendo-charts.js +1 -1
  61. package/package.json +1 -1
@@ -3,8 +3,8 @@ import Axis from './axis';
3
3
  import AxisLabel from './axis-label';
4
4
  import Box from './box';
5
5
 
6
- import { BLACK, DEFAULT_PRECISION, COORD_PRECISION, X, Y } from '../common/constants';
7
- import { deepExtend, defined, limitValue, round, setDefaultOptions } from '../common';
6
+ import { BLACK, DEFAULT_PRECISION, COORD_PRECISION } from '../common/constants';
7
+ import { deepExtend, defined, limitValue, round, setDefaultOptions, valueOrDefault } from '../common';
8
8
 
9
9
  import autoMajorUnit from './utils/auto-major-unit';
10
10
  import autoAxisMin from './utils/auto-axis-min';
@@ -70,17 +70,13 @@ class NumericAxis extends Axis {
70
70
 
71
71
  getTickPositions(unit, skipUnit) {
72
72
  const options = this.options;
73
- const { vertical, reverse } = options;
74
- const lineBox = this.lineBox();
75
- const lineSize = vertical ? lineBox.height() : lineBox.width();
73
+ const { axisDir, axisOrigin, lineBox, lineSize } = this.lineInfo();
76
74
  const range = options.max - options.min;
77
75
  const scale = lineSize / range;
78
76
  const step = unit * scale;
79
77
  const divisions = this.getDivisions(unit);
80
- const dir = (vertical ? -1 : 1) * (reverse ? -1 : 1);
81
- const startEdge = dir === 1 ? 1 : 2;
82
78
  const positions = [];
83
- let pos = lineBox[(vertical ? Y : X) + startEdge];
79
+ let pos = lineBox[axisOrigin];
84
80
  let skipStep = 0;
85
81
 
86
82
  if (skipUnit) {
@@ -92,7 +88,7 @@ class NumericAxis extends Axis {
92
88
  positions.push(round(pos, COORD_PRECISION));
93
89
  }
94
90
 
95
- pos = pos + step * dir;
91
+ pos = pos + step * axisDir;
96
92
  }
97
93
 
98
94
  return positions;
@@ -108,79 +104,48 @@ class NumericAxis extends Axis {
108
104
 
109
105
  getSlot(a, b, limit = false) {
110
106
  const options = this.options;
111
- const { vertical, reverse } = options;
112
- const valueAxis = vertical ? Y : X;
113
- const lineBox = this.lineBox();
114
- const lineStart = lineBox[valueAxis + (reverse ? 2 : 1)];
115
- const lineSize = vertical ? lineBox.height() : lineBox.width();
116
- const dir = reverse ? -1 : 1;
117
- const step = dir * (lineSize / (options.max - options.min));
118
- const slotBox = new Box(lineBox.x1, lineBox.y1, lineBox.x1, lineBox.y1);
119
-
120
- let start = a;
121
- let end = b;
122
-
123
- if (!defined(start)) {
124
- start = end || 0;
125
- }
107
+ const { axis, axisDir, lineBox, lineSize, lineStart } = this.lineInfo();
108
+ const step = axisDir * (lineSize / (options.max - options.min));
126
109
 
127
- if (!defined(end)) {
128
- end = start || 0;
129
- }
110
+ let start = valueOrDefault(a, b || 0);
111
+ let end = valueOrDefault(b, a || 0);
130
112
 
131
113
  if (limit) {
132
- start = Math.max(Math.min(start, options.max), options.min);
133
- end = Math.max(Math.min(end, options.max), options.min);
114
+ start = limitValue(start, options.min, options.max);
115
+ end = limitValue(end, options.min, options.max);
134
116
  }
135
117
 
136
- let p1, p2;
137
-
138
- if (vertical) {
139
- p1 = options.max - Math.max(start, end);
140
- p2 = options.max - Math.min(start, end);
141
- } else {
142
- p1 = Math.min(start, end) - options.min;
143
- p2 = Math.max(start, end) - options.min;
144
- }
118
+ const p1 = Math.min(start, end) - options.min;
119
+ const p2 = Math.max(start, end) - options.min;
145
120
 
146
- slotBox[valueAxis + 1] = limitCoordinate(lineStart + step * (reverse ? p2 : p1));
147
- slotBox[valueAxis + 2] = limitCoordinate(lineStart + step * (reverse ? p1 : p2));
121
+ const slotBox = new Box(lineBox.x1, lineBox.y1, lineBox.x1, lineBox.y1);
122
+ slotBox[axis + 1] = limitCoordinate(lineStart + step * (axisDir > 0 ? p1 : p2));
123
+ slotBox[axis + 2] = limitCoordinate(lineStart + step * (axisDir > 0 ? p2 : p1));
148
124
 
149
125
  return slotBox;
150
126
  }
151
127
 
152
128
  getValue(point) {
153
129
  const options = this.options;
154
- const { vertical, reverse } = options;
155
130
  const max = Number(options.max);
156
131
  const min = Number(options.min);
157
- const valueAxis = vertical ? Y : X;
158
- const lineBox = this.lineBox();
159
- const lineStart = lineBox[valueAxis + (reverse ? 2 : 1)];
160
- const lineSize = vertical ? lineBox.height() : lineBox.width();
161
- const dir = reverse ? -1 : 1;
162
- const offset = dir * (point[valueAxis] - lineStart);
163
- const step = (max - min) / lineSize;
164
- const valueOffset = offset * step;
165
-
166
- if (offset < 0 || offset > lineSize) {
132
+ const offset = this.pointOffset(point);
133
+ const valueOffset = offset * (max - min);
134
+
135
+ if (offset < 0 || offset > 1) {
167
136
  return null;
168
137
  }
169
138
 
170
- const value = vertical ?
171
- max - valueOffset :
172
- min + valueOffset;
173
-
139
+ const value = min + valueOffset;
174
140
  return round(value, DEFAULT_PRECISION);
175
141
  }
176
142
 
177
143
  translateRange(delta) {
178
144
  const options = this.options;
179
145
  const { vertical, reverse, max, min } = options;
180
- const lineBox = this.lineBox();
181
- const size = vertical ? lineBox.height() : lineBox.width();
146
+ const { lineSize } = this.lineInfo();
182
147
  const range = max - min;
183
- const scale = size / range;
148
+ const scale = lineSize / range;
184
149
  let offset = round(delta / scale, DEFAULT_PRECISION);
185
150
 
186
151
  if ((vertical || reverse) && !(vertical && reverse )) {
@@ -194,16 +159,6 @@ class NumericAxis extends Axis {
194
159
  };
195
160
  }
196
161
 
197
- scaleRange(delta) {
198
- const options = this.options;
199
- const offset = -delta * options.majorUnit;
200
-
201
- return {
202
- min: options.min - offset,
203
- max: options.max + offset
204
- };
205
- }
206
-
207
162
  labelsCount() {
208
163
  return this.getDivisions(this.options.majorUnit);
209
164
  }
@@ -240,18 +195,32 @@ class NumericAxis extends Axis {
240
195
  }
241
196
  }
242
197
 
243
- zoomRange(delta) {
244
- const { totalMin, totalMax } = this;
245
- const newRange = this.scaleRange(delta);
246
- const min = limitValue(newRange.min, totalMin, totalMax);
247
- const max = limitValue(newRange.max, totalMin, totalMax);
198
+ scaleRange(scale, cursor) {
199
+ const position = Math.abs(this.pointOffset(cursor));
200
+ const delta = (this.options.max - this.options.min) * Math.min(1, scale);
201
+ const minDelta = position * delta;
202
+ const maxDelta = (1 - position) * delta;
203
+ const min = this.options.min + minDelta;
204
+ let max = this.options.max - maxDelta;
248
205
 
249
- if (this.isValidRange(min, max)) {
250
- return {
251
- min: min,
252
- max: max
253
- };
206
+ if (max - min < MIN_VALUE_RANGE) {
207
+ max = min + MIN_VALUE_RANGE;
254
208
  }
209
+
210
+ return {
211
+ min: min,
212
+ max: max
213
+ };
214
+ }
215
+
216
+ zoomRange(scale, cursor) {
217
+ const { totalMin, totalMax } = this;
218
+ const range = this.scaleRange(scale, cursor);
219
+
220
+ return {
221
+ min: limitValue(range.min, totalMin, totalMax),
222
+ max: limitValue(range.max, totalMin, totalMax)
223
+ };
255
224
  }
256
225
 
257
226
  isValidRange(min, max) {
@@ -5,6 +5,7 @@ export * from './sparkline';
5
5
  export * from './stock';
6
6
  export * from './gauges';
7
7
  export * from './barcode';
8
+ export * from './qrcode';
8
9
  export * from './common';
9
10
 
10
11
  export { baseTheme as chartBaseTheme } from './chart/base-theme';
@@ -0,0 +1,91 @@
1
+ import { QRDataMode } from './qr-data-mode';
2
+ import { extend } from '../../utils';
3
+ import {
4
+ toBitsString,
5
+ splitInto
6
+ } from '../../utils';
7
+
8
+ export class AlphaNumericQRDataMode extends QRDataMode {
9
+ initProperties() {
10
+ super.initProperties();
11
+
12
+ extend(this, {
13
+ characters: {
14
+ "0": 0,
15
+ "1": 1,
16
+ "2": 2,
17
+ "3": 3,
18
+ "4": 4,
19
+ "5": 5,
20
+ "6": 6,
21
+ "7": 7,
22
+ "8": 8,
23
+ "9": 9,
24
+ "A": 10,
25
+ "B": 11,
26
+ "C": 12,
27
+ "D": 13,
28
+ "E": 14,
29
+ "F": 15,
30
+ "G": 16,
31
+ "H": 17,
32
+ "I": 18,
33
+ "J": 19,
34
+ "K": 20,
35
+ "L": 21,
36
+ "M": 22,
37
+ "N": 23,
38
+ "O": 24,
39
+ "P": 25,
40
+ "Q": 26,
41
+ "R": 27,
42
+ "S": 28,
43
+ "T": 29,
44
+ "U": 30,
45
+ "V": 31,
46
+ "W": 32,
47
+ "X": 33,
48
+ "Y": 34,
49
+ "Z": 35,
50
+ " ": 36,
51
+ "$": 37,
52
+ "%": 38,
53
+ "*": 39,
54
+ "+": 40,
55
+ "-": 41,
56
+ ".": 42,
57
+ "/": 43,
58
+ ":": 44
59
+ },
60
+ bitsInCharacterCount: [9, 11, 13],
61
+ modeIndicator: "0010"
62
+ });
63
+ }
64
+
65
+ getValue(character) {
66
+ return this.characters[character];
67
+ }
68
+
69
+ encode(str, version) {
70
+ let
71
+ parts = splitInto(str, 2),
72
+ result = this.getModeCountString(str.length, version),
73
+ value;
74
+ let i;
75
+
76
+ for (i = 0; i < parts.length - 1; i++) {
77
+ value = 45 * this.getValue(parts[i].charAt(0)) + this.getValue(parts[i].charAt(1));
78
+ result += toBitsString(value, 11);
79
+ }
80
+
81
+ value = parts[i].length === 2 ?
82
+ 45 * this.getValue(parts[i].charAt(0)) + this.getValue(parts[i].charAt(1)) :
83
+ this.getValue(parts[i].charAt(0));
84
+
85
+ return result + toBitsString(value, 1 + 5 * parts[i].length);
86
+ }
87
+
88
+ getStringBitsLength(inputLength, version) {
89
+ return 4 + this.getBitsCharacterCount(version) + 11 * Math.floor(inputLength / 2) + 6 * (inputLength % 2);
90
+ }
91
+ }
@@ -0,0 +1,41 @@
1
+ import { QRDataMode } from './qr-data-mode';
2
+ import { extend } from '../../utils';
3
+ import {
4
+ toBitsString
5
+ } from '../../utils';
6
+
7
+ export class ByteQRDataMode extends QRDataMode {
8
+ initProperties() {
9
+ super.initProperties();
10
+
11
+ extend(this, {
12
+ bitsInCharacterCount: [8, 16, 16],
13
+ modeIndicator: "0100"
14
+ });
15
+ }
16
+
17
+ getValue(character) {
18
+ let code = character.charCodeAt(0);
19
+
20
+ if (code <= 127 || (160 <= code && code <= 255)) {
21
+ return code;
22
+ }
23
+
24
+ throw new Error("Unsupported character: " + character);
25
+ }
26
+
27
+ encode(str, version) {
28
+ let mode = this,
29
+ result = mode.getModeCountString(str.length, version);
30
+
31
+ for (let i = 0; i < str.length; i++) {
32
+ result += toBitsString(mode.getValue(str.charAt(i)), 8);
33
+ }
34
+
35
+ return result;
36
+ }
37
+
38
+ getStringBitsLength(inputLength, version) {
39
+ return 4 + this.getBitsCharacterCount(version) + 8 * inputLength;
40
+ }
41
+ }
@@ -0,0 +1,13 @@
1
+ import { NumericQRDataMode } from './numeric-data-mode';
2
+ import { AlphaNumericQRDataMode } from './alpha-numeric-data-mode';
3
+ import { ByteQRDataMode } from './byte-data-mode';
4
+
5
+ const NUMERIC = "numeric";
6
+ const ALPHA_NUMERIC = "alphanumeric";
7
+ const BYTE = "byte";
8
+
9
+ export let DataModeInstances = {
10
+ [NUMERIC]: new NumericQRDataMode(),
11
+ [ALPHA_NUMERIC]: new AlphaNumericQRDataMode(),
12
+ [BYTE]: new ByteQRDataMode()
13
+ };
@@ -0,0 +1,39 @@
1
+ import { QRDataMode } from './qr-data-mode';
2
+ import { extend } from '../../utils';
3
+ import {
4
+ toBitsString,
5
+ splitInto
6
+ } from '../../utils';
7
+
8
+ export class NumericQRDataMode extends QRDataMode {
9
+ initProperties() {
10
+ super.initProperties();
11
+
12
+ extend(this, {
13
+ bitsInCharacterCount: [10, 12, 14],
14
+ modeIndicator: "0001"
15
+ });
16
+ }
17
+
18
+ getValue(character) {
19
+ return parseInt(character, 10);
20
+ }
21
+
22
+ encode(str, version) {
23
+ let mode = this,
24
+ parts = splitInto(str, 3),
25
+ result = mode.getModeCountString(str.length, version);
26
+ let i;
27
+
28
+ for (i = 0; i < parts.length - 1; i++) {
29
+ result += toBitsString(parts[i], 10);
30
+ }
31
+
32
+ return result + toBitsString(parts[i], 1 + 3 * parts[i].length);
33
+ }
34
+
35
+ getStringBitsLength(inputLength, version) {
36
+ let mod3 = inputLength % 3;
37
+ return 4 + this.getBitsCharacterCount(version) + 10 * Math.floor(inputLength / 3) + 3 * mod3 + (mod3 === 0 ? 0 : 1);
38
+ }
39
+ }
@@ -0,0 +1,44 @@
1
+ import { Class } from '../../../common';
2
+ import { extend } from '../../utils';
3
+ import {
4
+ toBitsString
5
+ } from '../../utils';
6
+
7
+ export class QRDataMode extends Class {
8
+ constructor() {
9
+ super();
10
+
11
+ this.initProperties();
12
+ }
13
+
14
+ initProperties() {
15
+ extend(this, {
16
+ modeIndicator: "",
17
+ bitsInCharacterCount: []
18
+ });
19
+ }
20
+
21
+ getVersionIndex(version) {
22
+ if (version < 10) {
23
+ return 0;
24
+ } else if (version > 26) {
25
+ return 2;
26
+ }
27
+
28
+ return 1;
29
+ }
30
+
31
+ getBitsCharacterCount(version) {
32
+ return this.bitsInCharacterCount[this.getVersionIndex(version || 40)];
33
+ }
34
+
35
+ getModeCountString(length, version) {
36
+ return this.modeIndicator + toBitsString(length, this.getBitsCharacterCount(version));
37
+ }
38
+
39
+ encode() { }
40
+
41
+ getStringBitsLength() { }
42
+
43
+ getValue() { }
44
+ }
@@ -0,0 +1,19 @@
1
+ import { Class } from '../../../common';
2
+ import { EncodingResult } from '../encoding-result';
3
+ import {
4
+ getModes,
5
+ getVersion,
6
+ getDataCodewordsCount,
7
+ getDataString
8
+ } from '../encoding';
9
+
10
+ export class IsoEncoder extends Class {
11
+ getEncodingResult(inputString, errorCorrectionLevel) {
12
+ let modes = getModes(inputString),
13
+ dataCodewordsCount = getDataCodewordsCount(modes),
14
+ version = getVersion(dataCodewordsCount, errorCorrectionLevel),
15
+ dataString = getDataString(modes, version);
16
+
17
+ return new EncodingResult(dataString, version);
18
+ }
19
+ }
@@ -0,0 +1,83 @@
1
+ import { Class } from '../../../common';
2
+ import { EncodingResult } from '../encoding-result';
3
+ import { DataModeInstances } from '../data-modes/data-mode-instances';
4
+ import { extend } from '../../utils';
5
+ import { toBitsString } from '../../utils';
6
+ import { getVersion } from '../encoding';
7
+
8
+ const BYTE = "byte";
9
+
10
+ export class Utf8Encoder extends Class {
11
+ constructor() {
12
+ super();
13
+
14
+ this.initProperties();
15
+
16
+ this.mode = DataModeInstances[this.encodingMode];
17
+ }
18
+
19
+ initProperties() {
20
+ extend(this, {
21
+ encodingMode: BYTE,
22
+ utfBOM: "111011111011101110111111",
23
+ initialModeCountStringLength: 20,
24
+ ranges: [128, 2048, 65536, 2097152, 67108864]
25
+ });
26
+ }
27
+
28
+ getEncodingResult(inputString, errorCorrectionLevel) {
29
+ let data = this.encode(inputString),
30
+ dataCodewordsCount = this.getDataCodewordsCount(data),
31
+ version = getVersion(dataCodewordsCount, errorCorrectionLevel),
32
+ dataString = this.mode.getModeCountString(data.length / 8, version) + data;
33
+
34
+ return new EncodingResult(dataString, version);
35
+ }
36
+
37
+ getDataCodewordsCount(data) {
38
+ let dataLength = data.length,
39
+ dataCodewordsCount = Math.ceil((this.initialModeCountStringLength + dataLength) / 8);
40
+
41
+ return dataCodewordsCount;
42
+ }
43
+
44
+ encode(str) {
45
+ let result = this.utfBOM;
46
+
47
+ for (let i = 0; i < str.length; i++) {
48
+ result += this.encodeCharacter(str.charCodeAt(i));
49
+ }
50
+
51
+ return result;
52
+ }
53
+
54
+ encodeCharacter(code) {
55
+ let bytesCount = this.getBytesCount(code),
56
+ bc = bytesCount - 1,
57
+ result = "";
58
+
59
+ if (bytesCount === 1) {
60
+ result = toBitsString(code, 8);
61
+ } else {
62
+ let significantOnes = 8 - bytesCount;
63
+
64
+ for (let i = 0; i < bc; i++) {
65
+ result = toBitsString(code >> (i * 6) & 63 | 128, 8) + result;
66
+ }
67
+
68
+ result = ((code >> bc * 6) | ((255 >> significantOnes) << significantOnes)).toString(2) + result;
69
+ }
70
+
71
+ return result;
72
+ }
73
+
74
+ getBytesCount(code) {
75
+ let ranges = this.ranges;
76
+
77
+ for (let i = 0; i < ranges.length; i++) {
78
+ if (code < ranges[i]) {
79
+ return i + 1;
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,10 @@
1
+ import { Class } from '../../common';
2
+
3
+ export class EncodingResult extends Class {
4
+ constructor(dataString, version) {
5
+ super();
6
+
7
+ this.dataString = dataString;
8
+ this.version = version;
9
+ }
10
+ }