@pie-lib/plot 2.1.10-next.540 → 2.1.10-next.548
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/lib/root.js +78 -11
- package/lib/root.js.map +1 -1
- package/package.json +2 -2
- package/src/root.jsx +91 -21
package/lib/root.js
CHANGED
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = exports.Root = void 0;
|
|
9
9
|
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
|
|
10
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
13
|
|
|
12
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -102,6 +104,8 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
102
104
|
children = _this$props2.children,
|
|
103
105
|
classes = _this$props2.classes,
|
|
104
106
|
onChangeTitle = _this$props2.onChangeTitle,
|
|
107
|
+
showLabels = _this$props2.showLabels,
|
|
108
|
+
showPixelGuides = _this$props2.showPixelGuides,
|
|
105
109
|
showTitle = _this$props2.showTitle,
|
|
106
110
|
title = _this$props2.title,
|
|
107
111
|
rootRef = _this$props2.rootRef;
|
|
@@ -112,16 +116,27 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
112
116
|
height = _graphProps$size$heig === void 0 ? 500 : _graphProps$size$heig,
|
|
113
117
|
domain = graphProps.domain,
|
|
114
118
|
range = graphProps.range;
|
|
115
|
-
var
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
var activeTitlePlugins = ['bold', 'italic', 'underline', 'strikethrough' // 'languageCharacters'
|
|
119
|
+
var padding = showLabels ? 70 : 40;
|
|
120
|
+
var extraPadding = showLabels ? 16 : 40;
|
|
121
|
+
var finalWidth = width + padding * 2 + (domain.padding || 0) * 2 + extraPadding;
|
|
122
|
+
var finalHeight = height + padding * 2 + (range.padding || 0) * 2;
|
|
123
|
+
var activeTitlePlugins = ['bold', 'italic', 'underline', 'strikethrough', 'math' // 'languageCharacters'
|
|
121
124
|
];
|
|
125
|
+
var nbOfVerticalLines = parseInt(width / 100);
|
|
126
|
+
var nbOfHorizontalLines = parseInt(height / 100);
|
|
127
|
+
var sideGridlinesPadding = parseInt(height % 100);
|
|
122
128
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
123
129
|
className: classes.root
|
|
124
|
-
},
|
|
130
|
+
}, showPixelGuides && /*#__PURE__*/_react["default"].createElement("div", {
|
|
131
|
+
className: classes.topPixelGuides
|
|
132
|
+
}, (0, _toConsumableArray2["default"])(Array(nbOfVerticalLines + 1).keys()).map(function (value) {
|
|
133
|
+
return /*#__PURE__*/_react["default"].createElement(_renderUi.Readable, {
|
|
134
|
+
"false": true,
|
|
135
|
+
key: "top-guide-".concat(value)
|
|
136
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
137
|
+
className: classes.topPixelIndicator
|
|
138
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, value * 100, "px"), /*#__PURE__*/_react["default"].createElement("div", null, "|")));
|
|
139
|
+
})), showTitle && /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
125
140
|
className: (0, _classnames["default"])((0, _defineProperty2["default"])({}, classes.disabledTitle, disabledTitle), classes.graphTitle),
|
|
126
141
|
markup: title || '',
|
|
127
142
|
width: finalWidth,
|
|
@@ -131,7 +146,9 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
131
146
|
noBorder: true
|
|
132
147
|
},
|
|
133
148
|
activePlugins: activeTitlePlugins
|
|
134
|
-
}), /*#__PURE__*/_react["default"].createElement("
|
|
149
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
150
|
+
className: classes.wrapper
|
|
151
|
+
}, /*#__PURE__*/_react["default"].createElement("svg", {
|
|
135
152
|
width: finalWidth,
|
|
136
153
|
height: finalHeight,
|
|
137
154
|
className: classes.svg
|
|
@@ -144,8 +161,20 @@ var Root = /*#__PURE__*/function (_React$Component) {
|
|
|
144
161
|
}
|
|
145
162
|
},
|
|
146
163
|
className: classes.graphBox,
|
|
147
|
-
transform: "translate(".concat(
|
|
148
|
-
}, children))
|
|
164
|
+
transform: "translate(".concat(padding, ", ").concat(padding, ")")
|
|
165
|
+
}, children)), showPixelGuides && /*#__PURE__*/_react["default"].createElement("div", {
|
|
166
|
+
className: classes.sidePixelGuides,
|
|
167
|
+
style: {
|
|
168
|
+
paddingTop: sideGridlinesPadding
|
|
169
|
+
}
|
|
170
|
+
}, (0, _toConsumableArray2["default"])(Array(nbOfHorizontalLines + 1).keys()).reverse().map(function (value) {
|
|
171
|
+
return /*#__PURE__*/_react["default"].createElement(_renderUi.Readable, {
|
|
172
|
+
"false": true,
|
|
173
|
+
key: "top-guide-".concat(value)
|
|
174
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
175
|
+
className: classes.sidePixelIndicator
|
|
176
|
+
}, "\u2501 ", value * 100, "px"));
|
|
177
|
+
}))));
|
|
149
178
|
}
|
|
150
179
|
}]);
|
|
151
180
|
return Root;
|
|
@@ -155,10 +184,14 @@ exports.Root = Root;
|
|
|
155
184
|
(0, _defineProperty2["default"])(Root, "propTypes", {
|
|
156
185
|
title: _propTypes["default"].string,
|
|
157
186
|
children: _types.ChildrenType,
|
|
187
|
+
disabledTitle: _propTypes["default"].bool,
|
|
158
188
|
graphProps: _types.GraphPropsType.isRequired,
|
|
189
|
+
onChangeTitle: _propTypes["default"].func,
|
|
159
190
|
onMouseMove: _propTypes["default"].func,
|
|
160
191
|
classes: _propTypes["default"].object.isRequired,
|
|
192
|
+
showLabels: _propTypes["default"].bool,
|
|
161
193
|
showTitle: _propTypes["default"].bool,
|
|
194
|
+
showPixelGuides: _propTypes["default"].bool,
|
|
162
195
|
rootRef: _propTypes["default"].func
|
|
163
196
|
});
|
|
164
197
|
|
|
@@ -169,6 +202,9 @@ var styles = function styles(theme) {
|
|
|
169
202
|
color: _renderUi.color.text(),
|
|
170
203
|
backgroundColor: _renderUi.color.background()
|
|
171
204
|
},
|
|
205
|
+
wrapper: {
|
|
206
|
+
display: 'flex'
|
|
207
|
+
},
|
|
172
208
|
svg: {},
|
|
173
209
|
graphBox: {
|
|
174
210
|
cursor: 'pointer',
|
|
@@ -177,11 +213,42 @@ var styles = function styles(theme) {
|
|
|
177
213
|
graphTitle: {
|
|
178
214
|
color: _renderUi.color.text(),
|
|
179
215
|
fontSize: theme.typography.fontSize + 2,
|
|
180
|
-
padding: '
|
|
216
|
+
padding: '12px 4px 0',
|
|
181
217
|
textAlign: 'center'
|
|
182
218
|
},
|
|
183
219
|
disabledTitle: {
|
|
184
220
|
pointerEvents: 'none'
|
|
221
|
+
},
|
|
222
|
+
topPixelGuides: {
|
|
223
|
+
display: 'flex',
|
|
224
|
+
paddingTop: '6px',
|
|
225
|
+
marginLeft: '10px'
|
|
226
|
+
},
|
|
227
|
+
topPixelIndicator: {
|
|
228
|
+
color: _renderUi.color.primaryLight(),
|
|
229
|
+
display: 'flex',
|
|
230
|
+
flexDirection: 'column',
|
|
231
|
+
alignItems: 'center',
|
|
232
|
+
width: '100px',
|
|
233
|
+
pointerEvents: 'none',
|
|
234
|
+
userSelect: 'none'
|
|
235
|
+
},
|
|
236
|
+
sidePixelGuides: {
|
|
237
|
+
width: '70px',
|
|
238
|
+
display: 'flex',
|
|
239
|
+
flexDirection: 'column',
|
|
240
|
+
marginTop: '40px',
|
|
241
|
+
marginRight: '6px'
|
|
242
|
+
},
|
|
243
|
+
sidePixelIndicator: {
|
|
244
|
+
color: _renderUi.color.primaryLight(),
|
|
245
|
+
textAlign: 'right',
|
|
246
|
+
height: '20px',
|
|
247
|
+
pointerEvents: 'none',
|
|
248
|
+
userSelect: 'none',
|
|
249
|
+
'&:not(:last-child)': {
|
|
250
|
+
marginBottom: '80px'
|
|
251
|
+
}
|
|
185
252
|
}
|
|
186
253
|
};
|
|
187
254
|
};
|
package/lib/root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","names":["Root","g","props","graphProps","onMouseMove","scale","snap","coords","mouse","_groups","x","invert","y","snapped","select","on","mouseMove","bind","disabledTitle","children","classes","onChangeTitle","showTitle","title","rootRef","size","width","height","domain","range","topPadding","leftPadding","finalWidth","padding","finalHeight","activeTitlePlugins","root","cn","graphTitle","noBorder","svg","r","graphBox","React","Component","PropTypes","string","ChildrenType","GraphPropsType","isRequired","func","object","bool","styles","theme","border","color","primaryLight","text","backgroundColor","background","cursor","userSelect","fontSize","typography","textAlign","pointerEvents","withStyles"],"sources":["../src/root.jsx"],"sourcesContent":["import React from 'react';\nimport { ChildrenType } from './types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { select, mouse } from 'd3-selection';\nimport PropTypes from 'prop-types';\nimport { GraphPropsType } from './types';\nimport { color } from '@pie-lib/render-ui';\nimport EditableHtml from '@pie-lib/editable-html';\nimport cn from 'classnames';\n\nexport class Root extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n children: ChildrenType,\n graphProps: GraphPropsType.isRequired,\n onMouseMove: PropTypes.func,\n classes: PropTypes.object.isRequired,\n showTitle: PropTypes.bool,\n rootRef: PropTypes.func\n };\n\n mouseMove = g => {\n const { graphProps, onMouseMove } = this.props;\n\n if (!onMouseMove) {\n return;\n }\n\n const { scale, snap } = graphProps;\n const coords = mouse(g._groups[0][0]);\n const x = scale.x.invert(coords[0]);\n const y = scale.y.invert(coords[1]);\n\n const snapped = {\n x: snap.x(x),\n y: snap.y(y)\n };\n\n onMouseMove(snapped);\n };\n\n componentDidMount() {\n const g = select(this.g);\n g.on('mousemove', this.mouseMove.bind(this, g));\n }\n\n componentWillUnmount() {\n const g = select(this.g);\n g.on('mousemove', null);\n }\n\n render() {\n const {\n disabledTitle,\n graphProps,\n children,\n classes,\n onChangeTitle,\n showTitle,\n title,\n rootRef\n } = this.props;\n const {\n size: { width = 500, height = 500 },\n domain,\n range\n } = graphProps;\n const topPadding = 50;\n const leftPadding = topPadding + 10; // left side requires an extra padding of 10\n const finalWidth = width + leftPadding * 2 + (domain.padding || 0) * 2;\n const finalHeight = height + topPadding * 2 + (range.padding || 0) * 2;\n\n const activeTitlePlugins = [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough'\n // 'languageCharacters'\n ];\n\n return (\n <div className={classes.root}>\n {showTitle && (\n <EditableHtml\n className={cn(\n {\n [classes.disabledTitle]: disabledTitle\n },\n classes.graphTitle\n )}\n markup={title || ''}\n width={finalWidth}\n onChange={onChangeTitle}\n placeholder={!disabledTitle && 'Click here to add a title for this graph'}\n toolbarOpts={{ noBorder: true }}\n activePlugins={activeTitlePlugins}\n />\n )}\n <svg width={finalWidth} height={finalHeight} className={classes.svg}>\n <g\n ref={r => {\n this.g = r;\n if (rootRef) {\n rootRef(r);\n }\n }}\n className={classes.graphBox}\n transform={`translate(${leftPadding}, ${topPadding})`}\n >\n {children}\n </g>\n </svg>\n </div>\n );\n }\n}\nconst styles = theme => ({\n root: {\n border: `solid 1px ${color.primaryLight()}`,\n color: color.text(),\n backgroundColor: color.background()\n },\n svg: {},\n graphBox: {\n cursor: 'pointer',\n userSelect: 'none'\n },\n graphTitle: {\n color: color.text(),\n fontSize: theme.typography.fontSize + 2,\n padding: '8px 50px 0',\n textAlign: 'center'\n },\n disabledTitle: {\n pointerEvents: 'none'\n }\n});\n\nexport default withStyles(styles)(Root);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;IAEaA,I;;;;;;;;;;;;;;;kGAWC,UAAAC,CAAC,EAAI;MACf,kBAAoC,MAAKC,KAAzC;MAAA,IAAQC,UAAR,eAAQA,UAAR;MAAA,IAAoBC,WAApB,eAAoBA,WAApB;;MAEA,IAAI,CAACA,WAAL,EAAkB;QAChB;M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
1
|
+
{"version":3,"file":"root.js","names":["Root","g","props","graphProps","onMouseMove","scale","snap","coords","mouse","_groups","x","invert","y","snapped","select","on","mouseMove","bind","disabledTitle","children","classes","onChangeTitle","showLabels","showPixelGuides","showTitle","title","rootRef","size","width","height","domain","range","padding","extraPadding","finalWidth","finalHeight","activeTitlePlugins","nbOfVerticalLines","parseInt","nbOfHorizontalLines","sideGridlinesPadding","root","topPixelGuides","Array","keys","map","value","topPixelIndicator","cn","graphTitle","noBorder","wrapper","svg","r","graphBox","sidePixelGuides","paddingTop","reverse","sidePixelIndicator","React","Component","PropTypes","string","ChildrenType","bool","GraphPropsType","isRequired","func","object","styles","theme","border","color","primaryLight","text","backgroundColor","background","display","cursor","userSelect","fontSize","typography","textAlign","pointerEvents","marginLeft","flexDirection","alignItems","marginTop","marginRight","marginBottom","withStyles"],"sources":["../src/root.jsx"],"sourcesContent":["import React from 'react';\nimport { ChildrenType } from './types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { select, mouse } from 'd3-selection';\nimport PropTypes from 'prop-types';\nimport { GraphPropsType } from './types';\nimport { color, Readable } from '@pie-lib/render-ui';\nimport EditableHtml from '@pie-lib/editable-html';\nimport cn from 'classnames';\n\nexport class Root extends React.Component {\n static propTypes = {\n title: PropTypes.string,\n children: ChildrenType,\n disabledTitle: PropTypes.bool,\n graphProps: GraphPropsType.isRequired,\n onChangeTitle: PropTypes.func,\n onMouseMove: PropTypes.func,\n classes: PropTypes.object.isRequired,\n showLabels: PropTypes.bool,\n showTitle: PropTypes.bool,\n showPixelGuides: PropTypes.bool,\n rootRef: PropTypes.func\n };\n\n mouseMove = g => {\n const { graphProps, onMouseMove } = this.props;\n\n if (!onMouseMove) {\n return;\n }\n\n const { scale, snap } = graphProps;\n const coords = mouse(g._groups[0][0]);\n const x = scale.x.invert(coords[0]);\n const y = scale.y.invert(coords[1]);\n\n const snapped = {\n x: snap.x(x),\n y: snap.y(y)\n };\n\n onMouseMove(snapped);\n };\n\n componentDidMount() {\n const g = select(this.g);\n g.on('mousemove', this.mouseMove.bind(this, g));\n }\n\n componentWillUnmount() {\n const g = select(this.g);\n g.on('mousemove', null);\n }\n\n render() {\n const {\n disabledTitle,\n graphProps,\n children,\n classes,\n onChangeTitle,\n showLabels,\n showPixelGuides,\n showTitle,\n title,\n rootRef\n } = this.props;\n const {\n size: { width = 500, height = 500 },\n domain,\n range\n } = graphProps;\n\n const padding = showLabels ? 70 : 40;\n const extraPadding = showLabels ? 16 : 40;\n const finalWidth = width + padding * 2 + (domain.padding || 0) * 2 + extraPadding;\n const finalHeight = height + padding * 2 + (range.padding || 0) * 2;\n\n const activeTitlePlugins = [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n 'math'\n // 'languageCharacters'\n ];\n\n const nbOfVerticalLines = parseInt(width / 100);\n const nbOfHorizontalLines = parseInt(height / 100);\n const sideGridlinesPadding = parseInt(height % 100);\n\n return (\n <div className={classes.root}>\n {showPixelGuides && (\n <div className={classes.topPixelGuides}>\n {[...Array(nbOfVerticalLines + 1).keys()].map(value => (\n <Readable false key={`top-guide-${value}`}>\n <div className={classes.topPixelIndicator}>\n <div>{value * 100}px</div>\n <div>|</div>\n </div>\n </Readable>\n ))}\n </div>\n )}\n {showTitle && (\n <EditableHtml\n className={cn(\n {\n [classes.disabledTitle]: disabledTitle\n },\n classes.graphTitle\n )}\n markup={title || ''}\n width={finalWidth}\n onChange={onChangeTitle}\n placeholder={!disabledTitle && 'Click here to add a title for this graph'}\n toolbarOpts={{ noBorder: true }}\n activePlugins={activeTitlePlugins}\n />\n )}\n <div className={classes.wrapper}>\n <svg width={finalWidth} height={finalHeight} className={classes.svg}>\n <g\n ref={r => {\n this.g = r;\n if (rootRef) {\n rootRef(r);\n }\n }}\n className={classes.graphBox}\n transform={`translate(${padding}, ${padding})`}\n >\n {children}\n </g>\n </svg>\n {showPixelGuides && (\n <div className={classes.sidePixelGuides} style={{ paddingTop: sideGridlinesPadding }}>\n {[...Array(nbOfHorizontalLines + 1).keys()].reverse().map(value => (\n <Readable false key={`top-guide-${value}`}>\n <div className={classes.sidePixelIndicator}>━ {value * 100}px</div>\n </Readable>\n ))}\n </div>\n )}\n </div>\n </div>\n );\n }\n}\nconst styles = theme => ({\n root: {\n border: `solid 1px ${color.primaryLight()}`,\n color: color.text(),\n backgroundColor: color.background()\n },\n wrapper: {\n display: 'flex'\n },\n svg: {},\n graphBox: {\n cursor: 'pointer',\n userSelect: 'none'\n },\n graphTitle: {\n color: color.text(),\n fontSize: theme.typography.fontSize + 2,\n padding: '12px 4px 0',\n textAlign: 'center'\n },\n disabledTitle: {\n pointerEvents: 'none'\n },\n topPixelGuides: {\n display: 'flex',\n paddingTop: '6px',\n marginLeft: '10px'\n },\n topPixelIndicator: {\n color: color.primaryLight(),\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n width: '100px',\n pointerEvents: 'none',\n userSelect: 'none'\n },\n sidePixelGuides: {\n width: '70px',\n display: 'flex',\n flexDirection: 'column',\n marginTop: '40px',\n marginRight: '6px'\n },\n sidePixelIndicator: {\n color: color.primaryLight(),\n textAlign: 'right',\n height: '20px',\n pointerEvents: 'none',\n userSelect: 'none',\n\n '&:not(:last-child)': {\n marginBottom: '80px'\n }\n }\n});\n\nexport default withStyles(styles)(Root);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;IAEaA,I;;;;;;;;;;;;;;;kGAeC,UAAAC,CAAC,EAAI;MACf,kBAAoC,MAAKC,KAAzC;MAAA,IAAQC,UAAR,eAAQA,UAAR;MAAA,IAAoBC,WAApB,eAAoBA,WAApB;;MAEA,IAAI,CAACA,WAAL,EAAkB;QAChB;MACD;;MAED,IAAQC,KAAR,GAAwBF,UAAxB,CAAQE,KAAR;MAAA,IAAeC,IAAf,GAAwBH,UAAxB,CAAeG,IAAf;MACA,IAAMC,MAAM,GAAG,IAAAC,kBAAA,EAAMP,CAAC,CAACQ,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AE,KAFE;MAGd4B,UAAU,EAAE;IAHE,CAvBO;IA4BvBrC,iBAAiB,EAAE;MACjByB,KAAK,EAAEA,eAAA,CAAMC,YAAN,EADU;MAEjBI,OAAO,EAAE,MAFQ;MAGjBQ,aAAa,EAAE,QAHE;MAIjBC,UAAU,EAAE,QAJK;MAKjB1D,KAAK,EAAE,OALU;MAMjBuD,aAAa,EAAE,MANE;MAOjBJ,UAAU,EAAE;IAPK,CA5BI;IAqCvBxB,eAAe,EAAE;MACf3B,KAAK,EAAE,MADQ;MAEfiD,OAAO,EAAE,MAFM;MAGfQ,aAAa,EAAE,QAHA;MAIfE,SAAS,EAAE,MAJI;MAKfC,WAAW,EAAE;IALE,CArCM;IA4CvB9B,kBAAkB,EAAE;MAClBc,KAAK,EAAEA,eAAA,CAAMC,YAAN,EADW;MAElBS,SAAS,EAAE,OAFO;MAGlBrD,MAAM,EAAE,MAHU;MAIlBsD,aAAa,EAAE,MAJG;MAKlBJ,UAAU,EAAE,MALM;MAOlB,sBAAsB;QACpBU,YAAY,EAAE;MADM;IAPJ;EA5CG,CAAL;AAAA,CAApB;;eAyDe,IAAAC,kBAAA,EAAWrB,MAAX,EAAmBrE,IAAnB,C"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.1.10-next.
|
|
6
|
+
"version": "2.1.10-next.548+7bad91a1",
|
|
7
7
|
"description": "Some underlying components for building charts/graphs",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "^16.8.1"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "7bad91a13c9cc4987abe66c2b7484af9b9580cac",
|
|
42
42
|
"scripts": {}
|
|
43
43
|
}
|
package/src/root.jsx
CHANGED
|
@@ -4,7 +4,7 @@ import { withStyles } from '@material-ui/core/styles';
|
|
|
4
4
|
import { select, mouse } from 'd3-selection';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { GraphPropsType } from './types';
|
|
7
|
-
import { color } from '@pie-lib/render-ui';
|
|
7
|
+
import { color, Readable } from '@pie-lib/render-ui';
|
|
8
8
|
import EditableHtml from '@pie-lib/editable-html';
|
|
9
9
|
import cn from 'classnames';
|
|
10
10
|
|
|
@@ -12,10 +12,14 @@ export class Root extends React.Component {
|
|
|
12
12
|
static propTypes = {
|
|
13
13
|
title: PropTypes.string,
|
|
14
14
|
children: ChildrenType,
|
|
15
|
+
disabledTitle: PropTypes.bool,
|
|
15
16
|
graphProps: GraphPropsType.isRequired,
|
|
17
|
+
onChangeTitle: PropTypes.func,
|
|
16
18
|
onMouseMove: PropTypes.func,
|
|
17
19
|
classes: PropTypes.object.isRequired,
|
|
20
|
+
showLabels: PropTypes.bool,
|
|
18
21
|
showTitle: PropTypes.bool,
|
|
22
|
+
showPixelGuides: PropTypes.bool,
|
|
19
23
|
rootRef: PropTypes.func
|
|
20
24
|
};
|
|
21
25
|
|
|
@@ -56,6 +60,8 @@ export class Root extends React.Component {
|
|
|
56
60
|
children,
|
|
57
61
|
classes,
|
|
58
62
|
onChangeTitle,
|
|
63
|
+
showLabels,
|
|
64
|
+
showPixelGuides,
|
|
59
65
|
showTitle,
|
|
60
66
|
title,
|
|
61
67
|
rootRef
|
|
@@ -65,21 +71,39 @@ export class Root extends React.Component {
|
|
|
65
71
|
domain,
|
|
66
72
|
range
|
|
67
73
|
} = graphProps;
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
74
|
+
|
|
75
|
+
const padding = showLabels ? 70 : 40;
|
|
76
|
+
const extraPadding = showLabels ? 16 : 40;
|
|
77
|
+
const finalWidth = width + padding * 2 + (domain.padding || 0) * 2 + extraPadding;
|
|
78
|
+
const finalHeight = height + padding * 2 + (range.padding || 0) * 2;
|
|
72
79
|
|
|
73
80
|
const activeTitlePlugins = [
|
|
74
81
|
'bold',
|
|
75
82
|
'italic',
|
|
76
83
|
'underline',
|
|
77
|
-
'strikethrough'
|
|
84
|
+
'strikethrough',
|
|
85
|
+
'math'
|
|
78
86
|
// 'languageCharacters'
|
|
79
87
|
];
|
|
80
88
|
|
|
89
|
+
const nbOfVerticalLines = parseInt(width / 100);
|
|
90
|
+
const nbOfHorizontalLines = parseInt(height / 100);
|
|
91
|
+
const sideGridlinesPadding = parseInt(height % 100);
|
|
92
|
+
|
|
81
93
|
return (
|
|
82
94
|
<div className={classes.root}>
|
|
95
|
+
{showPixelGuides && (
|
|
96
|
+
<div className={classes.topPixelGuides}>
|
|
97
|
+
{[...Array(nbOfVerticalLines + 1).keys()].map(value => (
|
|
98
|
+
<Readable false key={`top-guide-${value}`}>
|
|
99
|
+
<div className={classes.topPixelIndicator}>
|
|
100
|
+
<div>{value * 100}px</div>
|
|
101
|
+
<div>|</div>
|
|
102
|
+
</div>
|
|
103
|
+
</Readable>
|
|
104
|
+
))}
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
83
107
|
{showTitle && (
|
|
84
108
|
<EditableHtml
|
|
85
109
|
className={cn(
|
|
@@ -96,20 +120,31 @@ export class Root extends React.Component {
|
|
|
96
120
|
activePlugins={activeTitlePlugins}
|
|
97
121
|
/>
|
|
98
122
|
)}
|
|
99
|
-
<
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
rootRef
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
123
|
+
<div className={classes.wrapper}>
|
|
124
|
+
<svg width={finalWidth} height={finalHeight} className={classes.svg}>
|
|
125
|
+
<g
|
|
126
|
+
ref={r => {
|
|
127
|
+
this.g = r;
|
|
128
|
+
if (rootRef) {
|
|
129
|
+
rootRef(r);
|
|
130
|
+
}
|
|
131
|
+
}}
|
|
132
|
+
className={classes.graphBox}
|
|
133
|
+
transform={`translate(${padding}, ${padding})`}
|
|
134
|
+
>
|
|
135
|
+
{children}
|
|
136
|
+
</g>
|
|
137
|
+
</svg>
|
|
138
|
+
{showPixelGuides && (
|
|
139
|
+
<div className={classes.sidePixelGuides} style={{ paddingTop: sideGridlinesPadding }}>
|
|
140
|
+
{[...Array(nbOfHorizontalLines + 1).keys()].reverse().map(value => (
|
|
141
|
+
<Readable false key={`top-guide-${value}`}>
|
|
142
|
+
<div className={classes.sidePixelIndicator}>━ {value * 100}px</div>
|
|
143
|
+
</Readable>
|
|
144
|
+
))}
|
|
145
|
+
</div>
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
113
148
|
</div>
|
|
114
149
|
);
|
|
115
150
|
}
|
|
@@ -120,6 +155,9 @@ const styles = theme => ({
|
|
|
120
155
|
color: color.text(),
|
|
121
156
|
backgroundColor: color.background()
|
|
122
157
|
},
|
|
158
|
+
wrapper: {
|
|
159
|
+
display: 'flex'
|
|
160
|
+
},
|
|
123
161
|
svg: {},
|
|
124
162
|
graphBox: {
|
|
125
163
|
cursor: 'pointer',
|
|
@@ -128,11 +166,43 @@ const styles = theme => ({
|
|
|
128
166
|
graphTitle: {
|
|
129
167
|
color: color.text(),
|
|
130
168
|
fontSize: theme.typography.fontSize + 2,
|
|
131
|
-
padding: '
|
|
169
|
+
padding: '12px 4px 0',
|
|
132
170
|
textAlign: 'center'
|
|
133
171
|
},
|
|
134
172
|
disabledTitle: {
|
|
135
173
|
pointerEvents: 'none'
|
|
174
|
+
},
|
|
175
|
+
topPixelGuides: {
|
|
176
|
+
display: 'flex',
|
|
177
|
+
paddingTop: '6px',
|
|
178
|
+
marginLeft: '10px'
|
|
179
|
+
},
|
|
180
|
+
topPixelIndicator: {
|
|
181
|
+
color: color.primaryLight(),
|
|
182
|
+
display: 'flex',
|
|
183
|
+
flexDirection: 'column',
|
|
184
|
+
alignItems: 'center',
|
|
185
|
+
width: '100px',
|
|
186
|
+
pointerEvents: 'none',
|
|
187
|
+
userSelect: 'none'
|
|
188
|
+
},
|
|
189
|
+
sidePixelGuides: {
|
|
190
|
+
width: '70px',
|
|
191
|
+
display: 'flex',
|
|
192
|
+
flexDirection: 'column',
|
|
193
|
+
marginTop: '40px',
|
|
194
|
+
marginRight: '6px'
|
|
195
|
+
},
|
|
196
|
+
sidePixelIndicator: {
|
|
197
|
+
color: color.primaryLight(),
|
|
198
|
+
textAlign: 'right',
|
|
199
|
+
height: '20px',
|
|
200
|
+
pointerEvents: 'none',
|
|
201
|
+
userSelect: 'none',
|
|
202
|
+
|
|
203
|
+
'&:not(:last-child)': {
|
|
204
|
+
marginBottom: '80px'
|
|
205
|
+
}
|
|
136
206
|
}
|
|
137
207
|
});
|
|
138
208
|
|