@pie-lib/charting 5.24.1 → 5.25.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 +17 -0
- package/lib/actions-button.js +4 -3
- package/lib/actions-button.js.map +1 -1
- package/lib/axes.js +44 -10
- package/lib/axes.js.map +1 -1
- package/lib/bars/common/bars.js +63 -9
- package/lib/bars/common/bars.js.map +1 -1
- package/lib/bars/common/correct-check-icon.js +55 -0
- package/lib/bars/common/correct-check-icon.js.map +1 -0
- package/lib/chart.js +17 -10
- package/lib/chart.js.map +1 -1
- package/lib/common/correctness-indicators.js +99 -0
- package/lib/common/correctness-indicators.js.map +1 -0
- package/lib/common/drag-handle.js +36 -8
- package/lib/common/drag-handle.js.map +1 -1
- package/lib/line/common/drag-handle.js +32 -9
- package/lib/line/common/drag-handle.js.map +1 -1
- package/lib/line/common/line.js +5 -2
- package/lib/line/common/line.js.map +1 -1
- package/lib/line/line-cross.js +26 -5
- package/lib/line/line-cross.js.map +1 -1
- package/lib/line/line-dot.js +24 -4
- package/lib/line/line-dot.js.map +1 -1
- package/lib/mark-label.js +18 -7
- package/lib/mark-label.js.map +1 -1
- package/lib/plot/common/plot.js +119 -9
- package/lib/plot/common/plot.js.map +1 -1
- package/lib/plot/dot.js +17 -4
- package/lib/plot/dot.js.map +1 -1
- package/lib/plot/line.js +19 -6
- package/lib/plot/line.js.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/__snapshots__/axes.test.jsx.snap +5 -1
- package/src/__tests__/__snapshots__/chart.test.jsx.snap +6 -3
- package/src/__tests__/__snapshots__/mark-label.test.jsx.snap +62 -56
- package/src/actions-button.jsx +3 -2
- package/src/axes.jsx +37 -3
- package/src/bars/common/bars.jsx +57 -4
- package/src/bars/common/correct-check-icon.jsx +20 -0
- package/src/chart.jsx +12 -3
- package/src/common/__tests__/__snapshots__/drag-handle.test.jsx.snap +3 -0
- package/src/common/correctness-indicators.jsx +55 -0
- package/src/common/drag-handle.jsx +28 -14
- package/src/line/common/__tests__/__snapshots__/drag-handle.test.jsx.snap +5 -0
- package/src/line/common/__tests__/__snapshots__/line.test.jsx.snap +2 -0
- package/src/line/common/drag-handle.jsx +31 -8
- package/src/line/common/line.jsx +3 -1
- package/src/line/line-cross.js +25 -3
- package/src/line/line-dot.js +40 -3
- package/src/mark-label.jsx +73 -58
- package/src/plot/common/__tests__/__snapshots__/plot.test.jsx.snap +1 -0
- package/src/plot/common/plot.jsx +114 -5
- package/src/plot/dot.js +19 -3
- package/src/plot/line.js +18 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/plot/common/plot.jsx"],"names":["log","RawPlot","props","setState","isHovered","dragValue","label","onChangeCategory","state","undefined","value","setDragValue","existing","next","graphProps","classes","xBand","index","CustomBarElement","interactive","correctness","defineChart","scale","range","size","max","v","Number","isFinite","barWidth","bandwidth","barHeight","y","barX","values","i","push","pointHeight","height","pointDiameter","Component","DraggableHandle","DragHandle","allowRolloverEvent","handleMouseEnter","handleMouseLeave","length","color","defaults","BORDER_GRAY","map","dragStop","primaryDark","React","PropTypes","func","number","object","string","isRequired","types","GraphPropsType","bool","shape","Bar","dot","fill","visualElementsColors","PLOT_FILL_COLOR","line","stroke","Plot","data","d","category","array"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,oBAAN,CAAZ;;IAEaC,O;;;;;AAiBX,mBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,yGAQA,YAAM;AACvB,YAAKC,QAAL,CAAc;AAAEC,QAAAA,SAAS,EAAE;AAAb,OAAd;AACD,KAVkB;AAAA,yGAYA,YAAM;AACvB,YAAKD,QAAL,CAAc;AAAEC,QAAAA,SAAS,EAAE;AAAb,OAAd;AACD,KAdkB;AAAA,qGA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C,sBAAUC,IAFX;AAGjBvC,EAAAA,KAAK,EAAEsC,sBAAUC,IAHA;AAIjBzC,EAAAA,UAAU,EAAE8C,YAAMC,cAAN,CAAqBF,UAJhB;AAKjBtC,EAAAA,WAAW,EAAEiC,sBAAUQ,IALN;AAMjB5C,EAAAA,gBAAgB,EAAEoC,sBAAUC;AANX,C;eAkCNgB,I","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { types } from '@pie-lib/plot';\nimport { Group } from '@vx/group';\nimport { withStyles } from '@material-ui/core/styles/index';\nimport DraggableHandle, { DragHandle } from '../../common/drag-handle';\nimport debug from 'debug';\nimport { color } from '@pie-lib/render-ui';\nimport { bandKey } from '../../utils';\nimport { correct, incorrect } from '../../common/styles';\n\nconst log = debug('pie-lib:chart:bars');\n\nexport class RawPlot extends React.Component {\n static propTypes = {\n onChangeCategory: PropTypes.func,\n value: PropTypes.number,\n classes: PropTypes.object,\n label: PropTypes.string,\n xBand: PropTypes.func,\n index: PropTypes.number.isRequired,\n graphProps: types.GraphPropsType.isRequired,\n CustomBarElement: PropTypes.func,\n interactive: PropTypes.bool,\n correctness: PropTypes.shape({\n value: PropTypes.string,\n label: PropTypes.string,\n }),\n };\n\n constructor(props) {\n super(props);\n this.state = {\n dragValue: undefined,\n isHovered: false,\n };\n }\n\n handleMouseEnter = () => {\n this.setState({ isHovered: true });\n };\n\n handleMouseLeave = () => {\n this.setState({ isHovered: false });\n };\n\n setDragValue = (dragValue) => this.setState({ dragValue });\n\n dragStop = () => {\n const { label, onChangeCategory } = this.props;\n const { dragValue } = this.state;\n log('[dragStop]', dragValue);\n\n if (dragValue !== undefined) {\n onChangeCategory({ label, value: dragValue });\n }\n\n this.setDragValue(undefined);\n };\n\n dragValue = (existing, next) => {\n log('[dragValue] next:', next);\n\n this.setDragValue(next);\n };\n\n render() {\n const {\n graphProps,\n value,\n label,\n classes,\n xBand,\n index,\n CustomBarElement,\n interactive,\n correctness,\n defineChart,\n } = this.props;\n\n const { scale, range, size } = graphProps;\n const { max } = range || {};\n const { dragValue, isHovered } = this.state;\n\n const v = Number.isFinite(dragValue) ? dragValue : value;\n const barWidth = xBand.bandwidth();\n const barHeight = scale.y(range.max - v);\n const barX = xBand(bandKey({ label }, index));\n\n log('label:', label, 'barX:', barX, 'v: ', v, 'barHeight:', barHeight, 'barWidth: ', barWidth);\n\n const values = [];\n\n for (let i = 0; i < v; i++) {\n values.push(i);\n }\n\n const pointHeight = size.height / max;\n const pointDiameter = (pointHeight > barWidth ? barWidth : pointHeight) * 0.8;\n const Component = interactive ? DraggableHandle : DragHandle;\n const allowRolloverEvent = interactive && !correctness;\n\n return (\n <React.Fragment>\n <g\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onTouchStart={this.handleMouseEnter}\n onTouchEnd={this.handleMouseLeave}\n >\n {isHovered && allowRolloverEvent && (\n <rect\n x={barX}\n y={scale.y(v)}\n width={barWidth}\n height={values?.length ? pointHeight * values.length : 0}\n stroke={color.defaults.BORDER_GRAY}\n strokeWidth={'4px'}\n fill={'transparent'}\n />\n )}\n {values.map((index) =>\n CustomBarElement({\n index,\n pointDiameter,\n barX,\n barWidth,\n pointHeight,\n label,\n value,\n classes,\n scale,\n }),\n )}\n <Component\n x={barX}\n y={v}\n interactive={interactive}\n width={barWidth}\n onDrag={(v) => this.dragValue(value, v)}\n onDragStop={this.dragStop}\n graphProps={graphProps}\n correctness={correctness}\n isHovered={isHovered}\n defineChart={defineChart}\n color={color.primaryDark()}\n />\n </g>\n </React.Fragment>\n );\n }\n}\n\nconst Bar = withStyles(() => ({\n dot: {\n fill: color.visualElementsColors.PLOT_FILL_COLOR,\n '&.correct': correct('stroke'),\n '&.incorrect': incorrect('stroke'),\n },\n line: {\n stroke: color.visualElementsColors.PLOT_FILL_COLOR,\n '&.correct': correct('stroke'),\n '&.incorrect': incorrect('stroke'),\n },\n}))(RawPlot);\n\nexport class Plot extends React.Component {\n static propTypes = {\n data: PropTypes.array,\n onChangeCategory: PropTypes.func,\n xBand: PropTypes.func,\n graphProps: types.GraphPropsType.isRequired,\n defineChart: PropTypes.bool,\n CustomBarElement: PropTypes.func,\n };\n\n render() {\n const { data, graphProps, xBand, CustomBarElement, onChangeCategory, defineChart } = this.props;\n\n return (\n <Group>\n {(data || []).map((d, index) => (\n <Bar\n value={d.value}\n label={d.label}\n interactive={defineChart || d.interactive}\n defineChart={defineChart}\n xBand={xBand}\n index={index}\n key={`bar-${d.label}-${d.value}-${index}`}\n onChangeCategory={(category) => onChangeCategory(index, category)}\n graphProps={graphProps}\n CustomBarElement={CustomBarElement}\n correctness={d.correctness}\n />\n ))}\n </Group>\n );\n }\n}\n\nexport default Plot;\n"],"file":"plot.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/plot/common/plot.jsx"],"names":["log","ICON_SIZE","RawPlot","props","setState","isHovered","dragValue","label","onChangeCategory","state","undefined","value","setDragValue","existing","next","barX","barWidth","correctVal","correctness","classes","scale","y","correctnessIcon","correctIcon","smallIcon","graphProps","xBand","index","CustomBarElement","interactive","defineChart","correctData","range","size","max","v","Number","isFinite","bandwidth","barHeight","values","i","push","pointHeight","height","pointDiameter","Component","DraggableHandle","DragHandle","allowRolloverEvent","handleMouseEnter","handleMouseLeave","length","color","defaults","BORDER_GRAY","map","parseFloat","isNaN","selectedVal","overlayValues","lastIndexOfOverlay","lastOverlayValue","renderCorrectnessIcon","valuesToRender","idx","dottedOverline","dragStop","primaryDark","React","PropTypes","func","number","object","string","isRequired","types","GraphPropsType","bool","shape","Bar","theme","dot","fill","visualElementsColors","PLOT_FILL_COLOR","dotColor","line","stroke","backgroundColor","correct","incorrectIcon","incorrectWithIcon","borderRadius","spacing","unit","WHITE","fontSize","width","padding","border","boxSizing","Plot","data","d","category","array"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GA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UAAA,KAAK,EAAEJ,KALT;AAME,UAAA,KAAK,EAAEC,KANT;AAOE,UAAA,GAAG,gBAAS6E,CAAC,CAACjG,KAAX,cAAoBiG,CAAC,CAAC7F,KAAtB,cAA+BgB,KAA/B,CAPL;AAQE,UAAA,gBAAgB,EAAE,0BAAC8E,QAAD;AAAA,mBAAcjG,iBAAgB,CAACmB,KAAD,EAAQ8E,QAAR,CAA9B;AAAA,WARpB;AASE,UAAA,UAAU,EAAEhF,UATd;AAUE,UAAA,gBAAgB,EAAEG,gBAVpB;AAWE,UAAA,WAAW,EAAE4E,CAAC,CAACtF,WAXjB;AAYE,UAAA,WAAW,EAAEa;AAZf,UADgB;AAAA,OAAjB,CADH,CADF;AAoBD;;;EAjCuBsC,kBAAMvB,S;;;iCAAnBwD,I,eACQ;AACjBC,EAAAA,IAAI,EAAEjC,sBAAUoC,KADC;AAEjBlG,EAAAA,gBAAgB,EAAE8D,sBAAUC,IAFX;AAGjB7C,EAAAA,KAAK,EAAE4C,sBAAUC,IAHA;AAIjB9C,EAAAA,UAAU,EAAEmD,YAAMC,cAAN,CAAqBF,UAJhB;AAKjB7C,EAAAA,WAAW,EAAEwC,sBAAUQ,IALN;AAMjBlD,EAAAA,gBAAgB,EAAE0C,sBAAUC;AANX,C;eAmCN+B,I","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Check from '@material-ui/icons/Check';\nimport { withStyles } from '@material-ui/core/styles/index';\nimport { Group } from '@vx/group';\nimport debug from 'debug';\n\nimport { types } from '@pie-lib/plot';\nimport DraggableHandle, { DragHandle } from '../../common/drag-handle';\nimport { color } from '@pie-lib/render-ui';\nimport { bandKey } from '../../utils';\nimport { correct, incorrect } from '../../common/styles';\n\nconst log = debug('pie-lib:chart:bars');\nconst ICON_SIZE = 16; // 10px icon + 2px padding on all sides + 1px border\n\nexport class RawPlot extends React.Component {\n static propTypes = {\n onChangeCategory: PropTypes.func,\n value: PropTypes.number,\n classes: PropTypes.object,\n label: PropTypes.string,\n xBand: PropTypes.func,\n index: PropTypes.number.isRequired,\n graphProps: types.GraphPropsType.isRequired,\n CustomBarElement: PropTypes.func,\n interactive: PropTypes.bool,\n correctness: PropTypes.shape({\n value: PropTypes.string,\n label: PropTypes.string,\n }),\n };\n\n constructor(props) {\n super(props);\n this.state = {\n dragValue: undefined,\n isHovered: false,\n };\n }\n\n handleMouseEnter = () => {\n this.setState({ isHovered: true });\n };\n\n handleMouseLeave = () => {\n this.setState({ isHovered: false });\n };\n\n setDragValue = (dragValue) => this.setState({ dragValue });\n\n dragStop = () => {\n const { label, onChangeCategory } = this.props;\n const { dragValue } = this.state;\n log('[dragStop]', dragValue);\n\n if (dragValue !== undefined) {\n onChangeCategory({ label, value: dragValue });\n }\n\n this.setDragValue(undefined);\n };\n\n dragValue = (existing, next) => {\n log('[dragValue] next:', next);\n\n this.setDragValue(next);\n };\n\n renderCorrectnessIcon = (barX, barWidth, correctVal, correctness, classes, scale) => (\n <foreignObject\n x={barX + barWidth / 2 - ICON_SIZE / 2}\n y={scale.y(correctVal) + ICON_SIZE}\n width={ICON_SIZE}\n height={ICON_SIZE}\n >\n <Check\n className={classNames(classes.correctnessIcon, classes.correctIcon, classes.smallIcon)}\n title={correctness.label}\n />\n </foreignObject>\n );\n\n render() {\n const {\n graphProps,\n value,\n label,\n classes,\n xBand,\n index,\n CustomBarElement,\n interactive,\n correctness,\n defineChart,\n correctData,\n } = this.props;\n\n const { scale, range, size } = graphProps;\n const { max } = range || {};\n const { dragValue, isHovered } = this.state;\n\n const v = Number.isFinite(dragValue) ? dragValue : value;\n const barWidth = xBand.bandwidth();\n const barHeight = scale.y(range.max - v);\n const barX = xBand(bandKey({ label }, index));\n\n log('label:', label, 'barX:', barX, 'v: ', v, 'barHeight:', barHeight, 'barWidth: ', barWidth);\n\n const values = [];\n\n for (let i = 0; i < v; i++) {\n values.push(i);\n }\n\n const pointHeight = size.height / max;\n const pointDiameter = (pointHeight > barWidth ? barWidth : pointHeight) * 0.8;\n const Component = interactive ? DraggableHandle : DragHandle;\n const allowRolloverEvent = interactive && !correctness;\n\n return (\n <React.Fragment>\n <g\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onTouchStart={this.handleMouseEnter}\n onTouchEnd={this.handleMouseLeave}\n >\n {isHovered && allowRolloverEvent && (\n <rect\n x={barX}\n y={scale.y(v)}\n width={barWidth}\n height={values?.length ? pointHeight * values.length : 0}\n stroke={color.defaults.BORDER_GRAY}\n strokeWidth={'4px'}\n fill={'transparent'}\n />\n )}\n {values.map((index) =>\n CustomBarElement({\n index,\n pointDiameter,\n barX,\n barWidth,\n pointHeight,\n label,\n value,\n classes,\n scale,\n }),\n )}\n {correctness &&\n correctness.value === 'incorrect' &&\n (() => {\n const correctVal = parseFloat(correctData[index] && correctData[index].value);\n if (isNaN(correctVal)) return null;\n const selectedVal = v;\n if (selectedVal > correctVal) {\n // selected is higher than correct: overlay the correct last segment\n const overlayValues = [];\n for (let i = 0; i < correctVal; i++) {\n overlayValues.push(i);\n }\n const lastIndexOfOverlay = overlayValues.length - 1;\n const lastOverlayValue = overlayValues[lastIndexOfOverlay];\n const barX = xBand(bandKey({ label }, index));\n const barWidth = xBand.bandwidth();\n const pointHeight = size.height / max;\n const pointDiameter = (pointHeight > barWidth ? barWidth : pointHeight) * 0.8;\n return (\n <>\n <CustomBarElement\n index={lastOverlayValue}\n pointDiameter={pointDiameter + 10} // increase point diameter for dotted line\n barX={barX}\n barWidth={barWidth}\n pointHeight={pointHeight}\n label={label}\n value={value}\n classes={classes}\n scale={scale}\n dottedOverline={true}\n />\n {this.renderCorrectnessIcon(barX, barWidth, correctVal, correctness, classes, scale)}\n </>\n );\n }\n // selected is lower than correct, render missing segment below the correct bar\n const valuesToRender = [];\n for (let i = selectedVal; i < correctVal; i++) {\n valuesToRender.push(i);\n }\n return (\n <>\n {valuesToRender.map((idx) =>\n CustomBarElement({\n index: idx,\n pointDiameter,\n barX,\n barWidth,\n pointHeight,\n label,\n value,\n classes,\n scale,\n dottedOverline: true,\n }),\n )}\n {this.renderCorrectnessIcon(barX, barWidth, correctVal, correctness, classes, scale)}\n </>\n );\n })()}\n <Component\n x={barX}\n y={v}\n interactive={interactive}\n width={barWidth}\n onDrag={(v) => this.dragValue(value, v)}\n onDragStop={this.dragStop}\n graphProps={graphProps}\n correctness={correctness}\n isHovered={isHovered}\n defineChart={defineChart}\n color={color.primaryDark()}\n isPlot\n />\n </g>\n </React.Fragment>\n );\n }\n}\n\nconst Bar = withStyles((theme) => ({\n dot: {\n fill: color.visualElementsColors.PLOT_FILL_COLOR,\n '&.correct': correct('stroke'),\n '&.incorrect': incorrect('stroke'),\n },\n dotColor: {\n fill: color.visualElementsColors.PLOT_FILL_COLOR,\n '&.correct': correct('fill'),\n '&.incorrect': incorrect('fill'),\n },\n line: {\n stroke: color.visualElementsColors.PLOT_FILL_COLOR,\n '&.correct': correct('stroke'),\n '&.incorrect': incorrect('stroke'),\n },\n correctIcon: {\n backgroundColor: color.correct(),\n },\n incorrectIcon: {\n backgroundColor: color.incorrectWithIcon(),\n },\n correctnessIcon: {\n borderRadius: theme.spacing.unit * 2,\n color: color.defaults.WHITE,\n fontSize: '16px',\n width: '16px',\n height: '16px',\n padding: '2px',\n border: `1px solid ${color.defaults.WHITE}`,\n stroke: 'initial',\n boxSizing: 'unset', // to override the default border-box in IBX\n },\n smallIcon: {\n fontSize: '10px',\n width: '10px',\n height: '10px',\n },\n}))(RawPlot);\n\nexport class Plot extends React.Component {\n static propTypes = {\n data: PropTypes.array,\n onChangeCategory: PropTypes.func,\n xBand: PropTypes.func,\n graphProps: types.GraphPropsType.isRequired,\n defineChart: PropTypes.bool,\n CustomBarElement: PropTypes.func,\n };\n\n render() {\n const { data, graphProps, xBand, CustomBarElement, onChangeCategory, defineChart, correctData } = this.props;\n\n return (\n <Group>\n {(data || []).map((d, index) => (\n <Bar\n value={d.value}\n label={d.label}\n interactive={defineChart || d.interactive}\n defineChart={defineChart}\n xBand={xBand}\n index={index}\n key={`bar-${d.label}-${d.value}-${index}`}\n onChangeCategory={(category) => onChangeCategory(index, category)}\n graphProps={graphProps}\n CustomBarElement={CustomBarElement}\n correctness={d.correctness}\n correctData={correctData}\n />\n ))}\n </Group>\n );\n }\n}\n\nexport default Plot;\n"],"file":"plot.js"}
|
package/lib/plot/dot.js
CHANGED
|
@@ -25,13 +25,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
25
25
|
|
|
26
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
27
|
|
|
28
|
+
var _shape = require("@vx/shape");
|
|
29
|
+
|
|
28
30
|
var _plot = require("@pie-lib/plot");
|
|
29
31
|
|
|
30
32
|
var _utils = require("../utils");
|
|
31
33
|
|
|
32
34
|
var _plot2 = _interopRequireDefault(require("./common/plot"));
|
|
33
35
|
|
|
34
|
-
var
|
|
36
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
35
37
|
|
|
36
38
|
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); }; }
|
|
37
39
|
|
|
@@ -46,11 +48,21 @@ var CustomBarElement = function CustomBarElement(props) {
|
|
|
46
48
|
label = props.label,
|
|
47
49
|
value = props.value,
|
|
48
50
|
classes = props.classes,
|
|
49
|
-
scale = props.scale
|
|
51
|
+
scale = props.scale,
|
|
52
|
+
dottedOverline = props.dottedOverline;
|
|
50
53
|
var r = pointDiameter / 2;
|
|
51
54
|
var cx = barX + (barWidth - pointDiameter) / 2 + r;
|
|
52
55
|
var cy = scale.y(index) - (pointHeight - pointDiameter) / 2 - r;
|
|
53
|
-
|
|
56
|
+
var EXTRA_PADDING = 2;
|
|
57
|
+
return dottedOverline ? /*#__PURE__*/_react["default"].createElement(_shape.Circle, {
|
|
58
|
+
key: "point-".concat(label, "-").concat(value, "-").concat(index),
|
|
59
|
+
cx: cx,
|
|
60
|
+
cy: cy,
|
|
61
|
+
r: r + EXTRA_PADDING,
|
|
62
|
+
strokeDasharray: "4,4",
|
|
63
|
+
stroke: _renderUi.color.defaults.BORDER_GRAY,
|
|
64
|
+
fill: "none"
|
|
65
|
+
}) : /*#__PURE__*/_react["default"].createElement(_shape.Circle, {
|
|
54
66
|
key: "point-".concat(label, "-").concat(value, "-").concat(index),
|
|
55
67
|
className: classes.dot,
|
|
56
68
|
cx: cx,
|
|
@@ -68,7 +80,8 @@ CustomBarElement.propTypes = {
|
|
|
68
80
|
value: _propTypes["default"].number,
|
|
69
81
|
label: _propTypes["default"].string,
|
|
70
82
|
classes: _propTypes["default"].object,
|
|
71
|
-
scale: _propTypes["default"].object
|
|
83
|
+
scale: _propTypes["default"].object,
|
|
84
|
+
dottedOverline: _propTypes["default"].bool
|
|
72
85
|
};
|
|
73
86
|
|
|
74
87
|
var DotPlot = /*#__PURE__*/function (_React$Component) {
|
package/lib/plot/dot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plot/dot.js"],"names":["CustomBarElement","props","index","pointDiameter","barX","barWidth","pointHeight","label","value","classes","scale","r","cx","cy","y","dot","propTypes","PropTypes","number","string","object","DotPlot","data","graphProps","size","xBand","x","width","React","Component","array","onChange","func","types","GraphPropsType","isRequired","type","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAW;AAClC,MAAQC,KAAR,
|
|
1
|
+
{"version":3,"sources":["../../src/plot/dot.js"],"names":["CustomBarElement","props","index","pointDiameter","barX","barWidth","pointHeight","label","value","classes","scale","dottedOverline","r","cx","cy","y","EXTRA_PADDING","color","defaults","BORDER_GRAY","dot","propTypes","PropTypes","number","string","object","bool","DotPlot","data","graphProps","size","xBand","x","width","React","Component","array","onChange","func","types","GraphPropsType","isRequired","type","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAW;AAClC,MAAQC,KAAR,GAA4GD,KAA5G,CAAQC,KAAR;AAAA,MAAeC,aAAf,GAA4GF,KAA5G,CAAeE,aAAf;AAAA,MAA8BC,IAA9B,GAA4GH,KAA5G,CAA8BG,IAA9B;AAAA,MAAoCC,QAApC,GAA4GJ,KAA5G,CAAoCI,QAApC;AAAA,MAA8CC,WAA9C,GAA4GL,KAA5G,CAA8CK,WAA9C;AAAA,MAA2DC,KAA3D,GAA4GN,KAA5G,CAA2DM,KAA3D;AAAA,MAAkEC,KAAlE,GAA4GP,KAA5G,CAAkEO,KAAlE;AAAA,MAAyEC,OAAzE,GAA4GR,KAA5G,CAAyEQ,OAAzE;AAAA,MAAkFC,KAAlF,GAA4GT,KAA5G,CAAkFS,KAAlF;AAAA,MAAyFC,cAAzF,GAA4GV,KAA5G,CAAyFU,cAAzF;AAEA,MAAMC,CAAC,GAAGT,aAAa,GAAG,CAA1B;AACA,MAAMU,EAAE,GAAGT,IAAI,GAAG,CAACC,QAAQ,GAAGF,aAAZ,IAA6B,CAApC,GAAwCS,CAAnD;AACA,MAAME,EAAE,GAAGJ,KAAK,CAACK,CAAN,CAAQb,KAAR,IAAiB,CAACI,WAAW,GAAGH,aAAf,IAAgC,CAAjD,GAAqDS,CAAhE;AACA,MAAMI,aAAa,GAAG,CAAtB;AAEA,SAAOL,cAAc,gBACnB,gCAAC,aAAD;AACE,IAAA,GAAG,kBAAWJ,KAAX,cAAoBC,KAApB,cAA6BN,KAA7B,CADL;AAEE,IAAA,EAAE,EAAEW,EAFN;AAGE,IAAA,EAAE,EAAE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IAApB,0BAA2B,EAA3B;;AACA,UAAMC,KAAK,GAAG,wBAAYrB,KAAK,CAACsB,CAAlB,EAAqBJ,IAArB,EAA2BE,IAAI,CAACG,KAAhC,EAAuC,SAAvC,CAAd;AAEA,0BAAO,gCAAC,iBAAD,gCAAUhC,KAAV;AAAiB,QAAA,KAAK,EAAE8B,KAAxB;AAA+B,QAAA,gBAAgB,EAAE/B;AAAjD,SAAP;AACD;;;EAd0BkC,kBAAMC,S;;;iCAAtBR,O,eACQ;AACjBC,EAAAA,IAAI,EAAEN,sBAAUc,KADC;AAEjBC,EAAAA,QAAQ,EAAEf,sBAAUgB,IAFH;AAGjBT,EAAAA,UAAU,EAAEU,YAAMC,cAAN,CAAqBC;AAHhB,C;;eAgBN;AAAA,SAAO;AACpBC,IAAAA,IAAI,EAAE,SADc;AAEpBP,IAAAA,SAAS,EAAER,OAFS;AAGpBgB,IAAAA,IAAI,EAAE;AAHc,GAAP;AAAA,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Circle } from '@vx/shape';\n\nimport { types } from '@pie-lib/plot';\nimport { dataToXBand } from '../utils';\nimport Plot from './common/plot';\nimport { color } from '@pie-lib/render-ui';\n\nconst CustomBarElement = (props) => {\n const { index, pointDiameter, barX, barWidth, pointHeight, label, value, classes, scale, dottedOverline } = props;\n\n const r = pointDiameter / 2;\n const cx = barX + (barWidth - pointDiameter) / 2 + r;\n const cy = scale.y(index) - (pointHeight - pointDiameter) / 2 - r;\n const EXTRA_PADDING = 2;\n\n return dottedOverline ? (\n <Circle\n key={`point-${label}-${value}-${index}`}\n cx={cx}\n cy={cy}\n r={r + EXTRA_PADDING}\n strokeDasharray=\"4,4\"\n stroke={color.defaults.BORDER_GRAY}\n fill=\"none\"\n />\n ) : (\n <Circle key={`point-${label}-${value}-${index}`} className={classes.dot} cx={cx} cy={cy} r={r} />\n );\n};\n\nCustomBarElement.propTypes = {\n index: PropTypes.number,\n pointDiameter: PropTypes.number,\n barX: PropTypes.number,\n barWidth: PropTypes.number,\n pointHeight: PropTypes.number,\n value: PropTypes.number,\n label: PropTypes.string,\n classes: PropTypes.object,\n scale: PropTypes.object,\n dottedOverline: PropTypes.bool,\n};\n\nexport class DotPlot extends React.Component {\n static propTypes = {\n data: PropTypes.array,\n onChange: PropTypes.func,\n graphProps: types.GraphPropsType.isRequired,\n };\n\n render() {\n const props = this.props;\n const { data, graphProps } = props;\n const { scale = {}, size = {} } = graphProps || {};\n const xBand = dataToXBand(scale.x, data, size.width, 'dotPlot');\n\n return <Plot {...props} xBand={xBand} CustomBarElement={CustomBarElement} />;\n }\n}\n\nexport default () => ({\n type: 'dotPlot',\n Component: DotPlot,\n name: 'Dot Plot',\n});\n"],"file":"dot.js"}
|
package/lib/plot/line.js
CHANGED
|
@@ -25,15 +25,17 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
25
25
|
|
|
26
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
27
|
|
|
28
|
+
var _shape = require("@vx/shape");
|
|
29
|
+
|
|
30
|
+
var _group = require("@vx/group");
|
|
31
|
+
|
|
28
32
|
var _plot = require("@pie-lib/plot");
|
|
29
33
|
|
|
30
34
|
var _utils = require("../utils");
|
|
31
35
|
|
|
32
|
-
var
|
|
36
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
33
37
|
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
var _group = require("@vx/group");
|
|
38
|
+
var _plot2 = _interopRequireDefault(require("./common/plot"));
|
|
37
39
|
|
|
38
40
|
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); }; }
|
|
39
41
|
|
|
@@ -48,10 +50,21 @@ var CustomBarElement = function CustomBarElement(props) {
|
|
|
48
50
|
label = props.label,
|
|
49
51
|
value = props.value,
|
|
50
52
|
classes = props.classes,
|
|
51
|
-
scale = props.scale
|
|
53
|
+
scale = props.scale,
|
|
54
|
+
dottedOverline = props.dottedOverline;
|
|
52
55
|
var x = barX + (barWidth - pointDiameter) / 2;
|
|
53
56
|
var y = scale.y(index) - (pointHeight - pointDiameter) / 2;
|
|
54
|
-
|
|
57
|
+
var EXTRA_PADDING = 2;
|
|
58
|
+
return dottedOverline ? /*#__PURE__*/_react["default"].createElement("rect", {
|
|
59
|
+
key: "point-".concat(label, "-").concat(value, "-").concat(index),
|
|
60
|
+
x: x - EXTRA_PADDING,
|
|
61
|
+
y: y - pointDiameter - EXTRA_PADDING,
|
|
62
|
+
width: pointDiameter + EXTRA_PADDING * 2,
|
|
63
|
+
height: pointDiameter + EXTRA_PADDING * 2,
|
|
64
|
+
strokeDasharray: "4,4",
|
|
65
|
+
stroke: _renderUi.color.defaults.BORDER_GRAY,
|
|
66
|
+
fill: "none"
|
|
67
|
+
}) : /*#__PURE__*/_react["default"].createElement(_group.Group, null, /*#__PURE__*/_react["default"].createElement(_shape.LinePath, {
|
|
55
68
|
data: [{
|
|
56
69
|
x: x,
|
|
57
70
|
y: y
|
package/lib/plot/line.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plot/line.js"],"names":["CustomBarElement","props","index","pointDiameter","barX","barWidth","pointHeight","label","value","classes","scale","x","y","line","d","propTypes","PropTypes","number","string","object","LinePlot","data","graphProps","size","xBand","width","React","Component","array","onChange","func","types","GraphPropsType","isRequired","type","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAW;AAClC,MAAQC,KAAR,
|
|
1
|
+
{"version":3,"sources":["../../src/plot/line.js"],"names":["CustomBarElement","props","index","pointDiameter","barX","barWidth","pointHeight","label","value","classes","scale","dottedOverline","x","y","EXTRA_PADDING","color","defaults","BORDER_GRAY","line","d","propTypes","PropTypes","number","string","object","LinePlot","data","graphProps","size","xBand","width","React","Component","array","onChange","func","types","GraphPropsType","isRequired","type","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAW;AAClC,MAAQC,KAAR,GAA4GD,KAA5G,CAAQC,KAAR;AAAA,MAAeC,aAAf,GAA4GF,KAA5G,CAAeE,aAAf;AAAA,MAA8BC,IAA9B,GAA4GH,KAA5G,CAA8BG,IAA9B;AAAA,MAAoCC,QAApC,GAA4GJ,KAA5G,CAAoCI,QAApC;AAAA,MAA8CC,WAA9C,GAA4GL,KAA5G,CAA8CK,WAA9C;AAAA,MAA2DC,KAA3D,GAA4GN,KAA5G,CAA2DM,KAA3D;AAAA,MAAkEC,KAAlE,GAA4GP,KAA5G,CAAkEO,KAAlE;AAAA,MAAyEC,OAAzE,GAA4GR,KAA5G,CAAyEQ,OAAzE;AAAA,MAAkFC,KAAlF,GAA4GT,KAA5G,CAAkFS,KAAlF;AAAA,MAAyFC,cAAzF,GAA4GV,KAA5G,CAAyFU,cAAzF;AAEA,MAAMC,CAAC,GAAGR,IAAI,GAAG,CAACC,QAAQ,GAAGF,aAAZ,IAA6B,CAA9C;AACA,MAAMU,CAAC,GAAGH,KAAK,CAACG,CAAN,CAAQX,KAAR,IAAiB,CAACI,WAAW,GAAGH,aAAf,IAAgC,CAA3D;AACA,MAAMW,aAAa,GAAG,CAAtB;AAEA,SAAOH,cAAc,gBACnB;AACE,IAAA,GAAG,kBAAWJ,KAAX,cAAoBC,KAApB,cAA6BN,KAA7B,CADL;AAEE,IAAA,CAAC,EAAEU,CAAC,GAAGE,aAFT;AAGE,IAAA,CAAC,EAAED,CAA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ACQ;AACjBC,EAAAA,IAAI,EAAEL,sBAAUY,KADC;AAEjBC,EAAAA,QAAQ,EAAEb,sBAAUc,IAFH;AAGjBR,EAAAA,UAAU,EAAES,YAAMC,cAAN,CAAqBC;AAHhB,C;;eAgBN;AAAA,SAAO;AACpBC,IAAAA,IAAI,EAAE,UADc;AAEpBP,IAAAA,SAAS,EAAEP,QAFS;AAGpBe,IAAAA,IAAI,EAAE;AAHc,GAAP;AAAA,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { LinePath } from '@vx/shape';\nimport { Group } from '@vx/group';\n\nimport { types } from '@pie-lib/plot';\nimport { dataToXBand } from '../utils';\nimport { color } from '@pie-lib/render-ui';\nimport Plot from './common/plot';\n\nconst CustomBarElement = (props) => {\n const { index, pointDiameter, barX, barWidth, pointHeight, label, value, classes, scale, dottedOverline } = props;\n\n const x = barX + (barWidth - pointDiameter) / 2;\n const y = scale.y(index) - (pointHeight - pointDiameter) / 2;\n const EXTRA_PADDING = 2;\n\n return dottedOverline ? (\n <rect\n key={`point-${label}-${value}-${index}`}\n x={x - EXTRA_PADDING}\n y={y - pointDiameter - EXTRA_PADDING}\n width={pointDiameter + EXTRA_PADDING * 2}\n height={pointDiameter + EXTRA_PADDING * 2}\n strokeDasharray=\"4,4\"\n stroke={color.defaults.BORDER_GRAY}\n fill=\"none\"\n />\n ) : (\n <Group>\n <LinePath\n data={[\n { x, y },\n { x: x + pointDiameter, y: y - pointDiameter },\n ]}\n key={`point-${label}-${value}-${index}-1`}\n className={classes.line}\n x={(d) => d.x}\n y={(d) => d.y}\n strokeWidth={pointDiameter / 5}\n />\n <LinePath\n data={[\n { x, y: y - pointDiameter },\n { x: x + pointDiameter, y },\n ]}\n key={`point-${label}-${value}-${index}-2`}\n className={classes.line}\n x={(d) => d.x}\n y={(d) => d.y}\n strokeWidth={pointDiameter / 5}\n />\n </Group>\n );\n};\n\nCustomBarElement.propTypes = {\n index: PropTypes.number,\n pointDiameter: PropTypes.number,\n barX: PropTypes.number,\n barWidth: PropTypes.number,\n pointHeight: PropTypes.number,\n value: PropTypes.number,\n label: PropTypes.string,\n classes: PropTypes.object,\n scale: PropTypes.object,\n};\n\nexport class LinePlot extends React.Component {\n static propTypes = {\n data: PropTypes.array,\n onChange: PropTypes.func,\n graphProps: types.GraphPropsType.isRequired,\n };\n\n render() {\n const props = this.props;\n const { data, graphProps } = props;\n const { scale = {}, size = {} } = graphProps || {};\n const xBand = dataToXBand(scale.x, data, size.width, 'linePlot');\n\n return <Plot {...props} xBand={xBand} CustomBarElement={CustomBarElement} />;\n }\n}\n\nexport default () => ({\n type: 'linePlot',\n Component: LinePlot,\n name: 'Line Plot',\n});\n"],"file":"line.js"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "5.
|
|
6
|
+
"version": "5.25.0",
|
|
7
7
|
"description": "charting",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@mapbox/point-geometry": "^0.1.0",
|
|
21
21
|
"@material-ui/core": "^3.8.3",
|
|
22
|
-
"@pie-lib/plot": "^2.
|
|
23
|
-
"@pie-lib/render-ui": "^4.
|
|
24
|
-
"@pie-lib/translator": "^2.
|
|
22
|
+
"@pie-lib/plot": "^2.17.0",
|
|
23
|
+
"@pie-lib/render-ui": "^4.25.0",
|
|
24
|
+
"@pie-lib/translator": "^2.13.0",
|
|
25
25
|
"@vx/axis": "^0.0.183",
|
|
26
26
|
"@vx/event": "^0.0.182",
|
|
27
27
|
"@vx/grid": "^0.0.183",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "^16.8.1"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "21bbb8481af78b1fa3efb9275e4afb4bc9af0354"
|
|
49
49
|
}
|
|
@@ -7,10 +7,14 @@ exports[`ChartAxes snapshot renders 1`] = `
|
|
|
7
7
|
Object {
|
|
8
8
|
"axis": "RawChartAxes-axis-1",
|
|
9
9
|
"axisLine": "RawChartAxes-axisLine-2",
|
|
10
|
+
"correctIcon": "RawChartAxes-correctIcon-9",
|
|
11
|
+
"correctnessIcon": "RawChartAxes-correctnessIcon-7",
|
|
10
12
|
"customColor": "RawChartAxes-customColor-6",
|
|
11
13
|
"dottedLine": "RawChartAxes-dottedLine-4",
|
|
12
14
|
"error": "RawChartAxes-error-5",
|
|
15
|
+
"incorrectIcon": "RawChartAxes-incorrectIcon-8",
|
|
13
16
|
"tick": "RawChartAxes-tick-3",
|
|
17
|
+
"tickContainer": "RawChartAxes-tickContainer-10",
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
graphProps={
|
|
@@ -469,7 +473,7 @@ exports[`TickComponent snapshot1 renders 1`] = `
|
|
|
469
473
|
}
|
|
470
474
|
}
|
|
471
475
|
x={NaN}
|
|
472
|
-
y={
|
|
476
|
+
y={18}
|
|
473
477
|
>
|
|
474
478
|
<WithStyles(MarkLabel)
|
|
475
479
|
disabled={true}
|
|
@@ -133,6 +133,7 @@ exports[`ChartAxes snapshot renders 1`] = `
|
|
|
133
133
|
onAutoFocusUsed={[Function]}
|
|
134
134
|
onChange={[Function]}
|
|
135
135
|
onChangeCategory={[Function]}
|
|
136
|
+
showCorrectness={false}
|
|
136
137
|
top={0}
|
|
137
138
|
xBand={[Function]}
|
|
138
139
|
/>
|
|
@@ -141,7 +142,7 @@ exports[`ChartAxes snapshot renders 1`] = `
|
|
|
141
142
|
>
|
|
142
143
|
<rect
|
|
143
144
|
fill="white"
|
|
144
|
-
height={
|
|
145
|
+
height={230}
|
|
145
146
|
width={120}
|
|
146
147
|
x={-10}
|
|
147
148
|
y={-75}
|
|
@@ -328,6 +329,7 @@ exports[`ChartAxes snapshot renders if size is not defined 1`] = `
|
|
|
328
329
|
onAutoFocusUsed={[Function]}
|
|
329
330
|
onChange={[Function]}
|
|
330
331
|
onChangeCategory={[Function]}
|
|
332
|
+
showCorrectness={false}
|
|
331
333
|
top={0}
|
|
332
334
|
xBand={[Function]}
|
|
333
335
|
/>
|
|
@@ -336,7 +338,7 @@ exports[`ChartAxes snapshot renders if size is not defined 1`] = `
|
|
|
336
338
|
>
|
|
337
339
|
<rect
|
|
338
340
|
fill="white"
|
|
339
|
-
height={
|
|
341
|
+
height={610}
|
|
340
342
|
width={500}
|
|
341
343
|
x={-10}
|
|
342
344
|
y={-75}
|
|
@@ -527,6 +529,7 @@ exports[`ChartAxes snapshot renders without chartType property 1`] = `
|
|
|
527
529
|
onAutoFocusUsed={[Function]}
|
|
528
530
|
onChange={[Function]}
|
|
529
531
|
onChangeCategory={[Function]}
|
|
532
|
+
showCorrectness={false}
|
|
530
533
|
top={0}
|
|
531
534
|
xBand={[Function]}
|
|
532
535
|
/>
|
|
@@ -535,7 +538,7 @@ exports[`ChartAxes snapshot renders without chartType property 1`] = `
|
|
|
535
538
|
>
|
|
536
539
|
<rect
|
|
537
540
|
fill="white"
|
|
538
|
-
height={
|
|
541
|
+
height={230}
|
|
539
542
|
width={120}
|
|
540
543
|
x={-10}
|
|
541
544
|
y={-75}
|
|
@@ -1,67 +1,73 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`MarkLabel snapshot renders 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<AutosizeInput
|
|
6
|
+
injectStyles={true}
|
|
7
|
+
inputClassName=""
|
|
8
|
+
inputRef={[Function]}
|
|
9
|
+
inputStyle={
|
|
10
|
+
Object {
|
|
11
|
+
"background": "transparent",
|
|
12
|
+
"boxSizing": "border-box",
|
|
13
|
+
"minWidth": undefined,
|
|
14
|
+
"paddingLeft": 0,
|
|
15
|
+
"paddingRight": 0,
|
|
16
|
+
"textAlign": "center",
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
minWidth={1}
|
|
20
|
+
onBlur={[Function]}
|
|
21
|
+
onChange={[Function]}
|
|
22
|
+
style={
|
|
23
|
+
Object {
|
|
24
|
+
"left": 0,
|
|
25
|
+
"marginTop": "0",
|
|
26
|
+
"minWidth": undefined,
|
|
27
|
+
"pointerEvents": "auto",
|
|
28
|
+
"position": "fixed",
|
|
29
|
+
"top": 0,
|
|
30
|
+
"transform": "rotate(undefineddeg)",
|
|
31
|
+
"transformOrigin": "left",
|
|
32
|
+
"visibility": "unset",
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
34
37
|
`;
|
|
35
38
|
|
|
36
39
|
exports[`MarkLabel snapshot renders 2`] = `
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
<div>
|
|
41
|
+
<AutosizeInput
|
|
42
|
+
injectStyles={true}
|
|
43
|
+
inputClassName=""
|
|
44
|
+
inputRef={[Function]}
|
|
45
|
+
inputStyle={
|
|
46
|
+
Object {
|
|
47
|
+
"background": "transparent",
|
|
48
|
+
"boxSizing": "border-box",
|
|
49
|
+
"minWidth": undefined,
|
|
50
|
+
"paddingLeft": 0,
|
|
51
|
+
"paddingRight": 0,
|
|
52
|
+
"textAlign": "center",
|
|
53
|
+
}
|
|
49
54
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
minWidth={1}
|
|
56
|
+
onBlur={[Function]}
|
|
57
|
+
onChange={[Function]}
|
|
58
|
+
style={
|
|
59
|
+
Object {
|
|
60
|
+
"left": 0,
|
|
61
|
+
"marginTop": "0",
|
|
62
|
+
"minWidth": undefined,
|
|
63
|
+
"pointerEvents": "auto",
|
|
64
|
+
"position": "fixed",
|
|
65
|
+
"top": 0,
|
|
66
|
+
"transform": "rotate(undefineddeg)",
|
|
67
|
+
"transformOrigin": "left",
|
|
68
|
+
"visibility": "unset",
|
|
69
|
+
}
|
|
64
70
|
}
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
67
73
|
`;
|
package/src/actions-button.jsx
CHANGED
|
@@ -20,10 +20,10 @@ export class ActionsButton extends React.Component {
|
|
|
20
20
|
|
|
21
21
|
static propTypes = {
|
|
22
22
|
classes: PropTypes.object.isRequired,
|
|
23
|
-
categories: PropTypes.array,
|
|
24
23
|
addCategory: PropTypes.func.isRequired,
|
|
25
24
|
deleteCategory: PropTypes.func.isRequired,
|
|
26
|
-
language: PropTypes.string
|
|
25
|
+
language: PropTypes.string,
|
|
26
|
+
categories: PropTypes.array,
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
handleActionsClick = (event) => {
|
|
@@ -91,6 +91,7 @@ const styles = (theme) => ({
|
|
|
91
91
|
cursor: 'pointer',
|
|
92
92
|
fontSize: theme.typography.fontSize,
|
|
93
93
|
color: color.tertiary(),
|
|
94
|
+
padding: theme.spacing.unit,
|
|
94
95
|
},
|
|
95
96
|
actionsPaper: {
|
|
96
97
|
padding: theme.spacing.unit,
|
package/src/axes.jsx
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { withStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { AxisLeft, AxisBottom } from '@vx/axis';
|
|
5
|
+
import Checkbox from '@material-ui/core/Checkbox';
|
|
6
|
+
|
|
4
7
|
import { types } from '@pie-lib/plot';
|
|
5
8
|
import { color } from '@pie-lib/render-ui';
|
|
6
9
|
import { AlertDialog } from '@pie-lib/config-ui';
|
|
7
|
-
import {
|
|
10
|
+
import { TickCorrectnessIndicator } from './common/correctness-indicators';
|
|
8
11
|
import { bandKey, getTickValues, getRotateAngle } from './utils';
|
|
9
12
|
import MarkLabel from './mark-label';
|
|
10
|
-
import Checkbox from '@material-ui/core/Checkbox';
|
|
11
13
|
|
|
12
14
|
export class TickComponent extends React.Component {
|
|
13
15
|
static propTypes = {
|
|
@@ -126,6 +128,7 @@ export class TickComponent extends React.Component {
|
|
|
126
128
|
error,
|
|
127
129
|
autoFocus,
|
|
128
130
|
hiddenLabelRef,
|
|
131
|
+
showCorrectness,
|
|
129
132
|
} = this.props;
|
|
130
133
|
|
|
131
134
|
if (!formattedValue) {
|
|
@@ -150,7 +153,7 @@ export class TickComponent extends React.Component {
|
|
|
150
153
|
<g>
|
|
151
154
|
<foreignObject
|
|
152
155
|
x={bandWidth ? barX : x - barWidth / 2}
|
|
153
|
-
y={
|
|
156
|
+
y={18}
|
|
154
157
|
width={barWidth}
|
|
155
158
|
height={4}
|
|
156
159
|
style={{ pointerEvents: 'none', overflow: 'visible' }}
|
|
@@ -178,6 +181,12 @@ export class TickComponent extends React.Component {
|
|
|
178
181
|
correctness={correctness}
|
|
179
182
|
error={error && error[index]}
|
|
180
183
|
limitCharacters
|
|
184
|
+
correctnessIndicator={
|
|
185
|
+
showCorrectness &&
|
|
186
|
+
correctness && (
|
|
187
|
+
<TickCorrectnessIndicator correctness={correctness} interactive={interactive} classes={classes} />
|
|
188
|
+
)
|
|
189
|
+
}
|
|
181
190
|
/>
|
|
182
191
|
</foreignObject>
|
|
183
192
|
|
|
@@ -313,6 +322,7 @@ TickComponent.propTypes = {
|
|
|
313
322
|
changeEditableEnabled: PropTypes.bool,
|
|
314
323
|
autoFocus: PropTypes.bool,
|
|
315
324
|
onAutoFocusUsed: PropTypes.func,
|
|
325
|
+
showCorrectness: PropTypes.bool,
|
|
316
326
|
};
|
|
317
327
|
|
|
318
328
|
export class RawChartAxes extends React.Component {
|
|
@@ -334,6 +344,7 @@ export class RawChartAxes extends React.Component {
|
|
|
334
344
|
changeEditableEnabled: PropTypes.bool,
|
|
335
345
|
autoFocus: PropTypes.bool,
|
|
336
346
|
onAutoFocusUsed: PropTypes.func,
|
|
347
|
+
showCorrectness: PropTypes.bool,
|
|
337
348
|
};
|
|
338
349
|
|
|
339
350
|
state = { height: 0, width: 0 };
|
|
@@ -376,6 +387,7 @@ export class RawChartAxes extends React.Component {
|
|
|
376
387
|
autoFocus,
|
|
377
388
|
onAutoFocusUsed,
|
|
378
389
|
error,
|
|
390
|
+
showCorrectness,
|
|
379
391
|
} = this.props;
|
|
380
392
|
|
|
381
393
|
const { axis, axisLine, tick } = classes;
|
|
@@ -425,6 +437,7 @@ export class RawChartAxes extends React.Component {
|
|
|
425
437
|
x: props.x,
|
|
426
438
|
y: props.y,
|
|
427
439
|
formattedValue: props.formattedValue,
|
|
440
|
+
showCorrectness,
|
|
428
441
|
};
|
|
429
442
|
|
|
430
443
|
return <TickComponent {...properties} />;
|
|
@@ -491,6 +504,27 @@ const ChartAxes = withStyles(
|
|
|
491
504
|
customColor: {
|
|
492
505
|
color: `${color.tertiary()} !important`,
|
|
493
506
|
},
|
|
507
|
+
correctnessIcon: {
|
|
508
|
+
borderRadius: theme.spacing.unit * 2,
|
|
509
|
+
color: color.defaults.WHITE,
|
|
510
|
+
fontSize: '16px',
|
|
511
|
+
width: '16px',
|
|
512
|
+
height: '16px',
|
|
513
|
+
padding: '2px',
|
|
514
|
+
border: `1px solid ${color.defaults.WHITE}`,
|
|
515
|
+
boxSizing: 'unset', // to override the default border-box in IBX
|
|
516
|
+
},
|
|
517
|
+
incorrectIcon: {
|
|
518
|
+
backgroundColor: color.incorrectWithIcon(),
|
|
519
|
+
},
|
|
520
|
+
correctIcon: {
|
|
521
|
+
backgroundColor: color.correct(),
|
|
522
|
+
},
|
|
523
|
+
tickContainer: {
|
|
524
|
+
display: 'flex',
|
|
525
|
+
flexDirection: 'column',
|
|
526
|
+
alignItems: 'center',
|
|
527
|
+
},
|
|
494
528
|
}),
|
|
495
529
|
{ withTheme: true },
|
|
496
530
|
)(RawChartAxes);
|