@tradingaction/core 2.0.11 → 2.0.13

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 (57) hide show
  1. package/LICENSE +24 -24
  2. package/README.md +5 -5
  3. package/lib/CanvasContainer.d.ts +19 -19
  4. package/lib/CanvasContainer.js +27 -27
  5. package/lib/Chart.d.ts +32 -32
  6. package/lib/Chart.js +56 -56
  7. package/lib/Chart.js.map +1 -1
  8. package/lib/ChartCanvas.d.ts +235 -235
  9. package/lib/ChartCanvas.js +770 -770
  10. package/lib/ChartCanvas.js.map +1 -1
  11. package/lib/EventCapture.d.ts +131 -131
  12. package/lib/EventCapture.js +488 -488
  13. package/lib/GenericChartComponent.d.ts +21 -21
  14. package/lib/GenericChartComponent.js +74 -74
  15. package/lib/GenericComponent.d.ts +81 -81
  16. package/lib/GenericComponent.js +354 -354
  17. package/lib/GenericComponent.js.map +1 -1
  18. package/lib/MoreProps.d.ts +16 -16
  19. package/lib/MoreProps.js +1 -1
  20. package/lib/index.d.ts +7 -7
  21. package/lib/index.js +7 -7
  22. package/lib/useEvent.d.ts +1 -1
  23. package/lib/useEvent.js +12 -12
  24. package/lib/utils/ChartDataUtil.d.ts +49 -49
  25. package/lib/utils/ChartDataUtil.js +204 -204
  26. package/lib/utils/PureComponent.d.ts +4 -4
  27. package/lib/utils/PureComponent.js +9 -9
  28. package/lib/utils/accumulatingWindow.d.ts +15 -15
  29. package/lib/utils/accumulatingWindow.js +97 -97
  30. package/lib/utils/barWidth.d.ts +15 -15
  31. package/lib/utils/barWidth.js +26 -26
  32. package/lib/utils/closestItem.d.ts +5 -5
  33. package/lib/utils/closestItem.js +44 -44
  34. package/lib/utils/evaluator.d.ts +7 -7
  35. package/lib/utils/evaluator.js +93 -93
  36. package/lib/utils/identity.d.ts +1 -1
  37. package/lib/utils/identity.js +1 -1
  38. package/lib/utils/index.d.ts +46 -46
  39. package/lib/utils/index.js +125 -125
  40. package/lib/utils/noop.d.ts +1 -1
  41. package/lib/utils/noop.js +2 -2
  42. package/lib/utils/shallowEqual.d.ts +1 -1
  43. package/lib/utils/shallowEqual.js +21 -21
  44. package/lib/utils/slidingWindow.d.ts +19 -19
  45. package/lib/utils/slidingWindow.js +108 -108
  46. package/lib/utils/strokeDasharray.d.ts +3 -3
  47. package/lib/utils/strokeDasharray.js +36 -36
  48. package/lib/utils/zipper.d.ts +7 -7
  49. package/lib/utils/zipper.js +35 -35
  50. package/lib/zoom/index.d.ts +1 -1
  51. package/lib/zoom/index.js +1 -1
  52. package/lib/zoom/zoomBehavior.d.ts +10 -10
  53. package/lib/zoom/zoomBehavior.js +17 -17
  54. package/package.json +2 -2
  55. package/src/Chart.tsx +2 -2
  56. package/src/ChartCanvas.tsx +1 -1
  57. package/src/GenericComponent.tsx +1 -0
