@pie-lib/graphing-module 1.0.24 → 1.0.27
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/module/index.js +46 -48
- package/module/manifest.json +5 -5
- package/package.json +1 -1
package/module/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_prop_types, _dll_lodash, _dll_react, _dll_material_ui__core_styles, _dll_material_ui__core, _dll_pie_lib__render_ui, _dll_react_dom, _dll_debug, _dll_classnames, _dll_material_ui__core_styles_color_manipulator} from "../../shared-module@^1.4.
|
|
1
|
+
import {_dll_prop_types, _dll_lodash, _dll_react, _dll_material_ui__core_styles, _dll_material_ui__core, _dll_pie_lib__render_ui, _dll_react_dom, _dll_debug, _dll_classnames, _dll_material_ui__core_styles_color_manipulator} from "../../shared-module@^1.4.6/module/index.js";
|
|
2
2
|
const PropTypes$C = _dll_prop_types;
|
|
3
3
|
const BaseDomainRangeType = {
|
|
4
4
|
min: PropTypes$C.number.isRequired,
|
|
@@ -11324,49 +11324,23 @@ class Arrow$1 extends React$j.Component {
|
|
|
11324
11324
|
graphProps: GraphPropsType.isRequired
|
|
11325
11325
|
};
|
|
11326
11326
|
}
|
|
11327
|
-
getRotation(currentAngle, referenceAngle, x, y) {
|
|
11328
|
-
const breakpoint = referenceAngle + 10;
|
|
11329
|
-
return `rotate(${-currentAngle - (currentAngle > breakpoint ? 15 : 0)}, ${x},${y})`;
|
|
11330
|
-
}
|
|
11331
|
-
getRotationWithBreakpoint(currentAngle, referenceAngle, x, y) {
|
|
11332
|
-
const firstBreakpoint = referenceAngle + 10;
|
|
11333
|
-
const secondBreakpoint = referenceAngle + 65;
|
|
11334
|
-
let t;
|
|
11335
|
-
if (currentAngle >= firstBreakpoint && currentAngle < secondBreakpoint) {
|
|
11336
|
-
t = 15;
|
|
11337
|
-
} else if (currentAngle > secondBreakpoint) {
|
|
11338
|
-
t = 7;
|
|
11339
|
-
} else {
|
|
11340
|
-
t = 0;
|
|
11341
|
-
}
|
|
11342
|
-
return `rotate(${-currentAngle + t}, ${x},${y})`;
|
|
11343
|
-
}
|
|
11344
11327
|
render() {
|
|
11345
11328
|
const {classes, angle, className, x, y, disabled, correctness, graphProps, ...rest} = this.props;
|
|
11346
11329
|
const size = thinnerShapesNeeded(graphProps) ? 12 : 14;
|
|
11347
11330
|
const {scale} = graphProps;
|
|
11348
11331
|
const scaledX = scale.x(x);
|
|
11349
11332
|
const scaledY = scale.y(y);
|
|
11350
|
-
|
|
11333
|
+
const transform = `rotate(${-angle}, ${scaledX},${scaledY})`;
|
|
11351
11334
|
const points = `${scaledX},${scaledY}
|
|
11352
11335
|
${scaledX - size},${scaledY - size / 2}
|
|
11353
11336
|
${scaledX - size}, ${scaledY + size / 2}`;
|
|
11354
|
-
if (angle >= 0 && angle < 90) {
|
|
11355
|
-
transform = this.getRotation(angle, 0, scaledX, scaledY);
|
|
11356
|
-
} else if (angle >= 90 && angle < 180) {
|
|
11357
|
-
transform = this.getRotationWithBreakpoint(angle, 90, scaledX, scaledY);
|
|
11358
|
-
} else if (angle >= 180 && angle < 270) {
|
|
11359
|
-
transform = this.getRotation(angle, 180, scaledX, scaledY);
|
|
11360
|
-
} else {
|
|
11361
|
-
transform = this.getRotationWithBreakpoint(angle, 280, scaledX, scaledY);
|
|
11362
|
-
}
|
|
11363
11337
|
return React$j.createElement('g', {
|
|
11364
11338
|
className: classNames$c(classes.point, disabled && classes.disabled, classes[correctness], className),
|
|
11365
11339
|
...rest,
|
|
11366
11340
|
__self: this,
|
|
11367
11341
|
__source: {
|
|
11368
11342
|
fileName: _jsxFileName$j,
|
|
11369
|
-
lineNumber:
|
|
11343
|
+
lineNumber: 45
|
|
11370
11344
|
}
|
|
11371
11345
|
}, React$j.createElement(ArrowHead, {
|
|
11372
11346
|
size: size,
|
|
@@ -11375,7 +11349,7 @@ class Arrow$1 extends React$j.Component {
|
|
|
11375
11349
|
__self: this,
|
|
11376
11350
|
__source: {
|
|
11377
11351
|
fileName: _jsxFileName$j,
|
|
11378
|
-
lineNumber:
|
|
11352
|
+
lineNumber: 54
|
|
11379
11353
|
}
|
|
11380
11354
|
}));
|
|
11381
11355
|
}
|
|
@@ -11760,6 +11734,11 @@ const styles$5 = theme => ({
|
|
|
11760
11734
|
disabled: {
|
|
11761
11735
|
border: `solid 1px ${color$9.primaryDark()}`,
|
|
11762
11736
|
background: color$9.background()
|
|
11737
|
+
},
|
|
11738
|
+
disabledMark: {
|
|
11739
|
+
border: `solid 1px ${color$9.disabled()}`,
|
|
11740
|
+
background: color$9.background(),
|
|
11741
|
+
color: color$9.disabled()
|
|
11763
11742
|
}
|
|
11764
11743
|
});
|
|
11765
11744
|
const position = (graphProps, mark, rect) => {
|
|
@@ -11839,20 +11818,21 @@ const MarkLabel = props => {
|
|
|
11839
11818
|
pointerEvents: 'auto',
|
|
11840
11819
|
...leftTop
|
|
11841
11820
|
};
|
|
11821
|
+
const disabledInput = disabled || mark.disabled;
|
|
11842
11822
|
return React$i.createElement(_default, {
|
|
11843
11823
|
inputRef: r => {
|
|
11844
11824
|
_ref(r);
|
|
11845
11825
|
externalInputRef(r);
|
|
11846
11826
|
},
|
|
11847
|
-
disabled:
|
|
11848
|
-
inputClassName: cn$1(classes.input, disabled && classes.disabled),
|
|
11827
|
+
disabled: disabledInput,
|
|
11828
|
+
inputClassName: cn$1(classes.input, disabled && classes.disabled, mark.disabled && classes.disabledMark),
|
|
11849
11829
|
value: label,
|
|
11850
11830
|
style: style,
|
|
11851
11831
|
onChange: onChange,
|
|
11852
11832
|
__self: undefined,
|
|
11853
11833
|
__source: {
|
|
11854
11834
|
fileName: _jsxFileName$i,
|
|
11855
|
-
lineNumber:
|
|
11835
|
+
lineNumber: 107
|
|
11856
11836
|
}
|
|
11857
11837
|
});
|
|
11858
11838
|
};
|
|
@@ -12306,6 +12286,15 @@ const lineToolComponent = Component => {
|
|
|
12306
12286
|
render() {
|
|
12307
12287
|
const {graphProps, onClick, labelNode, labelModeEnabled, coordinatesOnHover} = this.props;
|
|
12308
12288
|
const mark = this.state.mark ? this.state.mark : this.props.mark;
|
|
12289
|
+
if (mark.from && mark.disabled) {
|
|
12290
|
+
mark.from.disabled = mark.disabled;
|
|
12291
|
+
}
|
|
12292
|
+
if (mark.to && mark.disabled) {
|
|
12293
|
+
mark.to.disabled = mark.disabled;
|
|
12294
|
+
}
|
|
12295
|
+
if (mark.middle && mark.disabled) {
|
|
12296
|
+
mark.middle.disabled = mark.disabled;
|
|
12297
|
+
}
|
|
12309
12298
|
return React$e.createElement(Component, {
|
|
12310
12299
|
disabled: mark.disabled,
|
|
12311
12300
|
coordinatesOnHover: coordinatesOnHover,
|
|
@@ -12324,7 +12313,7 @@ const lineToolComponent = Component => {
|
|
|
12324
12313
|
__self: this,
|
|
12325
12314
|
__source: {
|
|
12326
12315
|
fileName: _jsxFileName$e,
|
|
12327
|
-
lineNumber:
|
|
12316
|
+
lineNumber: 117
|
|
12328
12317
|
}
|
|
12329
12318
|
});
|
|
12330
12319
|
}
|
|
@@ -12512,7 +12501,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12512
12501
|
__self: this,
|
|
12513
12502
|
__source: {
|
|
12514
12503
|
fileName: _jsxFileName$e,
|
|
12515
|
-
lineNumber:
|
|
12504
|
+
lineNumber: 291
|
|
12516
12505
|
}
|
|
12517
12506
|
}), labelNode);
|
|
12518
12507
|
}
|
|
@@ -12529,7 +12518,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12529
12518
|
__self: this,
|
|
12530
12519
|
__source: {
|
|
12531
12520
|
fileName: _jsxFileName$e,
|
|
12532
|
-
lineNumber:
|
|
12521
|
+
lineNumber: 304
|
|
12533
12522
|
}
|
|
12534
12523
|
}), labelNode);
|
|
12535
12524
|
}
|
|
@@ -12546,7 +12535,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12546
12535
|
__self: this,
|
|
12547
12536
|
__source: {
|
|
12548
12537
|
fileName: _jsxFileName$e,
|
|
12549
|
-
lineNumber:
|
|
12538
|
+
lineNumber: 317
|
|
12550
12539
|
}
|
|
12551
12540
|
}), labelNode);
|
|
12552
12541
|
}
|
|
@@ -12555,7 +12544,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12555
12544
|
__self: this,
|
|
12556
12545
|
__source: {
|
|
12557
12546
|
fileName: _jsxFileName$e,
|
|
12558
|
-
lineNumber:
|
|
12547
|
+
lineNumber: 330
|
|
12559
12548
|
}
|
|
12560
12549
|
}, to && React$e.createElement(DraggableComp, {
|
|
12561
12550
|
from: from,
|
|
@@ -12567,7 +12556,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12567
12556
|
__self: this,
|
|
12568
12557
|
__source: {
|
|
12569
12558
|
fileName: _jsxFileName$e,
|
|
12570
|
-
lineNumber:
|
|
12559
|
+
lineNumber: 332
|
|
12571
12560
|
}
|
|
12572
12561
|
}), lineLabelNode, React$e.createElement(FromPoint, {
|
|
12573
12562
|
x: from.x,
|
|
@@ -12580,7 +12569,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12580
12569
|
__self: this,
|
|
12581
12570
|
__source: {
|
|
12582
12571
|
fileName: _jsxFileName$e,
|
|
12583
|
-
lineNumber:
|
|
12572
|
+
lineNumber: 343
|
|
12584
12573
|
}
|
|
12585
12574
|
}), fromLabelNode, to && React$e.createElement(ToPoint, {
|
|
12586
12575
|
x: to.x,
|
|
@@ -12594,7 +12583,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12594
12583
|
__self: this,
|
|
12595
12584
|
__source: {
|
|
12596
12585
|
fileName: _jsxFileName$e,
|
|
12597
|
-
lineNumber:
|
|
12586
|
+
lineNumber: 355
|
|
12598
12587
|
}
|
|
12599
12588
|
}), toLabelNode);
|
|
12600
12589
|
}
|
|
@@ -14142,19 +14131,28 @@ const lineStyles = theme => ({
|
|
|
14142
14131
|
incorrect: styles$3.incorrect(theme, 'stroke')
|
|
14143
14132
|
});
|
|
14144
14133
|
const Line = props => {
|
|
14145
|
-
const {className, classes, disabled, correctness, graphProps, from, to, ...rest} = props;
|
|
14146
|
-
const
|
|
14134
|
+
const {className, classes, disabled, correctness, graphProps: {scale}, from, to, ...rest} = props;
|
|
14135
|
+
const startPoint = {
|
|
14136
|
+
x: scale.x(from.x),
|
|
14137
|
+
y: scale.y(from.y)
|
|
14138
|
+
};
|
|
14139
|
+
const endPoint = {
|
|
14140
|
+
x: scale.x(to.x),
|
|
14141
|
+
y: scale.y(to.y)
|
|
14142
|
+
};
|
|
14143
|
+
const length = getDistanceBetweenTwoPoints(startPoint, endPoint);
|
|
14147
14144
|
return React$5.createElement('line', {
|
|
14148
14145
|
className: classNames$3(classes.line, disabled && classes.disabled, classes[correctness], className),
|
|
14149
|
-
x1:
|
|
14150
|
-
y1:
|
|
14151
|
-
x2:
|
|
14152
|
-
y2:
|
|
14146
|
+
x1: startPoint.x,
|
|
14147
|
+
y1: startPoint.y,
|
|
14148
|
+
x2: endPoint.x,
|
|
14149
|
+
y2: endPoint.y,
|
|
14150
|
+
strokeDasharray: length - 7,
|
|
14153
14151
|
...rest,
|
|
14154
14152
|
__self: undefined,
|
|
14155
14153
|
__source: {
|
|
14156
14154
|
fileName: _jsxFileName$5,
|
|
14157
|
-
lineNumber:
|
|
14155
|
+
lineNumber: 33
|
|
14158
14156
|
}
|
|
14159
14157
|
});
|
|
14160
14158
|
};
|
package/module/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/graphing-module",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"mappings": {
|
|
5
5
|
"@pie-lib/plot": "_dll_pie_lib__plot",
|
|
6
6
|
"@pie-lib/graphing": "_dll_pie_lib__graphing",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"versionInfo": {
|
|
11
11
|
"data": {
|
|
12
12
|
"@pie-lib/plot": {
|
|
13
|
-
"version": "2.1.
|
|
13
|
+
"version": "2.1.10"
|
|
14
14
|
},
|
|
15
15
|
"@pie-lib/graphing": {
|
|
16
|
-
"version": "2.4.
|
|
16
|
+
"version": "2.4.13"
|
|
17
17
|
},
|
|
18
18
|
"d3-scale": {
|
|
19
19
|
"version": "2.2.2"
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"version": "1.4.2"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
"hash": "
|
|
25
|
+
"hash": "5530dd686d4430e31ada17f891c8a96f928e35b0"
|
|
26
26
|
},
|
|
27
27
|
"modules": [
|
|
28
28
|
{
|
|
29
29
|
"name": "@pie-lib/shared-module",
|
|
30
|
-
"version": "^1.4.
|
|
30
|
+
"version": "^1.4.6"
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
"isLocal": true
|