@pie-lib/graphing-solution-set 2.17.0 → 2.18.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +13 -65
  2. package/package.json +9 -8
  3. package/src/axis/axes.jsx +1 -1
  4. package/src/coordinates-label.jsx +1 -1
  5. package/src/graph-with-controls.jsx +1 -1
  6. package/src/grid-setup.jsx +1 -1
  7. package/src/labels.jsx +1 -1
  8. package/src/mark-label.jsx +1 -1
  9. package/src/toggle-bar.jsx +1 -1
  10. package/src/tools/polygon/line.jsx +1 -1
  11. package/src/tools/polygon/polygon.jsx +1 -1
  12. package/src/tools/shared/arrow-head.jsx +1 -1
  13. package/src/tools/shared/line/index.jsx +1 -1
  14. package/src/tools/shared/line/line-path.jsx +1 -1
  15. package/src/tools/shared/point/base-point.jsx +1 -1
  16. package/src/tools/shared/point/index.jsx +1 -1
  17. package/src/tools/shared/styles.js +1 -1
  18. package/src/undo-redo.jsx +1 -1
  19. package/lib/axis/arrow.js +0 -115
  20. package/lib/axis/arrow.js.map +0 -1
  21. package/lib/axis/axes.js +0 -415
  22. package/lib/axis/axes.js.map +0 -1
  23. package/lib/axis/index.js +0 -26
  24. package/lib/axis/index.js.map +0 -1
  25. package/lib/bg.js +0 -139
  26. package/lib/bg.js.map +0 -1
  27. package/lib/container/actions.js +0 -24
  28. package/lib/container/actions.js.map +0 -1
  29. package/lib/container/index.js +0 -166
  30. package/lib/container/index.js.map +0 -1
  31. package/lib/container/marks.js +0 -27
  32. package/lib/container/marks.js.map +0 -1
  33. package/lib/container/middleware.js +0 -25
  34. package/lib/container/middleware.js.map +0 -1
  35. package/lib/container/reducer.js +0 -25
  36. package/lib/container/reducer.js.map +0 -1
  37. package/lib/coordinates-label.js +0 -109
  38. package/lib/coordinates-label.js.map +0 -1
  39. package/lib/graph-with-controls.js +0 -372
  40. package/lib/graph-with-controls.js.map +0 -1
  41. package/lib/graph.js +0 -419
  42. package/lib/graph.js.map +0 -1
  43. package/lib/grid-setup.js +0 -462
  44. package/lib/grid-setup.js.map +0 -1
  45. package/lib/grid.js +0 -176
  46. package/lib/grid.js.map +0 -1
  47. package/lib/index.js +0 -51
  48. package/lib/index.js.map +0 -1
  49. package/lib/labels.js +0 -299
  50. package/lib/labels.js.map +0 -1
  51. package/lib/mark-label.js +0 -208
  52. package/lib/mark-label.js.map +0 -1
  53. package/lib/shared/index.js +0 -136
  54. package/lib/toggle-bar.js +0 -336
  55. package/lib/toggle-bar.js.map +0 -1
  56. package/lib/tool-menu.js +0 -325
  57. package/lib/tool-menu.js.map +0 -1
  58. package/lib/tools/index.js +0 -29
  59. package/lib/tools/index.js.map +0 -1
  60. package/lib/tools/line/component.js +0 -106
  61. package/lib/tools/line/component.js.map +0 -1
  62. package/lib/tools/line/index.js +0 -16
  63. package/lib/tools/line/index.js.map +0 -1
  64. package/lib/tools/polygon/component.js +0 -457
  65. package/lib/tools/polygon/component.js.map +0 -1
  66. package/lib/tools/polygon/index.js +0 -106
  67. package/lib/tools/polygon/index.js.map +0 -1
  68. package/lib/tools/polygon/line.js +0 -151
  69. package/lib/tools/polygon/line.js.map +0 -1
  70. package/lib/tools/polygon/polygon.js +0 -171
  71. package/lib/tools/polygon/polygon.js.map +0 -1
  72. package/lib/tools/shared/arrow-head.js +0 -75
  73. package/lib/tools/shared/arrow-head.js.map +0 -1
  74. package/lib/tools/shared/line/index.js +0 -637
  75. package/lib/tools/shared/line/index.js.map +0 -1
  76. package/lib/tools/shared/line/line-path.js +0 -145
  77. package/lib/tools/shared/line/line-path.js.map +0 -1
  78. package/lib/tools/shared/line/with-root-edge.js +0 -155
  79. package/lib/tools/shared/line/with-root-edge.js.map +0 -1
  80. package/lib/tools/shared/point/arrow-point.js +0 -113
  81. package/lib/tools/shared/point/arrow-point.js.map +0 -1
  82. package/lib/tools/shared/point/arrow.js +0 -96
  83. package/lib/tools/shared/point/arrow.js.map +0 -1
  84. package/lib/tools/shared/point/base-point.js +0 -151
  85. package/lib/tools/shared/point/base-point.js.map +0 -1
  86. package/lib/tools/shared/point/index.js +0 -94
  87. package/lib/tools/shared/point/index.js.map +0 -1
  88. package/lib/tools/shared/styles.js +0 -49
  89. package/lib/tools/shared/styles.js.map +0 -1
  90. package/lib/tools/shared/types.js +0 -19
  91. package/lib/tools/shared/types.js.map +0 -1
  92. package/lib/undo-redo.js +0 -107
  93. package/lib/undo-redo.js.map +0 -1
  94. package/lib/use-debounce.js +0 -32
  95. package/lib/use-debounce.js.map +0 -1
  96. package/lib/utils.js +0 -314
  97. package/lib/utils.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # 2.17.0 (2025-07-31)
