@perses-dev/components 0.0.0-snapshot-datasource-create-transform-e9f8493 → 0.0.0-snapshot-color-palette-gen-test-0ebddd6

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.
Files changed (82) hide show
  1. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
  2. package/dist/InfoTooltip/InfoTooltip.js +8 -5
  3. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  4. package/dist/Legend/CompactLegend.d.ts +3 -1
  5. package/dist/Legend/CompactLegend.d.ts.map +1 -1
  6. package/dist/Legend/CompactLegend.js +3 -1
  7. package/dist/Legend/CompactLegend.js.map +1 -1
  8. package/dist/Legend/Legend.d.ts +10 -1
  9. package/dist/Legend/Legend.d.ts.map +1 -1
  10. package/dist/Legend/Legend.js +24 -7
  11. package/dist/Legend/Legend.js.map +1 -1
  12. package/dist/Legend/ListLegend.d.ts +14 -4
  13. package/dist/Legend/ListLegend.d.ts.map +1 -1
  14. package/dist/Legend/ListLegend.js +111 -15
  15. package/dist/Legend/ListLegend.js.map +1 -1
  16. package/dist/Legend/ListLegendItem.d.ts +14 -2
  17. package/dist/Legend/ListLegendItem.d.ts.map +1 -1
  18. package/dist/Legend/ListLegendItem.js +31 -3
  19. package/dist/Legend/ListLegendItem.js.map +1 -1
  20. package/dist/LineChart/LineChart.d.ts +8 -2
  21. package/dist/LineChart/LineChart.d.ts.map +1 -1
  22. package/dist/LineChart/LineChart.js +11 -4
  23. package/dist/LineChart/LineChart.js.map +1 -1
  24. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +4 -2
  25. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
  26. package/dist/OptionsEditorLayout/OptionsEditorControl.js +34 -5
  27. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  28. package/dist/StatChart/StatChart.d.ts +1 -0
  29. package/dist/StatChart/StatChart.d.ts.map +1 -1
  30. package/dist/StatChart/StatChart.js +2 -2
  31. package/dist/StatChart/StatChart.js.map +1 -1
  32. package/dist/ThresholdsEditor/ThresholdInput.d.ts +3 -1
  33. package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
  34. package/dist/ThresholdsEditor/ThresholdInput.js +9 -3
  35. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  36. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  37. package/dist/ThresholdsEditor/ThresholdsEditor.js +57 -35
  38. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  39. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
  40. package/dist/TimeSeriesTooltip/SeriesInfo.js +4 -4
  41. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  42. package/dist/TimeSeriesTooltip/tooltip-model.d.ts +1 -9
  43. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
  44. package/dist/TimeSeriesTooltip/tooltip-model.js +3 -7
  45. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  46. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
  47. package/dist/TimeSeriesTooltip/utils.js +9 -6
  48. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  49. package/dist/cjs/InfoTooltip/InfoTooltip.js +8 -5
  50. package/dist/cjs/Legend/Legend.js +24 -7
  51. package/dist/cjs/Legend/ListLegend.js +106 -13
  52. package/dist/cjs/Legend/ListLegendItem.js +30 -2
  53. package/dist/cjs/LineChart/LineChart.js +11 -4
  54. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +33 -4
  55. package/dist/cjs/StatChart/StatChart.js +2 -2
  56. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +8 -2
  57. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +56 -34
  58. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +4 -4
  59. package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +3 -7
  60. package/dist/cjs/TimeSeriesTooltip/utils.js +9 -6
  61. package/dist/cjs/model/units/bytes.js +33 -39
  62. package/dist/cjs/model/units/decimal.js +15 -26
  63. package/dist/cjs/model/units/time.js +2 -3
  64. package/dist/cjs/utils/theme-gen.js +13 -5
  65. package/dist/model/legend.d.ts +1 -1
  66. package/dist/model/legend.d.ts.map +1 -1
  67. package/dist/model/legend.js.map +1 -1
  68. package/dist/model/units/bytes.d.ts +1 -5
  69. package/dist/model/units/bytes.d.ts.map +1 -1
  70. package/dist/model/units/bytes.js +28 -42
  71. package/dist/model/units/bytes.js.map +1 -1
  72. package/dist/model/units/decimal.d.ts +1 -12
  73. package/dist/model/units/decimal.d.ts.map +1 -1
  74. package/dist/model/units/decimal.js +14 -30
  75. package/dist/model/units/decimal.js.map +1 -1
  76. package/dist/model/units/time.d.ts.map +1 -1
  77. package/dist/model/units/time.js +2 -3
  78. package/dist/model/units/time.js.map +1 -1
  79. package/dist/utils/theme-gen.d.ts.map +1 -1
  80. package/dist/utils/theme-gen.js +13 -5
  81. package/dist/utils/theme-gen.js.map +1 -1
  82. package/package.json +11 -5
@@ -83,7 +83,10 @@ function _interopRequireWildcard(obj, nodeInterop) {
83
83
  _components.LegendComponent,
84
84
  _renderers.CanvasRenderer
85
85
  ]);
