@pie-lib/charting 5.1.4 → 5.1.7

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/src/chart.jsx CHANGED
@@ -47,6 +47,7 @@ export class Chart extends React.Component {
47
47
  title: PropTypes.string,
48
48
  onDataChange: PropTypes.func,
49
49
  addCategoryEnabled: PropTypes.bool,
50
+ showPixelGuides: PropTypes.bool,
50
51
  categoryDefaultLabel: PropTypes.string,
51
52
  defineChart: PropTypes.bool,
52
53
  theme: PropTypes.object
@@ -140,7 +141,16 @@ export class Chart extends React.Component {
140
141
  };
141
142
 
142
143
  render() {
143
- const { classes, className, domain, range, size, title, addCategoryEnabled } = this.props;
144
+ const {
145
+ classes,
146
+ className,
147
+ domain,
148
+ range,
149
+ size,
150
+ title,
151
+ addCategoryEnabled,
152
+ showPixelGuides
153
+ } = this.props;
144
154
  let { chartType } = this.props;
145
155
 
146
156
  const defineChart = this.props.defineChart || false;
@@ -186,7 +196,7 @@ export class Chart extends React.Component {
186
196
  rootCommon.graphProps.size.height += top + increaseHeight;
187
197
 
188
198
  return (
189
- <div className={classNames(classes.class, className)}>
199
+ <div className={classNames(classes.chart, className)}>
190
200
  <div className={classes.controls}>
191
201
  <ToolMenu
192
202
  className={classes.toolMenu}
@@ -194,7 +204,14 @@ export class Chart extends React.Component {
194
204
  addCategory={() => this.addCategory(correctValues.range)}
195
205
  />
196
206
  </div>
197
- <Root title={title} classes={classes} rootRef={r => (this.rootNode = r)} {...rootCommon}>
207
+ <Root
208
+ title={title}
209
+ thisIsChart={defineChart}
210
+ showPixelGuides={showPixelGuides}
211
+ classes={classes}
212
+ rootRef={r => (this.rootNode = r)}
213
+ {...rootCommon}
214
+ >
198
215
  <ChartGrid
199
216
  {...common}
200
217
  xBand={xBand}
@@ -233,8 +250,12 @@ const styles = theme => ({
233
250
  graphBox: {
234
251
  transform: 'translate(60px, 35px)'
235
252
  },
253
+ chart: {
254
+ display: 'flex',
255
+ flexDirection: 'column',
256
+ width: 'min-content'
257
+ },
236
258
  controls: {
237
- width: 'inherit',
238
259
  display: 'flex',
239
260
  justifyContent: 'space-between',
240
261
  padding: theme.spacing.unit,
@@ -244,12 +265,6 @@ const styles = theme => ({
244
265
  borderLeft: `solid 1px ${color.primaryDark()}`,
245
266
  borderRight: `solid 1px ${color.primaryDark()}`
246
267
  },
247
- root: {
248
- overflow: 'hidden'
249
- },
250
- svg: {
251
- overflow: 'visible'
252
- },
253
268
  toolMenu: {
254
269
  minHeight: '36px'
255
270
  }
@@ -33,6 +33,7 @@ export class RawDragHandle extends React.Component {
33
33
  ...rest
34
34
  } = this.props;
35
35
  const { scale } = graphProps;
36
+
36
37
  return (
37
38
  <svg
38
39
  x={x}
@@ -107,6 +108,7 @@ export const D = gridDraggable({
107
108
  //TODO: should be in grid-draggable, if axis is y delta.x should always be 0.
108
109
  delta.x = 0;
109
110
  const newPoint = utils.point(props).add(utils.point(delta));
111
+
110
112
  return newPoint.y;
111
113
  },
112
114
  bounds: (props, { domain, range }) => {
@@ -16,8 +16,7 @@ const styles = theme => ({
16
16
  color: color.primaryDark(),
17
17
  '&.correct': correct('color'),
18
18
  '&.incorrect': incorrect('color'),
19
- '&.disabled': disabled('color'),
20
- backgroundColor: 'transparent !important'
19
+ '&.disabled': { ...disabled('color'), backgroundColor: 'transparent !important' }
21
20
  }
22
21
  });
23
22