@@ -1,126 +1,126 @@
1
- export { default as zipper } from "./zipper";
2
- export { default as slidingWindow } from "./slidingWindow";
3
- export * from "./closestItem";
4
- export * from "./identity";
5
- export * from "./noop";
6
- export * from "./shallowEqual";
7
- export { default as accumulatingWindow } from "./accumulatingWindow";
8
- export * from "./barWidth";
9
- export * from "./strokeDasharray";
10
- export * from "./PureComponent";
11
- export const sign = (x) => {
12
- // @ts-ignore
13
- return (x > 0) - (x < 0);
14
- };
15
- export const path = (loc = []) => {
16
- const key = Array.isArray(loc) ? loc : [loc];
17
- const length = key.length;
18
- return function (obj, defaultValue) {
19
- if (length === 0) {
20
- return isDefined(obj) ? obj : defaultValue;
21
- }
22
- let index = 0;
23
- while (obj != null && index < length) {
24
- obj = obj[key[index++]];
25
- }
26
- return index === length ? obj : defaultValue;
27
- };
28
- };
29
- export const functor = (v) => {
30
- return typeof v === "function" ? v : () => v;
31
- };
32
- export function getClosestValue(inputValue, currentValue) {
33
- const values = Array.isArray(inputValue) ? inputValue : [inputValue];
34
- const diff = values
35
- .map((each) => each - currentValue)
36
- .reduce((diff1, diff2) => (Math.abs(diff1) < Math.abs(diff2) ? diff1 : diff2));
37
- return currentValue + diff;
38
- }
39
- export function d3Window(node) {
40
- const d3win = node && ((node.ownerDocument && node.ownerDocument.defaultView) || (node.document && node) || node.defaultView);
41
- return d3win;
42
- }
43
- export const MOUSEENTER = "mouseenter.interaction";
44
- export const MOUSELEAVE = "mouseleave.interaction";
45
- export const MOUSEMOVE = "mousemove.pan";
46
- export const MOUSEUP = "mouseup.pan";
47
- export const TOUCHMOVE = "touchmove.pan";
48
- export const TOUCHEND = "touchend.pan touchcancel.pan";
49
- export function getTouchProps(touch) {
50
- return {
51
- pageX: touch.pageX,
52
- pageY: touch.pageY,
53
- clientX: touch.clientX,
54
- clientY: touch.clientY,
55
- };
56
- }
57
- export function head(array, accessor) {
58
- if (accessor && array) {
59
- let value;
60
- // tslint:disable-next-line: prefer-for-of
61
- for (let i = 0; i < array.length; i++) {
62
- value = array[i];
63
- if (isDefined(accessor(value))) {
64
- return value;
65
- }
66
- }
67
- return undefined;
68
- }
69
- return array ? array[0] : undefined;
70
- }
71
- export const first = head;
72
- export function last(array, accessor) {
73
- if (accessor && array) {
74
- let value;
75
- for (let i = array.length - 1; i >= 0; i--) {
76
- value = array[i];
77
- if (isDefined(accessor(value))) {
78
- return value;
79
- }
80
- }
81
- return undefined;
82
- }
83
- const length = array ? array.length : 0;
84
- return length ? array[length - 1] : undefined;
85
- }
86
- export const isDefined = (d) => {
87
- return d !== null && d !== undefined;
88
- };
89
- export function isNotDefined(d) {
90
- return !isDefined(d);
91
- }
92
- export function isObject(d) {
93
- return isDefined(d) && typeof d === "object" && !Array.isArray(d);
94
- }
95
- export function touchPosition(touch, e) {
96
- const container = e.currentTarget;
97
- const rect = container.getBoundingClientRect();
98
- const x = touch.clientX - rect.left - container.clientLeft;
99
- const y = touch.clientY - rect.top - container.clientTop;
100
- return [Math.round(x), Math.round(y)];
101
- }
102
- export function mousePosition(e, defaultRect) {
103
- const container = e.currentTarget;
104
- const rect = defaultRect !== null && defaultRect !== void 0 ? defaultRect : container.getBoundingClientRect();
105
- const x = e.clientX - rect.left - container.clientLeft;
106
- const y = e.clientY - rect.top - container.clientTop;
107
- return [Math.round(x), Math.round(y)];
108
- }
109
- export function clearCanvas(canvasList, ratio) {
110
- canvasList.forEach((each) => {
111
- each.setTransform(1, 0, 0, 1, 0, 0);
112
- each.clearRect(-1, -1, each.canvas.width + 2, each.canvas.height + 2);
113
- each.scale(ratio, ratio);
114
- });
115
- }
116
- // copied from https://github.com/lodash/lodash/blob/master/mapObject.js
117
- export function mapObject(object = {}, iteratee = (x) => x) {
118
- const props = Object.keys(object);
119
- const result = new Array(props.length);
120
- props.forEach((key, index) => {
121
- // @ts-ignore
122
- result[index] = iteratee(object[key], key, object);
123
- });
124
- return result;
125
- }
1
+ export { default as zipper } from "./zipper";
2
+ export { default as slidingWindow } from "./slidingWindow";
3
+ export * from "./closestItem";
4
+ export * from "./identity";
5
+ export * from "./noop";
6
+ export * from "./shallowEqual";
7
+ export { default as accumulatingWindow } from "./accumulatingWindow";
8
+ export * from "./barWidth";
9
+ export * from "./strokeDasharray";
10
+ export * from "./PureComponent";
11
+ export const sign = (x) => {
12
+ // @ts-ignore
13
+ return (x > 0) - (x < 0);
14
+ };
15
+ export const path = (loc = []) => {
16
+ const key = Array.isArray(loc) ? loc : [loc];
17
+ const length = key.length;
18
+ return function (obj, defaultValue) {
19
+ if (length === 0) {
20
+ return isDefined(obj) ? obj : defaultValue;
21
+ }
22
+ let index = 0;
23
+ while (obj != null && index < length) {
24
+ obj = obj[key[index++]];
25
+ }
26
+ return index === length ? obj : defaultValue;
27
+ };
28
+ };
29
+ export const functor = (v) => {
30
+ return typeof v === "function" ? v : () => v;
31
+ };
32
+ export function getClosestValue(inputValue, currentValue) {
33
+ const values = Array.isArray(inputValue) ? inputValue : [inputValue];
34
+ const diff = values
35
+ .map((each) => each - currentValue)
36
+ .reduce((diff1, diff2) => (Math.abs(diff1) < Math.abs(diff2) ? diff1 : diff2));
37
+ return currentValue + diff;
38
+ }
39
+ export function d3Window(node) {
40
+ const d3win = node && ((node.ownerDocument && node.ownerDocument.defaultView) || (node.document && node) || node.defaultView);
41
+ return d3win;
42
+ }
43
+ export const MOUSEENTER = "mouseenter.interaction";
44
+ export const MOUSELEAVE = "mouseleave.interaction";
45
+ export const MOUSEMOVE = "mousemove.pan";
46
+ export const MOUSEUP = "mouseup.pan";
47
+ export const TOUCHMOVE = "touchmove.pan";
48
+ export const TOUCHEND = "touchend.pan touchcancel.pan";
49
+ export function getTouchProps(touch) {
50
+ return {
51
+ pageX: touch.pageX,
52
+ pageY: touch.pageY,
53
+ clientX: touch.clientX,
54
+ clientY: touch.clientY,
55
+ };
56
+ }
57
+ export function head(array, accessor) {
58
+ if (accessor && array) {
59
+ let value;
60
+ // tslint:disable-next-line: prefer-for-of
61
+ for (let i = 0; i < array.length; i++) {
62
+ value = array[i];
63
+ if (isDefined(accessor(value))) {
64
+ return value;
65
+ }
66
+ }
67
+ return undefined;
68
+ }
69
+ return array ? array[0] : undefined;
70
+ }
71
+ export const first = head;
72
+ export function last(array, accessor) {
73
+ if (accessor && array) {
74
+ let value;
75
+ for (let i = array.length - 1; i >= 0; i--) {
76
+ value = array[i];
77
+ if (isDefined(accessor(value))) {
78
+ return value;
79
+ }
80
+ }
81
+ return undefined;
82
+ }
83
+ const length = array ? array.length : 0;
84
+ return length ? array[length - 1] : undefined;
85
+ }
86
+ export const isDefined = (d) => {
87
+ return d !== null && d !== undefined;
88
+ };
89
+ export function isNotDefined(d) {
90
+ return !isDefined(d);
91
+ }
92
+ export function isObject(d) {
93
+ return isDefined(d) && typeof d === "object" && !Array.isArray(d);
94
+ }
95
+ export function touchPosition(touch, e) {
96
+ const container = e.currentTarget;
97
+ const rect = container.getBoundingClientRect();
98
+ const x = touch.clientX - rect.left - container.clientLeft;
99
+ const y = touch.clientY - rect.top - container.clientTop;
100
+ return [Math.round(x), Math.round(y)];
101
+ }
102
+ export function mousePosition(e, defaultRect) {
103
+ const container = e.currentTarget;
104
+ const rect = defaultRect !== null && defaultRect !== void 0 ? defaultRect : container.getBoundingClientRect();
105
+ const x = e.clientX - rect.left - container.clientLeft;
106
+ const y = e.clientY - rect.top - container.clientTop;
107
+ return [Math.round(x), Math.round(y)];
108
+ }
109
+ export function clearCanvas(canvasList, ratio) {
110
+ canvasList.forEach((each) => {
111
+ each.setTransform(1, 0, 0, 1, 0, 0);
112
+ each.clearRect(-1, -1, each.canvas.width + 2, each.canvas.height + 2);
113
+ each.scale(ratio, ratio);
114
+ });
115
+ }
116
+ // copied from https://github.com/lodash/lodash/blob/master/mapObject.js
117
+ export function mapObject(object = {}, iteratee = (x) => x) {
118
+ const props = Object.keys(object);
119
+ const result = new Array(props.length);
120
+ props.forEach((key, index) => {
121
+ // @ts-ignore
122
+ result[index] = iteratee(object[key], key, object);
123
+ });
124
+ return result;
125
+ }
126
126
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export declare const noop: () => void;
1
+ export declare const noop: () => void;
package/lib/utils/noop.js CHANGED
@@ -1,3 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2
- export const noop = () => { };
1
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2
+ export const noop = () => { };
3
3
  //# sourceMappingURL=noop.js.map
