@pie-lib/graphing-module 1.9.0 → 1.9.2

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/module/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import {_dll_prop_types, _dll_pie_lib__render_ui, _dll_material_ui__core_styles, _dll_react, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_material_ui__core, _dll_material_ui__core_styles_color_manipulator, _dll_material_ui__icons} from "../../shared-module@^1.5.18/module/index.js";
2
- import {_dll_pie_lib__editable_html} from "../../editable-html-module@^3.2.0/module/index.js";
3
- import {_dll_pie_lib__drag} from "../../drag-module@^1.0.70/module/index.js";
4
- import {_dll_pie_lib__config_ui} from "../../config-module@^2.1.18/module/index.js";
1
+ import {_dll_prop_types, _dll_pie_lib__render_ui, _dll_material_ui__core_styles, _dll_react, _dll_classnames, _dll_react_dom, _dll_lodash, _dll_debug, _dll_material_ui__core, _dll_material_ui__core_styles_color_manipulator, _dll_material_ui__icons} from "../../shared-module@^1.5.20/module/index.js";
2
+ import {_dll_pie_lib__editable_html} from "../../editable-html-module@^3.2.2/module/index.js";
3
+ import {_dll_pie_lib__drag} from "../../drag-module@^1.0.72/module/index.js";
4
+ import {_dll_pie_lib__config_ui} from "../../config-module@^2.1.20/module/index.js";
5
5
  const PropTypes$D = _dll_prop_types;