6
+ # 2.18.0 (2025-07-31)
7
7
 
8
8
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # 2.16.0 (2025-07-31)
14
+ # 2.17.0 (2025-07-31)
15
15
 
16
16
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
17
17
 
@@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
19
 
20
20
 
21
21
 
22
- # 2.15.0-beta.8 (2025-07-25)
22
+ # 2.16.0 (2025-07-31)
23
23
 
24
24
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
25
25
 
@@ -27,142 +27,90 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
27
27
 
28
28
 
29
29
 
30
- # 2.15.0-beta.7 (2025-07-25)
30
+ # 2.16.0 (2025-07-31)
31
31
 
32
32
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
33
33
 
34
+ # 2.17.0 (2025-07-31)
34
35
 
36
+ **Note:** Version bump only for package @pie-lib/graphing-solution-set
35
37
 
38
+ # 2.16.0 (2025-07-31)
36
39
 
40
+ **Note:** Version bump only for package @pie-lib/graphing-solution-set
37
41
 
38
- # 2.15.0-beta.7 (2025-07-25)
42
+ # 2.15.0-beta.8 (2025-07-25)
39
43
 
40
44
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
41
45
 
46
+ # 2.15.0-beta.7 (2025-07-25)
42
47
 
48
+ **Note:** Version bump only for package @pie-lib/graphing-solution-set
43
49
 
50
+ # 2.15.0-beta.7 (2025-07-25)
44
51
 
52
+ **Note:** Version bump only for package @pie-lib/graphing-solution-set
45
53
 
46
54
  # 2.15.0-beta.6 (2025-07-25)
47
55
 
48
56
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
49
57
 
50
-
51
-
52
-
53
-
54
58
  # 2.15.0-beta.6 (2025-07-25)
55
59
 
56
60
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
57
61
 
58
-
59
-
60
-
61
-
62
62
  # 2.15.0-beta.5 (2025-07-25)
63
63
 
64
64
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
65
65
 
66
-
67
-
68
-
69
-
70
66
  # 2.15.0-beta.5 (2025-07-25)
71
67
 
72
68
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
73
69
 
74
-
75
-
76
-
77
-
78
70
  # 2.15.0-beta.4 (2025-07-25)