86
- function LineChart({ height , data , yAxis , unit , grid , legend , onDataZoom , onDoubleClick }) {
86
+ function LineChart({ height , data , yAxis , unit , grid , legend , tooltipConfig ={
87
+ wrapLabels: true
88
+ } , onDataZoom , onDoubleClick , __experimentalEChartsOptionsOverride }) {
89
+ var ref;
87
90
  const chartsTheme = (0, _chartsThemeProvider.useChartsTheme)();
88
91
  const chartRef = (0, _react.useRef)();
89
92
  const [showTooltip, setShowTooltip] = (0, _react.useState)(true);
@@ -177,6 +180,9 @@ function LineChart({ height , data , yAxis , unit , grid , legend , onDataZoom ,
177
180
  grid,
178
181
  legend
179
182
  };
183
+ if (__experimentalEChartsOptionsOverride) {
184
+ return __experimentalEChartsOptionsOverride(option);
185
+ }
180
186
  return option;
181
187
  }, [
182
188
  data,
@@ -185,7 +191,8 @@ function LineChart({ height , data , yAxis , unit , grid , legend , onDataZoom ,
185
191
  grid,
186
192
  legend,
187
193
  noDataOption,
188
- timeZone
194
+ timeZone,
195
+ __experimentalEChartsOptionsOverride
189
196
  ]);
190
197
  return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
191
198
  sx: {
@@ -215,10 +222,10 @@ function LineChart({ height , data , yAxis , unit , grid , legend , onDataZoom ,
215
222
  },
216
223
  onDoubleClick: handleOnDoubleClick,
217
224
  children: [
218
- showTooltip === true && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_timeSeriesTooltip.TimeSeriesTooltip, {
225
+ showTooltip === true && ((ref = option.tooltip) === null || ref === void 0 ? void 0 : ref.showContent) === false && tooltipConfig.hidden !== true && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_timeSeriesTooltip.TimeSeriesTooltip, {
219
226
  chartRef: chartRef,
220
227
  chartData: data,
221
- wrapLabels: true,
228
+ wrapLabels: tooltipConfig.wrapLabels,
222
229
  pinTooltip: pinTooltip,
223
230
  unit: unit
224
231
  }),
@@ -21,13 +21,15 @@ Object.defineProperty(exports, "OptionsEditorControl", {
21
21
  const _jsxRuntime = require("react/jsx-runtime");
22
22
  const _material = require("@mui/material");
23
23
  const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
24
+ const _informationOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/InformationOutline"));
24
25
  const _utils = require("../utils");
26
+ const _infoTooltip = require("../InfoTooltip");
25
27
  function _interopRequireDefault(obj) {
26
28
  return obj && obj.__esModule ? obj : {
27
29
  default: obj
28
30
  };
29
31
  }
30
- const OptionsEditorControl = ({ label , control })=>{
32
+ const OptionsEditorControl = ({ label , control , description })=>{
31
33
  // Make sure we have a unique ID we can use for associating labels and
32
34
  // controls for a11y.
33
35
  const generatedControlId = (0, _utils.useId)('EditorSectionControl');
@@ -41,9 +43,36 @@ const OptionsEditorControl = ({ label , control })=>{
41
43
  alignItems: "center",
42
44
  justifyContent: "space-between",
43
45
  children: [
44
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.FormLabel, {
45
- htmlFor: controlId,
46
- children: label
46
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
47
+ direction: "row",
48
+ alignItems: "center",
49
+ justifyContent: "center",
50
+ children: [
51
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.FormLabel, {
52
+ htmlFor: controlId,
53
+ children: label
54
+ }),
55
+ description && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_infoTooltip.InfoTooltip, {
56
+ description: description,
57
+ enterDelay: 100,
58
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
59
+ size: "small",
60
+ sx: (theme)=>({
61
+ borderRadius: theme.shape.borderRadius,
62
+ padding: '4x',
63
+ margin: '0 2px'
64
+ }),
65
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_informationOutline.default, {
66
+ "aria-describedby": "info-tooltip",
67
+ "aria-hidden": false,
68
+ fontSize: "inherit",
69
+ sx: {
70
+ color: (theme)=>theme.palette.grey[700]
71
+ }
72
+ })
73
+ })
74
+ })
75
+ ]
47
76
  }),
48
77
  /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
49
78
  sx: {
@@ -40,7 +40,7 @@ const _echart = require("../EChart");
40
40
  const MIN_VALUE_SIZE = 12;
41
41
  const MAX_VALUE_SIZE = 36;
42
42
  function StatChart(props) {
43
- const { width , height , data , unit , sparkline } = props;
43
+ const { width , height , data , unit , color , sparkline } = props;
44
44
  const chartsTheme = (0, _chartsThemeProvider.useChartsTheme)();
45
45
  const formattedValue = data.calculatedValue === undefined ? '' : (0, _units.formatValue)(data.calculatedValue, unit);
46
46
  const option = (0, _react.useMemo)(()=>{
@@ -109,7 +109,7 @@ function StatChart(props) {
109
109
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
110
110
  variant: "h3",
111
111
  sx: (theme)=>({
112
- color: theme.palette.text.primary,
112
+ color: color !== null && color !== void 0 ? color : theme.palette.text.primary,
113
113
  fontSize: `clamp(${MIN_VALUE_SIZE}px, ${valueSize}px, ${MAX_VALUE_SIZE}px)`,
114
114
  padding: `${containerPadding} ${containerPadding} 0 ${containerPadding}`
115
115
  }),
@@ -28,7 +28,7 @@ function _interopRequireDefault(obj) {
28
28
  default: obj
29
29
  };
30
30
  }
31
- function ThresholdInput({ inputRef , label , color , value , onChange , onColorChange , onBlur , onDelete }) {
31
+ function ThresholdInput({ inputRef , label , color , value , mode , onChange , onColorChange , onBlur , onDelete }) {
32
32
  const [key, setKey] = (0, _react.useState)(0); // use key to cause input to lose focus when pressing enter
33
33
  return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
34
34
  flex: 1,
@@ -50,7 +50,7 @@ function ThresholdInput({ inputRef , label , color , value , onChange , onColorC
50
50
  id: label,
51
51
  inputRef: inputRef,
52
52
  type: "number",
53
- value: value === 0 ? undefined : value,
53
+ value: value === 0 ? '' : value,
54
54
  placeholder: "0",
55
55
  onChange: onChange,
56
56
  onBlur: onBlur,
@@ -59,6 +59,12 @@ function ThresholdInput({ inputRef , label , color , value , onChange , onColorC
59
59
  onBlur();
60
60
  setKey(key + 1);
61
61
  }
62
+ },
63
+ InputProps: {
64
+ endAdornment: mode === 'Percent' ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
65
+ paddingX: 1,
66
+ children: "%"
67
+ }) : undefined
62
68
  }
63
69
  }, key),
64
70
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
@@ -24,9 +24,9 @@ const _immer = /*#__PURE__*/ _interopRequireDefault(require("immer"));
24
24
  const _material = require("@mui/material");
25
25
  const _plus = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Plus"));
26
26
  const _system = require("@mui/system");
27
- const _infoTooltip = require("../InfoTooltip");
28
27
  const _chartsThemeProvider = require("../context/ChartsThemeProvider");
29
28
  const _optionsEditorLayout = require("../OptionsEditorLayout");
29
+ const _infoTooltip = require("../InfoTooltip");
30
30
  const _thresholdColorPicker = require("./ThresholdColorPicker");
31
31
  const _thresholdInput = require("./ThresholdInput");
32
32
  function _interopRequireDefault(obj) {
@@ -120,6 +120,10 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
120
120
  onChange((0, _immer.default)(thresholds, (draft)=>{
121
121
  draft.default_color = color;
122
122
  }));
123
+ } else {
124
+ onChange({
125
+ default_color: color
126
+ });
123
127
  }
124
128
  };
125
129
  // sort thresholds in ascending order every time an input blurs
@@ -156,6 +160,14 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
156
160
  }
157
161
  ]
158
162
  });
163
+ } else if (thresholds && thresholds.steps === undefined) {
164
+ onChange((0, _immer.default)(thresholds, (draft)=>{
165
+ draft.steps = [
166
+ {
167
+ value: DEFAULT_STEP
168
+ }
169
+ ];
170
+ }));
159
171
  } else {
160
172
  onChange((0, _immer.default)(thresholds, (draft)=>{
161
173
  const steps = draft.steps;
@@ -191,46 +203,55 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
191
203
  var ref1, _color, ref2;
192
204
  return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_optionsEditorLayout.OptionsEditorGroup, {
193
205
  title: "Thresholds",
194
- icon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
195
- size: "small",
196
- "aria-label": "add threshold",
197
- onClick: addThresholdInput,
198
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_plus.default, {})
206
+ icon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_infoTooltip.InfoTooltip, {
207
+ description: 'Add threshold',
208
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
209
+ size: "small",
210
+ "aria-label": "add threshold",
211
+ onClick: addThresholdInput,
212
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_plus.default, {})
213
+ })
199
214
  }),
200
215
  children: [
201
- /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.ToggleButtonGroup, {
202
- exclusive: true,
203
- disabled: disablePercentMode,
204
- value: (ref1 = thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode) !== null && ref1 !== void 0 ? ref1 : 'Absolute',
205
- onChange: handleModeChange,
206
- sx: {
207
- height: '36px',
208
- marginLeft: 'auto'
209
- },
210
- children: [
211
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.ToggleButton, {
212
- "aria-label": "absolute",
213
- value: "Absolute",
214
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_infoTooltip.InfoTooltip, {
215
- description: "Absolute",
216
- children: "#"
217
- })
218
- }),
219
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.ToggleButton, {
220
- "aria-label": "percent",
221
- value: "Percent",
222
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_infoTooltip.InfoTooltip, {
223
- description: "Percentage means thresholds relative to min & max",
224
- children: "%"
216
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_optionsEditorLayout.OptionsEditorControl, {
217
+ label: "Mode",
218
+ description: "Percentage means thresholds relative to min & max",
219
+ control: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.ToggleButtonGroup, {
220
+ exclusive: true,
221
+ disabled: disablePercentMode,
222
+ value: (ref1 = thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode) !== null && ref1 !== void 0 ? ref1 : 'Absolute',
223
+ onChange: handleModeChange,
224
+ sx: {
225
+ height: '36px',
226
+ marginLeft: 'auto'
227
+ },
228
+ children: [
229
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.ToggleButton, {
230
+ "aria-label": "absolute",
231
+ value: "Absolute",
232
+ sx: {
233
+ fontWeight: 500
234
+ },
235
+ children: "Absolute"
236
+ }),
237
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.ToggleButton, {
238
+ "aria-label": "percent",
239
+ value: "Percent",
240
+ sx: {
241
+ fontWeight: 500
242
+ },
243
+ children: "Percent"
225
244
  })
226
- })
227
- ]
245
+ ]
246
+ })
228
247
  }),
