@pie-lib/graphing 2.12.17-next.2 → 2.12.17-next.8
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.
|
@@ -30,7 +30,6 @@ var _arrowHead = require("../shared/arrow-head");
|
|
|
30
30
|
var _utils = require("../../utils");
|
|
31
31
|
|
|
32
32
|
var _excluded = ["className", "classes", "correctness", "disabled", "graphProps", "from", "to"];
|
|
33
|
-
var markerId = (0, _arrowHead.genUid)();
|
|
34
33
|
|
|
35
34
|
var lineStyles = function lineStyles(theme) {
|
|
36
35
|
return {
|
|
@@ -46,6 +45,7 @@ var lineStyles = function lineStyles(theme) {
|
|
|
46
45
|
};
|
|
47
46
|
|
|
48
47
|
var ArrowedLine = function ArrowedLine(props) {
|
|
48
|
+
var markerId = (0, _arrowHead.genUid)();
|
|
49
49
|
var className = props.className,
|
|
50
50
|
classes = props.classes,
|
|
51
51
|
correctness = props.correctness,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/tools/line/component.jsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/tools/line/component.jsx"],"names":["lineStyles","theme","line","styles","enabledArrow","arrow","disabledArrow","disabled","correct","correctArrow","incorrect","incorrectArrow","ArrowedLine","props","markerId","className","classes","correctness","graphProps","from","to","rest","scale","domain","range","trig","edges","eFrom","eTo","suffix","x","y","propTypes","PropTypes","string","object","bool","types","GraphPropsType","PointType","StyledArrowedLine","Line","Component"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD;AAAA,SAAY;AAC7BC,IAAAA,IAAI,EAAEC,aAAOD,IAAP,CAAYD,KAAZ,CADuB;AAE7BG,IAAAA,YAAY,EAAED,aAAOE,KAAP,CAAaJ,KAAb,CAFe;AAG7BK,IAAAA,aAAa,EAAEH,aAAOG,aAAP,CAAq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OtBnB,EAAAA,EAAE,EAAEiB,YAAME,SAPY;AAQtBzB,EAAAA,QAAQ,EAAEmB,sBAAUC;AARE,CAAxB;AAWA,IAAMM,iBAAiB,GAAG,wBAAWxC,UAAX,EAAuBY,WAAvB,CAA1B;AAEA,IAAM6B,IAAI,GAAG,oBAASD,iBAAT,CAAb;AACA,IAAME,SAAS,GAAG,6BAAkBD,IAAlB,CAAlB;eAEeC,S","sourcesContent":["import { lineToolComponent, lineBase, styles } from '../shared/line';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { trig, types } from '@pie-lib/plot';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { ArrowMarker, genUid } from '../shared/arrow-head';\nimport { thinnerShapesNeeded, getAdjustedGraphLimits } from '../../utils';\n\nconst lineStyles = (theme) => ({\n line: styles.line(theme),\n enabledArrow: styles.arrow(theme),\n disabledArrow: styles.disabledArrow(theme),\n disabled: styles.disabled(theme),\n correct: styles.correct(theme, 'stroke'),\n correctArrow: styles.correct(theme),\n incorrect: styles.incorrect(theme, 'stroke'),\n incorrectArrow: styles.incorrect(theme),\n});\n\nexport const ArrowedLine = (props) => {\n const markerId = genUid();\n const { className, classes, correctness, disabled, graphProps, from, to, ...rest } = props;\n const { scale } = graphProps;\n const { domain, range } = getAdjustedGraphLimits(graphProps);\n const [eFrom, eTo] = trig.edges(domain, range)(from, to);\n const suffix = correctness || (disabled && 'disabled') || 'enabled';\n\n return (\n <g>\n <defs>\n <ArrowMarker\n size={thinnerShapesNeeded(graphProps) ? 4 : 5}\n id={`${props.markerId || markerId}-${suffix}`}\n className={classNames(classes[`${suffix}Arrow`])}\n />\n </defs>\n <line\n x1={scale.x(eFrom.x)}\n y1={scale.y(eFrom.y)}\n x2={scale.x(eTo.x)}\n y2={scale.y(eTo.y)}\n className={classNames(classes.line, disabled && classes.disabled, classes[correctness], className)}\n markerEnd={`url(#${props.markerId || markerId}-${suffix})`}\n markerStart={`url(#${props.markerId || markerId}-${suffix})`}\n {...rest}\n />\n </g>\n );\n};\n\nArrowedLine.propTypes = {\n className: PropTypes.string,\n classes: PropTypes.object,\n correctness: PropTypes.string,\n disabled: PropTypes.bool,\n graphProps: types.GraphPropsType,\n from: types.PointType,\n to: types.PointType,\n markerId: PropTypes.string,\n};\n\nconst StyledArrowedLine = withStyles(lineStyles)(ArrowedLine);\n\nconst Line = lineBase(StyledArrowedLine);\nconst Component = lineToolComponent(Line);\n\nexport default Component;\n"],"file":"component.js"}
|
|
@@ -30,7 +30,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
30
30
|
var _utils = require("../../utils");
|
|
31
31
|
|
|
32
32
|
var _excluded = ["graphProps", "from", "to", "classes", "disabled", "correctness", "className"];
|
|
33
|
-
var markerId = (0, _arrowHead.genUid)();
|
|
34
33
|
|
|
35
34
|
var rayStyles = function rayStyles(theme) {
|
|
36
35
|
return {
|
|
@@ -46,6 +45,7 @@ var rayStyles = function rayStyles(theme) {
|
|
|
46
45
|
};
|
|
47
46
|
|
|
48
47
|
var RayLine = function RayLine(props) {
|
|
48
|
+
var markerId = (0, _arrowHead.genUid)();
|
|
49
49
|
var graphProps = props.graphProps,
|
|
50
50
|
from = props.from,
|
|
51
51
|
to = props.to,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/tools/ray/component.jsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/tools/ray/component.jsx"],"names":["rayStyles","theme","line","styles","enabledArrow","arrow","disabledArrow","disabled","correct","correctArrow","incorrect","incorrectArrow","RayLine","props","markerId","graphProps","from","to","classes","correctness","className","rest","scale","domain","range","trig","edges","aToB","suffix","x","y","propTypes","PropTypes","object","string","bool","any","types","PointType","StyledRay","Ray","Component"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,SAAS,GAAG,SAAZA,SAAY,CAACC,KAAD;AAAA,SAAY;AAC5BC,I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AUI,GALJ;AAMlBpB,EAAAA,IAAI,EAAEqB,YAAMC,SANM;AAOlBrB,EAAAA,EAAE,EAAEoB,YAAMC,SAPQ;AAQlBxB,EAAAA,QAAQ,EAAEkB,sBAAUE;AARF,CAApB;AAWA,IAAMK,SAAS,GAAG,wBAAWvC,SAAX,EAAsBY,OAAtB,CAAlB;AAEA,IAAM4B,GAAG,GAAG,oBAASD,SAAT,CAAZ;AACA,IAAME,SAAS,GAAG,6BAAkBD,GAAlB,CAAlB;eAEeC,S","sourcesContent":["import { lineToolComponent, lineBase, styles } from '../shared/line';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { ArrowMarker, genUid } from '../shared/arrow-head';\nimport { trig, types } from '@pie-lib/plot';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { thinnerShapesNeeded, getAdjustedGraphLimits } from '../../utils';\n\nconst rayStyles = (theme) => ({\n line: styles.line(theme),\n enabledArrow: styles.arrow(theme),\n disabledArrow: styles.disabledArrow(theme),\n disabled: styles.disabled(theme),\n correct: styles.correct(theme, 'stroke'),\n correctArrow: styles.correct(theme),\n incorrect: styles.incorrect(theme, 'stroke'),\n incorrectArrow: styles.incorrect(theme),\n});\n\nexport const RayLine = (props) => {\n const markerId = genUid();\n const { graphProps, from, to, classes, disabled, correctness, className, ...rest } = props;\n const { scale } = graphProps;\n const { domain, range } = getAdjustedGraphLimits(graphProps);\n const [aToB] = trig.edges(domain, range)(from, to);\n const suffix = correctness || (disabled && 'disabled') || 'enabled';\n\n return (\n <g>\n <defs>\n <ArrowMarker\n size={thinnerShapesNeeded(graphProps) ? 4 : 5}\n id={`${props.markerId || markerId}-${suffix}`}\n className={classNames(classes[`${suffix}Arrow`])}\n />\n </defs>\n <line\n x1={scale.x(from.x)}\n y1={scale.y(from.y)}\n x2={scale.x(aToB.x)}\n y2={scale.y(aToB.y)}\n {...rest}\n className={classNames(classes.line, disabled && classes.disabled, classes[correctness], className)}\n markerEnd={`url(#${props.markerId || markerId}-${suffix})`}\n />\n </g>\n );\n};\n\nRayLine.propTypes = {\n classes: PropTypes.object,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n correctness: PropTypes.string,\n graphProps: PropTypes.any,\n from: types.PointType,\n to: types.PointType,\n markerId: PropTypes.string,\n};\n\nconst StyledRay = withStyles(rayStyles)(RayLine);\n\nconst Ray = lineBase(StyledRay);\nconst Component = lineToolComponent(Ray);\n\nexport default Component;\n"],"file":"component.js"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.12.17-next.
|
|
6
|
+
"version": "2.12.17-next.8+decf6dfe",
|
|
7
7
|
"description": "Graphing components",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@pie-lib/drag": "^2.1.15",
|
|
22
22
|
"@pie-lib/graphing-utils": "^1.1.32",
|
|
23
23
|
"@pie-lib/plot": "^2.6.12",
|
|
24
|
-
"@pie-lib/render-ui": "^4.14.
|
|
24
|
+
"@pie-lib/render-ui": "^4.14.16-next.25+decf6dfe",
|
|
25
25
|
"@vx/axis": "^0.0.189",
|
|
26
26
|
"@vx/clip-path": "^0.0.189",
|
|
27
27
|
"@vx/event": "^0.0.189",
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": "^16.8.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "decf6dfe78c166e9b6000ee9fc62cc274c33646a",
|
|
48
48
|
"scripts": {}
|
|
49
49
|
}
|
|
@@ -7,8 +7,6 @@ import { withStyles } from '@material-ui/core/styles';
|
|
|
7
7
|
import { ArrowMarker, genUid } from '../shared/arrow-head';
|
|
8
8
|
import { thinnerShapesNeeded, getAdjustedGraphLimits } from '../../utils';
|
|
9
9
|
|
|
10
|
-
const markerId = genUid();
|
|
11
|
-
|
|
12
10
|
const lineStyles = (theme) => ({
|
|
13
11
|
line: styles.line(theme),
|
|
14
12
|
enabledArrow: styles.arrow(theme),
|
|
@@ -21,6 +19,7 @@ const lineStyles = (theme) => ({
|
|
|
21
19
|
});
|
|
22
20
|
|
|
23
21
|
export const ArrowedLine = (props) => {
|
|
22
|
+
const markerId = genUid();
|
|
24
23
|
const { className, classes, correctness, disabled, graphProps, from, to, ...rest } = props;
|
|
25
24
|
const { scale } = graphProps;
|
|
26
25
|
const { domain, range } = getAdjustedGraphLimits(graphProps);
|
|
@@ -7,8 +7,6 @@ import { withStyles } from '@material-ui/core/styles';
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { thinnerShapesNeeded, getAdjustedGraphLimits } from '../../utils';
|
|
9
9
|
|
|
10
|
-
const markerId = genUid();
|
|
11
|
-
|
|
12
10
|
const rayStyles = (theme) => ({
|
|
13
11
|
line: styles.line(theme),
|
|
14
12
|
enabledArrow: styles.arrow(theme),
|
|
@@ -21,6 +19,7 @@ const rayStyles = (theme) => ({
|
|
|
21
19
|
});
|
|
22
20
|
|
|
23
21
|
export const RayLine = (props) => {
|
|
22
|
+
const markerId = genUid();
|
|
24
23
|
const { graphProps, from, to, classes, disabled, correctness, className, ...rest } = props;
|
|
25
24
|
const { scale } = graphProps;
|
|
26
25
|
const { domain, range } = getAdjustedGraphLimits(graphProps);
|