@pie-lib/graphing 2.34.3-next.0 → 2.34.3-next.162

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 (215) hide show
  1. package/CHANGELOG.md +13 -67
  2. package/esm/package.json +3 -0
  3. package/lib/axis/arrow.js +19 -55
  4. package/lib/axis/arrow.js.map +1 -1
  5. package/lib/axis/axes.js +106 -194
  6. package/lib/axis/axes.js.map +1 -1
  7. package/lib/axis/index.js +1 -6
  8. package/lib/axis/index.js.map +1 -1
  9. package/lib/bg.js +21 -49
  10. package/lib/bg.js.map +1 -1
  11. package/lib/container/actions.js +2 -8
  12. package/lib/container/actions.js.map +1 -1
  13. package/lib/container/index.js +14 -59
  14. package/lib/container/index.js.map +1 -1
  15. package/lib/container/marks.js +1 -6
  16. package/lib/container/marks.js.map +1 -1
  17. package/lib/container/middleware.js +2 -8
  18. package/lib/container/middleware.js.map +1 -1
  19. package/lib/container/reducer.js +1 -8
  20. package/lib/container/reducer.js.map +1 -1
  21. package/lib/coordinates-label.js +24 -54
  22. package/lib/coordinates-label.js.map +1 -1
  23. package/lib/graph-with-controls.js +120 -184
  24. package/lib/graph-with-controls.js.map +1 -1
  25. package/lib/graph.js +59 -116
  26. package/lib/graph.js.map +1 -1
  27. package/lib/grid-setup.js +168 -224
  28. package/lib/grid-setup.js.map +1 -1
  29. package/lib/grid.js +29 -74
  30. package/lib/grid.js.map +1 -1
  31. package/lib/index.js +1 -13
  32. package/lib/index.js.map +1 -1
  33. package/lib/key-legend.js +40 -85
  34. package/lib/key-legend.js.map +1 -1
  35. package/lib/label-svg-icon.js +1 -7
  36. package/lib/label-svg-icon.js.map +1 -1
  37. package/lib/labels.js +65 -121
  38. package/lib/labels.js.map +1 -1
  39. package/lib/mark-label.js +120 -163
  40. package/lib/mark-label.js.map +1 -1
  41. package/lib/toggle-bar.js +155 -243
  42. package/lib/toggle-bar.js.map +1 -1
  43. package/lib/tool-menu.js +16 -50
  44. package/lib/tool-menu.js.map +1 -1
  45. package/lib/tools/absolute/component.js +4 -10
  46. package/lib/tools/absolute/component.js.map +1 -1
  47. package/lib/tools/absolute/index.js +3 -16
  48. package/lib/tools/absolute/index.js.map +1 -1
  49. package/lib/tools/circle/bg-circle.js +42 -92
  50. package/lib/tools/circle/bg-circle.js.map +1 -1
  51. package/lib/tools/circle/component.js +78 -165
  52. package/lib/tools/circle/component.js.map +1 -1
  53. package/lib/tools/circle/index.js +3 -13
  54. package/lib/tools/circle/index.js.map +1 -1
  55. package/lib/tools/exponential/component.js +4 -10
  56. package/lib/tools/exponential/component.js.map +1 -1
  57. package/lib/tools/exponential/index.js +3 -18
  58. package/lib/tools/exponential/index.js.map +1 -1
  59. package/lib/tools/index.js +3 -16
  60. package/lib/tools/index.js.map +1 -1
  61. package/lib/tools/line/component.js +27 -48
  62. package/lib/tools/line/component.js.map +1 -1
  63. package/lib/tools/line/index.js +1 -6
  64. package/lib/tools/line/index.js.map +1 -1
  65. package/lib/tools/parabola/component.js +4 -10
  66. package/lib/tools/parabola/component.js.map +1 -1
  67. package/lib/tools/parabola/index.js +3 -16
  68. package/lib/tools/parabola/index.js.map +1 -1
  69. package/lib/tools/point/component.js +24 -71
  70. package/lib/tools/point/component.js.map +1 -1
  71. package/lib/tools/point/index.js +3 -11
  72. package/lib/tools/point/index.js.map +1 -1
  73. package/lib/tools/polygon/component.js +83 -184
  74. package/lib/tools/polygon/component.js.map +1 -1
  75. package/lib/tools/polygon/index.js +6 -23
  76. package/lib/tools/polygon/index.js.map +1 -1
  77. package/lib/tools/polygon/line.js +48 -91
  78. package/lib/tools/polygon/line.js.map +1 -1
  79. package/lib/tools/polygon/polygon.js +65 -98
  80. package/lib/tools/polygon/polygon.js.map +1 -1
  81. package/lib/tools/ray/component.js +41 -60
  82. package/lib/tools/ray/component.js.map +1 -1
  83. package/lib/tools/ray/index.js +1 -6
  84. package/lib/tools/ray/index.js.map +1 -1
  85. package/lib/tools/segment/component.js +25 -43
  86. package/lib/tools/segment/component.js.map +1 -1
  87. package/lib/tools/segment/index.js +1 -6
  88. package/lib/tools/segment/index.js.map +1 -1
  89. package/lib/tools/shared/arrow-head.js +69 -28
  90. package/lib/tools/shared/arrow-head.js.map +1 -1
  91. package/lib/tools/shared/icons/CorrectSVG.js +12 -8
  92. package/lib/tools/shared/icons/CorrectSVG.js.map +1 -1
  93. package/lib/tools/shared/icons/IncorrectSVG.js +12 -8
  94. package/lib/tools/shared/icons/IncorrectSVG.js.map +1 -1
  95. package/lib/tools/shared/icons/MissingSVG.js +12 -8
  96. package/lib/tools/shared/icons/MissingSVG.js.map +1 -1
  97. package/lib/tools/shared/line/index.js +140 -193
  98. package/lib/tools/shared/line/index.js.map +1 -1
  99. package/lib/tools/shared/line/line-path.js +70 -101
  100. package/lib/tools/shared/line/line-path.js.map +1 -1
  101. package/lib/tools/shared/line/with-root-edge.js +22 -56
  102. package/lib/tools/shared/line/with-root-edge.js.map +1 -1
  103. package/lib/tools/shared/point/arrow-point.js +21 -62
  104. package/lib/tools/shared/point/arrow-point.js.map +1 -1
  105. package/lib/tools/shared/point/arrow.js +23 -52
  106. package/lib/tools/shared/point/arrow.js.map +1 -1
  107. package/lib/tools/shared/point/base-point.js +54 -72
  108. package/lib/tools/shared/point/base-point.js.map +1 -1
  109. package/lib/tools/shared/point/index.js +22 -57
  110. package/lib/tools/shared/point/index.js.map +1 -1
  111. package/lib/tools/shared/styles.js +10 -38
  112. package/lib/tools/shared/styles.js.map +1 -1
  113. package/lib/tools/shared/types.js +2 -9
  114. package/lib/tools/shared/types.js.map +1 -1
  115. package/lib/tools/sine/component.js +8 -19
  116. package/lib/tools/sine/component.js.map +1 -1
  117. package/lib/tools/sine/index.js +3 -16
  118. package/lib/tools/sine/index.js.map +1 -1
  119. package/lib/tools/vector/component.js +24 -44
  120. package/lib/tools/vector/component.js.map +1 -1
  121. package/lib/tools/vector/index.js +1 -6
  122. package/lib/tools/vector/index.js.map +1 -1
  123. package/lib/undo-redo.js +29 -69
  124. package/lib/undo-redo.js.map +1 -1
  125. package/lib/use-debounce.js +4 -11
  126. package/lib/use-debounce.js.map +1 -1
  127. package/lib/utils.js +51 -128
  128. package/lib/utils.js.map +1 -1
  129. package/package.json +33 -21
  130. package/src/__tests__/graph-with-controls.test.jsx +28 -11
  131. package/src/__tests__/graph.test.jsx +104 -168
  132. package/src/__tests__/grid.test.jsx +8 -6
  133. package/src/__tests__/labels.test.jsx +25 -8
  134. package/src/__tests__/mark-label.test.jsx +12 -17
  135. package/src/__tests__/toggle-bar.test.jsx +92 -17
  136. package/src/__tests__/tool-menu.test.jsx +61 -12
  137. package/src/__tests__/undo-redo.test.jsx +7 -8
  138. package/src/__tests__/utils.js +3 -0
  139. package/src/axis/__tests__/arrow.test.jsx +16 -17
  140. package/src/axis/__tests__/axes.test.jsx +118 -122
  141. package/src/axis/arrow.jsx +7 -12
  142. package/src/axis/axes.jsx +45 -55
  143. package/src/coordinates-label.jsx +14 -18
  144. package/src/graph-with-controls.jsx +52 -59
  145. package/src/grid-setup.jsx +210 -206
  146. package/src/grid.jsx +2 -4
  147. package/src/key-legend.jsx +52 -56
  148. package/src/labels.jsx +23 -30
  149. package/src/mark-label.jsx +92 -81
  150. package/src/toggle-bar.jsx +135 -164
  151. package/src/tool-menu.jsx +1 -1
  152. package/src/tools/circle/__tests__/bg-circle.test.jsx +7 -9
  153. package/src/tools/circle/__tests__/component.test.jsx +17 -189
  154. package/src/tools/circle/bg-circle.jsx +20 -28
  155. package/src/tools/circle/component.jsx +28 -63
  156. package/src/tools/line/__tests__/component.test.jsx +7 -7
  157. package/src/tools/line/component.jsx +22 -15
  158. package/src/tools/point/__tests__/component.test.jsx +18 -43
  159. package/src/tools/point/component.jsx +1 -1
  160. package/src/tools/polygon/__tests__/component.test.jsx +18 -162
  161. package/src/tools/polygon/__tests__/line.test.jsx +7 -10
  162. package/src/tools/polygon/__tests__/polygon.test.jsx +7 -8
  163. package/src/tools/polygon/component.jsx +3 -4
  164. package/src/tools/polygon/line.jsx +30 -33
  165. package/src/tools/polygon/polygon.jsx +52 -45
  166. package/src/tools/ray/__tests__/component.test.jsx +7 -8
  167. package/src/tools/ray/component.jsx +38 -25
  168. package/src/tools/segment/__tests__/component.test.jsx +7 -8
  169. package/src/tools/segment/component.jsx +19 -18
  170. package/src/tools/shared/__tests__/arrow-head.test.jsx +14 -17
  171. package/src/tools/shared/arrow-head.jsx +60 -7
  172. package/src/tools/shared/icons/CorrectSVG.jsx +10 -0
  173. package/src/tools/shared/icons/IncorrectSVG.jsx +10 -0
  174. package/src/tools/shared/icons/MissingSVG.jsx +10 -0
  175. package/src/tools/shared/line/__tests__/index.test.jsx +19 -165
  176. package/src/tools/shared/line/__tests__/line-path.test.jsx +8 -8
  177. package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +22 -22
  178. package/src/tools/shared/line/index.jsx +52 -7
  179. package/src/tools/shared/line/line-path.jsx +55 -59
  180. package/src/tools/shared/line/with-root-edge.jsx +1 -1
  181. package/src/tools/shared/point/__tests__/arrow-point.test.jsx +15 -11
  182. package/src/tools/shared/point/__tests__/base-point.test.jsx +14 -11
  183. package/src/tools/shared/point/arrow-point.jsx +10 -24
  184. package/src/tools/shared/point/arrow.jsx +5 -11
  185. package/src/tools/shared/point/base-point.jsx +42 -19
  186. package/src/tools/shared/point/index.jsx +27 -44
  187. package/src/tools/vector/__tests__/component.test.jsx +7 -8
  188. package/src/tools/vector/component.jsx +11 -16
  189. package/src/undo-redo.jsx +19 -21
  190. package/src/__tests__/__snapshots__/graph-with-controls.test.jsx.snap +0 -237
  191. package/src/__tests__/__snapshots__/graph.test.jsx.snap +0 -211
  192. package/src/__tests__/__snapshots__/grid.test.jsx.snap +0 -54
  193. package/src/__tests__/__snapshots__/labels.test.jsx.snap +0 -30
  194. package/src/__tests__/__snapshots__/mark-label.test.jsx.snap +0 -45
  195. package/src/__tests__/__snapshots__/toggle-bar.test.jsx.snap +0 -7
  196. package/src/__tests__/__snapshots__/tool-menu.test.jsx.snap +0 -13
  197. package/src/__tests__/__snapshots__/undo-redo.test.jsx.snap +0 -14
  198. package/src/axis/__tests__/__snapshots__/arrow.test.jsx.snap +0 -33
  199. package/src/axis/__tests__/__snapshots__/axes.test.jsx.snap +0 -122
  200. package/src/tools/circle/__tests__/__snapshots__/bg-circle.test.jsx.snap +0 -46
  201. package/src/tools/circle/__tests__/__snapshots__/component.test.jsx.snap +0 -293
  202. package/src/tools/line/__tests__/__snapshots__/component.test.jsx.snap +0 -20
  203. package/src/tools/point/__tests__/__snapshots__/component.test.jsx.snap +0 -40
  204. package/src/tools/polygon/__tests__/__snapshots__/component.test.jsx.snap +0 -415
  205. package/src/tools/polygon/__tests__/__snapshots__/line.test.jsx.snap +0 -45
  206. package/src/tools/polygon/__tests__/__snapshots__/polygon.test.jsx.snap +0 -52
  207. package/src/tools/ray/__tests__/__snapshots__/component.test.jsx.snap +0 -23
  208. package/src/tools/segment/__tests__/__snapshots__/component.test.jsx.snap +0 -14
  209. package/src/tools/shared/__tests__/__snapshots__/arrow-head.test.jsx.snap +0 -27
  210. package/src/tools/shared/line/__tests__/__snapshots__/index.test.jsx.snap +0 -360
  211. package/src/tools/shared/line/__tests__/__snapshots__/line-path.test.jsx.snap +0 -58
  212. package/src/tools/shared/line/__tests__/__snapshots__/with-root-edge.test.jsx.snap +0 -63
  213. package/src/tools/shared/point/__tests__/__snapshots__/arrow-point.test.jsx.snap +0 -56
  214. package/src/tools/shared/point/__tests__/__snapshots__/base-point.test.jsx.snap +0 -44
  215. package/src/tools/vector/__tests__/__snapshots__/component.test.jsx.snap +0 -12