@@ -1 +1 @@
1
- export declare const shallowEqual: (a: any, b: any) => boolean;
1
+ export declare const shallowEqual: (a: any, b: any) => boolean;
@@ -1,22 +1,22 @@
1
- export const shallowEqual = (a, b) => {
2
- if (a === b) {
3
- return true;
4
- }
5
- if (!(a instanceof Object) || !(b instanceof Object)) {
6
- return false;
7
- }
8
- const keys = Object.keys(a);
9
- const length = keys.length;
10
- for (let i = 0; i < length; i++) {
11
- if (!(keys[i] in b)) {
12
- return false;
13
- }
14
- }
15
- for (let i = 0; i < length; i++) {
16
- if (a[keys[i]] !== b[keys[i]]) {
17
- return false;
18
- }
19
- }
20
- return length === Object.keys(b).length;
21
- };
1
+ export const shallowEqual = (a, b) => {
2
+ if (a === b) {
3
+ return true;
4
+ }
5
+ if (!(a instanceof Object) || !(b instanceof Object)) {
6
+ return false;
7
+ }
8
+ const keys = Object.keys(a);
9
+ const length = keys.length;
10
+ for (let i = 0; i < length; i++) {
11
+ if (!(keys[i] in b)) {
12
+ return false;
13
+ }
14
+ }
15
+ for (let i = 0; i < length; i++) {
16
+ if (a[keys[i]] !== b[keys[i]]) {
17
+ return false;
18
+ }
19
+ }
20
+ return length === Object.keys(b).length;
21
+ };
22
22
  //# sourceMappingURL=shallowEqual.js.map