229
- steps && steps.map((step, i)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_thresholdInput.ThresholdInput, {
248
+ steps && steps.map((step, i)=>{
249
+ /*#__PURE__*/ return (0, _jsxRuntime.jsx)(_thresholdInput.ThresholdInput, {
230
250
  inputRef: i === steps.length - 1 ? recentlyAddedInputRef : undefined,
231
251
  label: `T${i + 1}`,
232
252
  color: (ref2 = (_color = step.color) !== null && _color !== void 0 ? _color : palette[i]) !== null && ref2 !== void 0 ? ref2 : defaultThresholdColor,
233
253
  value: step.value,
254
+ mode: thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode,
234
255
  onColorChange: (color)=>handleThresholdColorChange(color, i),
235
256
  onChange: (e)=>{
236
257
  handleThresholdValueChange(e, i);
@@ -239,7 +260,8 @@ function ThresholdsEditor({ thresholds , onChange , hideDefault , disablePercent
239
260
  deleteThreshold(i);
240
261
  },
241
262
  onBlur: handleThresholdBlur
242
- }, i)).reverse(),
263
+ }, i);
264
+ }).reverse(),
243
265
  !hideDefault && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_system.Stack, {
244
266
  flex: 1,
245
267
  direction: "row",
@@ -24,7 +24,7 @@ const _seriesMarker = require("./SeriesMarker");
24
24
  const _seriesLabelsStack = require("./SeriesLabelsStack");
25
25
  const _tooltipModel = require("./tooltip-model");
26
26
  function SeriesInfo(props) {
27
- const { seriesName , formattedY , markerColor , totalSeries , wrapLabels } = props;
27
+ const { seriesName , formattedY , markerColor , totalSeries , wrapLabels =true } = props;
28
28
  // metric __name__ comes before opening curly brace, ignore if not populated
29
29
  // ex with metric name: node_load15{env="demo",job="node"}
30
30
  // ex without metric name: {env="demo",job="node"}
@@ -44,8 +44,8 @@ function SeriesInfo(props) {
44
44
  markerColor: markerColor
45
45
  });
46
46
  }
47
- // add space after commas when more than one focused series
48
- const inlineSeriesLabels = formattedSeriesLabels.replace(/[,]/g, ', ');
47
+ // add space after commas so wrapLabels works
48
+ const formattedSeriesInfo = seriesName.replace(/[,]/g, ', ');
49
49
  return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
50
50
  sx: {
51
51
  display: 'table-row',
@@ -76,7 +76,7 @@ function SeriesInfo(props) {
76
76
  textOverflow: 'ellipsis',
77
77
  whiteSpace: wrapLabels ? 'normal' : 'nowrap'
78
78
  }),
79
- children: inlineSeriesLabels
79
+ children: formattedSeriesInfo
80
80
  })
