@pie-lib/graphing-module 1.0.24 → 1.0.25

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 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.3/module/index.js";
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.4/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
- let transform;
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: 74
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: 83
11352
+ lineNumber: 54
11379
11353
  }
11380
11354
  }));
11381
11355
  }
@@ -14142,19 +14116,28 @@ const lineStyles = theme => ({
14142
14116
  incorrect: styles$3.incorrect(theme, 'stroke')
14143
14117
  });
14144
14118
  const Line = props => {
14145
- const {className, classes, disabled, correctness, graphProps, from, to, ...rest} = props;
14146
- const {scale} = graphProps;
14119
+ const {className, classes, disabled, correctness, graphProps: {scale}, from, to, ...rest} = props;
14120
+ const startPoint = {
14121
+ x: scale.x(from.x),
14122
+ y: scale.y(from.y)
14123
+ };
14124
+ const endPoint = {
14125
+ x: scale.x(to.x),
14126
+ y: scale.y(to.y)
14127
+ };
14128
+ const length = getDistanceBetweenTwoPoints(startPoint, endPoint);
14147
14129
  return React$5.createElement('line', {
14148
14130
  className: classNames$3(classes.line, disabled && classes.disabled, classes[correctness], className),
14149
- x1: scale.x(from.x),
14150
- y1: scale.y(from.y),
14151
- x2: scale.x(to.x),
14152
- y2: scale.y(to.y),
14131
+ x1: startPoint.x,
14132
+ y1: startPoint.y,
14133
+ x2: endPoint.x,
14134
+ y2: endPoint.y,
14135
+ strokeDasharray: length - 7,
14153
14136
  ...rest,
14154
14137
  __self: undefined,
14155
14138
  __source: {
14156
14139
  fileName: _jsxFileName$5,
14157
- lineNumber: 20
14140
+ lineNumber: 33
14158
14141
  }
14159
14142
  });
14160
14143
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/graphing-module",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
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.9"
13
+ "version": "2.1.10"
14
14
  },
15
15
  "@pie-lib/graphing": {
16
- "version": "2.4.10"
16
+ "version": "2.4.11"
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": "8d9d0c11032014b49b8c98cbd7d2e8856b73ad26"
25
+ "hash": "8b8a098fa53f4ded079f7faf3f0d6bb33c2122af"
26
26
  },
27
27
  "modules": [
28
28
  {
29
29
  "name": "@pie-lib/shared-module",
30
- "version": "^1.4.3"
30
+ "version": "^1.4.4"
31
31
  }
32
32
  ],
33
33
  "isLocal": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/graphing-module",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "module": "module/index.js",
5
5
  "repository": "pie-framework/pie-lib",
6
6
  "publishConfig": {