@@ -1,22 +1,20 @@
1
- import { withStyles } from '@material-ui/core/styles/index';
1
+ import React from 'react';
2
+ import { styled } from '@mui/material/styles';
2
3
  import { gridDraggable } from '@pie-lib/plot';
3
4
  import * as utils from '../../../utils';
4
- import { disabled, correct, incorrect, missing, disabledSecondary } from '../styles';
5
5
  import { RawBp } from './base-point';
6
6
  import { RawArrow } from './arrow-point';
7
- import { color } from '@pie-lib/render-ui';
8
- import BaseArrow from './arrow';
7
+ import { BaseArrow } from './arrow';
9
8
 
9
+ // Drag & bounds options
10
10
  const opts = {
11
11
  bounds: (props, { domain, range }) => {
12
12
  const { x, y } = props;
13
13
  const area = { left: x, top: y, bottom: y, right: x };
14
-
15
14
  return utils.bounds(area, domain, range);
16
15
  },
17
16
  anchorPoint: (props) => {
18
17
  const { x, y } = props;
19
-
20
18
  return { x, y };
21
19
  },
22
20
  fromDelta: (props, delta) => {
@@ -24,42 +22,27 @@ const opts = {
24
22
  },
25
23
  };
26
24
 
27
- const styles = () => {
28
- return {
29
- point: {
30
- '& circle, & polygon': {
31
- cursor: 'pointer',
32
- fill: color.defaults.BLACK,
33
- },
34
- },
35
- disabled: {
36
- '& circle, & polygon': {
37
- ...disabled(),
38
- },
39
- },
40
- disabledSecondary: {
41
- '& circle, & polygon': {
42
- ...disabledSecondary(),
43
- },
44
- },
45
- correct: {
46
- '& circle, & polygon': {
47
- ...correct(),
48
- },
49
- },
50
- incorrect: {
51
- '& circle, & polygon': {
52
- ...incorrect(),
53
- },
54
- },
55
- missing: {
56
- '& circle, & polygon': {
57
- ...missing(),
58
- },
59
- },
60
- };
61
- };
25
+ // Common styled point
26
+ const PointStyle = styled('g')(() => ({
27
+ '& circle, & polygon': {
28
+ cursor: 'pointer',
29
+ },
30
+ }));
31
+
32
+ export const BasePoint = gridDraggable(opts)((props) => (
33
+ <PointStyle {...props}>
34
+ <RawBp {...props} />
35
+ </PointStyle>
36
+ ));
37
+
38
+ export const ArrowPoint = gridDraggable(opts)((props) => (
39
+ <PointStyle {...props}>
40
+ <RawArrow {...props} />
41
+ </PointStyle>
42
+ ));
62
43
 
63
- export const BasePoint = withStyles(styles)(gridDraggable(opts)(RawBp));
64
- export const ArrowPoint = withStyles(styles)(gridDraggable(opts)(RawArrow));
65
- export const Arrow = withStyles(styles)(gridDraggable(opts)(BaseArrow));
44
+ export const Arrow = gridDraggable(opts)((props) => (
45
+ <PointStyle {...props}>
46
+ <BaseArrow {...props} />
47
+ </PointStyle>
48
+ ));
@@ -1,12 +1,11 @@
1
- import { shallow } from 'enzyme';
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
- let w;
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 shallow(<Line {...props} />);
17
+ return render(<Line {...props} />);
19
18
  };