81
81
  ]
82
82
  }),
@@ -46,10 +46,6 @@ const TOOLTIP_DATE_FORMAT = new Intl.DateTimeFormat(undefined, {
46
46
  });
47
47
  const defaultCursorData = {
48
48
  coords: {
49
- viewport: {
50
- x: 0,
51
- y: 0
52
- },
53
49
  plotCanvas: {
54
50
  x: 0,
55
51
  y: 0
@@ -71,9 +67,9 @@ const useMousePosition = ()=>{
71
67
  (0, _react.useEffect)(()=>{
72
68
  const setFromEvent = (e)=>{
73
69
  return setCoords({
74
- viewport: {
75
- x: e.clientX,
76
- y: e.clientY
70
+ page: {
71
+ x: e.pageX,
72
+ y: e.pageY
77
73
  },
78
74
  plotCanvas: {
79
75
  x: e.offsetX,
@@ -28,19 +28,22 @@ function assembleTransform(mousePos, seriesNum, chartWidth, chartHeight, pinnedP
28
28
  }
29
29
  const cursorPaddingX = 32;
30
30
  const cursorPaddingY = 16;
31
- const x = mousePos.viewport.x;
32
- let y = mousePos.viewport.y + cursorPaddingY;
33
- const isCloseToBottom = mousePos.viewport.y > window.innerHeight * 0.8;
31
+ // Tooltip is located in a Portal attached to the body.
32
+ // Using page coordinates instead of viewport ensures the tooltip is
33
+ // absolutely positioned correctly as the user scrolls
34
+ const x = mousePos.page.x;
35
+ let y = mousePos.page.y + cursorPaddingY;
36
+ const isCloseToBottom = mousePos.page.y > window.innerHeight * 0.8;
34
37
  const yPosAdjustThreshold = chartHeight * 0.75;
35
38
  // adjust so tooltip does not get cut off at bottom of chart, reduce multiplier to move up
36
39
  if (isCloseToBottom === true) {
37
40
  if (seriesNum > 6) {
38
- y = mousePos.viewport.y * 0.65;
41
+ y = mousePos.page.y * 0.75;
39
42
  } else {
40
- y = mousePos.viewport.y * 0.75;
43
+ y = mousePos.page.y * 0.9;
41
44
  }
42
45
  } else if (mousePos.plotCanvas.y > yPosAdjustThreshold) {
43
- y = mousePos.viewport.y * 0.85;
46
+ y = mousePos.page.y * 0.95;
44
47
  }
45
48
  // use tooltip width to determine when to repos from right to left (width is narrower when only 1 focused series since labels wrap)
46
49
  const tooltipWidth = seriesNum > 1 ? _tooltipModel.TOOLTIP_MAX_WIDTH : _tooltipModel.TOOLTIP_MAX_WIDTH / 2;
@@ -25,7 +25,13 @@ _export(exports, {
25
25
  BYTES_UNIT_CONFIG: ()=>BYTES_UNIT_CONFIG,
26
26
  formatBytes: ()=>formatBytes
27
27
  });
28
+ const _numbro = /*#__PURE__*/ _interopRequireDefault(require("numbro"));
28
29
  const _constants = require("./constants");
30
+ function _interopRequireDefault(obj) {
31
+ return obj && obj.__esModule ? obj : {
32
+ default: obj
33
+ };
34
+ }
29
35
  const bytesUnitKinds = [
30
36
  'Bytes'
31
37
  ];
@@ -35,52 +41,40 @@ const BYTES_GROUP_CONFIG = {
35
41
  abbreviate: true
36
42
  };
37
43
  const BYTES_UNIT_CONFIG = {
44
+ // This uses units that are powers of 1000.
45
+ // In other words, 1KB = 1000 bytes.
38
46
  Bytes: {
39
47
  group: 'Bytes',
40
48
  label: 'Bytes'
41
49
  }
42
50
  };
43
- function formatBytes(bytes, unitOptions) {
51
+ function formatBytes(bytes, { abbreviate , decimal_places }) {
44
52
  if (bytes === 0) return '0 bytes';
45
- // default to full 'Bytes' formatting
46
- const options = unitOptions.abbreviate === undefined ? {
47
- ...unitOptions,
48
- abbreviate: false
49
- } : unitOptions;
50
- var _decimal_places;
51
- let decimals = (_decimal_places = options.decimal_places) !== null && _decimal_places !== void 0 ? _decimal_places : _constants.DEFAULT_DECIMAL_PLACES;
52
- // avoids minimumFractionDigits value is out of range error, possible values are 0 to 20
53
+ decimal_places = decimal_places !== null && decimal_places !== void 0 ? decimal_places : _constants.DEFAULT_DECIMAL_PLACES;
54
+ // Avoids maximumFractionDigits value is out of range error. Possible values are 0 to 20.
53
55
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits
54
- if (decimals < 0) {
55
- decimals = 0;
56
- } else if (decimals > 20) {
57
- decimals = 20;
56
+ if (decimal_places < 0) {
57
+ decimal_places = 0;
58
+ } else if (decimal_places > 20) {
59
+ decimal_places = 20;
58
60
  }
59
- const formatParams = {
60
- style: 'decimal',
61
- minimumFractionDigits: decimals,
62
- maximumFractionDigits: decimals,
63
- useGrouping: true
64
- };
65
- const formatter = new Intl.NumberFormat('en-US', formatParams);
66
- if (options.abbreviate === false) {
67
- return `${formatter.format(bytes)} bytes`;
61
+ const showFullNumber = abbreviate == false || bytes < 1000;
62
+ if (showFullNumber) {
63
+ const formatter = new Intl.NumberFormat('en-US', {
64
+ style: 'unit',
65
+ unit: 'byte',
66
+ unitDisplay: 'long',
67
+ maximumFractionDigits: decimal_places,
68
+ useGrouping: true
69
+ });
70
+ return formatter.format(bytes);
68
71
  }
69
- const k = 1024;
70
- const sizes = [
71
- 'bytes',
72
- 'KB',
73
- 'MB',
74
- 'GB',
75
- 'TB',
76
- 'PB',
77
- 'EB',
78
- 'ZB',
79
- 'YB'
80
- ];
81
- // Math.max(0, ...) ensures that we don't return -1 as a value for the index.
82
- // Why? When the number of bytes are between -1 and 1, Math.floor(Math.log(bytes)/Math.log(1024)) returns -1.
83
- const i = Math.max(0, Math.floor(Math.log(bytes) / Math.log(k)));
84
- const abbreviatedValue = bytes / Math.pow(k, i);
85
- return `${formatter.format(abbreviatedValue)} ${sizes[i]}`;
72
+ return (0, _numbro.default)(bytes).format({
73
+ output: 'byte',
74
+ base: 'decimal',
75
+ spaceSeparated: true,
76
+ mantissa: decimal_places,
77
+ trimMantissa: true,
78
+ optionalMantissa: true
79
+ });
86
80
  }
@@ -23,11 +23,8 @@ function _export(target, all) {
23
23
  _export(exports, {
24
24
  PERCENT_GROUP_CONFIG: ()=>PERCENT_GROUP_CONFIG,
25
25
  DECIMAL_UNIT_CONFIG: ()=>DECIMAL_UNIT_CONFIG,
26
- formatDecimal: ()=>formatDecimal,
27
- abbreviateLargeNumber: ()=>abbreviateLargeNumber,
28
- formatNumber: ()=>formatNumber
26
+ formatDecimal: ()=>formatDecimal
29
27
  });
30
- const _mathjs = require("../../utils/mathjs");
31
28
  const _constants = require("./constants");
32
29
  const decimalUnitKinds = [
33
30
  'Decimal'
@@ -42,29 +39,21 @@ const DECIMAL_UNIT_CONFIG = {
42
39
  label: 'Decimal'
43
40
  }
44
41
  };
45
- function formatDecimal(value, unitOptions) {
46
- var _decimal_places;
47
- const decimals = (_decimal_places = unitOptions.decimal_places) !== null && _decimal_places !== void 0 ? _decimal_places : _constants.DEFAULT_DECIMAL_PLACES;
48
- if (value === 0) {
49
- return value.toString();
42
+ function formatDecimal(value, { abbreviate , decimal_places }) {
43
+ decimal_places = decimal_places !== null && decimal_places !== void 0 ? decimal_places : _constants.DEFAULT_DECIMAL_PLACES;
44
+ // Avoids maximumFractionDigits value is out of range error. Possible values are 0 to 20.
45
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#minimumfractiondigits
46
+ if (decimal_places < 0) {
47
+ decimal_places = 0;
48
+ } else if (decimal_places > 20) {
49
+ decimal_places = 20;
50
50
  }
51
- if (unitOptions.abbreviate && value >= 1000) {
52
- return abbreviateLargeNumber(value, decimals);
53
- }
54
- const formatParams = {
51
+ const showFullNumber = abbreviate == false || value < 1000;
52
+ const formatter = new Intl.NumberFormat('en-US', {
55
53
  style: 'decimal',
56
- minimumFractionDigits: decimals,
57
- maximumFractionDigits: decimals,
54
+ notation: showFullNumber ? 'standard' : 'compact',
55
+ maximumFractionDigits: decimal_places,
58
56
  useGrouping: true
59
- };
60
- const decimalFormatter = new Intl.NumberFormat('en-US', formatParams);
61
- return decimalFormatter.format(value);
62
- }
63
- function abbreviateLargeNumber(num, decimals = 2) {
64
- const modifier = (n)=>(0, _mathjs.round)(n, decimals);
65
- return formatNumber(num, modifier);
66
- }
67
- function formatNumber(num, modifier) {
68
- const fn = modifier !== null && modifier !== void 0 ? modifier : Math.round;
69
- return num >= 1e12 ? fn(num / 1e12) + 'T' : num >= 1e9 ? fn(num / 1e9) + 'B' : num >= 1e6 ? fn(num / 1e6) + 'M' : num >= 1e3 ? fn(num / 1e3) + 'K' : num.toString();
57
+ });
58
+ return formatter.format(value);
70
59
  }
@@ -89,14 +89,13 @@ var TimeIntlDuration;
89
89
  })(TimeIntlDuration || (TimeIntlDuration = {}));
90
90
  function formatTime(value, unitOptions) {
91
91
  var _decimal_places;
92
- const decimals = (_decimal_places = unitOptions.decimal_places) !== null && _decimal_places !== void 0 ? _decimal_places : _constants.DEFAULT_DECIMAL_PLACES;
92
+ const decimalPlaces = (_decimal_places = unitOptions.decimal_places) !== null && _decimal_places !== void 0 ? _decimal_places : _constants.DEFAULT_DECIMAL_PLACES;
93
93
  const timeUnit = TimeIntlDuration[unitOptions.kind];
94
94
  const formatter = new Intl.NumberFormat('en-US', {
95
95
  style: 'unit',
96
96
  unit: timeUnit,
97
97
  unitDisplay: 'long',
98
- minimumFractionDigits: decimals,
99
- maximumFractionDigits: decimals
98
+ maximumFractionDigits: decimalPlaces
100
99
  });
101
100
  return formatter.format(value);
102
101
  }
@@ -40,12 +40,20 @@ function generateChartsTheme(muiTheme, echartsTheme) {
40
40
  left: 20,
41
41
  containLabel: true
42
42
  },
43
+ // Accessible categorical palette from: https://colorbrewer2.org/#type=qualitative&scheme=Paired&n=12
43
44
  color: [
44
- '#8dd3c7',
45
- '#bebada',
46
- '#fb8072',
47
- '#80b1d3',
48
- '#fdb462'
45
+ '#a6cee3',
46
+ '#1f78b4',
47
+ '#b2df8a',
48
+ '#33a02c',
49
+ '#fb9a99',
50
+ '#e31a1c',
51
+ '#fdbf6f',
52
+ '#ff7f00',
53
+ '#cab2d6',
54
+ '#6a3d9a',
55
+ '#ffff99',
56
+ '#b15928'
49
57
  ],
50
58
  categoryAxis: {
51
59
  show: true,
@@ -9,7 +9,7 @@ export interface LegendItem {
9
9
  label: string;
10
10
  isSelected: boolean;
11
11
  color: string;
12
- onClick: MouseEventHandler<HTMLLIElement>;
12
+ onClick: MouseEventHandler<HTMLElement>;
13
13
  }
14
14
  export declare type LegendPositionConfig = {
15
15
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/model/legend.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,eAAO,MAAM,eAAe,8BAA+B,CAAC;AAE5D,oBAAY,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;CAC3C;AAED,oBAAY,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAG3F,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,aAE5B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,eAAe,sBAQ3D;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,WAE9D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,aAAa,WASxD"}
1
+ {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/model/legend.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,eAAO,MAAM,eAAe,8BAA+B,CAAC;AAE5D,oBAAY,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;CACzC;AAED,oBAAY,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAG3F,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,aAE5B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,eAAe,sBAQ3D;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,WAE9D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,aAAa,WASxD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/legend.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { MouseEventHandler } from 'react';\n\nexport const legendPositions = ['Bottom', 'Right'] as const;\n\nexport type LegendPositions = (typeof legendPositions)[number];\n\nexport interface LegendOptions {\n position: LegendPositions;\n}\n\nexport interface LegendItem {\n id: string;\n label: string;\n isSelected: boolean;\n color: string;\n onClick: MouseEventHandler<HTMLLIElement>;\n}\n\nexport type LegendPositionConfig = {\n label: string;\n};\n\nexport const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendPositionConfig>> = {\n Bottom: { label: 'Bottom' },\n Right: { label: 'Right' },\n};\n\nexport const DEFAULT_LEGEND: LegendOptions = {\n position: 'Bottom',\n};\n\nexport function getLegendPosition(position?: LegendPositions) {\n if (position === undefined) {\n return DEFAULT_LEGEND.position;\n }\n if (isValidLegendPosition(position)) {\n return position;\n }\n return DEFAULT_LEGEND.position;\n}\n\nexport function isValidLegendPosition(position: LegendPositions) {\n return (legendPositions as readonly string[]).includes(position);\n}\n\nexport function validateLegendSpec(legend?: LegendOptions) {\n if (legend === undefined) {\n // undefined is valid since this is how legend is hidden by default\n return true;\n }\n if (!isValidLegendPosition(legend.position)) {\n return false;\n }\n return true;\n}\n"],"names":["legendPositions","LEGEND_POSITIONS_CONFIG","Bottom","label","Right","DEFAULT_LEGEND","position","getLegendPosition","undefined","isValidLegendPosition","includes","validateLegendSpec","legend"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,MAAMA,eAAe,GAAG;IAAC,QAAQ;IAAE,OAAO;CAAC,AAAS,CAAC;AAoB5D,OAAO,MAAMC,uBAAuB,GAA4D;IAC9FC,MAAM,EAAE;QAAEC,KAAK,EAAE,QAAQ;KAAE;IAC3BC,KAAK,EAAE;QAAED,KAAK,EAAE,OAAO;KAAE;CAC1B,CAAC;AAEF,OAAO,MAAME,cAAc,GAAkB;IAC3CC,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,OAAO,SAASC,iBAAiB,CAACD,QAA0B,EAAE;IAC5D,IAAIA,QAAQ,KAAKE,SAAS,EAAE;QAC1B,OAAOH,cAAc,CAACC,QAAQ,CAAC;IACjC,CAAC;IACD,IAAIG,qBAAqB,CAACH,QAAQ,CAAC,EAAE;QACnC,OAAOA,QAAQ,CAAC;IAClB,CAAC;IACD,OAAOD,cAAc,CAACC,QAAQ,CAAC;AACjC,CAAC;AAED,OAAO,SAASG,qBAAqB,CAACH,QAAyB,EAAE;IAC/D,OAAO,AAACN,eAAe,CAAuBU,QAAQ,CAACJ,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED,OAAO,SAASK,kBAAkB,CAACC,MAAsB,EAAE;IACzD,IAAIA,MAAM,KAAKJ,SAAS,EAAE;QACxB,mEAAmE;QACnE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAACC,qBAAqB,CAACG,MAAM,CAACN,QAAQ,CAAC,EAAE;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"sources":["../../src/model/legend.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { MouseEventHandler } from 'react';\n\nexport const legendPositions = ['Bottom', 'Right'] as const;\n\nexport type LegendPositions = (typeof legendPositions)[number];\n\nexport interface LegendOptions {\n position: LegendPositions;\n}\n\nexport interface LegendItem {\n id: string;\n label: string;\n isSelected: boolean;\n color: string;\n onClick: MouseEventHandler<HTMLElement>;\n}\n\nexport type LegendPositionConfig = {\n label: string;\n};\n\nexport const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendPositionConfig>> = {\n Bottom: { label: 'Bottom' },\n Right: { label: 'Right' },\n};\n\nexport const DEFAULT_LEGEND: LegendOptions = {\n position: 'Bottom',\n};\n\nexport function getLegendPosition(position?: LegendPositions) {\n if (position === undefined) {\n return DEFAULT_LEGEND.position;\n }\n if (isValidLegendPosition(position)) {\n return position;\n }\n return DEFAULT_LEGEND.position;\n}\n\nexport function isValidLegendPosition(position: LegendPositions) {\n return (legendPositions as readonly string[]).includes(position);\n}\n\nexport function validateLegendSpec(legend?: LegendOptions) {\n if (legend === undefined) {\n // undefined is valid since this is how legend is hidden by default\n return true;\n }\n if (!isValidLegendPosition(legend.position)) {\n return false;\n }\n return true;\n}\n"],"names":["legendPositions","LEGEND_POSITIONS_CONFIG","Bottom","label","Right","DEFAULT_LEGEND","position","getLegendPosition","undefined","isValidLegendPosition","includes","validateLegendSpec","legend"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,MAAMA,eAAe,GAAG;IAAC,QAAQ;IAAE,OAAO;CAAC,AAAS,CAAC;AAoB5D,OAAO,MAAMC,uBAAuB,GAA4D;IAC9FC,MAAM,EAAE;QAAEC,KAAK,EAAE,QAAQ;KAAE;IAC3BC,KAAK,EAAE;QAAED,KAAK,EAAE,OAAO;KAAE;CAC1B,CAAC;AAEF,OAAO,MAAME,cAAc,GAAkB;IAC3CC,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,OAAO,SAASC,iBAAiB,CAACD,QAA0B,EAAE;IAC5D,IAAIA,QAAQ,KAAKE,SAAS,EAAE;QAC1B,OAAOH,cAAc,CAACC,QAAQ,CAAC;IACjC,CAAC;IACD,IAAIG,qBAAqB,CAACH,QAAQ,CAAC,EAAE;QACnC,OAAOA,QAAQ,CAAC;IAClB,CAAC;IACD,OAAOD,cAAc,CAACC,QAAQ,CAAC;AACjC,CAAC;AAED,OAAO,SAASG,qBAAqB,CAACH,QAAyB,EAAE;IAC/D,OAAO,AAACN,eAAe,CAAuBU,QAAQ,CAACJ,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED,OAAO,SAASK,kBAAkB,CAACC,MAAsB,EAAE;IACzD,IAAIA,MAAM,KAAKJ,SAAS,EAAE;QACxB,mEAAmE;QACnE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAACC,qBAAqB,CAACG,MAAM,CAACN,QAAQ,CAAC,EAAE;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -8,10 +8,6 @@ export declare type BytesUnitOptions = {
8
8
  };
9
9
  export declare const BYTES_GROUP_CONFIG: UnitGroupConfig;
10
10
  export declare const BYTES_UNIT_CONFIG: Readonly<Record<BytesUnitKind, UnitConfig>>;
11
- /**
12
- * Format value as bytes, use abbreviate option for more readable sizes (KB, MB, GB, etc.)
13
- * https://stackoverflow.com/questions/15900485/correct-way-to-convert-size-in-bytes-to-kb-mb-gb-in-javascript/18650828#18650828
14
- */
15
- export declare function formatBytes(bytes: number, unitOptions: BytesUnitOptions): string;
11
+ export declare function formatBytes(bytes: number, { abbreviate, decimal_places }: BytesUnitOptions): string;
16
12
  export {};
17
13
  //# sourceMappingURL=bytes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src/model/units/bytes.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtD,QAAA,MAAM,cAAc,oBAAqB,CAAC;AAC1C,aAAK,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,eAIhC,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAKzE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,UAmCvE"}
1
+ {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src/model/units/bytes.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtD,QAAA,MAAM,cAAc,oBAAqB,CAAC;AAC1C,aAAK,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,aAAa,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,eAIhC,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAOzE,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,gBAAgB,UAiC1F"}