@perses-dev/components 0.13.0 → 0.15.0
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/dist/{TimeRangeSelector → DateTimeRangePicker}/AbsoluteTimePicker.d.ts +0 -0
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -0
- package/dist/{TimeRangeSelector → DateTimeRangePicker}/AbsoluteTimePicker.js +38 -33
- package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -0
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +11 -0
- package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -0
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js +77 -0
- package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -0
- package/dist/{TimeRangeSelector → DateTimeRangePicker}/TimeRangeSelector.d.ts +0 -0
- package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -0
- package/dist/{TimeRangeSelector → DateTimeRangePicker}/TimeRangeSelector.js +0 -0
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -0
- package/dist/{TimeRangeSelector → DateTimeRangePicker}/index.d.ts +1 -0
- package/dist/DateTimeRangePicker/index.d.ts.map +1 -0
- package/dist/{TimeRangeSelector → DateTimeRangePicker}/index.js +1 -0
- package/dist/DateTimeRangePicker/index.js.map +1 -0
- package/dist/{TimeRangeSelector → DateTimeRangePicker}/utils.d.ts +0 -0
- package/dist/DateTimeRangePicker/utils.d.ts.map +1 -0
- package/dist/{TimeRangeSelector → DateTimeRangePicker}/utils.js +0 -0
- package/dist/DateTimeRangePicker/utils.js.map +1 -0
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +0 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +3 -3
- package/dist/GaugeChart/GaugeChart.js.map +1 -1
- package/dist/Legend/CompactLegend.d.ts +6 -1
- package/dist/Legend/CompactLegend.d.ts.map +1 -1
- package/dist/Legend/CompactLegend.js +16 -7
- package/dist/Legend/CompactLegend.js.map +1 -1
- package/dist/Legend/Legend.d.ts.map +1 -1
- package/dist/Legend/Legend.js +4 -9
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/ListLegend.d.ts +3 -0
- package/dist/Legend/ListLegend.d.ts.map +1 -1
- package/dist/Legend/ListLegend.js +18 -2
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.d.ts +2 -1
- package/dist/Legend/ListLegendItem.d.ts.map +1 -1
- package/dist/Legend/ListLegendItem.js +11 -9
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/LineChart/LineChart.js +1 -1
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/StatChart/StatChart.js +1 -1
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/StatChart.test.js +1 -2
- package/dist/StatChart/StatChart.test.js.map +1 -1
- package/dist/cjs/{TimeRangeSelector → DateTimeRangePicker}/AbsoluteTimePicker.js +37 -32
- package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +83 -0
- package/dist/cjs/{TimeRangeSelector → DateTimeRangePicker}/TimeRangeSelector.js +0 -0
- package/dist/cjs/{TimeRangeSelector → DateTimeRangePicker}/index.js +1 -0
- package/dist/cjs/{TimeRangeSelector → DateTimeRangePicker}/utils.js +0 -0
- package/dist/cjs/Drawer/Drawer.js +0 -1
- package/dist/cjs/GaugeChart/GaugeChart.js +3 -3
- package/dist/cjs/Legend/CompactLegend.js +12 -6
- package/dist/cjs/Legend/Legend.js +4 -9
- package/dist/cjs/Legend/ListLegend.js +15 -1
- package/dist/cjs/Legend/ListLegendItem.js +48 -13
- package/dist/cjs/LineChart/LineChart.js +1 -1
- package/dist/cjs/StatChart/StatChart.js +1 -1
- package/dist/cjs/StatChart/StatChart.test.js +2 -3
- package/dist/cjs/context/ChartsThemeProvider.js +1 -6
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/model/units.js +1 -1
- package/dist/cjs/test/index.js +0 -1
- package/dist/cjs/test-utils/index.js +28 -0
- package/dist/cjs/{test → test-utils}/theme.js +0 -1
- package/dist/cjs/utils/mathjs.js +25 -0
- package/dist/cjs/utils/theme-gen.js +1 -2
- package/dist/cjs/utils/theme-gen.test.js +1 -2
- package/dist/context/ChartsThemeProvider.d.ts +0 -1
- package/dist/context/ChartsThemeProvider.d.ts.map +1 -1
- package/dist/context/ChartsThemeProvider.js +1 -6
- package/dist/context/ChartsThemeProvider.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/model/theme.d.ts +0 -1
- package/dist/model/theme.d.ts.map +1 -1
- package/dist/model/theme.js.map +1 -1
- package/dist/model/units.js +1 -1
- package/dist/model/units.js.map +1 -1
- package/dist/test/index.d.ts +0 -1
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +0 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test-utils/index.d.ts +2 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/test-utils/index.js +15 -0
- package/dist/test-utils/index.js.map +1 -0
- package/dist/test-utils/theme.d.ts +3 -0
- package/dist/test-utils/theme.d.ts.map +1 -0
- package/dist/{test → test-utils}/theme.js +0 -1
- package/dist/test-utils/theme.js.map +1 -0
- package/dist/utils/mathjs.d.ts +6 -0
- package/dist/utils/mathjs.d.ts.map +1 -0
- package/dist/utils/mathjs.js +20 -0
- package/dist/utils/mathjs.js.map +1 -0
- package/dist/utils/theme-gen.d.ts +1 -1
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +1 -2
- package/dist/utils/theme-gen.js.map +1 -1
- package/dist/utils/theme-gen.test.js +1 -2
- package/dist/utils/theme-gen.test.js.map +1 -1
- package/package.json +7 -2
- package/dist/TimeRangeSelector/AbsoluteTimePicker.d.ts.map +0 -1
- package/dist/TimeRangeSelector/AbsoluteTimePicker.js.map +0 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +0 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +0 -1
- package/dist/TimeRangeSelector/index.d.ts.map +0 -1
- package/dist/TimeRangeSelector/index.js.map +0 -1
- package/dist/TimeRangeSelector/utils.d.ts.map +0 -1
- package/dist/TimeRangeSelector/utils.js.map +0 -1
- package/dist/test/theme.d.ts +0 -3
- package/dist/test/theme.d.ts.map +0 -1
- package/dist/test/theme.js.map +0 -1
|
@@ -19,24 +19,59 @@ Object.defineProperty(exports, "ListLegendItem", {
|
|
|
19
19
|
get: ()=>ListLegendItem
|
|
20
20
|
});
|
|
21
21
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _react = /*#__PURE__*/
|
|
22
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
23
23
|
const _material = require("@mui/material");
|
|
24
|
+
const _utils = require("../utils");
|
|
24
25
|
const _legendColorBadge = require("./LegendColorBadge");
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
27
|
+
if (typeof WeakMap !== "function") return null;
|
|
28
|
+
var cacheBabelInterop = new WeakMap();
|
|
29
|
+
var cacheNodeInterop = new WeakMap();
|
|
30
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
31
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
32
|
+
})(nodeInterop);
|
|
29
33
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
35
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
36
|
+
return obj;
|
|
37
|
+
}
|
|
38
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
39
|
+
return {
|
|
40
|
+
default: obj
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
44
|
+
if (cache && cache.has(obj)) {
|
|
45
|
+
return cache.get(obj);
|
|
46
|
+
}
|
|
47
|
+
var newObj = {};
|
|
48
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
49
|
+
for(var key in obj){
|
|
50
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
51
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
52
|
+
if (desc && (desc.get || desc.set)) {
|
|
53
|
+
Object.defineProperty(newObj, key, desc);
|
|
54
|
+
} else {
|
|
55
|
+
newObj[key] = obj[key];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
newObj.default = obj;
|
|
60
|
+
if (cache) {
|
|
61
|
+
cache.set(obj, newObj);
|
|
62
|
+
}
|
|
63
|
+
return newObj;
|
|
64
|
+
}
|
|
65
|
+
const ListLegendItem = /*#__PURE__*/ _react.default.memo(function ListLegendItem({ item , sx , ...others }) {
|
|
66
|
+
return /*#__PURE__*/ (0, _react.createElement)(_material.ListItem, {
|
|
67
|
+
...others,
|
|
68
|
+
sx: (0, _utils.combineSx)({
|
|
36
69
|
padding: 0,
|
|
37
70
|
cursor: 'pointer'
|
|
38
|
-
},
|
|
71
|
+
}, sx),
|
|
72
|
+
dense: true,
|
|
39
73
|
"data-testid": `legend-item-${item.color}`,
|
|
74
|
+
key: item.id,
|
|
40
75
|
onClick: item.onClick,
|
|
41
76
|
selected: item.isSelected,
|
|
42
77
|
children: [
|
|
@@ -53,5 +88,5 @@ const ListLegendItem = /*#__PURE__*/ _react.default.memo(function ListLegendItem
|
|
|
53
88
|
primary: item.label
|
|
54
89
|
})
|
|
55
90
|
]
|
|
56
|
-
}
|
|
91
|
+
});
|
|
57
92
|
});
|
|
@@ -195,7 +195,7 @@ function LineChart({ height , data , unit , grid , legend , visualMap , onDataZo
|
|
|
195
195
|
height: '100%'
|
|
196
196
|
},
|
|
197
197
|
option: option,
|
|
198
|
-
theme: chartsTheme.
|
|
198
|
+
theme: chartsTheme.echartsTheme,
|
|
199
199
|
onEvents: handleEvents,
|
|
200
200
|
_instance: chartRef
|
|
201
201
|
})
|
|
@@ -18,7 +18,7 @@ const _jsxRuntime = require("react/jsx-runtime");
|
|
|
18
18
|
const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
|
|
19
19
|
const _react1 = require("@testing-library/react");
|
|
20
20
|
const _chartsThemeProvider = require("../context/ChartsThemeProvider");
|
|
21
|
-
const
|
|
21
|
+
const _testUtils = require("../test-utils");
|
|
22
22
|
const _statChart = require("./StatChart");
|
|
23
23
|
function _interopRequireDefault(obj) {
|
|
24
24
|
return obj && obj.__esModule ? obj : {
|
|
@@ -66,8 +66,7 @@ describe('StatChart', ()=>{
|
|
|
66
66
|
describe('Render default options (no sparkline)', ()=>{
|
|
67
67
|
it('should render', ()=>{
|
|
68
68
|
(0, _react1.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(_chartsThemeProvider.ChartsThemeProvider, {
|
|
69
|
-
|
|
70
|
-
chartsTheme: _test.testChartsTheme,
|
|
69
|
+
chartsTheme: _testUtils.testChartsTheme,
|
|
71
70
|
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_statChart.StatChart, {
|
|
72
71
|
width: contentDimensions.width,
|
|
73
72
|
height: contentDimensions.height,
|
|
@@ -27,7 +27,6 @@ _export(exports, {
|
|
|
27
27
|
});
|
|
28
28
|
const _jsxRuntime = require("react/jsx-runtime");
|
|
29
29
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
30
|
-
const _echarts = require("echarts");
|
|
31
30
|
function _getRequireWildcardCache(nodeInterop) {
|
|
32
31
|
if (typeof WeakMap !== "function") return null;
|
|
33
32
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -68,11 +67,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
68
67
|
return newObj;
|
|
69
68
|
}
|
|
70
69
|
function ChartsThemeProvider(props) {
|
|
71
|
-
const { children ,
|
|
72
|
-
if (chartsTheme !== undefined && chartsTheme.echartsTheme !== undefined) {
|
|
73
|
-
// register ECharts theme to be used in individual charts, see: https://apache.github.io/echarts-handbook/en/concepts/style/#theme
|
|
74
|
-
(0, _echarts.registerTheme)(themeName, chartsTheme.echartsTheme);
|
|
75
|
-
}
|
|
70
|
+
const { children , chartsTheme } = props;
|
|
76
71
|
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(ChartsThemeContext.Provider, {
|
|
77
72
|
value: chartsTheme,
|
|
78
73
|
children: children
|
package/dist/cjs/index.js
CHANGED
|
@@ -24,11 +24,11 @@ _exportStar(require("./Legend"), exports);
|
|
|
24
24
|
_exportStar(require("./LineChart"), exports);
|
|
25
25
|
_exportStar(require("./GaugeChart"), exports);
|
|
26
26
|
_exportStar(require("./StatChart"), exports);
|
|
27
|
-
_exportStar(require("./
|
|
27
|
+
_exportStar(require("./DateTimeRangePicker"), exports);
|
|
28
28
|
_exportStar(require("./context/ChartsThemeProvider"), exports);
|
|
29
29
|
_exportStar(require("./utils"), exports);
|
|
30
30
|
_exportStar(require("./model"), exports);
|
|
31
|
-
_exportStar(require("./test"), exports);
|
|
31
|
+
_exportStar(require("./test-utils"), exports);
|
|
32
32
|
function _exportStar(from, to) {
|
|
33
33
|
Object.keys(from).forEach(function(k) {
|
|
34
34
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
package/dist/cjs/model/units.js
CHANGED
|
@@ -27,7 +27,7 @@ _export(exports, {
|
|
|
27
27
|
formatNumber: ()=>formatNumber
|
|
28
28
|
});
|
|
29
29
|
const _dateFns = require("date-fns");
|
|
30
|
-
const _mathjs = require("mathjs");
|
|
30
|
+
const _mathjs = require("../utils/mathjs");
|
|
31
31
|
const DEFAULT_DECIMAL_PLACES = 2;
|
|
32
32
|
function formatValue(value, unitOptions) {
|
|
33
33
|
if (unitOptions === undefined) {
|
package/dist/cjs/test/index.js
CHANGED
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15
15
|
value: true
|
|
16
16
|
});
|
|
17
17
|
_exportStar(require("./render"), exports);
|
|
18
|
-
_exportStar(require("./theme"), exports);
|
|
19
18
|
function _exportStar(from, to) {
|
|
20
19
|
Object.keys(from).forEach(function(k) {
|
|
21
20
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_exportStar(require("./theme"), exports);
|
|
18
|
+
function _exportStar(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "round", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>round
|
|
20
|
+
});
|
|
21
|
+
const _mathjs = require("mathjs");
|
|
22
|
+
// This ensures we get a minimal mathjs bundle for just what we need (see https://mathjs.org/docs/custom_bundling.html)
|
|
23
|
+
const { round } = (0, _mathjs.create)({
|
|
24
|
+
roundDependencies: _mathjs.roundDependencies
|
|
25
|
+
});
|
|
@@ -20,7 +20,7 @@ Object.defineProperty(exports, "generateChartsTheme", {
|
|
|
20
20
|
});
|
|
21
21
|
const _lodashEs = require("lodash-es");
|
|
22
22
|
const DEFAULT_TEXT_COLOR = '#222';
|
|
23
|
-
function generateChartsTheme(
|
|
23
|
+
function generateChartsTheme(muiTheme, echartsTheme) {
|
|
24
24
|
var ref, ref1, ref2, ref3, ref4;
|
|
25
25
|
var ref5;
|
|
26
26
|
const primaryTextColor = (ref5 = (ref = muiTheme.palette.text) === null || ref === void 0 ? void 0 : ref.primary) !== null && ref5 !== void 0 ? ref5 : DEFAULT_TEXT_COLOR;
|
|
@@ -160,7 +160,6 @@ function generateChartsTheme(themeName, muiTheme, echartsTheme) {
|
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
162
|
return {
|
|
163
|
-
themeName,
|
|
164
163
|
echartsTheme: (0, _lodashEs.merge)(muiConvertedTheme, echartsTheme),
|
|
165
164
|
noDataOption: {
|
|
166
165
|
title: {
|
|
@@ -29,7 +29,7 @@ describe('generateChartsTheme', ()=>{
|
|
|
29
29
|
smooth: true
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
const chartsTheme = (0, _themeGen.generateChartsTheme)(
|
|
32
|
+
const chartsTheme = (0, _themeGen.generateChartsTheme)(muiTheme, echartsThemeOverrides);
|
|
33
33
|
it('should return perses specific charts theme from converted MUI theme', ()=>{
|
|
34
34
|
expect(chartsTheme).toMatchInlineSnapshot(`
|
|
35
35
|
Object {
|
|
@@ -191,7 +191,6 @@ describe('generateChartsTheme', ()=>{
|
|
|
191
191
|
"color": "#1976d2",
|
|
192
192
|
"width": 2,
|
|
193
193
|
},
|
|
194
|
-
"themeName": "perses",
|
|
195
194
|
}
|
|
196
195
|
`);
|
|
197
196
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartsThemeProvider.d.ts","sourceRoot":"","sources":["../../src/context/ChartsThemeProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartsThemeProvider.d.ts","sourceRoot":"","sources":["../../src/context/ChartsThemeProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,eAGlE;AAED,eAAO,MAAM,kBAAkB,8CAA0D,CAAC;AAE1F,wBAAgB,cAAc,IAAI,iBAAiB,CAMlD"}
|
|
@@ -12,13 +12,8 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import React, { createContext, useContext } from 'react';
|
|
15
|
-
import { registerTheme } from 'echarts';
|
|
16
15
|
export function ChartsThemeProvider(props) {
|
|
17
|
-
const { children ,
|
|
18
|
-
if (chartsTheme !== undefined && chartsTheme.echartsTheme !== undefined) {
|
|
19
|
-
// register ECharts theme to be used in individual charts, see: https://apache.github.io/echarts-handbook/en/concepts/style/#theme
|
|
20
|
-
registerTheme(themeName, chartsTheme.echartsTheme);
|
|
21
|
-
}
|
|
16
|
+
const { children , chartsTheme } = props;
|
|
22
17
|
return /*#__PURE__*/ _jsx(ChartsThemeContext.Provider, {
|
|
23
18
|
value: chartsTheme,
|
|
24
19
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/ChartsThemeProvider.tsx"],"sourcesContent":["// Copyright 2022 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 React, { createContext, useContext } from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/context/ChartsThemeProvider.tsx"],"sourcesContent":["// Copyright 2022 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 React, { createContext, useContext } from 'react';\nimport { PersesChartsTheme } from '../model';\n\nexport interface ChartsThemeProviderProps {\n chartsTheme?: PersesChartsTheme;\n children?: React.ReactNode;\n}\n\nexport function ChartsThemeProvider(props: ChartsThemeProviderProps) {\n const { children, chartsTheme } = props;\n return <ChartsThemeContext.Provider value={chartsTheme}>{children}</ChartsThemeContext.Provider>;\n}\n\nexport const ChartsThemeContext = createContext<PersesChartsTheme | undefined>(undefined);\n\nexport function useChartsTheme(): PersesChartsTheme {\n const ctx = useContext(ChartsThemeContext);\n if (ctx === undefined) {\n throw new Error('No ChartsThemeContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n"],"names":["React","createContext","useContext","ChartsThemeProvider","props","children","chartsTheme","ChartsThemeContext","Provider","value","undefined","useChartsTheme","ctx","Error"],"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;AAEjC;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,QAAQ,OAAO,CAAC;AAQzD,OAAO,SAASC,mBAAmB,CAACC,KAA+B,EAAE;IACnE,MAAM,EAAEC,QAAQ,CAAA,EAAEC,WAAW,CAAA,EAAE,GAAGF,KAAK,AAAC;IACxC,qBAAO,KAACG,kBAAkB,CAACC,QAAQ;QAACC,KAAK,EAAEH,WAAW;kBAAGD,QAAQ;MAA+B,CAAC;AACnG,CAAC;AAED,OAAO,MAAME,kBAAkB,iBAAGN,aAAa,CAAgCS,SAAS,CAAC,CAAC;AAE1F,OAAO,SAASC,cAAc,GAAsB;IAClD,MAAMC,GAAG,GAAGV,UAAU,CAACK,kBAAkB,CAAC,AAAC;IAC3C,IAAIK,GAAG,KAAKF,SAAS,EAAE;QACrB,MAAM,IAAIG,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,OAAOD,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ export * from './Legend';
|
|
|
8
8
|
export * from './LineChart';
|
|
9
9
|
export * from './GaugeChart';
|
|
10
10
|
export * from './StatChart';
|
|
11
|
-
export * from './
|
|
11
|
+
export * from './DateTimeRangePicker';
|
|
12
12
|
export * from './context/ChartsThemeProvider';
|
|
13
13
|
export * from './utils';
|
|
14
14
|
export * from './model';
|
|
15
|
-
export * from './test';
|
|
15
|
+
export * from './test-utils';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,10 +20,10 @@ export * from './Legend';
|
|
|
20
20
|
export * from './LineChart';
|
|
21
21
|
export * from './GaugeChart';
|
|
22
22
|
export * from './StatChart';
|
|
23
|
-
export * from './
|
|
23
|
+
export * from './DateTimeRangePicker';
|
|
24
24
|
export * from './context/ChartsThemeProvider';
|
|
25
25
|
export * from './utils';
|
|
26
26
|
export * from './model';
|
|
27
|
-
export * from './test';
|
|
27
|
+
export * from './test-utils';
|
|
28
28
|
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2022 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\nexport * from './Drawer';\nexport * from './EChart';\nexport * from './ErrorAlert';\nexport * from './ErrorBoundary';\nexport * from './InfoTooltip';\nexport * from './JSONEditor';\nexport * from './Legend';\nexport * from './LineChart';\nexport * from './GaugeChart';\nexport * from './StatChart';\nexport * from './
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2022 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\nexport * from './Drawer';\nexport * from './EChart';\nexport * from './ErrorAlert';\nexport * from './ErrorBoundary';\nexport * from './InfoTooltip';\nexport * from './JSONEditor';\nexport * from './Legend';\nexport * from './LineChart';\nexport * from './GaugeChart';\nexport * from './StatChart';\nexport * from './DateTimeRangePicker';\nexport * from './context/ChartsThemeProvider';\nexport * from './utils';\nexport * from './model';\nexport * from './test-utils';\n"],"names":[],"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;AAEjC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
package/dist/model/theme.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/model/theme.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEtH,MAAM,WAAW,iBAAiB;IAChC,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/model/theme.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEtH,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,iBAAiB,CAAC;IAChC,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAGD,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,GAAG,CAAC,EAAE,eAAe,CAAC;IACtB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B"}
|
package/dist/model/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/theme.ts"],"sourcesContent":["// Copyright 2022 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 type { EChartsOption, EChartsCoreOption, BarSeriesOption, LineSeriesOption, GaugeSeriesOption } from 'echarts';\n\nexport interface PersesChartsTheme {\n
|
|
1
|
+
{"version":3,"sources":["../../src/model/theme.ts"],"sourcesContent":["// Copyright 2022 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 type { EChartsOption, EChartsCoreOption, BarSeriesOption, LineSeriesOption, GaugeSeriesOption } from 'echarts';\n\nexport interface PersesChartsTheme {\n echartsTheme: EChartsTheme;\n noDataOption: EChartsCoreOption;\n sparkline: {\n width: number;\n color: string;\n };\n}\n\n// https://github.com/apache/echarts/issues/12489#issuecomment-643185207\nexport interface EChartsTheme extends EChartsOption {\n bar?: BarSeriesOption;\n line?: LineSeriesOption;\n gauge?: GaugeSeriesOption;\n}\n"],"names":[],"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;AAEjC,WAgBC"}
|
package/dist/model/units.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { milliseconds } from 'date-fns';
|
|
14
|
-
import { round } from 'mathjs';
|
|
14
|
+
import { round } from '../utils/mathjs';
|
|
15
15
|
export const DEFAULT_DECIMAL_PLACES = 2;
|
|
16
16
|
export function formatValue(value, unitOptions) {
|
|
17
17
|
if (unitOptions === undefined) {
|
package/dist/model/units.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/units.ts"],"sourcesContent":["// Copyright 2022 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 { Duration, milliseconds } from 'date-fns';\nimport { round } from 'mathjs';\n\nexport const DEFAULT_DECIMAL_PLACES = 2;\n\nexport type UnitOptions = TimeUnitOptions | PercentUnitOptions | DecimalUnitOptions | BytesUnitOptions;\n\nexport function formatValue(value: number, unitOptions?: UnitOptions): string {\n if (unitOptions === undefined) {\n return value.toString();\n }\n\n if (isDecimalUnit(unitOptions)) {\n return formatDecimal(value, unitOptions);\n }\n\n if (isTimeUnit(unitOptions)) {\n return formatTime(value, unitOptions);\n }\n\n if (isPercentUnit(unitOptions)) {\n return formatPercent(value, unitOptions);\n }\n\n if (isBytesUnit(unitOptions)) {\n const decimals = unitOptions.decimal_places ?? DEFAULT_DECIMAL_PLACES;\n return formatBytes(value, decimals);\n }\n\n const exhaustive: never = unitOptions;\n throw new Error(`Unknown unit options ${exhaustive}`);\n}\n\n/* Time Unit Conversion */\nconst timeUnitKinds = ['Milliseconds', 'Seconds', 'Minutes', 'Hours', 'Days', 'Weeks', 'Months', 'Years'] as const;\nconst timeUnitKindsSet = new Set<string>(timeUnitKinds);\n\ntype TimeUnitOptions = {\n kind: typeof timeUnitKinds[number];\n};\n\nfunction isTimeUnit(unitOptions: UnitOptions): unitOptions is TimeUnitOptions {\n return timeUnitKindsSet.has(unitOptions.kind);\n}\n\nfunction formatTime(value: number, unitOptions: TimeUnitOptions): string {\n // Create a Duration from the value based on what time unit it is\n const duration: Duration = {};\n switch (unitOptions.kind) {\n case 'Milliseconds':\n duration.seconds = value / 1000;\n break;\n case 'Seconds':\n duration.seconds = value;\n break;\n case 'Minutes':\n duration.minutes = value;\n break;\n case 'Hours':\n duration.hours = value;\n break;\n case 'Days':\n duration.days = value;\n break;\n case 'Weeks':\n duration.weeks = value;\n break;\n case 'Months':\n duration.months = value;\n break;\n case 'Years':\n duration.years = value;\n break;\n default: {\n const exhaustive: never = unitOptions.kind;\n throw new Error(`Unknown time unit type ${exhaustive}`);\n }\n }\n\n // Find the largest whole time unit we can display the value in and use it\n const ms = milliseconds(duration);\n const seconds = ms / 1000;\n if (seconds < 1) {\n return `${ms.toFixed()} milliseconds`;\n }\n\n const minutes = seconds / 60;\n if (minutes < 1) {\n return `${seconds.toFixed()} seconds`;\n }\n\n const hours = minutes / 60;\n if (hours < 1) {\n return `${minutes.toFixed()} minutes`;\n }\n\n const days = hours / 24;\n if (days < 1) {\n return `${hours.toFixed()} hours`;\n }\n\n const weeks = days / 7;\n if (weeks < 1) {\n return `${days.toFixed()} days`;\n }\n\n const years = weeks / 52;\n if (years < 1) {\n return `${weeks.toFixed()} weeks`;\n }\n\n return `${years.toFixed()} years`;\n}\n\n/* Percent Unit Conversion */\nconst percentUnitKinds = ['Percent', 'PercentDecimal', '%'] as const;\nconst percentUnitKindsSet = new Set<string>(percentUnitKinds);\n\ntype PercentUnitOptions = {\n kind: typeof percentUnitKinds[number];\n decimal_places?: number;\n};\n\nfunction isPercentUnit(unitOptions: UnitOptions): unitOptions is PercentUnitOptions {\n return percentUnitKindsSet.has(unitOptions.kind);\n}\n\nfunction formatPercent(value: number, unitOptions: PercentUnitOptions): string {\n const decimals = unitOptions.decimal_places ?? DEFAULT_DECIMAL_PLACES;\n\n if (unitOptions.kind === 'PercentDecimal') {\n value = value * 100;\n }\n\n return value.toFixed(decimals) + '%';\n}\n\n/* Decimal Unit Conversion */\nconst decimalUnitKinds = ['Decimal'] as const;\nconst decimalUnitKindsSet = new Set<string>(decimalUnitKinds);\n\ntype DecimalUnitOptions = {\n kind: typeof decimalUnitKinds[number];\n decimal_places?: number;\n abbreviate?: boolean;\n};\n\nfunction isDecimalUnit(unitOptions: UnitOptions): unitOptions is DecimalUnitOptions {\n return decimalUnitKindsSet.has(unitOptions.kind);\n}\n\nfunction formatDecimal(value: number, unitOptions: DecimalUnitOptions): string {\n const decimals = unitOptions.decimal_places ?? DEFAULT_DECIMAL_PLACES;\n\n if (unitOptions.abbreviate === true) {\n return abbreviateLargeNumber(value, decimals);\n }\n\n const formatParams: Intl.NumberFormatOptions = {\n style: 'decimal',\n minimumFractionDigits: 0,\n maximumFractionDigits: decimals,\n useGrouping: true,\n };\n const decimalFormatter = new Intl.NumberFormat('en-US', formatParams);\n return decimalFormatter.format(value);\n}\n\n/**\n * Takes large numbers and abbreviates them with the appropriate suffix\n * 10123 -> 10.123k\n * 1000000 -> 1M\n */\nexport function abbreviateLargeNumber(num: number, decimals = 2) {\n const modifier = (n: number) => round(n, decimals);\n return formatNumber(num, modifier);\n}\n\n/**\n * Takes large numbers, rounds and abbreviates them with the appropriate suffix\n * Add modifier to run on output value prior to unit being added (defaults to rounding)\n */\nexport function formatNumber(num: number, modifier?: (n: number) => number): string {\n const fn = modifier ?? Math.round;\n\n return num >= 1e12\n ? fn(num / 1e12) + 'T'\n : num >= 1e9\n ? fn(num / 1e9) + 'B'\n : num >= 1e6\n ? fn(num / 1e6) + 'M'\n : num >= 1e3\n ? fn(num / 1e3) + 'K'\n : num.toString();\n}\n\n/* Bytes Unit Conversion */\nconst bytesUnitKinds = ['Bytes'] as const;\nconst bytesUnitKindsSet = new Set<string>(bytesUnitKinds);\n\ntype BytesUnitOptions = {\n kind: typeof bytesUnitKinds[number];\n decimal_places?: number;\n};\n\nfunction isBytesUnit(unitOptions: UnitOptions): unitOptions is BytesUnitOptions {\n return bytesUnitKindsSet.has(unitOptions.kind);\n}\n\n// https://stackoverflow.com/questions/15900485/correct-way-to-convert-size-in-bytes-to-kb-mb-gb-in-javascript/18650828#18650828\nfunction formatBytes(bytes: number, decimals = 2) {\n if (bytes === 0) return '0 Bytes';\n\n const k = 1024;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n\n // Math.max(0, ...) ensures that we don't return -1 as a value for the index.\n // Why? When the number of bytes are between -1 and 1, Math.floor(Math.log(bytes)/Math.log(1024)) returns -1.\n const i = Math.max(0, Math.floor(Math.log(bytes) / Math.log(k)));\n\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n}\n"],"names":["milliseconds","round","DEFAULT_DECIMAL_PLACES","formatValue","value","unitOptions","undefined","toString","isDecimalUnit","formatDecimal","isTimeUnit","formatTime","isPercentUnit","formatPercent","isBytesUnit","decimals","decimal_places","formatBytes","exhaustive","Error","timeUnitKinds","timeUnitKindsSet","Set","has","kind","duration","seconds","minutes","hours","days","weeks","months","years","ms","toFixed","percentUnitKinds","percentUnitKindsSet","decimalUnitKinds","decimalUnitKindsSet","abbreviate","abbreviateLargeNumber","formatParams","style","minimumFractionDigits","maximumFractionDigits","useGrouping","decimalFormatter","Intl","NumberFormat","format","num","modifier","n","formatNumber","fn","Math","bytesUnitKinds","bytesUnitKindsSet","bytes","k","dm","sizes","i","max","floor","log","parseFloat","pow"],"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;AAEjC,SAAmBA,YAAY,QAAQ,UAAU,CAAC;AAClD,SAASC,KAAK,QAAQ,QAAQ,CAAC;AAE/B,OAAO,MAAMC,sBAAsB,GAAG,CAAC,CAAC;AAIxC,OAAO,SAASC,WAAW,CAACC,KAAa,EAAEC,WAAyB,EAAU;IAC5E,IAAIA,WAAW,KAAKC,SAAS,EAAE;QAC7B,OAAOF,KAAK,CAACG,QAAQ,EAAE,CAAC;IAC1B,CAAC;IAED,IAAIC,aAAa,CAACH,WAAW,CAAC,EAAE;QAC9B,OAAOI,aAAa,CAACL,KAAK,EAAEC,WAAW,CAAC,CAAC;IAC3C,CAAC;IAED,IAAIK,UAAU,CAACL,WAAW,CAAC,EAAE;QAC3B,OAAOM,UAAU,CAACP,KAAK,EAAEC,WAAW,CAAC,CAAC;IACxC,CAAC;IAED,IAAIO,aAAa,CAACP,WAAW,CAAC,EAAE;QAC9B,OAAOQ,aAAa,CAACT,KAAK,EAAEC,WAAW,CAAC,CAAC;IAC3C,CAAC;IAED,IAAIS,WAAW,CAACT,WAAW,CAAC,EAAE;YACXA,eAA0B;QAA3C,MAAMU,QAAQ,GAAGV,CAAAA,eAA0B,GAA1BA,WAAW,CAACW,cAAc,cAA1BX,eAA0B,c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1
|
+
{"version":3,"sources":["../../src/model/units.ts"],"sourcesContent":["// Copyright 2022 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 { Duration, milliseconds } from 'date-fns';\nimport { round } from '../utils/mathjs';\n\nexport const DEFAULT_DECIMAL_PLACES = 2;\n\nexport type UnitOptions = TimeUnitOptions | PercentUnitOptions | DecimalUnitOptions | BytesUnitOptions;\n\nexport function formatValue(value: number, unitOptions?: UnitOptions): string {\n if (unitOptions === undefined) {\n return value.toString();\n }\n\n if (isDecimalUnit(unitOptions)) {\n return formatDecimal(value, unitOptions);\n }\n\n if (isTimeUnit(unitOptions)) {\n return formatTime(value, unitOptions);\n }\n\n if (isPercentUnit(unitOptions)) {\n return formatPercent(value, unitOptions);\n }\n\n if (isBytesUnit(unitOptions)) {\n const decimals = unitOptions.decimal_places ?? DEFAULT_DECIMAL_PLACES;\n return formatBytes(value, decimals);\n }\n\n const exhaustive: never = unitOptions;\n throw new Error(`Unknown unit options ${exhaustive}`);\n}\n\n/* Time Unit Conversion */\nconst timeUnitKinds = ['Milliseconds', 'Seconds', 'Minutes', 'Hours', 'Days', 'Weeks', 'Months', 'Years'] as const;\nconst timeUnitKindsSet = new Set<string>(timeUnitKinds);\n\ntype TimeUnitOptions = {\n kind: typeof timeUnitKinds[number];\n};\n\nfunction isTimeUnit(unitOptions: UnitOptions): unitOptions is TimeUnitOptions {\n return timeUnitKindsSet.has(unitOptions.kind);\n}\n\nfunction formatTime(value: number, unitOptions: TimeUnitOptions): string {\n // Create a Duration from the value based on what time unit it is\n const duration: Duration = {};\n switch (unitOptions.kind) {\n case 'Milliseconds':\n duration.seconds = value / 1000;\n break;\n case 'Seconds':\n duration.seconds = value;\n break;\n case 'Minutes':\n duration.minutes = value;\n break;\n case 'Hours':\n duration.hours = value;\n break;\n case 'Days':\n duration.days = value;\n break;\n case 'Weeks':\n duration.weeks = value;\n break;\n case 'Months':\n duration.months = value;\n break;\n case 'Years':\n duration.years = value;\n break;\n default: {\n const exhaustive: never = unitOptions.kind;\n throw new Error(`Unknown time unit type ${exhaustive}`);\n }\n }\n\n // Find the largest whole time unit we can display the value in and use it\n const ms = milliseconds(duration);\n const seconds = ms / 1000;\n if (seconds < 1) {\n return `${ms.toFixed()} milliseconds`;\n }\n\n const minutes = seconds / 60;\n if (minutes < 1) {\n return `${seconds.toFixed()} seconds`;\n }\n\n const hours = minutes / 60;\n if (hours < 1) {\n return `${minutes.toFixed()} minutes`;\n }\n\n const days = hours / 24;\n if (days < 1) {\n return `${hours.toFixed()} hours`;\n }\n\n const weeks = days / 7;\n if (weeks < 1) {\n return `${days.toFixed()} days`;\n }\n\n const years = weeks / 52;\n if (years < 1) {\n return `${weeks.toFixed()} weeks`;\n }\n\n return `${years.toFixed()} years`;\n}\n\n/* Percent Unit Conversion */\nconst percentUnitKinds = ['Percent', 'PercentDecimal', '%'] as const;\nconst percentUnitKindsSet = new Set<string>(percentUnitKinds);\n\ntype PercentUnitOptions = {\n kind: typeof percentUnitKinds[number];\n decimal_places?: number;\n};\n\nfunction isPercentUnit(unitOptions: UnitOptions): unitOptions is PercentUnitOptions {\n return percentUnitKindsSet.has(unitOptions.kind);\n}\n\nfunction formatPercent(value: number, unitOptions: PercentUnitOptions): string {\n const decimals = unitOptions.decimal_places ?? DEFAULT_DECIMAL_PLACES;\n\n if (unitOptions.kind === 'PercentDecimal') {\n value = value * 100;\n }\n\n return value.toFixed(decimals) + '%';\n}\n\n/* Decimal Unit Conversion */\nconst decimalUnitKinds = ['Decimal'] as const;\nconst decimalUnitKindsSet = new Set<string>(decimalUnitKinds);\n\ntype DecimalUnitOptions = {\n kind: typeof decimalUnitKinds[number];\n decimal_places?: number;\n abbreviate?: boolean;\n};\n\nfunction isDecimalUnit(unitOptions: UnitOptions): unitOptions is DecimalUnitOptions {\n return decimalUnitKindsSet.has(unitOptions.kind);\n}\n\nfunction formatDecimal(value: number, unitOptions: DecimalUnitOptions): string {\n const decimals = unitOptions.decimal_places ?? DEFAULT_DECIMAL_PLACES;\n\n if (unitOptions.abbreviate === true) {\n return abbreviateLargeNumber(value, decimals);\n }\n\n const formatParams: Intl.NumberFormatOptions = {\n style: 'decimal',\n minimumFractionDigits: 0,\n maximumFractionDigits: decimals,\n useGrouping: true,\n };\n const decimalFormatter = new Intl.NumberFormat('en-US', formatParams);\n return decimalFormatter.format(value);\n}\n\n/**\n * Takes large numbers and abbreviates them with the appropriate suffix\n * 10123 -> 10.123k\n * 1000000 -> 1M\n */\nexport function abbreviateLargeNumber(num: number, decimals = 2) {\n const modifier = (n: number) => round(n, decimals);\n return formatNumber(num, modifier);\n}\n\n/**\n * Takes large numbers, rounds and abbreviates them with the appropriate suffix\n * Add modifier to run on output value prior to unit being added (defaults to rounding)\n */\nexport function formatNumber(num: number, modifier?: (n: number) => number): string {\n const fn = modifier ?? Math.round;\n\n return num >= 1e12\n ? fn(num / 1e12) + 'T'\n : num >= 1e9\n ? fn(num / 1e9) + 'B'\n : num >= 1e6\n ? fn(num / 1e6) + 'M'\n : num >= 1e3\n ? fn(num / 1e3) + 'K'\n : num.toString();\n}\n\n/* Bytes Unit Conversion */\nconst bytesUnitKinds = ['Bytes'] as const;\nconst bytesUnitKindsSet = new Set<string>(bytesUnitKinds);\n\ntype BytesUnitOptions = {\n kind: typeof bytesUnitKinds[number];\n decimal_places?: number;\n};\n\nfunction isBytesUnit(unitOptions: UnitOptions): unitOptions is BytesUnitOptions {\n return bytesUnitKindsSet.has(unitOptions.kind);\n}\n\n// https://stackoverflow.com/questions/15900485/correct-way-to-convert-size-in-bytes-to-kb-mb-gb-in-javascript/18650828#18650828\nfunction formatBytes(bytes: number, decimals = 2) {\n if (bytes === 0) return '0 Bytes';\n\n const k = 1024;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n\n // Math.max(0, ...) ensures that we don't return -1 as a value for the index.\n // Why? When the number of bytes are between -1 and 1, Math.floor(Math.log(bytes)/Math.log(1024)) returns -1.\n const i = Math.max(0, Math.floor(Math.log(bytes) / Math.log(k)));\n\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n}\n"],"names":["milliseconds","round","DEFAULT_DECIMAL_PLACES","formatValue","value","unitOptions","undefined","toString","isDecimalUnit","formatDecimal","isTimeUnit","formatTime","isPercentUnit","formatPercent","isBytesUnit","decimals","decimal_places","formatBytes","exhaustive","Error","timeUnitKinds","timeUnitKindsSet","Set","has","kind","duration","seconds","minutes","hours","days","weeks","months","years","ms","toFixed","percentUnitKinds","percentUnitKindsSet","decimalUnitKinds","decimalUnitKindsSet","abbreviate","abbreviateLargeNumber","formatParams","style","minimumFractionDigits","maximumFractionDigits","useGrouping","decimalFormatter","Intl","NumberFormat","format","num","modifier","n","formatNumber","fn","Math","bytesUnitKinds","bytesUnitKindsSet","bytes","k","dm","sizes","i","max","floor","log","parseFloat","pow"],"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;AAEjC,SAAmBA,YAAY,QAAQ,UAAU,CAAC;AAClD,SAASC,KAAK,QAAQ,iBAAiB,CAAC;AAExC,OAAO,MAAMC,sBAAsB,GAAG,CAAC,CAAC;AAIxC,OAAO,SAASC,WAAW,CAACC,KAAa,EAAEC,WAAyB,EAAU;IAC5E,IAAIA,WAAW,KAAKC,SAAS,EAAE;QAC7B,OAAOF,KAAK,CAACG,QA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AI;QAAE,IAAI;QAAE,IAAI;QAAE,IAAI;QAAE,IAAI;QAAE,IAAI;KAAC,AAAC;IAExE,6EAA6E;IAC7E,6GAA6G;IAC7G,MAAMC,CAAC,GAAGP,IAAI,CAACQ,GAAG,CAAC,CAAC,EAAER,IAAI,CAACS,KAAK,CAACT,IAAI,CAACU,GAAG,CAACP,KAAK,CAAC,GAAGH,IAAI,CAACU,GAAG,CAACN,CAAC,CAAC,CAAC,CAAC,AAAC;IAEjE,OAAOO,UAAU,CAAC,AAACR,CAAAA,KAAK,GAAGH,IAAI,CAACY,GAAG,CAACR,CAAC,EAAEG,CAAC,CAAC,CAAA,CAAE5B,OAAO,CAAC0B,EAAE,CAAC,CAAC,GAAG,GAAG,GAAGC,KAAK,CAACC,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
package/dist/test/index.d.ts
CHANGED
package/dist/test/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC"}
|
package/dist/test/index.js
CHANGED
package/dist/test/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test/index.ts"],"sourcesContent":["// Copyright 2022 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\nexport * from './render';\
|
|
1
|
+
{"version":3,"sources":["../../src/test/index.ts"],"sourcesContent":["// Copyright 2022 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\nexport * from './render';\n"],"names":[],"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;AAEjC,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-utils/index.ts"],"names":[],"mappings":"AAaA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export * from './theme';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test-utils/index.ts"],"sourcesContent":["// Copyright 2022 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\nexport * from './theme';\n"],"names":[],"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;AAEjC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/test-utils/theme.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,eAAe,EAAE,iBAO7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/test-utils/theme.ts"],"sourcesContent":["// Copyright 2022 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 { PersesChartsTheme } from '../model';\n\nexport const testChartsTheme: PersesChartsTheme = {\n echartsTheme: {},\n noDataOption: {},\n sparkline: {\n width: 1,\n color: '#000000',\n },\n};\n"],"names":["testChartsTheme","echartsTheme","noDataOption","sparkline","width","color"],"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,GAAsB;IAChDC,YAAY,EAAE,EAAE;IAChBC,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE;QACTC,KAAK,EAAE,CAAC;QACRC,KAAK,EAAE,SAAS;KACjB;CACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const round: {
|
|
2
|
+
<T extends import("mathjs").MathNumericType | import("mathjs").MathCollection>(x: T, n?: number | import("mathjs").BigNumber | undefined): T extends number ? number : T extends string ? string : T extends boolean ? boolean : T;
|
|
3
|
+
<U extends import("mathjs").MathCollection>(x: import("mathjs").MathNumericType, n: U): U;
|
|
4
|
+
};
|
|
5
|
+
export { round };
|
|
6
|
+
//# sourceMappingURL=mathjs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mathjs.d.ts","sourceRoot":"","sources":["../../src/utils/mathjs.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAQ,KAAK;;;CAAkC,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import { roundDependencies, create } from 'mathjs';
|
|
14
|
+
// This ensures we get a minimal mathjs bundle for just what we need (see https://mathjs.org/docs/custom_bundling.html)
|
|
15
|
+
const { round } = create({
|
|
16
|
+
roundDependencies
|
|
17
|
+
});
|
|
18
|
+
export { round };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=mathjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/mathjs.ts"],"sourcesContent":["// Copyright 2022 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 { roundDependencies, create } from 'mathjs';\n\n// This ensures we get a minimal mathjs bundle for just what we need (see https://mathjs.org/docs/custom_bundling.html)\nconst { round } = create({ roundDependencies });\nexport { round };\n"],"names":["roundDependencies","create","round"],"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;AAEjC,SAASA,iBAAiB,EAAEC,MAAM,QAAQ,QAAQ,CAAC;AAEnD,uHAAuH;AACvH,MAAM,EAAEC,KAAK,CAAA,EAAE,GAAGD,MAAM,CAAC;IAAED,iBAAiB;CAAE,CAAC,AAAC;AAChD,SAASE,KAAK,GAAG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Theme } from '@mui/material';
|
|
2
2
|
import { EChartsTheme, PersesChartsTheme } from '../model';
|
|
3
3
|
declare type MuiTheme = Omit<Theme, 'components'>;
|
|
4
|
-
export declare function generateChartsTheme(
|
|
4
|
+
export declare function generateChartsTheme(muiTheme: MuiTheme, echartsTheme: EChartsTheme): PersesChartsTheme;
|
|
5
5
|
export {};
|
|
6
6
|
//# sourceMappingURL=theme-gen.d.ts.map
|