20
- describe('snapshot', () => {
21
- it('renders', () => {
22
- const w = wrapper();
23
- expect(w).toMatchSnapshot();
19
+ describe('rendering', () => {
20
+ it('renders without crashing', () => {
21
+ const { container } = renderComponent();
22
+ expect(container.firstChild).toBeInTheDocument();
24
23
  });
25
24
  });
26
25
  });
@@ -3,23 +3,18 @@ import { Arrow } from '../shared/point';
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { types } from '@pie-lib/plot';
6
- import classNames from 'classnames';
7
- import { withStyles } from '@material-ui/core/styles';
6
+ import { styled } from '@mui/material/styles';
8
7
  import { getDistanceBetweenTwoPoints } from '../../utils';
9
8
 
10
- const lineStyles = (theme) => ({
11
- line: styles.line(theme),
12
- disabled: styles.disabled(theme),
13
- disabledSecondary: styles.disabledSecondary(theme),
14
- correct: styles.correct(theme, 'stroke'),
15
- incorrect: styles.incorrect(theme, 'stroke'),
16
- missing: styles.missing(theme, 'stroke'),
17
- });
9
+ const StyledLine = styled('line')(({ theme, disabled, correctness }) => ({
10
+ ...styles.line(theme),
11
+ ...(disabled && styles.disabledSecondary(theme)),
12
+ ...(correctness && styles[correctness] && styles[correctness](theme, 'stroke')),
13
+ }));
18
14
 
19
15
  export const Line = (props) => {
20
16
  const {
21
17
  className,
22
- classes,
23
18
  disabled,
24
19
  correctness,
25
20
  graphProps: { scale },
@@ -32,8 +27,10 @@ export const Line = (props) => {
32
27
  const length = getDistanceBetweenTwoPoints(startPoint, endPoint);
33
28
 
34
29
  return (
35
- <line
36
- className={classNames(classes.line, disabled && classes.disabledSecondary, classes[correctness], className)}
30
+ <StyledLine
31
+ className={className}
32
+ disabled={disabled}
33
+ correctness={correctness}
37
34
  x1={startPoint.x}
38
35
  y1={startPoint.y}
39
36
  x2={endPoint.x}
@@ -46,7 +43,6 @@ export const Line = (props) => {
46
43
 
47
44
  Line.propTypes = {
48
45
  className: PropTypes.string,
49
- classes: PropTypes.object,
50
46
  disabled: PropTypes.bool,
51
47
  correctness: PropTypes.string,
52
48
  graphProps: PropTypes.any,
@@ -54,8 +50,7 @@ Line.propTypes = {
54
50
  to: types.PointType,
55
51
  };
56
52
 
57
- const StyledLine = withStyles(lineStyles)(Line);
58
- const Vector = lineBase(StyledLine, { to: Arrow });
53
+ const Vector = lineBase(Line, { to: Arrow });
59
54
  const Component = lineToolComponent(Vector);
60
55
 
61
56
  export default Component;
package/src/undo-redo.jsx CHANGED
@@ -1,16 +1,24 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classNames from 'classnames';
4
- import Button from '@material-ui/core/Button';
5
- import { withStyles } from '@material-ui/core';
4
+ import Button from '@mui/material/Button';
5
+ import { styled } from '@mui/material/styles';
6
6
  import { color } from '@pie-lib/render-ui';
7
7
  import Translator from '@pie-lib/translator';
8
8
 
9
9
  const { translator } = Translator;
10
10
 
11
+ const StyledButton = styled(Button)(({ theme }) => ({
12
+ color: color.text(),
13
+ fontWeight: 'bold',
14
+ marginBottom: theme.spacing(0.5),
15
+ '&:not(:last-of-type)': {
16
+ marginRight: theme.spacing(0.5),
17
+ },
18
+ }));
19
+
11
20
  export class UndoRedo extends React.Component {
12
21
  static propTypes = {
13
- classes: PropTypes.object,
14
22
  className: PropTypes.string,
15
23
  onUndo: PropTypes.func.isRequired,
16
24
  onRedo: PropTypes.func.isRequired,
@@ -20,31 +28,21 @@ export class UndoRedo extends React.Component {
20
28
  static defaultProps = {};
21
29
 
22
30
  render() {
23
- const { classes, className, onUndo, onRedo, onReset, language } = this.props;
31
+ const { className, onUndo, onRedo, onReset, language } = this.props;
24
32
  return (
25
33
  <div className={classNames(className)}>
26
- <Button classes={{ root: classes.button }} onClick={() => onUndo(true)}>
34
+ <StyledButton onClick={() => onUndo(true)}>
27
35
  {translator.t('common:undo', { lng: language })}
28
- </Button>
29
- <Button classes={{ root: classes.button }} onClick={() => onRedo(true)}>
36
+ </StyledButton>
37
+ <StyledButton onClick={() => onRedo(true)}>
30
38
  {translator.t('graphing.redo', { lng: language })}
31
- </Button>
32
- <Button classes={{ root: classes.button }} onClick={() => onReset()}>
39
+ </StyledButton>
40
+ <StyledButton onClick={() => onReset()}>
33
41
  {translator.t('graphing.reset', { lng: language })}
34
- </Button>
42
+ </StyledButton>
35
43
  </div>
36
44
  );
37
45
  }
38
46
  }
39
47
 
40
- const styles = (theme) => ({
41
- button: {
42
- color: color.text(),
43
- marginBottom: theme.spacing.unit / 2,
44
- '&:not(:last-of-type)': {
45
- marginRight: theme.spacing.unit / 2,
46
- },
47
- },
48
- });
49
-
50
- export default withStyles(styles)(UndoRedo);
48
+ export default UndoRedo;
@@ -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
- `;