@perses-dev/components 0.5.2 → 0.6.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/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +1 -1
- package/dist/Tooltip/Tooltip.d.ts +1 -0
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +1 -1
- package/dist/Tooltip/tooltip-model.d.ts +1 -1
- package/dist/Tooltip/tooltip-model.js +1 -1
- package/dist/cjs/LineChart/LineChart.js +13 -3
- package/dist/cjs/Tooltip/Tooltip.js +6 -13
- package/dist/cjs/Tooltip/tooltip-model.js +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../src/LineChart/LineChart.tsx"],"names":[],"mappings":";AAgBA,OAAO,KAAK,EAEV,mBAAmB,EAEnB,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAiBjB,OAAO,EAAiC,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAe,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAgE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiBtG,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,SAAS,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../src/LineChart/LineChart.tsx"],"names":[],"mappings":";AAgBA,OAAO,KAAK,EAEV,mBAAmB,EAEnB,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAiBjB,OAAO,EAAiC,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAe,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAgE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiBtG,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,SAAS,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,cAAc,eAsJpG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useMemo,useRef,useState}from"react";import{useDeepMemo}from"@perses-dev/core";import{Box}from"@mui/material";import{use}from"echarts/core";import{LineChart as EChartsLineChart}from"echarts/charts";import{GridComponent,DataZoomComponent,MarkAreaComponent,MarkLineComponent,MarkPointComponent,TitleComponent,ToolboxComponent,TooltipComponent,LegendComponent,VisualMapComponent}from"echarts/components";import{CanvasRenderer}from"echarts/renderers";import{EChart}from"../EChart";import{PROGRESSIVE_MODE_SERIES_LIMIT}from"../model/graph";import{formatValue}from"../model/units";import{useChartsTheme}from"../context/ChartsThemeProvider";import{Tooltip}from"../Tooltip/Tooltip";import{enableDataZoom,restoreChart,getDateRange,getFormattedDate}from"./utils";use([EChartsLineChart,GridComponent,DataZoomComponent,MarkAreaComponent,MarkLineComponent,MarkPointComponent,TitleComponent,ToolboxComponent,TooltipComponent,LegendComponent,VisualMapComponent,CanvasRenderer]);export function LineChart({height:e,data:o,unit:t,grid:r,legend:n,visualMap:a,onDataZoom:i}){const s=useChartsTheme(),m=useRef(),[p,l]=useState(!0),u=useMemo((()=>({datazoom:e=>{var t,r;if(void 0===i||void 0===e.batch[0])return;const n=null!==(t=e.batch[0].startValue)&&void 0!==t?t:0,a=null!==(r=e.batch[0].endValue)&&void 0!==r?r:o.xAxis.length-1,s=o.xAxis[n],m=o.xAxis[a];void 0!==s&&void 0!==m&&i({start:s,end:m,startIndex:n,endIndex:a})}})),[o,i]);void 0!==m.current&&enableDataZoom(m.current);const
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useMemo,useRef,useState}from"react";import{useDeepMemo}from"@perses-dev/core";import{Box}from"@mui/material";import{use}from"echarts/core";import{LineChart as EChartsLineChart}from"echarts/charts";import{GridComponent,DataZoomComponent,MarkAreaComponent,MarkLineComponent,MarkPointComponent,TitleComponent,ToolboxComponent,TooltipComponent,LegendComponent,VisualMapComponent}from"echarts/components";import{CanvasRenderer}from"echarts/renderers";import{EChart}from"../EChart";import{PROGRESSIVE_MODE_SERIES_LIMIT}from"../model/graph";import{formatValue}from"../model/units";import{useChartsTheme}from"../context/ChartsThemeProvider";import{Tooltip}from"../Tooltip/Tooltip";import{enableDataZoom,restoreChart,getDateRange,getFormattedDate}from"./utils";use([EChartsLineChart,GridComponent,DataZoomComponent,MarkAreaComponent,MarkLineComponent,MarkPointComponent,TitleComponent,ToolboxComponent,TooltipComponent,LegendComponent,VisualMapComponent,CanvasRenderer]);export function LineChart({height:e,data:o,unit:t,grid:r,legend:n,visualMap:a,onDataZoom:i}){const s=useChartsTheme(),m=useRef(),[p,l]=useState(!0),[u,h]=useState(!1),x=useMemo((()=>({datazoom:e=>{var t,r;if(void 0===i&&setTimeout((()=>{h(!1)}),10),void 0===i||void 0===e.batch[0])return;const n=null!==(t=e.batch[0].startValue)&&void 0!==t?t:0,a=null!==(r=e.batch[0].endValue)&&void 0!==r?r:o.xAxis.length-1,s=o.xAxis[n],m=o.xAxis[a];void 0!==s&&void 0!==m&&i({start:s,end:m,startIndex:n,endIndex:a})}})),[o,i,h]);void 0!==m.current&&enableDataZoom(m.current);const d=useDeepMemo((()=>{var e;if(void 0===o.timeSeries)return{};if(null===o.timeSeries||0===o.timeSeries.length)return s.noDataOption;const i=o.timeSeries.length<PROGRESSIVE_MODE_SERIES_LIMIT,m=null!==(e=o.rangeMs)&&void 0!==e?e:getDateRange(o.xAxis);return{series:o.timeSeries,xAxis:{type:"category",data:o.xAxis,max:o.xAxisMax,axisLabel:{formatter:e=>getFormattedDate(e,m)}},yAxis:{type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>formatValue(e,t)}},animation:!1,tooltip:{show:i,trigger:"axis",showContent:!1,axisPointer:{type:"none"}},toolbox:{feature:{dataZoom:{icon:null,yAxisIndex:"none"}}},grid:r,legend:n,visualMap:a}}),[o,r,n,a]);return _jsxs(Box,{sx:{height:e},onClick:()=>h((e=>!e)),onDoubleClick:()=>{h(!1),void 0!==m.current&&restoreChart(m.current)},onMouseDown:e=>{e.target instanceof HTMLCanvasElement&&l(!1)},onMouseUp:()=>{l(!0)},onMouseLeave:()=>{l(!1),h(!1)},onMouseEnter:()=>{l(!0)},children:[!0===p&&_jsx(Tooltip,{chartRef:m,chartData:o,wrapLabels:!0,pinTooltip:u}),_jsx(EChart,{sx:{width:"100%",height:"100%"},option:d,theme:s.themeName,onEvents:x,_instance:m})]})}
|
|
@@ -4,6 +4,7 @@ import { EChartsDataFormat } from '../model/graph';
|
|
|
4
4
|
interface TooltipProps {
|
|
5
5
|
chartRef: React.MutableRefObject<EChartsInstance | undefined>;
|
|
6
6
|
chartData: EChartsDataFormat;
|
|
7
|
+
pinTooltip: boolean;
|
|
7
8
|
wrapLabels?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare const Tooltip: React.NamedExoticComponent<TooltipProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMnD,UAAU,YAAY;IACpB,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IAC9D,SAAS,EAAE,iBAAiB,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMnD,UAAU,YAAY;IACpB,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IAC9D,SAAS,EAAE,iBAAiB,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,OAAO,0CAqDX,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/Tooltip/Tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import React,{useState}from"react";import{Box,Portal}from"@mui/material";import{getFocusedSeriesData}from"./focused-series";import{TOOLTIP_MAX_HEIGHT,TOOLTIP_MAX_WIDTH,useMousePosition}from"./tooltip-model";import{TooltipContent}from"./TooltipContent";import{assembleTransform}from"./utils";const Tooltip=React.memo((function({chartRef:o,chartData:t,wrapLabels:e}){var
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import React,{useState}from"react";import{Box,Portal}from"@mui/material";import{getFocusedSeriesData}from"./focused-series";import{TOOLTIP_MAX_HEIGHT,TOOLTIP_MAX_WIDTH,useMousePosition}from"./tooltip-model";import{TooltipContent}from"./TooltipContent";import{assembleTransform}from"./utils";const Tooltip=React.memo((function({chartRef:o,chartData:t,wrapLabels:e,pinTooltip:r}){var l,i;const[s,n]=useState(null),a=useMousePosition();if(null===a||null===a.target)return null;if(null===s&&"CANVAS"!==a.target.tagName)return null;const u=o.current,m=getFocusedSeriesData(a,t,s,u),p=null!==(l=null==u?void 0:u.getWidth())&&void 0!==l?l:750,f=null!==(i=null==u?void 0:u.getHeight())&&void 0!==i?i:230,c=assembleTransform(a,m.length,p,f,s);return 0===m.length?null:(!0===r&&null===s&&n(a),_jsx(Portal,{children:_jsx(Box,{sx:o=>({maxWidth:TOOLTIP_MAX_WIDTH,maxHeight:TOOLTIP_MAX_HEIGHT,position:"absolute",top:0,left:0,backgroundColor:"#2E313E",borderRadius:"6px",color:"#fff",fontSize:"11px",visibility:"visible",opacity:1,transition:"all 0.1s ease-out",zIndex:o.zIndex.tooltip,overflow:"hidden","&:hover":{overflowY:"auto"}}),style:{transform:c},children:_jsx(TooltipContent,{focusedSeries:m,wrapLabels:e})})}))}));export{Tooltip};
|
|
@@ -2,7 +2,7 @@ import { FocusedSeriesArray } from './focused-series';
|
|
|
2
2
|
export declare const TOOLTIP_MAX_WIDTH = 650;
|
|
3
3
|
export declare const TOOLTIP_MAX_HEIGHT = 230;
|
|
4
4
|
export declare const TOOLTIP_LABELS_MAX_WIDTH: number;
|
|
5
|
-
export declare const TOOLTIP_MAX_ITEMS =
|
|
5
|
+
export declare const TOOLTIP_MAX_ITEMS = 50;
|
|
6
6
|
export declare const TOOLTIP_DATE_FORMAT: Intl.DateTimeFormat;
|
|
7
7
|
export declare const defaultCursorData: {
|
|
8
8
|
coords: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect,useState}from"react";export const TOOLTIP_MAX_WIDTH=650;export const TOOLTIP_MAX_HEIGHT=230;export const TOOLTIP_LABELS_MAX_WIDTH=500;export const TOOLTIP_MAX_ITEMS=
|
|
1
|
+
import{useEffect,useState}from"react";export const TOOLTIP_MAX_WIDTH=650;export const TOOLTIP_MAX_HEIGHT=230;export const TOOLTIP_LABELS_MAX_WIDTH=500;export const TOOLTIP_MAX_ITEMS=50;export const TOOLTIP_DATE_FORMAT=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0});export const defaultCursorData={coords:{viewport:{x:0,y:0},plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0};export const emptyTooltipData={cursor:defaultCursorData,focusedSeries:null};export const useMousePosition=()=>{const[e,t]=useState(null);return useEffect((()=>{const e=e=>t({viewport:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.offsetX,y:e.offsetY},zrender:{x:e.zrX,y:e.zrY},target:e.target});return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}}),[]),e};
|
|
@@ -45,11 +45,17 @@ function LineChart({ height, data, unit, grid, legend, visualMap, onDataZoom })
|
|
|
45
45
|
const chartsTheme = (0, ChartsThemeProvider_1.useChartsTheme)();
|
|
46
46
|
const chartRef = (0, react_1.useRef)();
|
|
47
47
|
const [showTooltip, setShowTooltip] = (0, react_1.useState)(true);
|
|
48
|
+
const [pinTooltip, setPinTooltip] = (0, react_1.useState)(false);
|
|
48
49
|
const handleEvents = (0, react_1.useMemo)(() => {
|
|
49
50
|
return {
|
|
50
|
-
// TODO: use legendselectchanged event to fix tooltip when legend selected
|
|
51
51
|
datazoom: (params) => {
|
|
52
52
|
var _a, _b;
|
|
53
|
+
if (onDataZoom === undefined) {
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
// workaround so unpin happens after click event
|
|
56
|
+
setPinTooltip(false);
|
|
57
|
+
}, 10);
|
|
58
|
+
}
|
|
53
59
|
if (onDataZoom === undefined || params.batch[0] === undefined)
|
|
54
60
|
return;
|
|
55
61
|
const startIndex = (_a = params.batch[0].startValue) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -66,12 +72,15 @@ function LineChart({ height, data, unit, grid, legend, visualMap, onDataZoom })
|
|
|
66
72
|
onDataZoom(zoomEvent);
|
|
67
73
|
}
|
|
68
74
|
},
|
|
75
|
+
// TODO: use legendselectchanged event to fix tooltip when legend selected
|
|
69
76
|
};
|
|
70
|
-
}, [data, onDataZoom]);
|
|
77
|
+
}, [data, onDataZoom, setPinTooltip]);
|
|
71
78
|
if (chartRef.current !== undefined) {
|
|
72
79
|
(0, utils_1.enableDataZoom)(chartRef.current);
|
|
73
80
|
}
|
|
81
|
+
const handleOnClick = () => setPinTooltip((current) => !current);
|
|
74
82
|
const handleOnDoubleClick = () => {
|
|
83
|
+
setPinTooltip(false);
|
|
75
84
|
if (chartRef.current !== undefined) {
|
|
76
85
|
(0, utils_1.restoreChart)(chartRef.current);
|
|
77
86
|
}
|
|
@@ -90,6 +99,7 @@ function LineChart({ height, data, unit, grid, legend, visualMap, onDataZoom })
|
|
|
90
99
|
};
|
|
91
100
|
const handleOnMouseLeave = () => {
|
|
92
101
|
setShowTooltip(false);
|
|
102
|
+
setPinTooltip(false);
|
|
93
103
|
};
|
|
94
104
|
const option = (0, core_1.useDeepMemo)(() => {
|
|
95
105
|
var _a;
|
|
@@ -145,7 +155,7 @@ function LineChart({ height, data, unit, grid, legend, visualMap, onDataZoom })
|
|
|
145
155
|
}, [data, grid, legend, visualMap]);
|
|
146
156
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
147
157
|
height,
|
|
148
|
-
}, onDoubleClick: handleOnDoubleClick, onMouseDown: handleOnMouseDown, onMouseUp: handleOnMouseUp, onMouseLeave: handleOnMouseLeave, onMouseEnter: handleOnMouseEnter, children: [showTooltip === true && (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { chartRef: chartRef, chartData: data, wrapLabels: true }), (0, jsx_runtime_1.jsx)(EChart_1.EChart, { sx: {
|
|
158
|
+
}, onClick: handleOnClick, onDoubleClick: handleOnDoubleClick, onMouseDown: handleOnMouseDown, onMouseUp: handleOnMouseUp, onMouseLeave: handleOnMouseLeave, onMouseEnter: handleOnMouseEnter, children: [showTooltip === true && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { chartRef: chartRef, chartData: data, wrapLabels: true, pinTooltip: pinTooltip })), (0, jsx_runtime_1.jsx)(EChart_1.EChart, { sx: {
|
|
149
159
|
width: '100%',
|
|
150
160
|
height: '100%',
|
|
151
161
|
}, option: option, theme: chartsTheme.themeName, onEvents: handleEvents, _instance: chartRef })] }));
|
|
@@ -43,33 +43,26 @@ const focused_series_1 = require("./focused-series");
|
|
|
43
43
|
const tooltip_model_1 = require("./tooltip-model");
|
|
44
44
|
const TooltipContent_1 = require("./TooltipContent");
|
|
45
45
|
const utils_1 = require("./utils");
|
|
46
|
-
const Tooltip = react_1.default.memo(function Tooltip({ chartRef, chartData, wrapLabels }) {
|
|
46
|
+
const Tooltip = react_1.default.memo(function Tooltip({ chartRef, chartData, wrapLabels, pinTooltip }) {
|
|
47
47
|
var _a, _b;
|
|
48
48
|
const [pinnedPos, setPinnedPos] = (0, react_1.useState)(null);
|
|
49
49
|
const mousePos = (0, tooltip_model_1.useMousePosition)();
|
|
50
50
|
if (mousePos === null || mousePos.target === null)
|
|
51
51
|
return null;
|
|
52
52
|
// ensure user is hovering over a chart before checking for nearby series
|
|
53
|
-
if (mousePos.target.tagName !== 'CANVAS')
|
|
53
|
+
if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS')
|
|
54
54
|
return null;
|
|
55
55
|
const chart = chartRef.current;
|
|
56
56
|
const focusedSeries = (0, focused_series_1.getFocusedSeriesData)(mousePos, chartData, pinnedPos, chart);
|
|
57
57
|
const chartWidth = (_a = chart === null || chart === void 0 ? void 0 : chart.getWidth()) !== null && _a !== void 0 ? _a : 750;
|
|
58
58
|
const chartHeight = (_b = chart === null || chart === void 0 ? void 0 : chart.getHeight()) !== null && _b !== void 0 ? _b : 230;
|
|
59
59
|
const cursorTransform = (0, utils_1.assembleTransform)(mousePos, focusedSeries.length, chartWidth, chartHeight, pinnedPos);
|
|
60
|
-
function handleMouseEnter() {
|
|
61
|
-
if (mousePos !== null) {
|
|
62
|
-
setPinnedPos(mousePos);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function handleMouseLeave() {
|
|
66
|
-
if (pinnedPos !== null) {
|
|
67
|
-
setPinnedPos(null);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
60
|
if (focusedSeries.length === 0) {
|
|
71
61
|
return null;
|
|
72
62
|
}
|
|
63
|
+
if (pinTooltip === true && pinnedPos === null) {
|
|
64
|
+
setPinnedPos(mousePos);
|
|
65
|
+
}
|
|
73
66
|
return ((0, jsx_runtime_1.jsx)(material_1.Portal, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: (theme) => ({
|
|
74
67
|
maxWidth: tooltip_model_1.TOOLTIP_MAX_WIDTH,
|
|
75
68
|
maxHeight: tooltip_model_1.TOOLTIP_MAX_HEIGHT,
|
|
@@ -90,6 +83,6 @@ const Tooltip = react_1.default.memo(function Tooltip({ chartRef, chartData, wra
|
|
|
90
83
|
},
|
|
91
84
|
}), style: {
|
|
92
85
|
transform: cursorTransform,
|
|
93
|
-
},
|
|
86
|
+
}, children: (0, jsx_runtime_1.jsx)(TooltipContent_1.TooltipContent, { focusedSeries: focusedSeries, wrapLabels: wrapLabels }) }) }));
|
|
94
87
|
});
|
|
95
88
|
exports.Tooltip = Tooltip;
|
|
@@ -17,7 +17,7 @@ const react_1 = require("react");
|
|
|
17
17
|
exports.TOOLTIP_MAX_WIDTH = 650;
|
|
18
18
|
exports.TOOLTIP_MAX_HEIGHT = 230;
|
|
19
19
|
exports.TOOLTIP_LABELS_MAX_WIDTH = exports.TOOLTIP_MAX_WIDTH - 150;
|
|
20
|
-
exports.TOOLTIP_MAX_ITEMS =
|
|
20
|
+
exports.TOOLTIP_MAX_ITEMS = 50;
|
|
21
21
|
exports.TOOLTIP_DATE_FORMAT = new Intl.DateTimeFormat(undefined, {
|
|
22
22
|
year: 'numeric',
|
|
23
23
|
month: 'short',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Common UI components used across Perses features",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
@@ -24,14 +24,15 @@
|
|
|
24
24
|
"lint:fix": "eslint --fix src --ext .ts,.tsx"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@perses-dev/core": "^0.
|
|
27
|
+
"@perses-dev/core": "^0.6.0",
|
|
28
28
|
"echarts": "^5.3.3",
|
|
29
29
|
"lodash-es": "^4.17.21",
|
|
30
30
|
"react-error-boundary": "^3.1.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@mui/material": "^5.5.1",
|
|
34
|
-
"react": "^17.0.2"
|
|
34
|
+
"react": "^17.0.2",
|
|
35
|
+
"react-dom": "^17.0.2"
|
|
35
36
|
},
|
|
36
37
|
"files": [
|
|
37
38
|
"dist"
|