@ivanmatiaspascual/interactive 1.3.1-sp1-beta.0.1.0
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.
- package/CHANGELOG.md +190 -0
- package/LICENSE +24 -0
- package/README.md +5 -0
- package/lib/Brush.d.ts +35 -0
- package/lib/Brush.js +103 -0
- package/lib/Brush.js.map +1 -0
- package/lib/ClickCallback.d.ts +18 -0
- package/lib/ClickCallback.js +12 -0
- package/lib/ClickCallback.js.map +1 -0
- package/lib/DrawingObjectSelector.d.ts +18 -0
- package/lib/DrawingObjectSelector.js +73 -0
- package/lib/DrawingObjectSelector.js.map +1 -0
- package/lib/EquidistantChannel.d.ts +74 -0
- package/lib/EquidistantChannel.js +149 -0
- package/lib/EquidistantChannel.js.map +1 -0
- package/lib/FibonacciRetracement.d.ts +83 -0
- package/lib/FibonacciRetracement.js +163 -0
- package/lib/FibonacciRetracement.js.map +1 -0
- package/lib/GannFan.d.ts +78 -0
- package/lib/GannFan.js +128 -0
- package/lib/GannFan.js.map +1 -0
- package/lib/InteractiveText.d.ts +70 -0
- package/lib/InteractiveText.js +89 -0
- package/lib/InteractiveText.js.map +1 -0
- package/lib/InteractiveYCoordinate.d.ts +128 -0
- package/lib/InteractiveYCoordinate.js +106 -0
- package/lib/InteractiveYCoordinate.js.map +1 -0
- package/lib/StandardDeviationChannel.d.ts +74 -0
- package/lib/StandardDeviationChannel.js +125 -0
- package/lib/StandardDeviationChannel.js.map +1 -0
- package/lib/TrendLine.d.ts +77 -0
- package/lib/TrendLine.js +125 -0
- package/lib/TrendLine.js.map +1 -0
- package/lib/ZoomButtons.d.ts +37 -0
- package/lib/ZoomButtons.js +85 -0
- package/lib/ZoomButtons.js.map +1 -0
- package/lib/components/ChannelWithArea.d.ts +30 -0
- package/lib/components/ChannelWithArea.js +126 -0
- package/lib/components/ChannelWithArea.js.map +1 -0
- package/lib/components/ClickableCircle.d.ts +26 -0
- package/lib/components/ClickableCircle.js +48 -0
- package/lib/components/ClickableCircle.js.map +1 -0
- package/lib/components/ClickableShape.d.ts +33 -0
- package/lib/components/ClickableShape.js +64 -0
- package/lib/components/ClickableShape.js.map +1 -0
- package/lib/components/GannFan.d.ts +32 -0
- package/lib/components/GannFan.js +134 -0
- package/lib/components/GannFan.js.map +1 -0
- package/lib/components/HoverTextNearMouse.d.ts +35 -0
- package/lib/components/HoverTextNearMouse.js +113 -0
- package/lib/components/HoverTextNearMouse.js.map +1 -0
- package/lib/components/InteractiveStraightLine.d.ts +57 -0
- package/lib/components/InteractiveStraightLine.js +220 -0
- package/lib/components/InteractiveStraightLine.js.map +1 -0
- package/lib/components/InteractiveText.d.ts +37 -0
- package/lib/components/InteractiveText.js +84 -0
- package/lib/components/InteractiveText.js.map +1 -0
- package/lib/components/InteractiveYCoordinate.d.ts +46 -0
- package/lib/components/InteractiveYCoordinate.js +109 -0
- package/lib/components/InteractiveYCoordinate.js.map +1 -0
- package/lib/components/LinearRegressionChannelWithArea.d.ts +31 -0
- package/lib/components/LinearRegressionChannelWithArea.js +104 -0
- package/lib/components/LinearRegressionChannelWithArea.js.map +1 -0
- package/lib/components/MouseLocationIndicator.d.ts +34 -0
- package/lib/components/MouseLocationIndicator.js +79 -0
- package/lib/components/MouseLocationIndicator.js.map +1 -0
- package/lib/components/Text.d.ts +17 -0
- package/lib/components/Text.js +26 -0
- package/lib/components/Text.js.map +1 -0
- package/lib/components/index.d.ts +11 -0
- package/lib/components/index.js +12 -0
- package/lib/components/index.js.map +1 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +13 -0
- package/lib/index.js.map +1 -0
- package/lib/utils.d.ts +7 -0
- package/lib/utils.js +84 -0
- package/lib/utils.js.map +1 -0
- package/lib/wrapper/EachEquidistantChannel.d.ts +59 -0
- package/lib/wrapper/EachEquidistantChannel.js +172 -0
- package/lib/wrapper/EachEquidistantChannel.js.map +1 -0
- package/lib/wrapper/EachFibRetracement.d.ts +77 -0
- package/lib/wrapper/EachFibRetracement.js +197 -0
- package/lib/wrapper/EachFibRetracement.js.map +1 -0
- package/lib/wrapper/EachGannFan.d.ts +81 -0
- package/lib/wrapper/EachGannFan.js +161 -0
- package/lib/wrapper/EachGannFan.js.map +1 -0
- package/lib/wrapper/EachInteractiveYCoordinate.d.ts +50 -0
- package/lib/wrapper/EachInteractiveYCoordinate.js +80 -0
- package/lib/wrapper/EachInteractiveYCoordinate.js.map +1 -0
- package/lib/wrapper/EachLinearRegressionChannel.d.ts +75 -0
- package/lib/wrapper/EachLinearRegressionChannel.js +89 -0
- package/lib/wrapper/EachLinearRegressionChannel.js.map +1 -0
- package/lib/wrapper/EachText.d.ts +58 -0
- package/lib/wrapper/EachText.js +79 -0
- package/lib/wrapper/EachText.js.map +1 -0
- package/lib/wrapper/EachTrendLine.d.ts +76 -0
- package/lib/wrapper/EachTrendLine.js +141 -0
- package/lib/wrapper/EachTrendLine.js.map +1 -0
- package/lib/wrapper/index.d.ts +7 -0
- package/lib/wrapper/index.js +8 -0
- package/lib/wrapper/index.js.map +1 -0
- package/package.json +55 -0
- package/src/Brush.tsx +177 -0
- package/src/ClickCallback.tsx +37 -0
- package/src/DrawingObjectSelector.tsx +97 -0
- package/src/EquidistantChannel.tsx +268 -0
- package/src/FibonacciRetracement.tsx +298 -0
- package/src/GannFan.tsx +233 -0
- package/src/InteractiveText.tsx +185 -0
- package/src/InteractiveYCoordinate.tsx +205 -0
- package/src/StandardDeviationChannel.tsx +269 -0
- package/src/TrendLine.tsx +283 -0
- package/src/ZoomButtons.tsx +172 -0
- package/src/components/ChannelWithArea.tsx +199 -0
- package/src/components/ClickableCircle.tsx +91 -0
- package/src/components/ClickableShape.tsx +114 -0
- package/src/components/GannFan.tsx +189 -0
- package/src/components/HoverTextNearMouse.tsx +174 -0
- package/src/components/InteractiveStraightLine.tsx +317 -0
- package/src/components/InteractiveText.tsx +153 -0
- package/src/components/InteractiveYCoordinate.tsx +205 -0
- package/src/components/LinearRegressionChannelWithArea.tsx +169 -0
- package/src/components/MouseLocationIndicator.tsx +128 -0
- package/src/components/Text.tsx +47 -0
- package/src/components/index.ts +11 -0
- package/src/index.ts +12 -0
- package/src/utils.ts +101 -0
- package/src/wrapper/EachEquidistantChannel.tsx +302 -0
- package/src/wrapper/EachFibRetracement.tsx +342 -0
- package/src/wrapper/EachGannFan.tsx +289 -0
- package/src/wrapper/EachInteractiveYCoordinate.tsx +198 -0
- package/src/wrapper/EachLinearRegressionChannel.tsx +202 -0
- package/src/wrapper/EachText.tsx +183 -0
- package/src/wrapper/EachTrendLine.tsx +297 -0
- package/src/wrapper/index.ts +7 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [1.3.1](https://github.com/reactivemarkets/react-financial-charts/compare/v1.3.0...v1.3.1) (2021-06-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @react-financial-charts/interactive
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.3.0](https://github.com/reactivemarkets/react-financial-charts/compare/v1.2.2...v1.3.0) (2021-05-23)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* adding module to type property in package.json ([1359ac6](https://github.com/reactivemarkets/react-financial-charts/commit/1359ac6e93d9638792c7bb478bba5fe1e5484a82)), closes [#520](https://github.com/reactivemarkets/react-financial-charts/issues/520)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [1.2.2](https://github.com/reactivemarkets/react-financial-charts/compare/v1.2.1...v1.2.2) (2021-04-30)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **interactive:** correcting props on TrendLine ([95cbb8e](https://github.com/reactivemarkets/react-financial-charts/commit/95cbb8e1a2f075969815d7ecfaaa8f2251fd4f84))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# [1.1.0](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.1...v1.1.0) (2021-02-26)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* adding react 17 as peer dependency ([569209b](https://github.com/reactivemarkets/react-financial-charts/commit/569209b6eb00f3c93eae1b5a9e4f014c055c93c7)), closes [#468](https://github.com/reactivemarkets/react-financial-charts/issues/468)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## [1.0.1](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0...v1.0.1) (2021-01-01)
|
|
48
|
+
|
|
49
|
+
**Note:** Version bump only for package @react-financial-charts/interactive
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# [1.0.0](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.16...v1.0.0) (2020-12-30)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Features
|
|
59
|
+
|
|
60
|
+
* **deps:** moving to d3 v6 ([8d371d2](https://github.com/reactivemarkets/react-financial-charts/commit/8d371d240bc7ac3db3e2f0037b3c0807e05b4749))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# [1.0.0-alpha.16](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2020-09-04)
|
|
67
|
+
|
|
68
|
+
**Note:** Version bump only for package @react-financial-charts/interactive
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# [1.0.0-alpha.15](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2020-09-03)
|
|
75
|
+
|
|
76
|
+
**Note:** Version bump only for package @react-financial-charts/interactive
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# [1.0.0-alpha.14](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2020-09-02)
|
|
83
|
+
|
|
84
|
+
**Note:** Version bump only for package @react-financial-charts/interactive
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# [1.0.0-alpha.13](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2020-09-01)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Bug Fixes
|
|
94
|
+
|
|
95
|
+
* **interactive:** correcting exports ([afe3ba9](https://github.com/reactivemarkets/react-financial-charts/commit/afe3ba9c38a9300c720895c51b5a0d09631eace9)), closes [#440](https://github.com/reactivemarkets/react-financial-charts/issues/440)
|
|
96
|
+
* removing canvas gradients ([2205163](https://github.com/reactivemarkets/react-financial-charts/commit/220516356300c6c1c8528de3ca43e7ddaf8e5e66))
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# [1.0.0-alpha.12](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2020-08-28)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### Bug Fixes
|
|
106
|
+
|
|
107
|
+
* **interactive:** missing constructor to initialize state in HoverTextNearMouse ([27f410a](https://github.com/reactivemarkets/react-financial-charts/commit/27f410a56a4ab87e758c55965ec162ce0066d509)), closes [#435](https://github.com/reactivemarkets/react-financial-charts/issues/435)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# [1.0.0-alpha.11](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2020-08-28)
|
|
114
|
+
|
|
115
|
+
**Note:** Version bump only for package @react-financial-charts/interactive
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
# [1.0.0-alpha.10](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2020-08-28)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Bug Fixes
|
|
125
|
+
|
|
126
|
+
* correcting more props ([2b3c1e0](https://github.com/reactivemarkets/react-financial-charts/commit/2b3c1e093b12131b7a4bc1ed12fd8ea4c541ac4b))
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
# [1.0.0-alpha.9](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2020-08-24)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Bug Fixes
|
|
136
|
+
|
|
137
|
+
* **interactive:** fixing undefined bug with interactive chart ([50b1ff7](https://github.com/reactivemarkets/react-financial-charts/commit/50b1ff75908765b7450b26f46d27f605bdf06f24))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Features
|
|
141
|
+
|
|
142
|
+
* adding more prop types across all components ([efefd4d](https://github.com/reactivemarkets/react-financial-charts/commit/efefd4dc3000ffe5ad5e63380ab324ab1e232a67))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
# [1.0.0-alpha.8](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2020-08-17)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
### Bug Fixes
|
|
152
|
+
|
|
153
|
+
* correcting prop types and docs ([198f0a5](https://github.com/reactivemarkets/react-financial-charts/commit/198f0a54dae54075383c25dca67ff48d5e5a1b2a))
|
|
154
|
+
* removing explict returns ([999b5ac](https://github.com/reactivemarkets/react-financial-charts/commit/999b5acb8d1669406e3d8be813d831e20151c87f))
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# [1.0.0-alpha.7](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2020-07-26)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### Bug Fixes
|
|
164
|
+
|
|
165
|
+
* updating prop types ([425b0b4](https://github.com/reactivemarkets/react-financial-charts/commit/425b0b459de229770e7608aff4f397b9bb00de5e))
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
# [1.0.0-alpha.1](https://github.com/reactivemarkets/react-financial-charts/compare/v1.0.0-alpha.0...v1.0.0-alpha.1) (2020-07-10)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
### Bug Fixes
|
|
175
|
+
|
|
176
|
+
* **core:** fixing issues with empty data sets ([23c2458](https://github.com/reactivemarkets/react-financial-charts/commit/23c2458bfe55e97eef96f80030fe32b9cf5ac1e1))
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
# [1.0.0-alpha.0](https://github.com/reactivemarkets/react-financial-charts/compare/v0.5.1...v1.0.0-alpha.0) (2020-07-08)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
* feat!: separating code into packages ([670537f](https://github.com/reactivemarkets/react-financial-charts/commit/670537fa280dddfbe921639a8e22a7c11d14e5f3))
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
### BREAKING CHANGES
|
|
189
|
+
|
|
190
|
+
* first stage of refactor breaking the code down.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
https://github.com/reactivemarkets/react-financial-charts
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2015-2018 Ragu Ramaswamy
|
|
5
|
+
Copyright (c) 2016 Julien Renaux
|
|
6
|
+
Copyright (c) 2019 Reactive Markets
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
|
16
|
+
all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
+
THE SOFTWARE.
|
package/README.md
ADDED
package/lib/Brush.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { strokeDashTypes } from "@ivanmatiaspascual/core";
|
|
3
|
+
interface BrushProps {
|
|
4
|
+
readonly enabled: boolean;
|
|
5
|
+
readonly onBrush: ({ start, end }: any, moreProps: any) => void;
|
|
6
|
+
readonly type?: "1D" | "2D";
|
|
7
|
+
readonly strokeStyle?: string;
|
|
8
|
+
readonly fillStyle?: string;
|
|
9
|
+
readonly interactiveState: object;
|
|
10
|
+
readonly strokeDashArray?: strokeDashTypes;
|
|
11
|
+
}
|
|
12
|
+
interface BrushState {
|
|
13
|
+
end?: any;
|
|
14
|
+
rect: any | null;
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
start?: any;
|
|
17
|
+
x1y1?: any;
|
|
18
|
+
}
|
|
19
|
+
export declare class Brush extends React.Component<BrushProps, BrushState> {
|
|
20
|
+
static defaultProps: {
|
|
21
|
+
type: string;
|
|
22
|
+
strokeStyle: string;
|
|
23
|
+
fillStyle: string;
|
|
24
|
+
strokeDashArray: string;
|
|
25
|
+
};
|
|
26
|
+
private zoomHappening?;
|
|
27
|
+
constructor(props: BrushProps);
|
|
28
|
+
terminate(): void;
|
|
29
|
+
render(): JSX.Element | null;
|
|
30
|
+
private readonly drawOnCanvas;
|
|
31
|
+
private readonly handleZoomStart;
|
|
32
|
+
private readonly handleDrawSquare;
|
|
33
|
+
private readonly handleZoomComplete;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
package/lib/Brush.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { getStrokeDasharrayCanvas, getMouseCanvas, GenericChartComponent, } from "@ivanmatiaspascual/core";
|
|
3
|
+
export class Brush extends React.Component {
|
|
4
|
+
constructor(props) {
|
|
5
|
+
super(props);
|
|
6
|
+
this.drawOnCanvas = (ctx) => {
|
|
7
|
+
const { rect } = this.state;
|
|
8
|
+
if (rect === null) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const { x, y, height, width } = rect;
|
|
12
|
+
const { strokeStyle = Brush.defaultProps.strokeStyle, fillStyle = Brush.defaultProps.fillStyle, strokeDashArray, } = this.props;
|
|
13
|
+
const dashArray = getStrokeDasharrayCanvas(strokeDashArray);
|
|
14
|
+
ctx.strokeStyle = strokeStyle;
|
|
15
|
+
ctx.fillStyle = fillStyle;
|
|
16
|
+
ctx.setLineDash(dashArray);
|
|
17
|
+
ctx.beginPath();
|
|
18
|
+
ctx.fillRect(x, y, width, height);
|
|
19
|
+
ctx.strokeRect(x, y, width, height);
|
|
20
|
+
};
|
|
21
|
+
this.handleZoomStart = (_, moreProps) => {
|
|
22
|
+
this.zoomHappening = false;
|
|
23
|
+
const { mouseXY: [, mouseY], currentItem, chartConfig: { yScale }, xAccessor, xScale, } = moreProps;
|
|
24
|
+
const x1y1 = [xScale(xAccessor(currentItem)), mouseY];
|
|
25
|
+
this.setState({
|
|
26
|
+
selected: true,
|
|
27
|
+
x1y1,
|
|
28
|
+
start: {
|
|
29
|
+
item: currentItem,
|
|
30
|
+
xValue: xAccessor(currentItem),
|
|
31
|
+
yValue: yScale.invert(mouseY),
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
this.handleDrawSquare = (_, moreProps) => {
|
|
36
|
+
if (this.state.x1y1 == null) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.zoomHappening = true;
|
|
40
|
+
const { mouseXY: [, mouseY], currentItem, chartConfig: { yScale }, xAccessor, xScale, } = moreProps;
|
|
41
|
+
const [x2, y2] = [xScale(xAccessor(currentItem)), mouseY];
|
|
42
|
+
const { x1y1: [x1, y1], } = this.state;
|
|
43
|
+
const x = Math.min(x1, x2);
|
|
44
|
+
const y = Math.min(y1, y2);
|
|
45
|
+
const height = Math.abs(y2 - y1);
|
|
46
|
+
const width = Math.abs(x2 - x1);
|
|
47
|
+
this.setState({
|
|
48
|
+
selected: true,
|
|
49
|
+
end: {
|
|
50
|
+
item: currentItem,
|
|
51
|
+
xValue: xAccessor(currentItem),
|
|
52
|
+
yValue: yScale.invert(mouseY),
|
|
53
|
+
},
|
|
54
|
+
rect: {
|
|
55
|
+
x,
|
|
56
|
+
y,
|
|
57
|
+
height,
|
|
58
|
+
width,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
this.handleZoomComplete = (_, moreProps) => {
|
|
63
|
+
if (this.zoomHappening) {
|
|
64
|
+
const { onBrush } = this.props;
|
|
65
|
+
if (onBrush !== undefined) {
|
|
66
|
+
const { start, end } = this.state;
|
|
67
|
+
onBrush({ start, end }, moreProps);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
this.setState({
|
|
71
|
+
selected: false,
|
|
72
|
+
rect: null,
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
this.terminate = this.terminate.bind(this);
|
|
76
|
+
this.state = {
|
|
77
|
+
rect: null,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
terminate() {
|
|
81
|
+
this.zoomHappening = false;
|
|
82
|
+
this.setState({
|
|
83
|
+
x1y1: null,
|
|
84
|
+
start: null,
|
|
85
|
+
end: null,
|
|
86
|
+
rect: null,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
const { enabled } = this.props;
|
|
91
|
+
if (!enabled) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return (React.createElement(GenericChartComponent, { disablePan: enabled, canvasToDraw: getMouseCanvas, canvasDraw: this.drawOnCanvas, onMouseDown: this.handleZoomStart, onMouseMove: this.handleDrawSquare, onClick: this.handleZoomComplete, drawOn: ["mousemove", "pan", "drag"] }));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
Brush.defaultProps = {
|
|
98
|
+
type: "2D",
|
|
99
|
+
strokeStyle: "#000000",
|
|
100
|
+
fillStyle: "#3h3h3h",
|
|
101
|
+
strokeDashArray: "ShortDash",
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=Brush.js.map
|
package/lib/Brush.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Brush.js","sourceRoot":"","sources":["../src/Brush.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACH,wBAAwB,EACxB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CAAC;SACf;QAED,OAAO,CACH,oBAAC,qBAAqB,IAClB,UAAU,EAAE,OAAO,EACnB,YAAY,EAAE,cAAc,EAC5B,UAAU,EAAE,IAAI,CAAC,YAAY,EAC7B,WAAW,EAAE,IAAI,CAAC,eAAe,EACjC,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAClC,OAAO,EAAE,IAAI,CAAC,kBAAkB,EAChC,MAAM,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,GACtC,CACL,CAAC;IACN,CAAC;;AA7Ca,kBAAY,GAAG;IACzB,IAAI,EAAE,IAAI;IACV,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,eAAe,EAAE,WAAW;CAC/B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface ClickCallbackProps {
|
|
3
|
+
readonly disablePan: boolean;
|
|
4
|
+
readonly onMouseDown?: (e: React.MouseEvent<Element, MouseEvent>, moreProps: any) => void;
|
|
5
|
+
readonly onClick?: (e: React.MouseEvent<Element, MouseEvent>, moreProps: any) => void;
|
|
6
|
+
readonly onDoubleClick?: (e: React.MouseEvent<Element, MouseEvent>, moreProps: any) => void;
|
|
7
|
+
readonly onContextMenu?: (e: React.MouseEvent<Element, MouseEvent>, moreProps: any) => void;
|
|
8
|
+
readonly onMouseMove?: (e: React.MouseEvent<Element, MouseEvent>, moreProps: any) => void;
|
|
9
|
+
readonly onPan?: (e: React.MouseEvent<Element, MouseEvent>, moreProps: any) => void;
|
|
10
|
+
readonly onPanEnd?: (e: React.MouseEvent<Element, MouseEvent>, moreProps: any) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare class ClickCallback extends React.Component<ClickCallbackProps> {
|
|
13
|
+
static defaultProps: {
|
|
14
|
+
disablePan: boolean;
|
|
15
|
+
};
|
|
16
|
+
render(): JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { getMouseCanvas, GenericChartComponent } from "@ivanmatiaspascual/core";
|
|
3
|
+
export class ClickCallback extends React.Component {
|
|
4
|
+
render() {
|
|
5
|
+
const { onMouseDown, onClick, onDoubleClick, onContextMenu, onMouseMove, onPan, onPanEnd } = this.props;
|
|
6
|
+
return (React.createElement(GenericChartComponent, { onMouseDown: onMouseDown, onClick: onClick, onDoubleClick: onDoubleClick, onContextMenu: onContextMenu, onMouseMove: onMouseMove, onPan: onPan, onPanEnd: onPanEnd, canvasToDraw: getMouseCanvas, drawOn: ["mousemove", "pan"] }));
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
ClickCallback.defaultProps = {
|
|
10
|
+
disablePan: false,
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=ClickCallback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClickCallback.js","sourceRoot":"","sources":["../src/ClickCallback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAahF,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,SAA6B;IAK3D,MAAM;QACT,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAExG,OAAO,CACH,oBAAC,qBAAqB,IAClB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,cAAc,EAC5B,MAAM,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC,GAC9B,CACL,CAAC;IACN,CAAC;;AApBa,0BAAY,GAAG;IACzB,UAAU,EAAE,KAAK;CACpB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface DrawingObjectSelectorProps {
|
|
3
|
+
readonly getInteractiveNodes: () => any[];
|
|
4
|
+
readonly onSelect?: (e: React.MouseEvent, interactives: any[], moreProps: any) => void;
|
|
5
|
+
readonly onDoubleClick?: (e: React.MouseEvent, item: any, moreProps: any) => void;
|
|
6
|
+
readonly drawingObjectMap: any;
|
|
7
|
+
readonly enabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class DrawingObjectSelector extends React.Component<DrawingObjectSelectorProps> {
|
|
10
|
+
static defaultProps: {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
};
|
|
13
|
+
render(): JSX.Element;
|
|
14
|
+
private readonly getInteraction;
|
|
15
|
+
private readonly handleClick;
|
|
16
|
+
private readonly handleDoubleClick;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { head, isDefined, mapObject, GenericComponent, getMouseCanvas } from "@ivanmatiaspascual/core";
|
|
3
|
+
import { getMorePropsForChart, getSelected } from "./utils";
|
|
4
|
+
export class DrawingObjectSelector extends React.Component {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.getInteraction = (moreProps) => {
|
|
8
|
+
const { getInteractiveNodes, drawingObjectMap } = this.props;
|
|
9
|
+
const interactiveNodes = getInteractiveNodes();
|
|
10
|
+
const interactives = mapObject(interactiveNodes, (each) => {
|
|
11
|
+
const key = drawingObjectMap[each.type];
|
|
12
|
+
const valueArray = isDefined(key) ? each.node.props[key] : undefined;
|
|
13
|
+
const valuePresent = isDefined(valueArray) && Array.isArray(valueArray) && valueArray.length > 0;
|
|
14
|
+
if (valuePresent) {
|
|
15
|
+
const morePropsForChart = getMorePropsForChart(moreProps, each.chartId);
|
|
16
|
+
const objects = each.node.getSelectionState(morePropsForChart);
|
|
17
|
+
return {
|
|
18
|
+
type: each.type,
|
|
19
|
+
chartId: each.chartId,
|
|
20
|
+
objects,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
type: each.type,
|
|
25
|
+
chartId: each.chartId,
|
|
26
|
+
objects: [],
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return interactives;
|
|
30
|
+
};
|
|
31
|
+
this.handleClick = (e, moreProps) => {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
const { onSelect } = this.props;
|
|
34
|
+
const { enabled } = this.props;
|
|
35
|
+
if (!enabled) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const interactives = this.getInteraction(moreProps);
|
|
39
|
+
if (onSelect !== undefined) {
|
|
40
|
+
onSelect(e, interactives, moreProps);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
this.handleDoubleClick = (e, moreProps) => {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
const { onDoubleClick } = this.props;
|
|
46
|
+
const { enabled } = this.props;
|
|
47
|
+
if (!enabled) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const interactives = this.getInteraction(moreProps);
|
|
51
|
+
const allSelected = getSelected(interactives);
|
|
52
|
+
if (allSelected.length > 0) {
|
|
53
|
+
const selected = head(allSelected);
|
|
54
|
+
const item = {
|
|
55
|
+
type: selected.type,
|
|
56
|
+
chartId: selected.chartId,
|
|
57
|
+
object: head(selected.objects),
|
|
58
|
+
};
|
|
59
|
+
const morePropsForChart = getMorePropsForChart(moreProps, selected.chartId);
|
|
60
|
+
if (onDoubleClick !== undefined) {
|
|
61
|
+
onDoubleClick(e, item, morePropsForChart);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
return (React.createElement(GenericComponent, { canvasToDraw: getMouseCanvas, onMouseDown: this.handleClick, onDoubleClick: this.handleDoubleClick, drawOn: ["mousemove", "pan", "drag"] }));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
DrawingObjectSelector.defaultProps = {
|
|
71
|
+
enabled: true,
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=DrawingObjectSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawingObjectSelector.js","sourceRoot":"","sources":["../src/DrawingObjectSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAU5D,MAAM,OAAO,qBAAsB,SAAQ,KAAK,CAAC,SAAqC;IAAtF;;QAgBqB,mBAAc,GAAG,CAAC,SAAc,EAAE,EAAE;YACjD,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YAC7D,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;YAC/C,MAAM,YAAY,GAAG,SAAS,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE;gBACtD,MAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAExC,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBAErE,MAAM,YAAY,GAAG,SAAS,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;gBACjG,IAAI,YAAY,EAAE;oBACd,MAAM,iBAAiB,GAAG,o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,WAAW,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;YAE9C,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;gBACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;gBACnC,MAAM,IAAI,GAAG;oBACT,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;oBACzB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;iBACjC,CAAC;gBACF,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;gBAC5E,IAAI,aAAa,KAAK,SAAS,EAAE;oBAC7B,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC;iBAC7C;aACJ;QACL,CAAC,CAAC;IACN,CAAC;IA/EU,MAAM;QACT,OAAO,CACH,oBAAC,gBAAgB,IACb,YAAY,EAAE,cAAc,EAC5B,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,aAAa,EAAE,IAAI,CAAC,iBAAiB,EACrC,MAAM,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,GACtC,CACL,CAAC;IACN,CAAC;;AAba,kCAAY,GAAG;IACzB,OAAO,EAAE,IAAI;CAChB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface EquidistantChannelProps {
|
|
3
|
+
readonly enabled: boolean;
|
|
4
|
+
readonly onStart: () => void;
|
|
5
|
+
readonly onComplete: (e: React.MouseEvent, newChannels: any[], moreProps: any) => void;
|
|
6
|
+
readonly onSelect: (e: React.MouseEvent, interactives: any[], moreProps: any) => void;
|
|
7
|
+
readonly currentPositionStroke?: string;
|
|
8
|
+
readonly currentPositionStrokeWidth?: number;
|
|
9
|
+
readonly currentPositionOpacity?: number;
|
|
10
|
+
readonly currentPositionRadius?: number;
|
|
11
|
+
readonly hoverText: object;
|
|
12
|
+
readonly channels: any[];
|
|
13
|
+
readonly appearance: {
|
|
14
|
+
readonly stroke: string;
|
|
15
|
+
readonly strokeOpacity: number;
|
|
16
|
+
readonly strokeWidth: number;
|
|
17
|
+
readonly fill: string;
|
|
18
|
+
readonly fillOpacity: number;
|
|
19
|
+
readonly edgeStroke: string;
|
|
20
|
+
readonly edgeFill: string;
|
|
21
|
+
readonly edgeFill2: string;
|
|
22
|
+
readonly edgeStrokeWidth: number;
|
|
23
|
+
readonly r: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
interface EquidistantChannelState {
|
|
27
|
+
current?: any;
|
|
28
|
+
override?: any;
|
|
29
|
+
}
|
|
30
|
+
export declare class EquidistantChannel extends React.Component<EquidistantChannelProps, EquidistantChannelState> {
|
|
31
|
+
static defaultProps: {
|
|
32
|
+
onSelect: () => void;
|
|
33
|
+
currentPositionStroke: string;
|
|
34
|
+
currentPositionOpacity: number;
|
|
35
|
+
currentPositionStrokeWidth: number;
|
|
36
|
+
currentPositionRadius: number;
|
|
37
|
+
hoverText: {
|
|
38
|
+
enable: boolean;
|
|
39
|
+
bgHeight: number;
|
|
40
|
+
bgWidth: number;
|
|
41
|
+
text: string;
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
fontSize: number;
|
|
44
|
+
fill: string;
|
|
45
|
+
bgFill: string;
|
|
46
|
+
bgOpacity: number;
|
|
47
|
+
};
|
|
48
|
+
channels: never[];
|
|
49
|
+
appearance: {
|
|
50
|
+
stroke: string;
|
|
51
|
+
strokeOpacity: number;
|
|
52
|
+
strokeWidth: number;
|
|
53
|
+
fill: string;
|
|
54
|
+
fillOpacity: number;
|
|
55
|
+
edgeStroke: string;
|
|
56
|
+
edgeFill: string;
|
|
57
|
+
edgeFill2: string;
|
|
58
|
+
edgeStrokeWidth: number;
|
|
59
|
+
r: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
private terminate;
|
|
63
|
+
private saveNodeType;
|
|
64
|
+
private getSelectionState;
|
|
65
|
+
private mouseMoved;
|
|
66
|
+
constructor(props: EquidistantChannelProps);
|
|
67
|
+
render(): JSX.Element;
|
|
68
|
+
private readonly handleDragChannel;
|
|
69
|
+
private readonly handleDragChannelComplete;
|
|
70
|
+
private readonly handleStart;
|
|
71
|
+
private readonly handleEnd;
|
|
72
|
+
private readonly handleDrawChannel;
|
|
73
|
+
}
|
|
74
|
+
export {};
|