79
71
 
80
72
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
81
73
 
82
-
83
-
84
-
85
-
86
74
  # 2.15.0-beta.3 (2025-07-25)
87
75
 
88
76
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
89
77
 
90
-
91
-
92
-
93
-
94
78
  # 2.15.0-beta.4 (2025-07-23)
95
79
 
96
80
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
97
81
 
98
-
99
-
100
-
101
-
102
82
  # 2.15.0-beta.3 (2025-07-23)
103
83
 
104
84
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
105
85
 
106
-
107
-
108
-
109
-
110
86
  # 2.15.0-beta.3 (2025-07-20)
111
87
 
112
88
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
113
89
 
114
-
115
-
116
-
117
-
118
90
  # 2.15.0-beta.2 (2025-07-20)
119
91
 
120
92
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
121
93
 
122
-
123
-
124
-
125
-
126
94
  # 2.15.0-beta.1 (2025-07-20)
127
95
 
128
96
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
129
97
 
130
-
131
-
132
-
133
-
134
98
  # 2.15.0-beta.2 (2025-07-20)
135
99
 
136
100
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
137
101
 
138
-
139
-
140
-
141
-
142
102
  # 2.15.0-beta.1 (2025-07-20)
143
103
 
144
104
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
145
105
 
146
-
147
-
148
-
149
-
150
106
  # 2.15.0-beta.1 (2025-07-20)
151
107
 
152
108
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
153
109
 
154
-
155
-
156
-
157
-
158
110
  # 2.15.0-beta.0 (2025-07-20)
159
111
 
160
112
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
161
113
 
162
-
163
-
164
-
165
-
166
114
  # 2.16.0-beta.0 (2025-07-15)
167
115
 
168
116
  **Note:** Version bump only for package @pie-lib/graphing-solution-set
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "2.17.0",
6
+ "version": "2.18.0",
7
7
  "description": "Graphing components",
8
8
  "keywords": [
9
9
  "react",
@@ -19,12 +19,13 @@
19
19
  "@mapbox/point-geometry": "^0.1.0",
20
20
  "@material-ui/core": "^3.8.3",
21
21
  "@material-ui/icons": "^3.0.2",
22
- "@pie-lib/drag": "beta",
23
- "@pie-lib/editable-html": "beta",
24
- "@pie-lib/graphing-utils": "beta",
25
- "@pie-lib/plot": "beta",
26
- "@pie-lib/tools": "beta",
27
- "@pie-lib/translator": "beta",
22
+ "@pie-lib/drag": "^2.6.0",
23
+ "@pie-lib/editable-html": "^11.5.0",
24
+ "@pie-lib/graphing-utils": "^1.5.0",
25
+ "@pie-lib/plot": "^2.11.0",
26
+ "@pie-lib/render-ui": "^4.19.0",
27
+ "@pie-lib/tools": "^0.13.0",
28
+ "@pie-lib/translator": "^2.7.0",
28
29
  "@vx/axis": "^0.0.189",
29
30
  "@vx/clip-path": "^0.0.189",
30
31
  "@vx/curve": "^0.0.189",
@@ -50,6 +51,6 @@
50
51
  "peerDependencies": {
51
52
  "react": "^16.8.1"
52
53
  },
53
- "gitHead": "ecb1ca31aa1c24d23af00d5ad04ce73ed8871057",
54
+ "gitHead": "889a13bfea2c768b8a3a6eabfc6fe7b7725aa832",
54
55
  "scripts": {}
55
56
  }
package/src/axis/axes.jsx CHANGED
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
5
5
  import Arrow from './arrow';
6
6
  import { withStyles } from '@material-ui/core';
7
7
  import { countWords, findLongestWord, amountToIncreaseWidth, getTickValues } from '../utils';
8
- import { color, Readable } from '../../../render-ui/src/index';
8
+ import { color, Readable } from '@pie-lib/render-ui';
9
9
 