6
6
  const BaseDomainRangeType = {
7
7
  min: PropTypes$D.number.isRequired,
@@ -828,14 +828,15 @@ const {withStyles: withStyles$m} = _dll_material_ui__core_styles;
828
828
  const EditableHtml$2 = _dll_pie_lib__editable_html;
829
829
  const _jsxFileName$x = "/home/circleci/repo/packages/plot/src/label.jsx";
830
830
  const LabelComponent = props => {
831
- const {classes, disabledLabel, graphHeight, graphWidth, isChartBottomLabel, isChartLeftLabel, placeholder, text, side, onChange} = props;
831
+ const {classes, disabledLabel, graphHeight, graphWidth, isChartBottomLabel, isDefineChartBottomLabel, isChartLeftLabel, isDefineChartLeftLabel, placeholder, text, side, onChange} = props;
832
832
  const [rotatedToHorizontal, setRotatedToHorizontal] = useState$2(false);
833
833
  const activePlugins = ['bold', 'italic', 'underline', 'strikethrough', 'math'];
834
- const chartValue = side === 'left' && isChartLeftLabel && graphHeight - 148;
834
+ const isChart = isChartBottomLabel || isChartLeftLabel || isDefineChartBottomLabel || isDefineChartLeftLabel;
835
+ const chartValue = side === 'left' && isDefineChartLeftLabel && graphHeight - 220;
835
836
  const defaultStyle = {
836
837
  width: chartValue || (side === 'left' || side === 'right' ? graphHeight - 8 : graphWidth - 8),
837
- top: chartValue || side === 'left' && `${graphHeight - 8}px` || side === 'bottom' && `${graphHeight - 90}px` || 0,
838
- left: side === 'right' && `${graphWidth - 8}px` || (isChartLeftLabel || isChartBottomLabel) && '50px' || 0
838
+ top: chartValue || isChartLeftLabel && `${graphHeight - 70}px` || side === 'left' && `${graphHeight - 8}px` || isChartBottomLabel && `${graphHeight - 40}px` || side === 'bottom' && `${graphHeight - 90}px` || 0,
839
+ left: side === 'right' && `${graphWidth - 8}px` || (isDefineChartLeftLabel || isDefineChartBottomLabel) && '40px' || isChartBottomLabel && '-10px' || 0
839
840
  };
840
841
  const rotatedStyle = {
841
842
  width: graphWidth - 8,
@@ -848,21 +849,21 @@ const LabelComponent = props => {
848
849
  __self: undefined,
849
850
  __source: {
850
851
  fileName: _jsxFileName$x,
851
- lineNumber: 54
852
+ lineNumber: 62
852
853
  }
853
854
  }, React$F.createElement('div', {
854
- className: cn$4(classes.axisLabel, {
855
+ className: cn$4(isChart ? classes.chartLabel : classes.axisLabel, {
855
856
  [classes.rotateLeftLabel]: side === 'left' && !rotatedToHorizontal,
856
857
  [classes.rotateRightLabel]: side === 'right' && !rotatedToHorizontal,
857
858
  [classes.editLabel]: rotatedToHorizontal,
858
- [classes.customBottom]: isChartBottomLabel
859
+ [classes.customBottom]: isChartBottomLabel || isDefineChartBottomLabel
859
860
  }),
860
861
  style: rotatedToHorizontal ? rotatedStyle : defaultStyle,
861
862
  onClick: rotateLabel,
862
863
  __self: undefined,
863
864
  __source: {
864
865
  fileName: _jsxFileName$x,
865
- lineNumber: 55
866
+ lineNumber: 63
866
867
  }
867
868
  }, disabledLabel ? React$F.createElement('div', {
868
869
  className: classes.disabledLabel,
@@ -872,7 +873,7 @@ const LabelComponent = props => {
872
873
  __self: undefined,
873
874
  __source: {
874
875
  fileName: _jsxFileName$x,
875
- lineNumber: 66
876
+ lineNumber: 74
876
877
  }
877
878
  }) : React$F.createElement(EditableHtml$2, {
878
879
  markup: text || '',
@@ -888,7 +889,7 @@ const LabelComponent = props => {
888
889
  __self: undefined,
889
890
  __source: {
890
891
  fileName: _jsxFileName$x,
891
- lineNumber: 68
892
+ lineNumber: 76
892
893
  }
893
894
  })));
894
895
  };
@@ -902,6 +903,12 @@ var Label$1 = withStyles$m(theme => ({
902
903
  margin: '4px',
903
904
  padding: '4px 0'
904
905
  },
906
+ chartLabel: {
907
+ fontSize: theme.typography.fontSize + 2,
908
+ textAlign: 'center',
909
+ margin: '4px',
910
+ padding: '4px 0'
911
+ },
905
912
  disabledLabel: {
906
913
  pointerEvents: 'none',
907
914
  width: '100%'
@@ -1029,7 +1036,7 @@ class Root$1 extends React$E.Component {
1029
1036
  const finalWidth = width + leftPadding * 2 + (domain.padding || 0) * 2;
1030
1037
  const finalHeight = height + topPadding * 2 + (range.padding || 0) * 2;
1031
1038
  const activeTitlePlugins = ['bold', 'italic', 'underline', 'strikethrough', 'math'];
1032
- const actualHeight = defineChart && showPixelGuides ? height - 150 : height;
1039
+ const actualHeight = defineChart && showPixelGuides ? height - 160 : height;
1033
1040
  const nbOfVerticalLines = parseInt(width / 100);
1034
1041
  const nbOfHorizontalLines = parseInt(actualHeight / 100);
1035
1042
  const sideGridlinesPadding = parseInt(actualHeight % 100);
@@ -1078,7 +1085,10 @@ class Root$1 extends React$E.Component {
1078
1085
  lineNumber: 131
1079
1086
  }
1080
1087
  }, "|"))))), showTitle && (disabledTitle ? React$E.createElement('div', {
1081
- className: cn$3(classes.graphTitle, classes.disabledTitle),
1088
+ style: isChart && ({
1089
+ width: finalWidth
1090
+ }),
1091
+ className: cn$3(isChart ? classes.chartTitle : classes.graphTitle, classes.disabledTitle),
1082
1092
  dangerouslySetInnerHTML: {
1083
1093
  __html: title || ''
1084
1094
  },
@@ -1088,9 +1098,12 @@ class Root$1 extends React$E.Component {
1088
1098
  lineNumber: 139
1089
1099
  }
1090
1100
  }) : React$E.createElement(EditableHtml$1, {
1101
+ style: isChart && ({
1102
+ width: finalWidth
1103
+ }),
1091
1104
  className: cn$3({
1092
1105
  [classes.rightMargin]: showPixelGuides
1093
- }, classes.graphTitle),
1106
+ }, isChart ? classes.chartTitle : classes.graphTitle),
1094
1107
  markup: title || '',
1095
1108
  onChange: onChangeTitle,
1096
1109
  placeholder: defineChart && titlePlaceholder || !disabledTitle && 'Click here to add a title for this graph',
@@ -1102,7 +1115,7 @@ class Root$1 extends React$E.Component {
1102
1115
  __self: this,
1103
1116
  __source: {
1104
1117
  fileName: _jsxFileName$w,
1105
- lineNumber: 144
1118
+ lineNumber: 152
1106
1119
  }
1107
1120
  })), showLabels && !isChart && React$E.createElement(Label$1, {
1108
1121
  side: "top",
@@ -1115,14 +1128,14 @@ class Root$1 extends React$E.Component {
1115
1128
  __self: this,
1116
1129
  __source: {
1117
1130
  fileName: _jsxFileName$w,
1118
- lineNumber: 158
1131
+ lineNumber: 174
1119
1132
  }
1120
1133
  }), React$E.createElement('div', {
1121
1134
  className: classes.wrapper,
1122
1135
  __self: this,
1123
1136
  __source: {
1124
1137
  fileName: _jsxFileName$w,
1125
- lineNumber: 168
1138
+ lineNumber: 184
1126
1139
  }
1127
1140
  }, showLabels && React$E.createElement(Label$1, {
1128
1141
  side: "left",
@@ -1131,12 +1144,13 @@ class Root$1 extends React$E.Component {
1131
1144
  placeholder: _optionalChain$1([labelsPlaceholders, 'optionalAccess', _2 => _2.left]),
1132
1145
  graphHeight: finalHeight,
1133
1146
  graphWidth: finalWidth,
1134
- isChartLeftLabel: isChart && defineChart,
1147
+ isChartLeftLabel: isChart && !defineChart,
1148
+ isDefineChartLeftLabel: isChart && defineChart,
1135
1149
  onChange: value => this.onChangeLabel(value, 'left'),
1136
1150
  __self: this,
1137
1151
  __source: {
1138
1152
  fileName: _jsxFileName$w,
1139
- lineNumber: 170
1153
+ lineNumber: 186
1140
1154
  }
1141
1155
  }), React$E.createElement('svg', {
1142
1156
  width: finalWidth,
@@ -1145,7 +1159,7 @@ class Root$1 extends React$E.Component {
1145
1159
  __self: this,
1146
1160
  __source: {
1147
1161
  fileName: _jsxFileName$w,
1148
- lineNumber: 181
1162
+ lineNumber: 198
1149
1163
  }
1150
1164
  }, React$E.createElement('g', {
1151
1165
  ref: r => {
@@ -1159,7 +1173,7 @@ class Root$1 extends React$E.Component {
1159
1173
  __self: this,
1160
1174
  __source: {
1161
1175
  fileName: _jsxFileName$w,
1162
- lineNumber: 186
1176
+ lineNumber: 203
1163
1177
  }
1164
1178
  }, children)), showLabels && !isChart && React$E.createElement(Label$1, {
1165
1179
  side: "right",
@@ -1172,7 +1186,7 @@ class Root$1 extends React$E.Component {
1172
1186
  __self: this,
1173
1187
  __source: {
1174
1188
  fileName: _jsxFileName$w,
1175
- lineNumber: 200
1189
+ lineNumber: 217
1176
1190
  }
1177
1191
  }), showPixelGuides && React$E.createElement('div', {
1178
1192
  className: classes.sidePixelGuides,
@@ -1183,7 +1197,7 @@ class Root$1 extends React$E.Component {
1183
1197
  __self: this,
1184
1198
  __source: {
1185
1199
  fileName: _jsxFileName$w,
1186
- lineNumber: 211
1200
+ lineNumber: 228
1187
1201
  }
1188
1202
  }, [...Array(nbOfHorizontalLines + 1).keys()].reverse().map(value => React$E.createElement(Readable$2, {
1189
1203
  false: true,
@@ -1191,14 +1205,14 @@ class Root$1 extends React$E.Component {
1191
1205
  __self: this,
1192
1206
  __source: {
1193
1207
  fileName: _jsxFileName$w,
1194
- lineNumber: 219
1208
+ lineNumber: 236
1195
1209
  }
1196
1210
  }, React$E.createElement('div', {
1197
1211
  className: classes.sidePixelIndicator,
1198
1212
  __self: this,
1199
1213
  __source: {
1200
1214
  fileName: _jsxFileName$w,
1201
- lineNumber: 220
1215
+ lineNumber: 237
1202
1216
  }
1203
1217
  }, "━ ", value * 100, "px"))))), showLabels && React$E.createElement(Label$1, {
1204
1218
  side: "bottom",
@@ -1207,12 +1221,13 @@ class Root$1 extends React$E.Component {
1207
1221
  placeholder: _optionalChain$1([labelsPlaceholders, 'optionalAccess', _4 => _4.bottom]),
1208
1222
  graphHeight: finalHeight,
1209
1223
  graphWidth: finalWidth,
1210
- isChartBottomLabel: isChart && defineChart,
1224
+ isChartBottomLabel: isChart && !defineChart,
1225
+ isDefineChartBottomLabel: isChart && defineChart,
1211
1226
  onChange: value => this.onChangeLabel(value, 'bottom'),
1212
1227
  __self: this,
1213
1228
  __source: {
1214
1229
  fileName: _jsxFileName$w,
1215
- lineNumber: 227
1230
+ lineNumber: 244
1216
1231
  }
1217
1232
  }));
1218
1233
  }
@@ -1248,6 +1263,12 @@ const styles$9 = theme => ({
1248
1263
  padding: '12px 4px 0',
1249
1264
  textAlign: 'center'
1250
1265
  },
1266
+ chartTitle: {
1267
+ color: color$i.text(),
1268
+ fontSize: theme.typography.fontSize + 4,
1269
+ padding: '12px 4px 0',
1270
+ textAlign: 'center'
1271
+ },
1251
1272
  disabledTitle: {
1252
1273
  pointerEvents: 'none'
1253
1274
  },
@@ -11642,13 +11663,25 @@ class RawBp extends React$n.Component {
11642
11663
  lineNumber: 45
11643
11664
  }
11644
11665
  }, React$n.createElement('circle', {
11666
+ style: {
11667
+ fill: 'transparent'
11668
+ },
11669
+ r: r * 2,
11670
+ cx: 2 * scale.x(x),
11671
+ cy: 2 * scale.y(y),
11672
+ __self: this,
11673
+ __source: {
11674
+ fileName: _jsxFileName$n,
11675
+ lineNumber: 56
11676
+ }
11677
+ }), React$n.createElement('circle', {
11645
11678
  r: r,
11646
11679
  cx: scale.x(x),
11647
11680
  cy: scale.y(y),
11648
11681
  __self: this,
11649
11682
  __source: {
11650
11683
  fileName: _jsxFileName$n,
11651
- lineNumber: 56
11684
+ lineNumber: 57
11652
11685
  }
11653
11686
  }), labelNode && coordinatesOnHover && showCoordinates && ReactDOM$4.createPortal(React$n.createElement(CoordinatesLabel$1, {
11654
11687
  graphProps: graphProps,
@@ -11657,7 +11690,7 @@ class RawBp extends React$n.Component {
11657
11690
  __self: this,
11658
11691
  __source: {
11659
11692
  fileName: _jsxFileName$n,
11660
- lineNumber: 61
11693
+ lineNumber: 62
11661
11694
  }
11662
11695
  }), labelNode));
11663
11696
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/graphing-module",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "mappings": {
5
5
  "@pie-lib/plot": "_dll_pie_lib__plot",
6
6
  "@pie-lib/graphing": "_dll_pie_lib__graphing",
@@ -10,10 +10,10 @@
10
10
  "versionInfo": {
11
11
  "data": {
12
12
  "@pie-lib/plot": {
13
- "version": "2.5.0"
13
+ "version": "2.5.1"
14
14
  },
15
15
  "@pie-lib/graphing": {
16
- "version": "2.11.0"
16
+ "version": "2.11.1"
17
17
  },
18
18
  "d3-scale": {
19
19
  "version": "2.2.2"
@@ -22,24 +22,24 @@
22
22
  "version": "1.4.2"
23
23
  }
24
24
  },
25
- "hash": "9bead60a43127f1232f4ac87ffa004e649c3f21c"
25
+ "hash": "3213371d0937190b266565a534761516aeea207a"
26
26
  },
27
27
  "modules": [
28
28
  {
29
29
  "name": "@pie-lib/shared-module",
30
- "version": "^1.5.18"
30
+ "version": "^1.5.20"
31
31
  },
32
32
  {
33
33
  "name": "@pie-lib/editable-html-module",
34
- "version": "^3.2.0"
34
+ "version": "^3.2.2"
35
35
  },
36
36
  {
37
37
  "name": "@pie-lib/drag-module",
38
- "version": "^1.0.70"
38
+ "version": "^1.0.72"
39
39
  },
40
40
  {
41
41
  "name": "@pie-lib/config-module",
42
- "version": "^2.1.18"
42
+ "version": "^2.1.20"
43
43
  }
44
44
  ],
45
45
  "isLocal": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/graphing-module",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "module": "module/index.js",
5
5
  "repository": "pie-framework/pie-lib",
6
6
  "publishConfig": {