@pie-lib/graphing 2.4.16 → 2.5.1
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 +30 -0
- package/lib/container/index.js.map +1 -1
- package/lib/undo-redo.js +2 -2
- package/lib/undo-redo.js.map +1 -1
- package/package.json +3 -3
- package/src/container/index.jsx +2 -4
- package/src/undo-redo.jsx +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.5.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing@2.5.0...@pie-lib/graphing@2.5.1) (2022-05-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **graphing:** removed problematic componentDidUpdate ([9347554](https://github.com/pie-framework/pie-lib/commit/93475543422bbb7a62d82121751c2e10969904ec))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [2.5.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing@2.4.17...@pie-lib/graphing@2.5.0) (2022-05-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **graphing:** updated store on model change PD-1608 ([a3744dd](https://github.com/pie-framework/pie-lib/commit/a3744dd74d90cca280b90657cbd558ce7ab9c288))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [2.4.17](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing@2.4.16...@pie-lib/graphing@2.4.17) (2022-04-28)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @pie-lib/graphing
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## [2.4.16](https://github.com/pie-framework/pie-lib/compare/@pie-lib/graphing@2.4.15...@pie-lib/graphing@2.4.16) (2022-03-22)
|
|
7
37
|
|
|
8
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/container/index.jsx"],"names":["mapStateToProps","s","marks","present","mapDispatchToProps","dispatch","onChangeMarks","m","onUndo","ActionCreators","undo","onRedo","redo","onReset","GraphContainer","GraphWithControls","Root","props","storeState","store","getState","r","subscribe","onStoreChange","rest","correctnessSet","find","correctness","React","Component","PropTypes","func","array"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,CAAC;AAAA,SAAK;AAC5BC,IAAAA,KAAK,EAAED,CAAC,CAACC,KAAF,CAAQC;AADa,GAAL;AAAA,CAAzB;;AAIA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CAAAC,QAAQ;AAAA,SAAK;AACtCC,IAAAA,aAAa,EAAE,uBAAAC,CAAC;AAAA,aAAIF,QAAQ,CAAC,0BAAYE,CAAZ,CAAD,CAAZ;AAAA,KADsB;AAEtCC,IAAAA,MAAM,EAAE;AAAA,aAAMH,QAAQ,CAACI,0BAAeC,IAAf,EAAD,CAAd;AAAA,KAF8B;AAGtCC,IAAAA,MAAM,EAAE;AAAA,aAAMN,QAAQ,CAACI,0BAAeG,IAAf,EAAD,CAAd;AAAA,KAH8B;AAItCC,IAAAA,OAAO,EAAE;AAAA,aAAMR,QAAQ,CAAC,0BAAY,EAAZ,CAAD,CAAd;AAAA;AAJ6B,GAAL;AAAA,CAAnC;;AAOO,IAAMS,cAAc,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../src/container/index.jsx"],"names":["mapStateToProps","s","marks","present","mapDispatchToProps","dispatch","onChangeMarks","m","onUndo","ActionCreators","undo","onRedo","redo","onReset","GraphContainer","GraphWithControls","Root","props","storeState","store","getState","r","subscribe","onStoreChange","rest","correctnessSet","find","correctness","React","Component","PropTypes","func","array"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAAAC,CAAC;AAAA,SAAK;AAC5BC,IAAAA,KAAK,EAAED,CAAC,CAACC,KAAF,CAAQC;AADa,GAAL;AAAA,CAAzB;;AAIA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CAAAC,QAAQ;AAAA,SAAK;AACtCC,IAAAA,aAAa,EAAE,uBAAAC,CAAC;AAAA,aAAIF,QAAQ,CAAC,0BAAYE,CAAZ,CAAD,CAAZ;AAAA,KADsB;AAEtCC,IAAAA,MAAM,EAAE;AAAA,aAAMH,QAAQ,CAACI,0BAAeC,IAAf,EAAD,CAAd;AAAA,KAF8B;AAGtCC,IAAAA,MAAM,EAAE;AAAA,aAAMN,QAAQ,CAACI,0BAAeG,IAAf,EAAD,CAAd;AAAA,KAH8B;AAItCC,IAAAA,OAAO,EAAE;AAAA,aAAMR,QAAQ,CAAC,0BAAY,EAAZ,CAAD,CAAd;AAAA;AAJ6B,GAAL;AAAA,CAAnC;;AAOO,IAAMS,cAAc,GAAG,yBAAQd,eAAR,EAAyBI,kBAAzB,EAA6CW,6BAA7C,CAAvB;AAEP;AACA;AACA;AACA;;;;IACMC,I;;;;;AAMJ,gBAAYC,KAAZ,EAAmB;AAAA;;AAAA;;AACjB,8BAAMA,KAAN;;AADiB,oEASH,YAAM;AACpB,wBAAiC,MAAKA,KAAtC;AAAA,UAAQf,KAAR,eAAQA,KAAR;AAAA,UAAeI,aAAf,eAAeA,aAAf;;AACA,UAAMY,UAAU,GAAG,MAAKC,KAAL,CAAWC,QAAX,EAAnB;;AAEA,UAAI,CAAC,yBAAQF,UAAU,CAAChB,KAAX,CAAiBC,OAAzB,EAAkCD,KAAlC,CAAL,EAA+C;AAC7CI,QAAAA,aAAa,CAACY,UAAU,CAAChB,KAAX,CAAiBC,OAAlB,CAAb;AACD;AACF,KAhBkB;;AAGjB,QAAMkB,CAAC,GAAG,0BAAV;AACA,UAAKF,KAAL,GAAa,wBAAYE,CAAZ,EAAe;AAAEnB,MAAAA,KAAK,EAAEe,KAAK,CAACf;AAAf,KAAf,CAAb;;AAEA,UAAKiB,KAAL,CAAWG,SAAX,CAAqB,MAAKC,aAA1B;;AANiB;AAOlB;;;;WAWD,kBAAS;AACP;AACA,yBAA0C,KAAKN,KAA/C;AAAA,UAAQX,aAAR,gBAAQA,aAAR;AAAA,UAAuBJ,KAAvB,gBAAuBA,KAAvB;AAAA,UAAiCsB,IAAjC;;AACA,UAAMC,cAAc,GAAGvB,KAAK,IAAIA,KAAK,CAACwB,IAAN,CAAW,UAAAnB,CAAC;AAAA,eAAIA,CAAC,CAACoB,WAAN;AAAA,OAAZ,CAAhC;;AAEA,UAAIF,cAAJ,EAAoB;AAClB,4BAAO,gCAAC,6BAAD,eAAuBD,IAAvB;AAA6B,UAAA,KAAK,EAAEtB,KAApC;AAA2C,UAAA,QAAQ,EAAEuB;AAArD,WAAP;AACD;;AAED,0BACE,gCAAC,oBAAD;AAAU,QAAA,KAAK,EAAE,KAAKN;AAAtB,sBACE,gCAAC,cAAD,EAAoBK,IAApB,CADF,CADF;AAKD;;;;EAtCgBI,kBAAMC,S;;gBAAnBb,I,eACe;AACjBV,EAAAA,aAAa,EAAEwB,sBAAUC,IADR;AAEjB7B,EAAAA,KAAK,EAAE4B,sBAAUE;AAFA,C;;eAwCNhB,I","sourcesContent":["import { connect } from 'react-redux';\nimport React from 'react';\nimport { Provider } from 'react-redux';\nimport { createStore } from 'redux';\nimport reducer from './reducer';\nimport { changeMarks } from './actions';\nimport PropTypes from 'prop-types';\nimport isEqual from 'lodash/isEqual';\nimport { ActionCreators } from 'redux-undo';\nimport GraphWithControls from '../graph-with-controls';\n\nconst mapStateToProps = s => ({\n marks: s.marks.present\n});\n\nconst mapDispatchToProps = dispatch => ({\n onChangeMarks: m => dispatch(changeMarks(m)),\n onUndo: () => dispatch(ActionCreators.undo()),\n onRedo: () => dispatch(ActionCreators.redo()),\n onReset: () => dispatch(changeMarks([]))\n});\n\nexport const GraphContainer = connect(mapStateToProps, mapDispatchToProps)(GraphWithControls);\n\n/**\n * The graph component entry point with undo/redo\n * Redux is an implementation detail, hide it in the react component.\n */\nclass Root extends React.Component {\n static propTypes = {\n onChangeMarks: PropTypes.func,\n marks: PropTypes.array\n };\n\n constructor(props) {\n super(props);\n\n const r = reducer();\n this.store = createStore(r, { marks: props.marks });\n\n this.store.subscribe(this.onStoreChange);\n }\n\n onStoreChange = () => {\n const { marks, onChangeMarks } = this.props;\n const storeState = this.store.getState();\n\n if (!isEqual(storeState.marks.present, marks)) {\n onChangeMarks(storeState.marks.present);\n }\n };\n\n render() {\n // eslint-disable-next-line no-unused-vars\n const { onChangeMarks, marks, ...rest } = this.props;\n const correctnessSet = marks && marks.find(m => m.correctness);\n\n if (correctnessSet) {\n return <GraphWithControls {...rest} marks={marks} disabled={correctnessSet} />;\n }\n\n return (\n <Provider store={this.store}>\n <GraphContainer {...rest} />\n </Provider>\n );\n }\n}\n\nexport default Root;\n"],"file":"index.js"}
|
package/lib/undo-redo.js
CHANGED
|
@@ -104,9 +104,9 @@ var styles = function styles(theme) {
|
|
|
104
104
|
button: {
|
|
105
105
|
color: _renderUi.color.text(),
|
|
106
106
|
backgroundColor: _renderUi.color.background(),
|
|
107
|
+
marginBottom: theme.spacing.unit / 2,
|
|
107
108
|
'&:not(:last-of-type)': {
|
|
108
|
-
marginRight: theme.spacing.unit / 2
|
|
109
|
-
marginBottom: theme.spacing.unit / 2
|
|
109
|
+
marginRight: theme.spacing.unit / 2
|
|
110
110
|
},
|
|
111
111
|
'&:hover': {
|
|
112
112
|
backgroundColor: _renderUi.color.primary()
|
package/lib/undo-redo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/undo-redo.jsx"],"names":["UndoRedo","props","classes","className","onUndo","onRedo","onReset","root","button","React","Component","PropTypes","object","string","func","isRequired","styles","theme","color","text","backgroundColor","background","
|
|
1
|
+
{"version":3,"sources":["../src/undo-redo.jsx"],"names":["UndoRedo","props","classes","className","onUndo","onRedo","onReset","root","button","React","Component","PropTypes","object","string","func","isRequired","styles","theme","color","text","backgroundColor","background","marginBottom","spacing","unit","marginRight","primary"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;IAEaA,Q;;;;;;;;;;;;;WASX,kBAAS;AACP,wBAAwD,KAAKC,KAA7D;AAAA,UAAQC,OAAR,eAAQA,OAAR;AAAA,UAAiBC,SAAjB,eAAiBA,SAAjB;AAAA,UAA4BC,MAA5B,eAA4BA,MAA5B;AAAA,UAAoCC,MAApC,eAAoCA,MAApC;AAAA,UAA4CC,OAA5C,eAA4CA,OAA5C;AACA,0BACE;AAAK,QAAA,SAAS,EAAE,4BAAWH,SAAX;AAAhB,sBACE,gCAAC,kBAAD;AAAQ,QAAA,OAAO,EAAE;AAAEI,UAAAA,IAAI,EAAEL,OAAO,CAACM;AAAhB,SAAjB;AAA2C,QAAA,OAAO,EAAEJ;AAApD,gBADF,eAIE,gCAAC,kBAAD;AAAQ,QAAA,OAAO,EAAE;AAAEG,UAAAA,IAAI,EAAEL,OAAO,CAACM;AAAhB,SAAjB;AAA2C,QAAA,OAAO,EAAEH;AAApD,gBAJF,eAOE,gCAAC,kBAAD;AAAQ,QAAA,OAAO,EAAE;AAAEE,UAAAA,IAAI,EAAEL,OAAO,CAACM;AAAhB,SAAjB;AAA2C,QAAA,OAAO,EAAEF;AAApD,iBAPF,CADF;AAaD;;;;EAxB2BG,kBAAMC,S;;;;gBAAvBV,Q,eACQ;AACjBE,EAAAA,OAAO,EAAES,sBAAUC,MADF;AAEjBT,EAAAA,SAAS,EAAEQ,sBAAUE,MAFJ;AAGjBT,EAAAA,MAAM,EAAEO,sBAAUG,IAAV,CAAeC,UAHN;AAIjBV,EAAAA,MAAM,EAAEM,sBAAUG,IAAV,CAAeC,UAJN;AAKjBT,EAAAA,OAAO,EAAEK,sBAAUG,IAAV,CAAeC;AALP,C;;gBADRf,Q,kBAQW,E;;AAmBxB,IAAMgB,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBT,IAAAA,MAAM,EAAE;AACNU,MAAAA,KAAK,EAAEA,gBAAMC,IAAN,EADD;AAENC,MAAAA,eAAe,EAAEF,gBAAMG,UAAN,EAFX;AAGNC,MAAAA,YAAY,EAAEL,KAAK,CAACM,OAAN,CAAcC,IAAd,GAAqB,CAH7B;AAIN,8BAAwB;AACtBC,QAAAA,WAAW,EAAER,KAAK,CAACM,OAAN,CAAcC,IAAd,GAAqB;AADZ,OAJlB;AAON,iBAAW;AACTJ,QAAAA,eAAe,EAAEF,gBAAMQ,OAAN;AADR;AAPL;AADe,GAAL;AAAA,CAApB;;eAce,sBAAWV,MAAX,EAAmBhB,QAAnB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Button from '@material-ui/core/Button';\nimport { withStyles } from '@material-ui/core';\nimport { color } from '@pie-lib/render-ui';\n\nexport class UndoRedo extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n className: PropTypes.string,\n onUndo: PropTypes.func.isRequired,\n onRedo: PropTypes.func.isRequired,\n onReset: PropTypes.func.isRequired\n };\n static defaultProps = {};\n render() {\n const { classes, className, onUndo, onRedo, onReset } = this.props;\n return (\n <div className={classNames(className)}>\n <Button classes={{ root: classes.button }} onClick={onUndo}>\n Undo\n </Button>\n <Button classes={{ root: classes.button }} onClick={onRedo}>\n Redo\n </Button>\n <Button classes={{ root: classes.button }} onClick={onReset}>\n Reset\n </Button>\n </div>\n );\n }\n}\n\nconst styles = theme => ({\n button: {\n color: color.text(),\n backgroundColor: color.background(),\n marginBottom: theme.spacing.unit / 2,\n '&:not(:last-of-type)': {\n marginRight: theme.spacing.unit / 2\n },\n '&:hover': {\n backgroundColor: color.primary()\n }\n }\n});\n\nexport default withStyles(styles)(UndoRedo);\n"],"file":"undo-redo.js"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.5.1",
|
|
7
7
|
"description": "Graphing components",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@material-ui/core": "^3.8.3",
|
|
21
21
|
"@pie-lib/graphing-utils": "^1.1.20",
|
|
22
22
|
"@pie-lib/plot": "^2.1.10",
|
|
23
|
-
"@pie-lib/render-ui": "^4.12.
|
|
23
|
+
"@pie-lib/render-ui": "^4.12.6",
|
|
24
24
|
"@vx/axis": "^0.0.189",
|
|
25
25
|
"@vx/clip-path": "^0.0.189",
|
|
26
26
|
"@vx/event": "^0.0.189",
|
|
@@ -43,6 +43,6 @@
|
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": "^16.8.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "0ab3beb8351feafa08845f0c0639fb9a64e10e9a",
|
|
47
47
|
"scripts": {}
|
|
48
48
|
}
|
package/src/container/index.jsx
CHANGED
|
@@ -20,10 +20,7 @@ const mapDispatchToProps = dispatch => ({
|
|
|
20
20
|
onReset: () => dispatch(changeMarks([]))
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
export const GraphContainer = connect(
|
|
24
|
-
mapStateToProps,
|
|
25
|
-
mapDispatchToProps
|
|
26
|
-
)(GraphWithControls);
|
|
23
|
+
export const GraphContainer = connect(mapStateToProps, mapDispatchToProps)(GraphWithControls);
|
|
27
24
|
|
|
28
25
|
/**
|
|
29
26
|
* The graph component entry point with undo/redo
|
|
@@ -47,6 +44,7 @@ class Root extends React.Component {
|
|
|
47
44
|
onStoreChange = () => {
|
|
48
45
|
const { marks, onChangeMarks } = this.props;
|
|
49
46
|
const storeState = this.store.getState();
|
|
47
|
+
|
|
50
48
|
if (!isEqual(storeState.marks.present, marks)) {
|
|
51
49
|
onChangeMarks(storeState.marks.present);
|
|
52
50
|
}
|
package/src/undo-redo.jsx
CHANGED
|
@@ -36,9 +36,9 @@ const styles = theme => ({
|
|
|
36
36
|
button: {
|
|
37
37
|
color: color.text(),
|
|
38
38
|
backgroundColor: color.background(),
|
|
39
|
+
marginBottom: theme.spacing.unit / 2,
|
|
39
40
|
'&:not(:last-of-type)': {
|
|
40
|
-
marginRight: theme.spacing.unit / 2
|
|
41
|
-
marginBottom: theme.spacing.unit / 2
|
|
41
|
+
marginRight: theme.spacing.unit / 2
|
|
42
42
|
},
|
|
43
43
|
'&:hover': {
|
|
44
44
|
backgroundColor: color.primary()
|