10
10
  export const AxisPropTypes = {
11
11
  includeArrows: PropTypes.object,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { types } from '@pie-lib/plot';
4
- import { color } from '../../render-ui/src/index';
4
+ import { color } from '@pie-lib/render-ui';
5
5
  import { withStyles } from '@material-ui/core/styles';
6
6
  import InputBase from '@material-ui/core/InputBase';
7
7
  import { roundNumber } from './utils';
@@ -4,7 +4,7 @@ import { withStyles } from '@material-ui/core/styles';
4
4
  import classNames from 'classnames';
5
5
  import uniq from 'lodash/uniq';
6
6
  import isString from 'lodash/isString';
7
- import { color } from '../../render-ui/src/index';
7
+ import { color } from '@pie-lib/render-ui';
8
8
  import ToolMenu from './tool-menu';
9
9
  import Graph, { graphPropTypes } from './graph';
10
10
  import UndoRedo from './undo-redo';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { color, InputContainer } from '../../render-ui/src/index';
3
+ import { color, InputContainer } from '@pie-lib/render-ui';
4
4
  import { withStyles } from '@material-ui/core/styles';
5
5
  import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';
6
6
  import Typography from '@material-ui/core/Typography';
package/src/labels.jsx CHANGED
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { withStyles } from '@material-ui/core/styles';
4
4
  import { types } from '@pie-lib/plot';
5
- import { color, Readable } from '../../render-ui/src/index';
5
+ import { color, Readable } from '@pie-lib/render-ui';
6
6
  import EditableHtml from '@pie-lib/editable-html';
7
7
  import cn from 'classnames';
8
8
 
@@ -5,7 +5,7 @@ import { withStyles } from '@material-ui/core/styles';
5
5
  import AutosizeInput from 'react-input-autosize';
6
6
  import { useDebounce } from './use-debounce';
7
7
  import { types } from '@pie-lib/plot';
8
- import { color } from '../../render-ui/src/index';
8
+ import { color } from '@pie-lib/render-ui';
9
9
 
10
10
  const styles = (theme) => ({
11
11
  input: {
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { withStyles } from '@material-ui/core/styles';
4
4
  import cn from 'classnames';
5
5
  import Button from '@material-ui/core/Button';
6
- import { color } from '../../render-ui/src/index';
6
+ import { color } from '@pie-lib/render-ui';
7
7
  import { allTools } from './tools';
8
8
  import { withDragContext, DragSource, DropTarget } from '@pie-lib/drag';
9
9
  import Translator from '@pie-lib/translator';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { withStyles } from '@material-ui/core/styles';
4
4
  import { types, gridDraggable } from '@pie-lib/plot';
5
- import { color } from '../../../../render-ui/src/index';
5
+ import { color } from '@pie-lib/render-ui';
6
6
  import * as utils from '../../utils';
7
7
  import classNames from 'classnames';
8
8
  import { correct, disabled, incorrect, missing } from '../shared/styles';
@@ -4,7 +4,7 @@ import { withStyles } from '@material-ui/core/styles';
4
4
  import { gridDraggable, types } from '@pie-lib/plot';
5
5
  import * as utils from '../../utils';
6
6
  import classNames from 'classnames';
7
- import { color } from '../../../../render-ui/src/index';
7
+ import { color } from '@pie-lib/render-ui';
8
8
  import { fade } from '@material-ui/core/styles/colorManipulator';
9
9
  import { correct, disabled, incorrect } from '../shared/styles';
10
10
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { color } from '../../../../render-ui/src/index';
3
+ import { color } from '@pie-lib/render-ui';
4
4
 
5
5
  export const ArrowHead = ({ size, transform, points }) => (
6
6
  <polygon points={points || `0,0 ${size},${size / 2} 0,${size}`} transform={transform} />
@@ -8,7 +8,7 @@ import { disabled, correct, incorrect, missing } from '../styles';
8
8
  import ReactDOM from 'react-dom';
9
9
  import MarkLabel from '../../../mark-label';
10
10
  import isEmpty from 'lodash/isEmpty';
11
- import { color } from '../../../../../render-ui/src/index';
11
+ import { color } from '@pie-lib/render-ui';
12
12
  import { getMiddleOfTwoPoints, equalPoints, sameAxes } from '../../../utils';
13
13
 
14
14
  export const lineTool = (type, Component) => () => ({
@@ -5,7 +5,7 @@ import { types } from '@pie-lib/plot';
5
5
  import classNames from 'classnames';
6
6
  import { disabled, correct, incorrect, missing } from '../styles';
7
7
  import * as vx from '@vx/shape';
8
- import { color } from '../../../../../render-ui/src/index';
8
+ import { color } from '@pie-lib/render-ui';
9
9
 
10
10
  export class RawLinePath extends React.Component {
11
11
  static propTypes = {
@@ -5,7 +5,7 @@ import { types } from '@pie-lib/plot';
5
5
  import CoordinatesLabel from '../../../coordinates-label';
6
6
  import ReactDOM from 'react-dom';
7
7
  import { thinnerShapesNeeded } from '../../../utils';
8
- import { color } from '../../../../../render-ui/src/index';
8
+ import { color } from '@pie-lib/render-ui';
9
9
 
10
10
  export class RawBp extends React.Component {
11
11
  static propTypes = {
@@ -4,7 +4,7 @@ import * as utils from '../../../utils';
4
4
  import { disabled, correct, incorrect, missing } from '../styles';
5
5
  import { RawBp } from './base-point';
6
6
  import { RawArrow } from './arrow-point';
7
- import { color } from '../../../../../render-ui/src/index';
7
+ import { color } from '@pie-lib/render-ui';
8
8
  import BaseArrow from './arrow';
9
9
 
10
10
  const opts = {
@@ -1,4 +1,4 @@
1
- import { color } from '../../../../render-ui/src/index';
1
+ import { color } from '@pie-lib/render-ui';
2
2
 
3
3
  export const disabled = (key = 'fill') => ({
4
4
  [key]: color.disabled(),
package/src/undo-redo.jsx CHANGED
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
4
  import Button from '@material-ui/core/Button';
5
5
  import { withStyles } from '@material-ui/core';
6
- import { color } from '../../render-ui/src/index';
6
+ import { color } from '@pie-lib/render-ui';
7
7
  import Translator from '@pie-lib/translator';
8
8
 
9
9
  const { translator } = Translator;
package/lib/axis/arrow.js DELETED
@@ -1,115 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = exports.Arrow = void 0;
9
-
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
-
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
-
14
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
-
16
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
17
-
18
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
-
20
- var _react = _interopRequireDefault(require("react"));
21
-
22
- var _propTypes = _interopRequireDefault(require("prop-types"));
23
-
24
- var _classnames = _interopRequireDefault(require("classnames"));
25
-
26
- var _styles = require("@material-ui/core/styles");
27
-
28
- var _plot = require("@pie-lib/plot");
29
-
30
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
31
-
32
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
33
-
34
- var style = function style(theme) {
35
- return {
36
- root: {
37
- fill: "var(--arrow-color, ".concat(theme.palette.common.black, ")")
38
- }
39
- };
40
- };
41
-
42
- var Arrow = /*#__PURE__*/function (_React$Component) {
43
- (0, _inherits2["default"])(Arrow, _React$Component);
44
-
45
- var _super = _createSuper(Arrow);
46
-
47
- function Arrow() {
48
- (0, _classCallCheck2["default"])(this, Arrow);
49
- return _super.apply(this, arguments);
50
- }
51
-
52
- (0, _createClass2["default"])(Arrow, [{
53
- key: "render",
54
- value: function render() {
55
- var _this$props = this.props,
56
- x = _this$props.x,
57
- y = _this$props.y,
58
- classes = _this$props.classes,
59
- className = _this$props.className,
60
- scale = _this$props.scale;
61
- var names = (0, _classnames["default"])(classes.root, className);
62
- var direction = this.props.direction || 'left';
63
- var xv = scale.x(x);
64
- var yv = scale.y(y);
65
- var transform = '';
66
-
67
- var getTransform = function getTransform(x, y, rotate) {
68
- return "translate(".concat(x, ", ").concat(y, ") rotate(").concat(rotate, ")");
69
- };
70
-
71
- if (direction === 'left') {
72
- transform = getTransform(xv - 15, yv, 0);
73
- }
74
-
75
- if (direction === 'right') {
76
- transform = getTransform(xv + 15, yv, 180);
77
- }
78
-
79
- if (direction === 'up') {
80
- transform = getTransform(xv, yv - 15, 90);
81
- }
82
-
83
- if (direction === 'down') {
84
- transform = getTransform(xv, yv + 15, 270);
85
- }
86
-
87
- return /*#__PURE__*/_react["default"].createElement("path", {
88
- d: "m 0,0 8,-5 0,10 -8,-5",
89
- transform: transform,
90
- className: names
91
- });
92
- }
93
- }]);
94
- return Arrow;
95
- }(_react["default"].Component);
96
-
97
- exports.Arrow = Arrow;
98
- Arrow.propTypes = {
99
- y: _propTypes["default"].number,
100
- x: _propTypes["default"].number,
101
- direction: _propTypes["default"].oneOf(['left', 'right', 'up', 'down']),
102
- classes: _propTypes["default"].object.isRequired,
103
- className: _propTypes["default"].string,
104
- scale: _plot.types.ScaleType.isRequired
105
- };
106
- Arrow.defaultProps = {
107
- y: 0,
108
- x: 0,
109
- direction: 'left'
110
- };
111
-
112
- var _default = (0, _styles.withStyles)(style)(Arrow);
113
-
114
- exports["default"] = _default;
115
- //# sourceMappingURL=arrow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/axis/arrow.jsx"],"names":["style","theme","root","fill","palette","common","black","Arrow","props","x","y","classes","className","scale","names","direction","xv","yv","transform","getTransform","rotate","React","Component","propTypes","PropTypes","number","oneOf","object","isRequired","string","types","ScaleType","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA,IAAMA,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD;AAAA,SAAY;AACxBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,IAAI,+BAAwBF,KAAK,CAACG,OAAN,CAAcC,MAAd,CAAqBC,KAA7C;AADA;AADkB,GAAZ;AAAA,CAAd;;IAMaC,K;;;;;;;;;;;;WACX,kBAAS;AACP,wBAA4C,KAAKC,KAAjD;AAAA,UAAQC,CAAR,eAAQA,CAAR;AAAA,UAAWC,CAAX,eAAWA,CAAX;AAAA,UAAcC,OAAd,eAAcA,OAAd;AAAA,UAAuBC,SAAvB,eAAuBA,SAAvB;AAAA,UAAkCC,KAAlC,eAAkCA,KAAlC;AACA,UAAMC,KAAK,GAAG,4BAAWH,OAAO,CAACT,IAAnB,EAAyBU,SAAzB,CAAd;AACA,UAAIG,SAAS,GAAG,KAAKP,KAAL,CAAWO,SAAX,IAAwB,MAAxC;AAEA,UAAMC,EAAE,GAAGH,KAAK,CAACJ,CAAN,CAAQA,CAAR,CAAX;AACA,UAAMQ,EAAE,GAAGJ,KAAK,CAACH,CAAN,CAAQA,CAAR,CAAX;AAEA,UAAIQ,SAAS,GAAG,EAAhB;;AAEA,UAAMC,YAAY,GAAG,SAAfA,YAAe,CAACV,CAAD,EAAIC,CAAJ,EAAOU,MAAP;AAAA,mCAA+BX,CAA/B,eAAqCC,CAArC,sBAAkDU,MAAlD;AAAA,OAArB;;AAEA,UAAIL,SAAS,KAAK,MAAlB,EAA0B;AACxBG,QAAAA,SAAS,GAAGC,YAAY,CAACH,EAAE,GAAG,EAAN,EAAUC,EAAV,EAAc,CAAd,CAAxB;AACD;;AAED,UAAIF,SAAS,KAAK,OAAlB,EAA2B;AACzBG,QAAAA,SAAS,GAAGC,YAAY,CAACH,EAAE,GAAG,EAAN,EAAUC,EAAV,EAAc,GAAd,CAAxB;AACD;;AAED,UAAIF,SAAS,KAAK,IAAlB,EAAwB;AACtBG,QAAAA,SAAS,GAAGC,YAAY,CAACH,EAAD,EAAKC,EAAE,GAAG,EAAV,EAAc,EAAd,CAAxB;AACD;;AAED,UAAIF,SAAS,KAAK,MAAlB,EAA0B;AACxBG,QAAAA,SAAS,GAAGC,YAAY,CAACH,EAAD,EAAKC,EAAE,GAAG,EAAV,EAAc,GAAd,CAAxB;AACD;;AAED,0BAAO;AAAM,QAAA,CAAC,EAAC,uBAAR;AAAgC,QAAA,SAAS,EAAEC,SAA3C;AAAsD,QAAA,SAAS,EAAEJ;AAAjE,QAAP;AACD;;;EA9BwBO,kBAAMC,S;;;AAiCjCf,KAAK,CAACgB,SAAN,GAAkB;AAChBb,EAAAA,CAAC,EAAEc,sBAAUC,MADG;AAEhBhB,EAAAA,CAAC,EAAEe,sBAAUC,MAFG;AAGhBV,EAAAA,SAAS,EAAES,sBAAUE,KAAV,CAAgB,CAAC,MAAD,EAAS,OAAT,EAAkB,IAAlB,EAAwB,MAAxB,CAAhB,CAHK;AAIhBf,EAAAA,OAAO,EAAEa,sBAAUG,MAAV,CAAiBC,UAJV;AAKhBhB,EAAAA,SAAS,EAAEY,sBAAUK,MALL;AAMhBhB,EAAAA,KAAK,EAAEiB,YAAMC,SAAN,CAAgBH;AANP,CAAlB;AASArB,KAAK,CAACyB,YAAN,GAAqB;AACnBtB,EAAAA,CAAC,EAAE,CADgB;AAEnBD,EAAAA,CAAC,EAAE,CAFgB;AAGnBM,EAAAA,SAAS,EAAE;AAHQ,CAArB;;eAMe,wBAAWf,KAAX,EAAkBO,KAAlB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { types } from '@pie-lib/plot';\n\nconst style = (theme) => ({\n root: {\n fill: `var(--arrow-color, ${theme.palette.common.black})`,\n },\n});\n\nexport class Arrow extends React.Component {\n render() {\n const { x, y, classes, className, scale } = this.props;\n const names = classNames(classes.root, className);\n let direction = this.props.direction || 'left';\n\n const xv = scale.x(x);\n const yv = scale.y(y);\n\n let transform = '';\n\n const getTransform = (x, y, rotate) => `translate(${x}, ${y}) rotate(${rotate})`;\n\n if (direction === 'left') {\n transform = getTransform(xv - 15, yv, 0);\n }\n\n if (direction === 'right') {\n transform = getTransform(xv + 15, yv, 180);\n }\n\n if (direction === 'up') {\n transform = getTransform(xv, yv - 15, 90);\n }\n\n if (direction === 'down') {\n transform = getTransform(xv, yv + 15, 270);\n }\n\n return <path d=\"m 0,0 8,-5 0,10 -8,-5\" transform={transform} className={names} />;\n }\n}\n\nArrow.propTypes = {\n y: PropTypes.number,\n x: PropTypes.number,\n direction: PropTypes.oneOf(['left', 'right', 'up', 'down']),\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n scale: types.ScaleType.isRequired,\n};\n\nArrow.defaultProps = {\n y: 0,\n x: 0,\n direction: 'left',\n};\n\nexport default withStyles(style)(Arrow);\n"],"file":"arrow.js"}