@pie-lib/graphing 2.48.0-mui-update.0 → 3.1.0-next.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 +8 -116
- package/lib/__tests__/graph-with-controls.test.js +226 -0
- package/lib/__tests__/graph.test.js +187 -0
- package/lib/__tests__/grid.test.js +29 -0
- package/lib/__tests__/labels.test.js +61 -0
- package/lib/__tests__/mark-label.test.js +133 -0
- package/lib/__tests__/toggle-bar.test.js +150 -0
- package/lib/__tests__/tool-menu.test.js +101 -0
- package/lib/__tests__/undo-redo.test.js +31 -0
- package/lib/__tests__/use-debounce.test.js +24 -0
- package/lib/__tests__/utils.js +70 -0
- package/lib/__tests__/utils.test.js +123 -0
- package/lib/axis/__tests__/arrow.test.js +60 -0
- package/lib/axis/__tests__/axes.test.js +195 -0
- package/lib/axis/arrow.js +1 -1
- package/lib/axis/axes.js +1 -1
- package/lib/axis/index.js +1 -1
- package/lib/bg.js +1 -1
- package/lib/container/actions.js +1 -1
- package/lib/container/index.js +1 -1
- package/lib/container/marks.js +1 -1
- package/lib/container/middleware.js +1 -1
- package/lib/container/reducer.js +1 -1
- package/lib/coordinates-label.js +3 -1
- package/lib/coordinates-label.js.map +1 -1
- package/lib/graph-with-controls.js +1 -1
- package/lib/graph.js +1 -1
- package/lib/grid-setup.js +33 -39
- package/lib/grid-setup.js.map +1 -1
- package/lib/grid.js +1 -1
- package/lib/index.js +1 -1
- package/lib/key-legend.js +7 -8
- package/lib/key-legend.js.map +1 -1
- package/lib/label-svg-icon.js +1 -1
- package/lib/labels.js +7 -5
- package/lib/labels.js.map +1 -1
- package/lib/mark-label.js +17 -10
- package/lib/mark-label.js.map +1 -1
- package/lib/toggle-bar.js +12 -12
- package/lib/toggle-bar.js.map +1 -1
- package/lib/tool-menu.js +2 -4
- package/lib/tool-menu.js.map +1 -1
- package/lib/tools/absolute/__tests__/component.test.js +67 -0
- package/lib/tools/absolute/component.js +1 -1
- package/lib/tools/absolute/index.js +1 -1
- package/lib/tools/circle/__tests__/bg-circle.test.js +33 -0
- package/lib/tools/circle/__tests__/component.test.js +68 -0
- package/lib/tools/circle/bg-circle.js +1 -1
- package/lib/tools/circle/component.js +2 -3
- package/lib/tools/circle/component.js.map +1 -1
- package/lib/tools/circle/index.js +1 -1
- package/lib/tools/exponential/__tests__/component.test.js +66 -0
- package/lib/tools/exponential/component.js +1 -1
- package/lib/tools/exponential/index.js +1 -1
- package/lib/tools/index.js +1 -1
- package/lib/tools/line/__tests__/component.test.js +45 -0
- package/lib/tools/line/component.js +1 -1
- package/lib/tools/line/index.js +1 -1
- package/lib/tools/parabola/__tests__/component.test.js +66 -0
- package/lib/tools/parabola/component.js +1 -1
- package/lib/tools/parabola/index.js +1 -1
- package/lib/tools/point/__tests__/component.test.js +50 -0
- package/lib/tools/point/component.js +2 -2
- package/lib/tools/point/component.js.map +1 -1
- package/lib/tools/point/index.js +1 -1
- package/lib/tools/polygon/__tests__/component.test.js +85 -0
- package/lib/tools/polygon/__tests__/index.test.js +92 -0
- package/lib/tools/polygon/__tests__/line.test.js +29 -0
- package/lib/tools/polygon/__tests__/polygon.test.js +59 -0
- package/lib/tools/polygon/component.js +3 -3
- package/lib/tools/polygon/component.js.map +1 -1
- package/lib/tools/polygon/index.js +1 -1
- package/lib/tools/polygon/line.js +3 -3
- package/lib/tools/polygon/line.js.map +1 -1
- package/lib/tools/polygon/polygon.js +1 -1
- package/lib/tools/ray/__tests__/component.test.js +35 -0
- package/lib/tools/ray/component.js +1 -1
- package/lib/tools/ray/index.js +1 -1
- package/lib/tools/segment/__tests__/component.test.js +35 -0
- package/lib/tools/segment/component.js +1 -1
- package/lib/tools/segment/index.js +1 -1
- package/lib/tools/shared/__tests__/arrow-head.test.js +45 -0
- package/lib/tools/shared/arrow-head.js +1 -1
- package/lib/tools/shared/icons/CorrectSVG.js +10 -1
- package/lib/tools/shared/icons/CorrectSVG.js.map +1 -1
- package/lib/tools/shared/icons/IncorrectSVG.js +10 -1
- package/lib/tools/shared/icons/IncorrectSVG.js.map +1 -1
- package/lib/tools/shared/icons/MissingSVG.js +10 -1
- package/lib/tools/shared/icons/MissingSVG.js.map +1 -1
- package/lib/tools/shared/line/__tests__/index.test.js +124 -0
- package/lib/tools/shared/line/__tests__/line-path.test.js +62 -0
- package/lib/tools/shared/line/__tests__/with-root-edge.test.js +91 -0
- package/lib/tools/shared/line/index.js +15 -7
- package/lib/tools/shared/line/index.js.map +1 -1
- package/lib/tools/shared/line/line-path.js +2 -3
- package/lib/tools/shared/line/line-path.js.map +1 -1
- package/lib/tools/shared/line/with-root-edge.js +1 -1
- package/lib/tools/shared/point/__tests__/arrow-point.test.js +127 -0
- package/lib/tools/shared/point/__tests__/base-point.test.js +122 -0
- package/lib/tools/shared/point/arrow-point.js +2 -4
- package/lib/tools/shared/point/arrow-point.js.map +1 -1
- package/lib/tools/shared/point/arrow.js +2 -3
- package/lib/tools/shared/point/arrow.js.map +1 -1
- package/lib/tools/shared/point/base-point.js +1 -1
- package/lib/tools/shared/point/index.js +1 -1
- package/lib/tools/shared/styles.js +1 -1
- package/lib/tools/shared/types.js +1 -1
- package/lib/tools/sine/__tests__/component.test.js +72 -0
- package/lib/tools/sine/component.js +1 -1
- package/lib/tools/sine/index.js +1 -1
- package/lib/tools/vector/__tests__/component.test.js +32 -0
- package/lib/tools/vector/component.js +1 -1
- package/lib/tools/vector/index.js +1 -1
- package/lib/undo-redo.js +1 -1
- package/lib/use-debounce.js +1 -1
- package/lib/utils.js +1 -1
- package/package.json +8 -8
- package/src/__tests__/graph-with-controls.test.jsx +28 -11
- package/src/__tests__/graph.test.jsx +104 -168
- package/src/__tests__/grid.test.jsx +8 -6
- package/src/__tests__/labels.test.jsx +25 -8
- package/src/__tests__/mark-label.test.jsx +12 -17
- package/src/__tests__/toggle-bar.test.jsx +92 -17
- package/src/__tests__/tool-menu.test.jsx +61 -12
- package/src/__tests__/undo-redo.test.jsx +7 -8
- package/src/__tests__/utils.js +3 -0
- package/src/axis/__tests__/arrow.test.jsx +16 -17
- package/src/axis/__tests__/axes.test.jsx +118 -122
- package/src/coordinates-label.jsx +1 -0
- package/src/grid-setup.jsx +34 -40
- package/src/key-legend.jsx +1 -1
- package/src/labels.jsx +3 -1
- package/src/mark-label.jsx +10 -1
- package/src/toggle-bar.jsx +2 -1
- package/src/tool-menu.jsx +1 -1
- package/src/tools/circle/__tests__/bg-circle.test.jsx +7 -9
- package/src/tools/circle/__tests__/component.test.jsx +17 -189
- package/src/tools/circle/component.jsx +1 -1
- package/src/tools/line/__tests__/component.test.jsx +7 -7
- package/src/tools/point/__tests__/component.test.jsx +18 -43
- package/src/tools/point/component.jsx +1 -1
- package/src/tools/polygon/__tests__/component.test.jsx +18 -162
- package/src/tools/polygon/__tests__/line.test.jsx +7 -10
- package/src/tools/polygon/__tests__/polygon.test.jsx +7 -8
- package/src/tools/polygon/component.jsx +2 -2
- package/src/tools/polygon/line.jsx +3 -2
- package/src/tools/ray/__tests__/component.test.jsx +7 -8
- package/src/tools/segment/__tests__/component.test.jsx +7 -8
- package/src/tools/shared/__tests__/arrow-head.test.jsx +14 -17
- package/src/tools/shared/icons/CorrectSVG.jsx +10 -0
- package/src/tools/shared/icons/IncorrectSVG.jsx +10 -0
- package/src/tools/shared/icons/MissingSVG.jsx +10 -0
- package/src/tools/shared/line/__tests__/index.test.jsx +19 -165
- package/src/tools/shared/line/__tests__/line-path.test.jsx +8 -8
- package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +22 -22
- package/src/tools/shared/line/index.jsx +13 -5
- package/src/tools/shared/line/line-path.jsx +1 -1
- package/src/tools/shared/point/__tests__/arrow-point.test.jsx +15 -11
- package/src/tools/shared/point/__tests__/base-point.test.jsx +14 -11
- package/src/tools/shared/point/arrow-point.jsx +1 -1
- package/src/tools/shared/point/arrow.jsx +1 -1
- package/src/tools/vector/__tests__/component.test.jsx +7 -8
- package/src/__tests__/__snapshots__/graph-with-controls.test.jsx.snap +0 -237
- package/src/__tests__/__snapshots__/graph.test.jsx.snap +0 -211
- package/src/__tests__/__snapshots__/grid.test.jsx.snap +0 -54
- package/src/__tests__/__snapshots__/labels.test.jsx.snap +0 -30
- package/src/__tests__/__snapshots__/mark-label.test.jsx.snap +0 -45
- package/src/__tests__/__snapshots__/toggle-bar.test.jsx.snap +0 -7
- package/src/__tests__/__snapshots__/tool-menu.test.jsx.snap +0 -13
- package/src/__tests__/__snapshots__/undo-redo.test.jsx.snap +0 -14
- package/src/axis/__tests__/__snapshots__/arrow.test.jsx.snap +0 -33
- package/src/axis/__tests__/__snapshots__/axes.test.jsx.snap +0 -122
- package/src/tools/circle/__tests__/__snapshots__/bg-circle.test.jsx.snap +0 -46
- package/src/tools/circle/__tests__/__snapshots__/component.test.jsx.snap +0 -293
- package/src/tools/line/__tests__/__snapshots__/component.test.jsx.snap +0 -20
- package/src/tools/point/__tests__/__snapshots__/component.test.jsx.snap +0 -40
- package/src/tools/polygon/__tests__/__snapshots__/component.test.jsx.snap +0 -415
- package/src/tools/polygon/__tests__/__snapshots__/line.test.jsx.snap +0 -45
- package/src/tools/polygon/__tests__/__snapshots__/polygon.test.jsx.snap +0 -52
- package/src/tools/ray/__tests__/__snapshots__/component.test.jsx.snap +0 -23
- package/src/tools/segment/__tests__/__snapshots__/component.test.jsx.snap +0 -14
- package/src/tools/shared/__tests__/__snapshots__/arrow-head.test.jsx.snap +0 -27
- package/src/tools/shared/line/__tests__/__snapshots__/index.test.jsx.snap +0 -360
- package/src/tools/shared/line/__tests__/__snapshots__/line-path.test.jsx.snap +0 -58
- package/src/tools/shared/line/__tests__/__snapshots__/with-root-edge.test.jsx.snap +0 -63
- package/src/tools/shared/point/__tests__/__snapshots__/arrow-point.test.jsx.snap +0 -56
- package/src/tools/shared/point/__tests__/__snapshots__/base-point.test.jsx.snap +0 -44
- package/src/tools/vector/__tests__/__snapshots__/component.test.jsx.snap +0 -12
|
@@ -77,6 +77,13 @@ export const lineToolComponent = (Component) => {
|
|
|
77
77
|
static propTypes = {
|
|
78
78
|
...types.ToolPropTypeFields,
|
|
79
79
|
graphProps: types.GraphPropsType.isRequired,
|
|
80
|
+
limitLabeling: PropTypes.bool,
|
|
81
|
+
changeMarkProps: PropTypes.func,
|
|
82
|
+
disabled: PropTypes.bool,
|
|
83
|
+
from: types.PointType,
|
|
84
|
+
to: types.PointType,
|
|
85
|
+
labelModeEnabled: PropTypes.bool,
|
|
86
|
+
onClick: PropTypes.func,
|
|
80
87
|
};
|
|
81
88
|
|
|
82
89
|
constructor(props) {
|
|
@@ -218,9 +225,10 @@ export const lineBase = (Comp, opts) => {
|
|
|
218
225
|
onClick: PropTypes.func,
|
|
219
226
|
correctness: PropTypes.string,
|
|
220
227
|
disabled: PropTypes.bool,
|
|
221
|
-
|
|
222
|
-
labelModeEnabled: PropTypes.bool,
|
|
228
|
+
limitLabeling: PropTypes.bool,
|
|
223
229
|
changeMarkProps: PropTypes.func,
|
|
230
|
+
labelModeEnabled: PropTypes.bool,
|
|
231
|
+
labelNode: PropTypes.object,
|
|
224
232
|
};
|
|
225
233
|
|
|
226
234
|
onChangePoint = (point) => {
|
|
@@ -346,7 +354,7 @@ export const lineBase = (Comp, opts) => {
|
|
|
346
354
|
let lineLabelNode = null;
|
|
347
355
|
|
|
348
356
|
if (labelNode) {
|
|
349
|
-
if (from &&
|
|
357
|
+
if (from && Object.prototype.hasOwnProperty.call(from, 'label')) {
|
|
350
358
|
fromLabelNode = ReactDOM.createPortal(
|
|
351
359
|
<MarkLabel
|
|
352
360
|
inputRef={(r) => (this.input.from = r)}
|
|
@@ -359,7 +367,7 @@ export const lineBase = (Comp, opts) => {
|
|
|
359
367
|
);
|
|
360
368
|
}
|
|
361
369
|
|
|
362
|
-
if (to &&
|
|
370
|
+
if (to && Object.prototype.hasOwnProperty.call(to, 'label')) {
|
|
363
371
|
toLabelNode = ReactDOM.createPortal(
|
|
364
372
|
<MarkLabel
|
|
365
373
|
inputRef={(r) => (this.input.to = r)}
|
|
@@ -372,7 +380,7 @@ export const lineBase = (Comp, opts) => {
|
|
|
372
380
|
);
|
|
373
381
|
}
|
|
374
382
|
|
|
375
|
-
if (middle &&
|
|
383
|
+
if (middle && Object.prototype.hasOwnProperty.call(middle, 'label')) {
|
|
376
384
|
lineLabelNode = ReactDOM.createPortal(
|
|
377
385
|
<MarkLabel
|
|
378
386
|
inputRef={(r) => (this.input.middle = r)}
|
|
@@ -11,7 +11,7 @@ const dragging = () => ({
|
|
|
11
11
|
stroke: color.defaults.BLACK,
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
const StyledDrawLine = styled(vx.LinePath)(({
|
|
14
|
+
const StyledDrawLine = styled(vx.LinePath)(({ disabled: isDisabled, correctness }) => ({
|
|
15
15
|
fill: 'none',
|
|
16
16
|
strokeWidth: 2,
|
|
17
17
|
stroke: color.black(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { render } from '@pie-lib/test-utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ArrowPoint } from '../index';
|
|
4
4
|
import { graphProps } from '../../../../__tests__/utils';
|
|
@@ -7,10 +7,12 @@ import { gridDraggable, utils } from '@pie-lib/plot';
|
|
|
7
7
|
|
|
8
8
|
const { xy } = utils;
|
|
9
9
|
jest.mock('../../../../utils', () => {
|
|
10
|
-
const { point } = jest.requireActual('../../../../utils');
|
|
10
|
+
const { point, getAngleDeg, arrowDimensions } = jest.requireActual('../../../../utils');
|
|
11
11
|
return {
|
|
12
12
|
bounds: jest.fn(),
|
|
13
13
|
point,
|
|
14
|
+
getAngleDeg,
|
|
15
|
+
arrowDimensions,
|
|
14
16
|
};
|
|
15
17
|
});
|
|
16
18
|
|
|
@@ -24,9 +26,8 @@ jest.mock('@pie-lib/plot', () => {
|
|
|
24
26
|
});
|
|
25
27
|
|
|
26
28
|
describe('ArrowPoint', () => {
|
|
27
|
-
let w;
|
|
28
29
|
let onChange = jest.fn();
|
|
29
|
-
const
|
|
30
|
+
const renderComponent = (extras) => {
|
|
30
31
|
const defaults = {
|
|
31
32
|
classes: {},
|
|
32
33
|
className: 'className',
|
|
@@ -34,17 +35,20 @@ describe('ArrowPoint', () => {
|
|
|
34
35
|
graphProps: graphProps(),
|
|
35
36
|
from: xy(0, 0),
|
|
36
37
|
to: xy(1, 1),
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0,
|
|
37
40
|
};
|
|
38
41
|
const props = { ...defaults, ...extras };
|
|
39
|
-
return
|
|
42
|
+
return render(<ArrowPoint {...props} />);
|
|
40
43
|
};
|
|
41
44
|
|
|
42
|
-
describe('
|
|
43
|
-
it('renders', () => {
|
|
44
|
-
|
|
45
|
-
expect(
|
|
45
|
+
describe('rendering', () => {
|
|
46
|
+
it('renders without crashing', () => {
|
|
47
|
+
const { container } = renderComponent();
|
|
48
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
46
49
|
});
|
|
47
50
|
});
|
|
51
|
+
|
|
48
52
|
describe('gridDraggable options', () => {
|
|
49
53
|
let opts;
|
|
50
54
|
let domain;
|
|
@@ -60,8 +64,8 @@ describe('ArrowPoint', () => {
|
|
|
60
64
|
max: 1,
|
|
61
65
|
step: 1,
|
|
62
66
|
};
|
|
63
|
-
|
|
64
|
-
opts = gridDraggable.mock.calls[
|
|
67
|
+
renderComponent();
|
|
68
|
+
opts = gridDraggable.mock.calls[gridDraggable.mock.calls.length - 1][0];
|
|
65
69
|
});
|
|
66
70
|
|
|
67
71
|
describe('bounds', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { render } from '@pie-lib/test-utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { BasePoint } from '../index';
|
|
4
4
|
import { gridDraggable } from '@pie-lib/plot';
|
|
@@ -6,10 +6,11 @@ import { graphProps } from '../../../../__tests__/utils';
|
|
|
6
6
|
import { bounds } from '../../../../utils';
|
|
7
7
|
|
|
8
8
|
jest.mock('../../../../utils', () => {
|
|
9
|
-
const { point } = jest.requireActual('../../../../utils');
|
|
9
|
+
const { point, thinnerShapesNeeded } = jest.requireActual('../../../../utils');
|
|
10
10
|
return {
|
|
11
11
|
bounds: jest.fn(),
|
|
12
12
|
point,
|
|
13
|
+
thinnerShapesNeeded,
|
|
13
14
|
};
|
|
14
15
|
});
|
|
15
16
|
|
|
@@ -23,25 +24,27 @@ jest.mock('@pie-lib/plot', () => {
|
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
describe('BasePoint', () => {
|
|
26
|
-
let w;
|
|
27
27
|
let onChange = jest.fn();
|
|
28
|
-
const
|
|
28
|
+
const renderComponent = (extras) => {
|
|
29
29
|
const defaults = {
|
|
30
30
|
classes: {},
|
|
31
31
|
className: 'className',
|
|
32
32
|
onChange,
|
|
33
33
|
graphProps: graphProps(),
|
|
34
|
+
x: 0,
|
|
35
|
+
y: 0,
|
|
34
36
|
};
|
|
35
37
|
const props = { ...defaults, ...extras };
|
|
36
|
-
return
|
|
38
|
+
return render(<BasePoint {...props} />);
|
|
37
39
|
};
|
|
38
40
|
|
|
39
|
-
describe('
|
|
40
|
-
it('renders', () => {
|
|
41
|
-
|
|
42
|
-
expect(
|
|
41
|
+
describe('rendering', () => {
|
|
42
|
+
it('renders without crashing', () => {
|
|
43
|
+
const { container } = renderComponent();
|
|
44
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
43
45
|
});
|
|
44
46
|
});
|
|
47
|
+
|
|
45
48
|
describe('gridDraggable options', () => {
|
|
46
49
|
let opts;
|
|
47
50
|
let domain;
|
|
@@ -57,8 +60,8 @@ describe('BasePoint', () => {
|
|
|
57
60
|
max: 1,
|
|
58
61
|
step: 1,
|
|
59
62
|
};
|
|
60
|
-
|
|
61
|
-
opts = gridDraggable.mock.calls[
|
|
63
|
+
renderComponent();
|
|
64
|
+
opts = gridDraggable.mock.calls[gridDraggable.mock.calls.length - 1][0];
|
|
62
65
|
});
|
|
63
66
|
|
|
64
67
|
describe('bounds', () => {
|
|
@@ -27,7 +27,7 @@ export class RawArrow extends React.Component {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
render() {
|
|
30
|
-
const { className, x, y,
|
|
30
|
+
const { className, x, y, graphProps, from, to, ...rest } = this.props;
|
|
31
31
|
const { scale } = graphProps;
|
|
32
32
|
|
|
33
33
|
const angle = from && to ? getAngleDeg(from.x, from.y, to.x, to.y) : 0;
|
|
@@ -16,7 +16,7 @@ export class BaseArrow extends React.Component {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
render() {
|
|
19
|
-
const { className, angle, x, y,
|
|
19
|
+
const { className, angle, x, y, correctness, graphProps, ...rest } = this.props;
|
|
20
20
|
const size = thinnerShapesNeeded(graphProps) ? 12 : 14;
|
|
21
21
|
const { scale } = graphProps;
|
|
22
22
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { render } from '@pie-lib/test-utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Line } from '../component';
|
|
4
4
|
import { graphProps as getGraphProps } from '../../../__tests__/utils';
|
|
5
5
|
import { utils } from '@pie-lib/plot';
|
|
6
6
|
|
|
7
7
|
describe('Line', () => {
|
|
8
|
-
|
|
9
|
-
const wrapper = (extras) => {
|
|
8
|
+
const renderComponent = (extras) => {
|
|
10
9
|
const defaults = {
|
|
11
10
|
classes: {},
|
|
12
11
|
className: 'className',
|
|
@@ -15,12 +14,12 @@ describe('Line', () => {
|
|
|
15
14
|
to: utils.xy(1, 1),
|
|
16
15
|
};
|
|
17
16
|
const props = { ...defaults, ...extras };
|
|
18
|
-
return
|
|
17
|
+
return render(<Line {...props} />);
|
|
19
18
|
};
|
|
20
|
-
describe('
|
|
21
|
-
it('renders', () => {
|
|
22
|
-
const
|
|
23
|
-
expect(
|
|
19
|
+
describe('rendering', () => {
|
|
20
|
+
it('renders without crashing', () => {
|
|
21
|
+
const { container } = renderComponent();
|
|
22
|
+
expect(container.firstChild).toBeInTheDocument();
|
|
24
23
|
});
|
|
25
24
|
});
|
|
26
25
|
});
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`GraphWithControls snapshot renders 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
className=""
|
|
6
|
-
>
|
|
7
|
-
<div>
|
|
8
|
-
<ToolMenu
|
|
9
|
-
currentToolType="circle"
|
|
10
|
-
disabled={false}
|
|
11
|
-
labelModeEnabled={false}
|
|
12
|
-
onChange={[Function]}
|
|
13
|
-
toolbarTools={
|
|
14
|
-
Array [
|
|
15
|
-
"circle",
|
|
16
|
-
"line",
|
|
17
|
-
"label",
|
|
18
|
-
"parabola",
|
|
19
|
-
"point",
|
|
20
|
-
"polygon",
|
|
21
|
-
"ray",
|
|
22
|
-
"segment",
|
|
23
|
-
"sine",
|
|
24
|
-
"vector",
|
|
25
|
-
"absolute",
|
|
26
|
-
"exponential",
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
/>
|
|
30
|
-
<WithStyles(UndoRedo) />
|
|
31
|
-
</div>
|
|
32
|
-
<div />
|
|
33
|
-
<Graph
|
|
34
|
-
axesSettings={
|
|
35
|
-
Object {
|
|
36
|
-
"includeArrows": true,
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
backgroundMarks={
|
|
40
|
-
Array [
|
|
41
|
-
Object {
|
|
42
|
-
"label": "Point",
|
|
43
|
-
"showLabel": true,
|
|
44
|
-
"type": "point",
|
|
45
|
-
"x": 2,
|
|
46
|
-
"y": 2,
|
|
47
|
-
},
|
|
48
|
-
Object {
|
|
49
|
-
"building": true,
|
|
50
|
-
"from": Object {
|
|
51
|
-
"x": 0,
|
|
52
|
-
"y": 0,
|
|
53
|
-
},
|
|
54
|
-
"label": "Line",
|
|
55
|
-
"to": Object {
|
|
56
|
-
"x": 1,
|
|
57
|
-
"y": 1,
|
|
58
|
-
},
|
|
59
|
-
"type": "line",
|
|
60
|
-
},
|
|
61
|
-
Object {
|
|
62
|
-
"edge": Object {
|
|
63
|
-
"x": 0,
|
|
64
|
-
"y": 0,
|
|
65
|
-
},
|
|
66
|
-
"root": Object {
|
|
67
|
-
"x": 2,
|
|
68
|
-
"y": 2,
|
|
69
|
-
},
|
|
70
|
-
"type": "line",
|
|
71
|
-
},
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
coordinatesOnHover={false}
|
|
75
|
-
currentTool={
|
|
76
|
-
Object {
|
|
77
|
-
"Component": [Function],
|
|
78
|
-
"addPoint": [Function],
|
|
79
|
-
"hover": [Function],
|
|
80
|
-
"toolbar": true,
|
|
81
|
-
"type": "circle",
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
disabledLabels={false}
|
|
85
|
-
disabledTitle={false}
|
|
86
|
-
domain={
|
|
87
|
-
Object {
|
|
88
|
-
"max": 10,
|
|
89
|
-
"min": 0,
|
|
90
|
-
"step": 1,
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
labelModeEnabled={false}
|
|
94
|
-
labels={
|
|
95
|
-
Object {
|
|
96
|
-
"bottom": "d",
|
|
97
|
-
"left": "b",
|
|
98
|
-
"right": "c",
|
|
99
|
-
"top": "a",
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
marks={
|
|
103
|
-
Array [
|
|
104
|
-
Object {
|
|
105
|
-
"label": "Point",
|
|
106
|
-
"showLabel": true,
|
|
107
|
-
"type": "point",
|
|
108
|
-
"x": 2,
|
|
109
|
-
"y": 2,
|
|
110
|
-
},
|
|
111
|
-
Object {
|
|
112
|
-
"building": true,
|
|
113
|
-
"from": Object {
|
|
114
|
-
"x": 0,
|
|
115
|
-
"y": 0,
|
|
116
|
-
},
|
|
117
|
-
"label": "Line",
|
|
118
|
-
"to": Object {
|
|
119
|
-
"x": 1,
|
|
120
|
-
"y": 1,
|
|
121
|
-
},
|
|
122
|
-
"type": "line",
|
|
123
|
-
},
|
|
124
|
-
Object {
|
|
125
|
-
"edge": Object {
|
|
126
|
-
"x": 0,
|
|
127
|
-
"y": 0,
|
|
128
|
-
},
|
|
129
|
-
"root": Object {
|
|
130
|
-
"x": 2,
|
|
131
|
-
"y": 2,
|
|
132
|
-
},
|
|
133
|
-
"type": "line",
|
|
134
|
-
},
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
onChangeMarks={[MockFunction]}
|
|
138
|
-
range={
|
|
139
|
-
Object {
|
|
140
|
-
"max": 10,
|
|
141
|
-
"min": 0,
|
|
142
|
-
"step": 1,
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
showLabels={true}
|
|
146
|
-
showTitle={true}
|
|
147
|
-
size={
|
|
148
|
-
Object {
|
|
149
|
-
"height": 500,
|
|
150
|
-
"width": 500,
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
title="Title"
|
|
154
|
-
tools={
|
|
155
|
-
Array [
|
|
156
|
-
Object {
|
|
157
|
-
"Component": [Function],
|
|
158
|
-
"addPoint": [Function],
|
|
159
|
-
"hover": [Function],
|
|
160
|
-
"toolbar": true,
|
|
161
|
-
"type": "circle",
|
|
162
|
-
},
|
|
163
|
-
Object {
|
|
164
|
-
"Component": [Function],
|
|
165
|
-
"addPoint": [Function],
|
|
166
|
-
"toolbar": true,
|
|
167
|
-
"type": "line",
|
|
168
|
-
},
|
|
169
|
-
Object {
|
|
170
|
-
"Component": [Function],
|
|
171
|
-
"addPoint": [Function],
|
|
172
|
-
"complete": [Function],
|
|
173
|
-
"toolbar": true,
|
|
174
|
-
"type": "parabola",
|
|
175
|
-
},
|
|
176
|
-
Object {
|
|
177
|
-
"Component": [Function],
|
|
178
|
-
"addPoint": [Function],
|
|
179
|
-
"label": "Point",
|
|
180
|
-
"toolbar": true,
|
|
181
|
-
"type": "point",
|
|
182
|
-
},
|
|
183
|
-
Object {
|
|
184
|
-
"Component": [Function],
|
|
185
|
-
"addPoint": [Function],
|
|
186
|
-
"complete": [Function],
|
|
187
|
-
"toolbar": true,
|
|
188
|
-
"type": "polygon",
|
|
189
|
-
},
|
|
190
|
-
Object {
|
|
191
|
-
"Component": [Function],
|
|
192
|
-
"addPoint": [Function],
|
|
193
|
-
"toolbar": true,
|
|
194
|
-
"type": "ray",
|
|
195
|
-
},
|
|
196
|
-
Object {
|
|
197
|
-
"Component": [Function],
|
|
198
|
-
"addPoint": [Function],
|
|
199
|
-
"toolbar": true,
|
|
200
|
-
"type": "segment",
|
|
201
|
-
},
|
|
202
|
-
Object {
|
|
203
|
-
"Component": [Function],
|
|
204
|
-
"addPoint": [Function],
|
|
205
|
-
"complete": [Function],
|
|
206
|
-
"toolbar": true,
|
|
207
|
-
"type": "sine",
|
|
208
|
-
},
|
|
209
|
-
Object {
|
|
210
|
-
"Component": [Function],
|
|
211
|
-
"addPoint": [Function],
|
|
212
|
-
"toolbar": true,
|
|
213
|
-
"type": "vector",
|
|
214
|
-
},
|
|
215
|
-
Object {
|
|
216
|
-
"Component": [Function],
|
|
217
|
-
"addPoint": [Function],
|
|
218
|
-
"complete": [Function],
|
|
219
|
-
"toolbar": true,
|
|
220
|
-
"type": "absolute",
|
|
221
|
-
},
|
|
222
|
-
Object {
|
|
223
|
-
"Component": [Function],
|
|
224
|
-
"addPoint": [Function],
|
|
225
|
-
"complete": [Function],
|
|
226
|
-
"toolbar": true,
|
|
227
|
-
"type": "exponential",
|
|
228
|
-
},
|
|
229
|
-
Object {
|
|
230
|
-
"toolbar": true,
|
|
231
|
-
"type": "label",
|
|
232
|
-
},
|
|
233
|
-
]
|
|
234
|
-
}
|
|
235
|
-
/>
|
|
236
|
-
</div>
|
|
237
|
-
`;
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Graph snapshot renders 1`] = `
|
|
4
|
-
<WithStyles(Root)
|
|
5
|
-
disabledLabels={false}
|
|
6
|
-
disabledTitle={false}
|
|
7
|
-
graphProps={
|
|
8
|
-
Object {
|
|
9
|
-
"domain": Object {
|
|
10
|
-
"max": 1,
|
|
11
|
-
"min": 0,
|
|
12
|
-
"step": 1,
|
|
13
|
-
},
|
|
14
|
-
"getRootNode": [Function],
|
|
15
|
-
"range": Object {
|
|
16
|
-
"max": 1,
|
|
17
|
-
"min": 0,
|
|
18
|
-
"step": 1,
|
|
19
|
-
},
|
|
20
|
-
"scale": Object {
|
|
21
|
-
"x": [Function],
|
|
22
|
-
"y": [Function],
|
|
23
|
-
},
|
|
24
|
-
"size": Object {
|
|
25
|
-
"height": 400,
|
|
26
|
-
"width": 400,
|
|
27
|
-
},
|
|
28
|
-
"snap": Object {
|
|
29
|
-
"x": [Function],
|
|
30
|
-
"y": [Function],
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
labelsPlaceholders={Object {}}
|
|
35
|
-
mathMlOptions={Object {}}
|
|
36
|
-
rootRef={[Function]}
|
|
37
|
-
>
|
|
38
|
-
<g>
|
|
39
|
-
<WithStyles(Grid)
|
|
40
|
-
graphProps={
|
|
41
|
-
Object {
|
|
42
|
-
"domain": Object {
|
|
43
|
-
"max": 1,
|
|
44
|
-
"min": 0,
|
|
45
|
-
"step": 1,
|
|
46
|
-
},
|
|
47
|
-
"getRootNode": [Function],
|
|
48
|
-
"range": Object {
|
|
49
|
-
"max": 1,
|
|
50
|
-
"min": 0,
|
|
51
|
-
"step": 1,
|
|
52
|
-
},
|
|
53
|
-
"scale": Object {
|
|
54
|
-
"x": [Function],
|
|
55
|
-
"y": [Function],
|
|
56
|
-
},
|
|
57
|
-
"size": Object {
|
|
58
|
-
"height": 400,
|
|
59
|
-
"width": 400,
|
|
60
|
-
},
|
|
61
|
-
"snap": Object {
|
|
62
|
-
"x": [Function],
|
|
63
|
-
"y": [Function],
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/>
|
|
68
|
-
<Axes
|
|
69
|
-
graphProps={
|
|
70
|
-
Object {
|
|
71
|
-
"domain": Object {
|
|
72
|
-
"max": 1,
|
|
73
|
-
"min": 0,
|
|
74
|
-
"step": 1,
|
|
75
|
-
},
|
|
76
|
-
"getRootNode": [Function],
|
|
77
|
-
"range": Object {
|
|
78
|
-
"max": 1,
|
|
79
|
-
"min": 0,
|
|
80
|
-
"step": 1,
|
|
81
|
-
},
|
|
82
|
-
"scale": Object {
|
|
83
|
-
"x": [Function],
|
|
84
|
-
"y": [Function],
|
|
85
|
-
},
|
|
86
|
-
"size": Object {
|
|
87
|
-
"height": 400,
|
|
88
|
-
"width": 400,
|
|
89
|
-
},
|
|
90
|
-
"snap": Object {
|
|
91
|
-
"x": [Function],
|
|
92
|
-
"y": [Function],
|
|
93
|
-
},
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
includeArrows={
|
|
97
|
-
Object {
|
|
98
|
-
"down": true,
|
|
99
|
-
"left": true,
|
|
100
|
-
"right": true,
|
|
101
|
-
"up": true,
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
/>
|
|
105
|
-
<Bg
|
|
106
|
-
graphProps={
|
|
107
|
-
Object {
|
|
108
|
-
"domain": Object {
|
|
109
|
-
"max": 1,
|
|
110
|
-
"min": 0,
|
|
111
|
-
"step": 1,
|
|
112
|
-
},
|
|
113
|
-
"getRootNode": [Function],
|
|
114
|
-
"range": Object {
|
|
115
|
-
"max": 1,
|
|
116
|
-
"min": 0,
|
|
117
|
-
"step": 1,
|
|
118
|
-
},
|
|
119
|
-
"scale": Object {
|
|
120
|
-
"x": [Function],
|
|
121
|
-
"y": [Function],
|
|
122
|
-
},
|
|
123
|
-
"size": Object {
|
|
124
|
-
"height": 400,
|
|
125
|
-
"width": 400,
|
|
126
|
-
},
|
|
127
|
-
"snap": Object {
|
|
128
|
-
"x": [Function],
|
|
129
|
-
"y": [Function],
|
|
130
|
-
},
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
height={400}
|
|
134
|
-
onClick={[Function]}
|
|
135
|
-
width={400}
|
|
136
|
-
/>
|
|
137
|
-
<mask
|
|
138
|
-
id="graph-1618"
|
|
139
|
-
>
|
|
140
|
-
<rect
|
|
141
|
-
fill="white"
|
|
142
|
-
height={446}
|
|
143
|
-
width={446}
|
|
144
|
-
x={-23}
|
|
145
|
-
y={-23}
|
|
146
|
-
/>
|
|
147
|
-
|
|
148
|
-
</mask>
|
|
149
|
-
<g
|
|
150
|
-
id="marks"
|
|
151
|
-
mask="url('#graph-1618')"
|
|
152
|
-
>
|
|
153
|
-
<Point
|
|
154
|
-
graphProps={
|
|
155
|
-
Object {
|
|
156
|
-
"domain": Object {
|
|
157
|
-
"max": 1,
|
|
158
|
-
"min": 0,
|
|
159
|
-
"step": 1,
|
|
160
|
-
},
|
|
161
|
-
"getRootNode": [Function],
|
|
162
|
-
"range": Object {
|
|
163
|
-
"max": 1,
|
|
164
|
-
"min": 0,
|
|
165
|
-
"step": 1,
|
|
166
|
-
},
|
|
167
|
-
"scale": Object {
|
|
168
|
-
"x": [Function],
|
|
169
|
-
"y": [Function],
|
|
170
|
-
},
|
|
171
|
-
"size": Object {
|
|
172
|
-
"height": 400,
|
|
173
|
-
"width": 400,
|
|
174
|
-
},
|
|
175
|
-
"snap": Object {
|
|
176
|
-
"x": [Function],
|
|
177
|
-
"y": [Function],
|
|
178
|
-
},
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
isToolActive={false}
|
|
182
|
-
key="point-0"
|
|
183
|
-
mark={
|
|
184
|
-
Object {
|
|
185
|
-
"label": "Point",
|
|
186
|
-
"showLabel": true,
|
|
187
|
-
"type": "point",
|
|
188
|
-
"x": 2,
|
|
189
|
-
"y": 2,
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
onChange={[Function]}
|
|
193
|
-
onClick={[Function]}
|
|
194
|
-
onComplete={[Function]}
|
|
195
|
-
/>
|
|
196
|
-
<foreignObject
|
|
197
|
-
height={400}
|
|
198
|
-
style={
|
|
199
|
-
Object {
|
|
200
|
-
"fontSize": "14px",
|
|
201
|
-
"pointerEvents": "none",
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
width={400}
|
|
205
|
-
x="0"
|
|
206
|
-
y="0"
|
|
207
|
-
/>
|
|
208
|
-
</g>
|
|
209
|
-
</g>
|
|
210
|
-
</WithStyles(Root)>
|
|
211
|
-
`;
|