@@ -1,19 +1,19 @@
1
- interface SlidingWindow {
2
- (data: any[]): any[];
3
- misc(): any;
4
- misc(x: any): SlidingWindow;
5
- accumulator(): any;
6
- accumulator(x: any): SlidingWindow;
7
- skipInitial(): number;
8
- skipInitial(x: number): SlidingWindow;
9
- source(): any;
10
- source(source: any): SlidingWindow;
11
- sourcePath(): any;
12
- sourcePath(x: any): SlidingWindow;
13
- windowSize(): number;
14
- windowSize(windowSize: number): SlidingWindow;
15
- undefinedValue(): any;
16
- undefinedValue(x: any): SlidingWindow;
17
- }
18
- export default function (): SlidingWindow;
19
- export {};
1
+ interface SlidingWindow {
2
+ (data: any[]): any[];
3
+ misc(): any;
4
+ misc(x: any): SlidingWindow;
5
+ accumulator(): any;
6
+ accumulator(x: any): SlidingWindow;
7
+ skipInitial(): number;
8
+ skipInitial(x: number): SlidingWindow;
9
+ source(): any;
10
+ source(source: any): SlidingWindow;
11
+ sourcePath(): any;
12
+ sourcePath(x: any): SlidingWindow;
13
+ windowSize(): number;
14
+ windowSize(windowSize: number): SlidingWindow;
15
+ undefinedValue(): any;
16
+ undefinedValue(x: any): SlidingWindow;
17
+ }
18
+ export default function (): SlidingWindow;
19
+ export {};
@@ -1,109 +1,109 @@
1
- /*
2
-
3
- Taken from https://github.com/ScottLogic/d3fc/blob/master/src/indicator/algorithm/calculator/slidingWindow.js
4
-
5
- The MIT License (MIT)
6
-
7
- Copyright (c) 2014-2015 Scott Logic Ltd.
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy
10
- of this software and associated documentation files (the "Software"), to deal
11
- in the Software without restriction, including without limitation the rights
12
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- copies of the Software, and to permit persons to whom the Software is
14
- furnished to do so, subject to the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included in
17
- all copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
- THE SOFTWARE.
26
-
27
- */
28
- import { functor, path } from "./index";
29
- import { noop } from "./noop";
30
- export default function () {
31
- let undefinedValue;
32
- let windowSize = 10;
33
- let accumulator = noop;
34
- let sourcePath;
35
- let source;
36
- let skipInitial = 0;
37
- let misc;
38
- const slidingWindow = (data) => {
39
- const sourceFunction = source || path(sourcePath);
40
- // @ts-ignore
41
- const size = functor(windowSize).apply(this, arguments);
42
- const windowData = data.slice(skipInitial, size + skipInitial).map(sourceFunction);
43
- let accumulatorIdx = 0;
44
- const undef = functor(undefinedValue);
45
- return data.map((d, i) => {
46
- if (i < skipInitial + size - 1) {
47
- return undef(sourceFunction(d), i, misc);
48
- }
49
- if (i >= skipInitial + size) {
50
- // Treat windowData as FIFO rolling buffer
51
- windowData.shift();
52
- windowData.push(sourceFunction(d, i));
53
- }
54
- // @ts-ignore
55
- return accumulator(windowData, i, accumulatorIdx++, misc);
56
- });
57
- };
58
- slidingWindow.undefinedValue = function (x) {
59
- if (!arguments.length) {
60
- return undefinedValue;
61
- }
62
- undefinedValue = x;
63
- return slidingWindow;
64
- };
65
- slidingWindow.windowSize = function (x) {
66
- if (!arguments.length) {
67
- return windowSize;
68
- }
69
- windowSize = x;
70
- return slidingWindow;
71
- };
72
- slidingWindow.misc = function (x) {
73
- if (!arguments.length) {
74
- return misc;
75
- }
76
- misc = x;
77
- return slidingWindow;
78
- };
79
- slidingWindow.accumulator = function (x) {
80
- if (!arguments.length) {
81
- return accumulator;
82
- }
83
- accumulator = x;
84
- return slidingWindow;
85
- };
86
- slidingWindow.skipInitial = function (x) {
87
- if (!arguments.length) {
88
- return skipInitial;
89
- }
90
- skipInitial = x;
91
- return slidingWindow;
92
- };
93
- slidingWindow.sourcePath = function (x) {
94
- if (!arguments.length) {
95
- return sourcePath;
96
- }
97
- sourcePath = x;
98
- return slidingWindow;
99
- };
100
- slidingWindow.source = function (x) {
101
- if (!arguments.length) {
102
- return source;
103
- }
104
- source = x;
105
- return slidingWindow;
106
- };
107
- return slidingWindow;
108
- }
1
+ /*
2
+
3
+ Taken from https://github.com/ScottLogic/d3fc/blob/master/src/indicator/algorithm/calculator/slidingWindow.js
4
+
5
+ The MIT License (MIT)
6
+
7
+ Copyright (c) 2014-2015 Scott Logic Ltd.
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in
17
+ all copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
+ THE SOFTWARE.
26
+
27
+ */
28
+ import { functor, path } from "./index";
29
+ import { noop } from "./noop";
30
+ export default function () {
31
+ let undefinedValue;
32
+ let windowSize = 10;
33
+ let accumulator = noop;
34
+ let sourcePath;
35
+ let source;
36
+ let skipInitial = 0;
37
+ let misc;
38
+ const slidingWindow = (data) => {
39
+ const sourceFunction = source || path(sourcePath);
40
+ // @ts-ignore
41
+ const size = functor(windowSize).apply(this, arguments);
42
+ const windowData = data.slice(skipInitial, size + skipInitial).map(sourceFunction);
43
+ let accumulatorIdx = 0;
44
+ const undef = functor(undefinedValue);
45
+ return data.map((d, i) => {
46
+ if (i < skipInitial + size - 1) {
47
+ return undef(sourceFunction(d), i, misc);
48
+ }
49
+ if (i >= skipInitial + size) {
50
+ // Treat windowData as FIFO rolling buffer
51
+ windowData.shift();
52
+ windowData.push(sourceFunction(d, i));
53
+ }
54
+ // @ts-ignore
55
+ return accumulator(windowData, i, accumulatorIdx++, misc);
56
+ });
57
+ };
58
+ slidingWindow.undefinedValue = function (x) {
59
+ if (!arguments.length) {
60
+ return undefinedValue;
61
+ }
62
+ undefinedValue = x;
63
+ return slidingWindow;
64
+ };
65
+ slidingWindow.windowSize = function (x) {
66
+ if (!arguments.length) {
67
+ return windowSize;
68
+ }
69
+ windowSize = x;
70
+ return slidingWindow;
71
+ };
72
+ slidingWindow.misc = function (x) {
73
+ if (!arguments.length) {
74
+ return misc;
75
+ }
76
+ misc = x;
77
+ return slidingWindow;
78
+ };
79
+ slidingWindow.accumulator = function (x) {
80
+ if (!arguments.length) {
81
+ return accumulator;
82
+ }
83
+ accumulator = x;
84
+ return slidingWindow;
85
+ };
86
+ slidingWindow.skipInitial = function (x) {
87
+ if (!arguments.length) {
88
+ return skipInitial;
89
+ }
90
+ skipInitial = x;
91
+ return slidingWindow;
92
+ };
93
+ slidingWindow.sourcePath = function (x) {
94
+ if (!arguments.length) {
95
+ return sourcePath;
96
+ }
97
+ sourcePath = x;
98
+ return slidingWindow;
99
+ };
100
+ slidingWindow.source = function (x) {
101
+ if (!arguments.length) {
102
+ return source;
103
+ }
104
+ source = x;
105
+ return slidingWindow;
106
+ };
107
+ return slidingWindow;
108
+ }
109
109
  //# sourceMappingURL=slidingWindow.js.map
