@pie-lib/graphing-module 1.0.23 → 1.0.26
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 +58 -60
- 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.5/module/index.js";
|
|
2
2
|
const PropTypes$C = _dll_prop_types;
|
|
3
3
|
const BaseDomainRangeType = {
|
|
4
4
|
min: PropTypes$C.number.isRequired,
|
|
@@ -1109,7 +1109,7 @@ const amountToIncreaseWidth$2 = longestWord => {
|
|
|
1109
1109
|
if (!longestWord) {
|
|
1110
1110
|
return 0;
|
|
1111
1111
|
}
|
|
1112
|
-
return longestWord *
|
|
1112
|
+
return longestWord * 20;
|
|
1113
1113
|
};
|
|
1114
1114
|
var utils$1 = Object.freeze({
|
|
1115
1115
|
__proto__: null,
|
|
@@ -1144,14 +1144,17 @@ const GraphTitle = withStyles$k(theme => ({
|
|
|
1144
1144
|
}
|
|
1145
1145
|
}))(({value, classes}) => React$D.createElement(Typography, {
|
|
1146
1146
|
className: classes.title,
|
|
1147
|
-
variant: "h5",
|
|
1148
1147
|
color: "primary",
|
|
1148
|
+
variant: "h5",
|
|
1149
|
+
dangerouslySetInnerHTML: {
|
|
1150
|
+
__html: value
|
|
1151
|
+
},
|
|
1149
1152
|
__self: undefined,
|
|
1150
1153
|
__source: {
|
|
1151
1154
|
fileName: _jsxFileName$v,
|
|
1152
1155
|
lineNumber: 19
|
|
1153
1156
|
}
|
|
1154
|
-
}
|
|
1157
|
+
}));
|
|
1155
1158
|
class Root$1 extends React$D.Component {
|
|
1156
1159
|
constructor(...args) {
|
|
1157
1160
|
super(...args);
|
|
@@ -1206,14 +1209,14 @@ class Root$1 extends React$D.Component {
|
|
|
1206
1209
|
__self: this,
|
|
1207
1210
|
__source: {
|
|
1208
1211
|
fileName: _jsxFileName$v,
|
|
1209
|
-
lineNumber:
|
|
1212
|
+
lineNumber: 79
|
|
1210
1213
|
}
|
|
1211
1214
|
}, title && React$D.createElement(GraphTitle, {
|
|
1212
1215
|
value: title,
|
|
1213
1216
|
__self: this,
|
|
1214
1217
|
__source: {
|
|
1215
1218
|
fileName: _jsxFileName$v,
|
|
1216
|
-
lineNumber:
|
|
1219
|
+
lineNumber: 80
|
|
1217
1220
|
}
|
|
1218
1221
|
}), React$D.createElement('svg', {
|
|
1219
1222
|
width: finalWidth,
|
|
@@ -1222,7 +1225,7 @@ class Root$1 extends React$D.Component {
|
|
|
1222
1225
|
__self: this,
|
|
1223
1226
|
__source: {
|
|
1224
1227
|
fileName: _jsxFileName$v,
|
|
1225
|
-
lineNumber:
|
|
1228
|
+
lineNumber: 81
|
|
1226
1229
|
}
|
|
1227
1230
|
}, React$D.createElement('g', {
|
|
1228
1231
|
ref: r => {
|
|
@@ -1236,7 +1239,7 @@ class Root$1 extends React$D.Component {
|
|
|
1236
1239
|
__self: this,
|
|
1237
1240
|
__source: {
|
|
1238
1241
|
fileName: _jsxFileName$v,
|
|
1239
|
-
lineNumber:
|
|
1242
|
+
lineNumber: 82
|
|
1240
1243
|
}
|
|
1241
1244
|
}, children)));
|
|
1242
1245
|
}
|
|
@@ -3008,7 +3011,7 @@ var amountToIncreaseWidth$1 = function amountToIncreaseWidth(longestWord) {
|
|
|
3008
3011
|
if (!longestWord) {
|
|
3009
3012
|
return 0;
|
|
3010
3013
|
}
|
|
3011
|
-
return longestWord *
|
|
3014
|
+
return longestWord * 20;
|
|
3012
3015
|
};
|
|
3013
3016
|
utils.amountToIncreaseWidth = amountToIncreaseWidth$1;
|
|
3014
3017
|
const debug$8 = _dll_debug;
|
|
@@ -9408,6 +9411,7 @@ class Graph extends React$r.Component {
|
|
|
9408
9411
|
...m,
|
|
9409
9412
|
disabled: true
|
|
9410
9413
|
},
|
|
9414
|
+
labelNode: this.state.labelNode,
|
|
9411
9415
|
...common,
|
|
9412
9416
|
__self: this,
|
|
9413
9417
|
__source: {
|
|
@@ -9433,7 +9437,7 @@ class Graph extends React$r.Component {
|
|
|
9433
9437
|
__self: this,
|
|
9434
9438
|
__source: {
|
|
9435
9439
|
fileName: _jsxFileName$o,
|
|
9436
|
-
lineNumber:
|
|
9440
|
+
lineNumber: 203
|
|
9437
9441
|
}
|
|
9438
9442
|
});
|
|
9439
9443
|
}), React$r.createElement('foreignObject', {
|
|
@@ -9447,7 +9451,7 @@ class Graph extends React$r.Component {
|
|
|
9447
9451
|
__self: this,
|
|
9448
9452
|
__source: {
|
|
9449
9453
|
fileName: _jsxFileName$o,
|
|
9450
|
-
lineNumber:
|
|
9454
|
+
lineNumber: 219
|
|
9451
9455
|
}
|
|
9452
9456
|
})));
|
|
9453
9457
|
}
|
|
@@ -11320,49 +11324,23 @@ class Arrow$1 extends React$j.Component {
|
|
|
11320
11324
|
graphProps: GraphPropsType.isRequired
|
|
11321
11325
|
};
|
|
11322
11326
|
}
|
|
11323
|
-
getRotation(currentAngle, referenceAngle, x, y) {
|
|
11324
|
-
const breakpoint = referenceAngle + 10;
|
|
11325
|
-
return `rotate(${-currentAngle - (currentAngle > breakpoint ? 15 : 0)}, ${x},${y})`;
|
|
11326
|
-
}
|
|
11327
|
-
getRotationWithBreakpoint(currentAngle, referenceAngle, x, y) {
|
|
11328
|
-
const firstBreakpoint = referenceAngle + 10;
|
|
11329
|
-
const secondBreakpoint = referenceAngle + 65;
|
|
11330
|
-
let t;
|
|
11331
|
-
if (currentAngle >= firstBreakpoint && currentAngle < secondBreakpoint) {
|
|
11332
|
-
t = 15;
|
|
11333
|
-
} else if (currentAngle > secondBreakpoint) {
|
|
11334
|
-
t = 7;
|
|
11335
|
-
} else {
|
|
11336
|
-
t = 0;
|
|
11337
|
-
}
|
|
11338
|
-
return `rotate(${-currentAngle + t}, ${x},${y})`;
|
|
11339
|
-
}
|
|
11340
11327
|
render() {
|
|
11341
11328
|
const {classes, angle, className, x, y, disabled, correctness, graphProps, ...rest} = this.props;
|
|
11342
11329
|
const size = thinnerShapesNeeded(graphProps) ? 12 : 14;
|
|
11343
11330
|
const {scale} = graphProps;
|
|
11344
11331
|
const scaledX = scale.x(x);
|
|
11345
11332
|
const scaledY = scale.y(y);
|
|
11346
|
-
|
|
11333
|
+
const transform = `rotate(${-angle}, ${scaledX},${scaledY})`;
|
|
11347
11334
|
const points = `${scaledX},${scaledY}
|
|
11348
11335
|
${scaledX - size},${scaledY - size / 2}
|
|
11349
11336
|
${scaledX - size}, ${scaledY + size / 2}`;
|
|
11350
|
-
if (angle >= 0 && angle < 90) {
|
|
11351
|
-
transform = this.getRotation(angle, 0, scaledX, scaledY);
|
|
11352
|
-
} else if (angle >= 90 && angle < 180) {
|
|
11353
|
-
transform = this.getRotationWithBreakpoint(angle, 90, scaledX, scaledY);
|
|
11354
|
-
} else if (angle >= 180 && angle < 270) {
|
|
11355
|
-
transform = this.getRotation(angle, 180, scaledX, scaledY);
|
|
11356
|
-
} else {
|
|
11357
|
-
transform = this.getRotationWithBreakpoint(angle, 280, scaledX, scaledY);
|
|
11358
|
-
}
|
|
11359
11337
|
return React$j.createElement('g', {
|
|
11360
11338
|
className: classNames$c(classes.point, disabled && classes.disabled, classes[correctness], className),
|
|
11361
11339
|
...rest,
|
|
11362
11340
|
__self: this,
|
|
11363
11341
|
__source: {
|
|
11364
11342
|
fileName: _jsxFileName$j,
|
|
11365
|
-
lineNumber:
|
|
11343
|
+
lineNumber: 45
|
|
11366
11344
|
}
|
|
11367
11345
|
}, React$j.createElement(ArrowHead, {
|
|
11368
11346
|
size: size,
|
|
@@ -11371,7 +11349,7 @@ class Arrow$1 extends React$j.Component {
|
|
|
11371
11349
|
__self: this,
|
|
11372
11350
|
__source: {
|
|
11373
11351
|
fileName: _jsxFileName$j,
|
|
11374
|
-
lineNumber:
|
|
11352
|
+
lineNumber: 54
|
|
11375
11353
|
}
|
|
11376
11354
|
}));
|
|
11377
11355
|
}
|
|
@@ -11754,8 +11732,9 @@ const styles$5 = theme => ({
|
|
|
11754
11732
|
color: color$9.primaryDark()
|
|
11755
11733
|
},
|
|
11756
11734
|
disabled: {
|
|
11757
|
-
border: `solid 1px ${color$9.
|
|
11758
|
-
background: color$9.background()
|
|
11735
|
+
border: `solid 1px ${color$9.disabled()}`,
|
|
11736
|
+
background: color$9.background(),
|
|
11737
|
+
color: color$9.disabled()
|
|
11759
11738
|
}
|
|
11760
11739
|
});
|
|
11761
11740
|
const position = (graphProps, mark, rect) => {
|
|
@@ -11835,20 +11814,21 @@ const MarkLabel = props => {
|
|
|
11835
11814
|
pointerEvents: 'auto',
|
|
11836
11815
|
...leftTop
|
|
11837
11816
|
};
|
|
11817
|
+
const disabledInput = disabled || mark.disabled;
|
|
11838
11818
|
return React$i.createElement(_default, {
|
|
11839
11819
|
inputRef: r => {
|
|
11840
11820
|
_ref(r);
|
|
11841
11821
|
externalInputRef(r);
|
|
11842
11822
|
},
|
|
11843
|
-
disabled:
|
|
11844
|
-
inputClassName: cn$1(classes.input,
|
|
11823
|
+
disabled: disabledInput,
|
|
11824
|
+
inputClassName: cn$1(classes.input, disabledInput && classes.disabled),
|
|
11845
11825
|
value: label,
|
|
11846
11826
|
style: style,
|
|
11847
11827
|
onChange: onChange,
|
|
11848
11828
|
__self: undefined,
|
|
11849
11829
|
__source: {
|
|
11850
11830
|
fileName: _jsxFileName$i,
|
|
11851
|
-
lineNumber:
|
|
11831
|
+
lineNumber: 103
|
|
11852
11832
|
}
|
|
11853
11833
|
});
|
|
11854
11834
|
};
|
|
@@ -12302,6 +12282,15 @@ const lineToolComponent = Component => {
|
|
|
12302
12282
|
render() {
|
|
12303
12283
|
const {graphProps, onClick, labelNode, labelModeEnabled, coordinatesOnHover} = this.props;
|
|
12304
12284
|
const mark = this.state.mark ? this.state.mark : this.props.mark;
|
|
12285
|
+
if (mark.from && mark.disabled) {
|
|
12286
|
+
mark.from.disabled = mark.disabled;
|
|
12287
|
+
}
|
|
12288
|
+
if (mark.to && mark.disabled) {
|
|
12289
|
+
mark.to.disabled = mark.disabled;
|
|
12290
|
+
}
|
|
12291
|
+
if (mark.middle && mark.disabled) {
|
|
12292
|
+
mark.middle.disabled = mark.disabled;
|
|
12293
|
+
}
|
|
12305
12294
|
return React$e.createElement(Component, {
|
|
12306
12295
|
disabled: mark.disabled,
|
|
12307
12296
|
coordinatesOnHover: coordinatesOnHover,
|
|
@@ -12320,7 +12309,7 @@ const lineToolComponent = Component => {
|
|
|
12320
12309
|
__self: this,
|
|
12321
12310
|
__source: {
|
|
12322
12311
|
fileName: _jsxFileName$e,
|
|
12323
|
-
lineNumber:
|
|
12312
|
+
lineNumber: 117
|
|
12324
12313
|
}
|
|
12325
12314
|
});
|
|
12326
12315
|
}
|
|
@@ -12508,7 +12497,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12508
12497
|
__self: this,
|
|
12509
12498
|
__source: {
|
|
12510
12499
|
fileName: _jsxFileName$e,
|
|
12511
|
-
lineNumber:
|
|
12500
|
+
lineNumber: 291
|
|
12512
12501
|
}
|
|
12513
12502
|
}), labelNode);
|
|
12514
12503
|
}
|
|
@@ -12525,7 +12514,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12525
12514
|
__self: this,
|
|
12526
12515
|
__source: {
|
|
12527
12516
|
fileName: _jsxFileName$e,
|
|
12528
|
-
lineNumber:
|
|
12517
|
+
lineNumber: 304
|
|
12529
12518
|
}
|
|
12530
12519
|
}), labelNode);
|
|
12531
12520
|
}
|
|
@@ -12542,7 +12531,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12542
12531
|
__self: this,
|
|
12543
12532
|
__source: {
|
|
12544
12533
|
fileName: _jsxFileName$e,
|
|
12545
|
-
lineNumber:
|
|
12534
|
+
lineNumber: 317
|
|
12546
12535
|
}
|
|
12547
12536
|
}), labelNode);
|
|
12548
12537
|
}
|
|
@@ -12551,7 +12540,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12551
12540
|
__self: this,
|
|
12552
12541
|
__source: {
|
|
12553
12542
|
fileName: _jsxFileName$e,
|
|
12554
|
-
lineNumber:
|
|
12543
|
+
lineNumber: 330
|
|
12555
12544
|
}
|
|
12556
12545
|
}, to && React$e.createElement(DraggableComp, {
|
|
12557
12546
|
from: from,
|
|
@@ -12563,7 +12552,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12563
12552
|
__self: this,
|
|
12564
12553
|
__source: {
|
|
12565
12554
|
fileName: _jsxFileName$e,
|
|
12566
|
-
lineNumber:
|
|
12555
|
+
lineNumber: 332
|
|
12567
12556
|
}
|
|
12568
12557
|
}), lineLabelNode, React$e.createElement(FromPoint, {
|
|
12569
12558
|
x: from.x,
|
|
@@ -12576,7 +12565,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12576
12565
|
__self: this,
|
|
12577
12566
|
__source: {
|
|
12578
12567
|
fileName: _jsxFileName$e,
|
|
12579
|
-
lineNumber:
|
|
12568
|
+
lineNumber: 343
|
|
12580
12569
|
}
|
|
12581
12570
|
}), fromLabelNode, to && React$e.createElement(ToPoint, {
|
|
12582
12571
|
x: to.x,
|
|
@@ -12590,7 +12579,7 @@ const lineBase = (Comp, opts) => {
|
|
|
12590
12579
|
__self: this,
|
|
12591
12580
|
__source: {
|
|
12592
12581
|
fileName: _jsxFileName$e,
|
|
12593
|
-
lineNumber:
|
|
12582
|
+
lineNumber: 355
|
|
12594
12583
|
}
|
|
12595
12584
|
}), toLabelNode);
|
|
12596
12585
|
}
|
|
@@ -14138,19 +14127,28 @@ const lineStyles = theme => ({
|
|
|
14138
14127
|
incorrect: styles$3.incorrect(theme, 'stroke')
|
|
14139
14128
|
});
|
|
14140
14129
|
const Line = props => {
|
|
14141
|
-
const {className, classes, disabled, correctness, graphProps, from, to, ...rest} = props;
|
|
14142
|
-
const
|
|
14130
|
+
const {className, classes, disabled, correctness, graphProps: {scale}, from, to, ...rest} = props;
|
|
14131
|
+
const startPoint = {
|
|
14132
|
+
x: scale.x(from.x),
|
|
14133
|
+
y: scale.y(from.y)
|
|
14134
|
+
};
|
|
14135
|
+
const endPoint = {
|
|
14136
|
+
x: scale.x(to.x),
|
|
14137
|
+
y: scale.y(to.y)
|
|
14138
|
+
};
|
|
14139
|
+
const length = getDistanceBetweenTwoPoints(startPoint, endPoint);
|
|
14143
14140
|
return React$5.createElement('line', {
|
|
14144
14141
|
className: classNames$3(classes.line, disabled && classes.disabled, classes[correctness], className),
|
|
14145
|
-
x1:
|
|
14146
|
-
y1:
|
|
14147
|
-
x2:
|
|
14148
|
-
y2:
|
|
14142
|
+
x1: startPoint.x,
|
|
14143
|
+
y1: startPoint.y,
|
|
14144
|
+
x2: endPoint.x,
|
|
14145
|
+
y2: endPoint.y,
|
|
14146
|
+
strokeDasharray: length - 7,
|
|
14149
14147
|
...rest,
|
|
14150
14148
|
__self: undefined,
|
|
14151
14149
|
__source: {
|
|
14152
14150
|
fileName: _jsxFileName$5,
|
|
14153
|
-
lineNumber:
|
|
14151
|
+
lineNumber: 33
|
|
14154
14152
|
}
|
|
14155
14153
|
});
|
|
14156
14154
|
};
|
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.26",
|
|
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.12"
|
|
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": "d3b0cdc42a9437ab48f619dcf0a760adb5df9855"
|
|
26
26
|
},
|
|
27
27
|
"modules": [
|
|
28
28
|
{
|
|
29
29
|
"name": "@pie-lib/shared-module",
|
|
30
|
-
"version": "^1.4.
|
|
30
|
+
"version": "^1.4.5"
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
"isLocal": true
|