ag-common 0.0.761 → 0.0.762

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.
@@ -77,12 +77,10 @@ const LegendX = ({ data, lt, tt, colours, style, }) => {
77
77
  tt,
78
78
  }).part;
79
79
  const xs = data.map((a) => a.x);
80
- const ys = data.map((a) => a.y);
81
80
  const minX = Math.min(...xs);
82
81
  const maxX = Math.max(...xs);
83
- const maxY = Math.max(...ys);
84
82
  const itemsRaw = [{ v: minX, group: 0 }];
85
- const gc = 8;
83
+ const gc = 4;
86
84
  const gap = (maxX - minX) / gc;
87
85
  if (gap > common_1.twelveHMs) {
88
86
  for (let a = 1; a < gc; a += 1) {
@@ -91,13 +89,16 @@ const LegendX = ({ data, lt, tt, colours, style, }) => {
91
89
  }
92
90
  itemsRaw.push({ v: maxX, group: 0 });
93
91
  const items = itemsRaw.map((d) => ({ v: lt(d.v), group: d.group }));
94
- const ch = maxY.toString().length + 1;
95
- return (react_1.default.createElement(Base, { style: Object.assign(Object.assign({}, style), { marginLeft: 'auto', width: `calc(100% - ${ch}ch)` }) },
92
+ return (react_1.default.createElement(Base, { style: Object.assign(Object.assign({}, style), { width: 'calc(100% - 2.5rem)', marginLeft: '2.5rem' }) },
96
93
  react_1.default.createElement(Bar, null,
97
94
  react_1.default.createElement(Line, { style: { backgroundColor: style.color } }),
98
95
  react_1.default.createElement(Numbers, null, items.map((i, i2) => (react_1.default.createElement("span", {
99
96
  // eslint-disable-next-line react/no-array-index-key
100
- key: i.v + i2, "data-group": i.group, style: { backgroundColor: style.backgroundColor } }, i.v))))),
97
+ key: i.v + i2, "data-group": i.group, style: {
98
+ backgroundColor: style.backgroundColor,
99
+ writingMode: 'vertical-rl',
100
+ textOrientation: 'mixed',
101
+ } }, i.v))))),
101
102
  legendItems.length > 1 && (react_1.default.createElement(Items, null, legendItems.map((k) => (react_1.default.createElement(Item, { key: k.name },
102
103
  react_1.default.createElement(Col, { style: { backgroundColor: k.colour } }),
103
104
  k.name)))))));
@@ -33,8 +33,7 @@ const LegendY = ({ data, style, }) => {
33
33
  items.push(Math.floor(items[a - 1] + gap));
34
34
  }
35
35
  items.push(maxY);
36
- const ch = maxY.toString().length;
37
- return (react_1.default.createElement(Base, { style: Object.assign(Object.assign({}, style), { maxWidth: `${ch}ch`, paddingRight: '1ch', flexBasis: '1%' }) },
36
+ return (react_1.default.createElement(Base, { style: Object.assign(Object.assign({}, style), { width: '2.5rem', paddingRight: '1ch' }) },
38
37
  react_1.default.createElement(Numbers, null, items.map((i, i2) => (react_1.default.createElement("span", {
39
38
  // eslint-disable-next-line react/no-array-index-key
40
39
  key: i + i2, style: {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.761",
2
+ "version": "0.0.762",
3
3
  "name": "ag-common",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",