@@ -1,3 +1,3 @@
1
- export type strokeDashTypes = "Solid" | "ShortDash" | "ShortDash2" | "ShortDot" | "ShortDashDot" | "ShortDashDotDot" | "Dot" | "Dash" | "LongDash" | "DashDot" | "LongDashDot" | "LongDashDotDot";
2
- export declare const getStrokeDasharrayCanvas: (type?: strokeDashTypes) => number[];
3
- export declare const getStrokeDasharray: (type?: strokeDashTypes) => "none" | "6, 2" | "6, 3" | "2, 2" | "6, 2, 2, 2" | "6, 2, 2, 2, 2, 2" | "2, 6" | "4, 6" | "16, 6" | "8, 6, 2, 6" | "16, 6, 2, 6" | "16, 6, 2, 6, 2, 6";
1
+ export type strokeDashTypes = "Solid" | "ShortDash" | "ShortDash2" | "ShortDot" | "ShortDashDot" | "ShortDashDotDot" | "Dot" | "Dash" | "LongDash" | "DashDot" | "LongDashDot" | "LongDashDotDot";
2
+ export declare const getStrokeDasharrayCanvas: (type?: strokeDashTypes) => number[];
3
+ export declare const getStrokeDasharray: (type?: strokeDashTypes) => "none" | "6, 2" | "6, 3" | "2, 2" | "6, 2, 2, 2" | "6, 2, 2, 2, 2, 2" | "2, 6" | "4, 6" | "16, 6" | "8, 6, 2, 6" | "16, 6, 2, 6" | "16, 6, 2, 6, 2, 6";
@@ -1,37 +1,37 @@
1
- export const getStrokeDasharrayCanvas = (type) => {
2
- const a = getStrokeDasharray(type).split(",");
3
- if (a.length === 1) {
4
- return [];
5
- }
6
- return a.map((d) => Number(d));
7
- };
8
- export const getStrokeDasharray = (type) => {
9
- switch (type) {
10
- default:
11
- case "Solid":
12
- return "none";
13
- case "ShortDash":
14
- return "6, 2";
15
- case "ShortDash2":
16
- return "6, 3";
17
- case "ShortDot":
18
- return "2, 2";
19
- case "ShortDashDot":
20
- return "6, 2, 2, 2";
21
- case "ShortDashDotDot":
22
- return "6, 2, 2, 2, 2, 2";
23
- case "Dot":
24
- return "2, 6";
25
- case "Dash":
26
- return "4, 6";
27
- case "LongDash":
28
- return "16, 6";
29
- case "DashDot":
30
- return "8, 6, 2, 6";
31
- case "LongDashDot":
32
- return "16, 6, 2, 6";
33
- case "LongDashDotDot":
34
- return "16, 6, 2, 6, 2, 6";
35
- }
36
- };
1
+ export const getStrokeDasharrayCanvas = (type) => {
2
+ const a = getStrokeDasharray(type).split(",");
3
+ if (a.length === 1) {
4
+ return [];
5
+ }
6
+ return a.map((d) => Number(d));
7
+ };
8
+ export const getStrokeDasharray = (type) => {
9
+ switch (type) {
10
+ default:
11
+ case "Solid":
12
+ return "none";
13
+ case "ShortDash":
14
+ return "6, 2";
15
+ case "ShortDash2":
16
+ return "6, 3";
17
+ case "ShortDot":
18
+ return "2, 2";
19
+ case "ShortDashDot":
20
+ return "6, 2, 2, 2";
21
+ case "ShortDashDotDot":
22
+ return "6, 2, 2, 2, 2, 2";
23
+ case "Dot":
24
+ return "2, 6";
25
+ case "Dash":
26
+ return "4, 6";
27
+ case "LongDash":
28
+ return "16, 6";
29
+ case "DashDot":
30
+ return "8, 6, 2, 6";
31
+ case "LongDashDot":
32
+ return "16, 6, 2, 6";
33
+ case "LongDashDotDot":
34
+ return "16, 6, 2, 6, 2, 6";
35
+ }
36
+ };
37
37
  //# sourceMappingURL=strokeDasharray.js.map
@@ -1,7 +1,7 @@
1
- interface Zip {
2
- (...args: any[]): any[];
3
- combine(): any;
4
- combine(x: any): Zip;
5
- }
6
- export default function zipper(): Zip;
7
- export {};
1
+ interface Zip {
2
+ (...args: any[]): any[];
3
+ combine(): any;
4
+ combine(x: any): Zip;
5
+ }
6
+ export default function zipper(): Zip;
7
+ export {};