@perses-dev/components 0.31.0 → 0.32.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/ContentWithLegend/ContentWithLegend.d.ts +11 -0
- package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -0
- package/dist/ContentWithLegend/ContentWithLegend.js +65 -0
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -0
- package/dist/ContentWithLegend/index.d.ts +2 -0
- package/dist/ContentWithLegend/index.d.ts.map +1 -0
- package/dist/ContentWithLegend/index.js +15 -0
- package/dist/ContentWithLegend/index.js.map +1 -0
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +68 -0
- package/dist/ContentWithLegend/model/content-with-legend-model.d.ts.map +1 -0
- package/dist/ContentWithLegend/model/content-with-legend-model.js +90 -0
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -0
- package/dist/EChart/EChart.d.ts.map +1 -1
- package/dist/EChart/EChart.js +9 -1
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/Legend/Legend.d.ts.map +1 -1
- package/dist/Legend/Legend.js +30 -15
- package/dist/Legend/Legend.js.map +1 -1
- package/dist/Legend/ListLegend.d.ts.map +1 -1
- package/dist/Legend/ListLegend.js +2 -23
- package/dist/Legend/ListLegend.js.map +1 -1
- package/dist/Legend/ListLegendItem.d.ts +1 -1
- package/dist/Legend/TableLegend.d.ts +12 -0
- package/dist/Legend/TableLegend.d.ts.map +1 -0
- package/dist/Legend/TableLegend.js +61 -0
- package/dist/Legend/TableLegend.js.map +1 -0
- package/dist/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/LegendOptionsEditor/LegendOptionsEditor.js +35 -3
- package/dist/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +60 -22
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +8 -1
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.d.ts +5 -5
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.js +36 -54
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts +0 -2
- package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js +21 -97
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts +12 -0
- package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -0
- package/dist/TimeSeriesTooltip/TooltipHeader.js +163 -0
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -0
- package/dist/TimeSeriesTooltip/index.d.ts +1 -0
- package/dist/TimeSeriesTooltip/index.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/index.js +1 -0
- package/dist/TimeSeriesTooltip/index.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +2 -2
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +2 -2
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +10 -14
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +2 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +2 -2
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/cjs/ContentWithLegend/ContentWithLegend.js +70 -0
- package/dist/cjs/ContentWithLegend/index.js +28 -0
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +100 -0
- package/dist/cjs/EChart/EChart.js +9 -1
- package/dist/cjs/Legend/Legend.js +30 -15
- package/dist/cjs/Legend/ListLegend.js +2 -23
- package/dist/cjs/Legend/TableLegend.js +67 -0
- package/dist/cjs/LegendOptionsEditor/LegendOptionsEditor.js +34 -2
- package/dist/cjs/LineChart/LineChart.js +60 -22
- package/dist/cjs/StatChart/StatChart.js +8 -1
- package/dist/cjs/TimeSeriesTooltip/TimeSeriesTooltip.js +34 -91
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +19 -100
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +174 -0
- package/dist/cjs/TimeSeriesTooltip/index.js +1 -0
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +2 -2
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +3 -1
- package/dist/cjs/TimeSeriesTooltip/utils.js +2 -2
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/model/legend.js +30 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model/legend.d.ts +9 -3
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js +26 -1
- package/dist/model/legend.js.map +1 -1
- package/package.json +3 -3
|
@@ -11,27 +11,28 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { Box, Portal,
|
|
15
|
-
import
|
|
14
|
+
import { Box, Portal, Stack } from '@mui/material';
|
|
15
|
+
import { memo, useState } from 'react';
|
|
16
16
|
import useResizeObserver from 'use-resize-observer';
|
|
17
17
|
import { TooltipContent } from './TooltipContent';
|
|
18
|
+
import { TooltipHeader } from './TooltipHeader';
|
|
18
19
|
import { getNearbySeriesData } from './nearby-series';
|
|
19
|
-
import { FALLBACK_CHART_WIDTH,
|
|
20
|
+
import { FALLBACK_CHART_WIDTH, TOOLTIP_BG_COLOR_FALLBACK, TOOLTIP_MAX_HEIGHT, TOOLTIP_MAX_WIDTH, TOOLTIP_MIN_WIDTH, useMousePosition } from './tooltip-model';
|
|
20
21
|
import { assembleTransform } from './utils';
|
|
21
|
-
export const TimeSeriesTooltip = /*#__PURE__*/
|
|
22
|
+
export const TimeSeriesTooltip = /*#__PURE__*/ memo(function TimeSeriesTooltip({ chartRef , chartData , wrapLabels , unit , onUnpinClick , pinnedPos }) {
|
|
22
23
|
const [showAllSeries, setShowAllSeries] = useState(false);
|
|
23
|
-
const [pinnedPos, setPinnedPos] = useState(null);
|
|
24
24
|
const mousePos = useMousePosition();
|
|
25
25
|
const { height , width , ref: tooltipRef } = useResizeObserver();
|
|
26
|
+
const isTooltipPinned = pinnedPos !== null;
|
|
26
27
|
if (mousePos === null || mousePos.target === null) return null;
|
|
27
28
|
// Ensure user is hovering over a chart before checking for nearby series.
|
|
28
29
|
if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS') return null;
|
|
29
30
|
const chart = chartRef.current;
|
|
30
31
|
var ref;
|
|
31
|
-
const chartWidth = (ref = chart === null || chart === void 0 ? void 0 : chart.getWidth()) !== null && ref !== void 0 ? ref : FALLBACK_CHART_WIDTH; // Fallback width not likely to
|
|
32
|
+
const chartWidth = (ref = chart === null || chart === void 0 ? void 0 : chart.getWidth()) !== null && ref !== void 0 ? ref : FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
|
|
32
33
|
const cursorTransform = assembleTransform(mousePos, chartWidth, pinnedPos, height !== null && height !== void 0 ? height : 0, width !== null && width !== void 0 ? width : 0);
|
|
33
34
|
// Get series nearby the cursor and pass into tooltip content children.
|
|
34
|
-
const
|
|
35
|
+
const nearbySeries = getNearbySeriesData({
|
|
35
36
|
mousePos,
|
|
36
37
|
chartData,
|
|
37
38
|
pinnedPos,
|
|
@@ -39,27 +40,25 @@ export const TimeSeriesTooltip = /*#__PURE__*/ React.memo(function TimeSeriesToo
|
|
|
39
40
|
unit,
|
|
40
41
|
showAllSeries
|
|
41
42
|
});
|
|
42
|
-
if (
|
|
43
|
+
if (nearbySeries.length === 0) {
|
|
43
44
|
return null;
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
// Option for user to see all series instead of only the nearby focused series.
|
|
49
|
-
// Only relevant when there are more total series than are visible.
|
|
50
|
-
const showAllSeriesToggle = isTooltipPinned === true && showAllSeries === false && chartData.timeSeries.length > 1 && focusedSeries.length !== chartData.timeSeries.length;
|
|
46
|
+
const totalSeries = chartData.timeSeries.length;
|
|
47
|
+
var ref1;
|
|
51
48
|
return /*#__PURE__*/ _jsx(Portal, {
|
|
52
|
-
children: /*#__PURE__*/
|
|
49
|
+
children: /*#__PURE__*/ _jsx(Box, {
|
|
53
50
|
ref: tooltipRef,
|
|
54
|
-
sx: (theme)=>
|
|
51
|
+
sx: (theme)=>{
|
|
52
|
+
var ref;
|
|
53
|
+
return {
|
|
55
54
|
minWidth: TOOLTIP_MIN_WIDTH,
|
|
56
55
|
maxWidth: TOOLTIP_MAX_WIDTH,
|
|
57
56
|
maxHeight: TOOLTIP_MAX_HEIGHT,
|
|
58
|
-
padding:
|
|
57
|
+
padding: 0,
|
|
59
58
|
position: 'absolute',
|
|
60
59
|
top: 0,
|
|
61
60
|
left: 0,
|
|
62
|
-
backgroundColor:
|
|
61
|
+
backgroundColor: (ref1 = (ref = theme.palette.designSystem) === null || ref === void 0 ? void 0 : ref.grey[800]) !== null && ref1 !== void 0 ? ref1 : TOOLTIP_BG_COLOR_FALLBACK,
|
|
63
62
|
borderRadius: '6px',
|
|
64
63
|
color: '#fff',
|
|
65
64
|
fontSize: '11px',
|
|
@@ -71,45 +70,28 @@ export const TimeSeriesTooltip = /*#__PURE__*/ React.memo(function TimeSeriesToo
|
|
|
71
70
|
'&:hover': {
|
|
72
71
|
overflowY: 'auto'
|
|
73
72
|
}
|
|
74
|
-
}
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
75
|
style: {
|
|
76
76
|
transform: cursorTransform
|
|
77
77
|
},
|
|
78
|
-
children:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
textAlign: 'right'
|
|
96
|
-
},
|
|
97
|
-
children: [
|
|
98
|
-
/*#__PURE__*/ _jsx(Typography, {
|
|
99
|
-
children: "Show All?"
|
|
100
|
-
}),
|
|
101
|
-
/*#__PURE__*/ _jsx(Switch, {
|
|
102
|
-
checked: showAllSeries,
|
|
103
|
-
onChange: (_, checked)=>setShowAllSeries(checked),
|
|
104
|
-
sx: (theme)=>({
|
|
105
|
-
'& .MuiSwitch-switchBase': {
|
|
106
|
-
color: theme.palette.common.white
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
]
|
|
111
|
-
})
|
|
112
|
-
]
|
|
78
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
79
|
+
spacing: 0.5,
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsx(TooltipHeader, {
|
|
82
|
+
nearbySeries: nearbySeries,
|
|
83
|
+
totalSeries: totalSeries,
|
|
84
|
+
isTooltipPinned: isTooltipPinned,
|
|
85
|
+
showAllSeries: showAllSeries,
|
|
86
|
+
onShowAllClick: (checked)=>setShowAllSeries(checked),
|
|
87
|
+
onUnpinClick: onUnpinClick
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
90
|
+
series: nearbySeries,
|
|
91
|
+
wrapLabels: wrapLabels
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
})
|
|
113
95
|
})
|
|
114
96
|
});
|
|
115
97
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/TimeSeriesTooltip.tsx"],"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 { Box, Portal,
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/TimeSeriesTooltip.tsx"],"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 { Box, Portal, Stack } from '@mui/material';\nimport { ECharts as EChartsInstance } from 'echarts/core';\nimport { memo, useState } from 'react';\nimport useResizeObserver from 'use-resize-observer';\nimport { EChartsDataFormat, UnitOptions } from '../model';\nimport { TooltipContent } from './TooltipContent';\nimport { TooltipHeader } from './TooltipHeader';\nimport { getNearbySeriesData } from './nearby-series';\nimport {\n CursorCoordinates,\n FALLBACK_CHART_WIDTH,\n TOOLTIP_BG_COLOR_FALLBACK,\n TOOLTIP_MAX_HEIGHT,\n TOOLTIP_MAX_WIDTH,\n TOOLTIP_MIN_WIDTH,\n useMousePosition,\n} from './tooltip-model';\nimport { assembleTransform } from './utils';\n\nexport interface TimeSeriesTooltipProps {\n chartRef: React.MutableRefObject<EChartsInstance | undefined>;\n chartData: EChartsDataFormat;\n wrapLabels?: boolean;\n unit?: UnitOptions;\n onUnpinClick?: () => void;\n pinnedPos: CursorCoordinates | null;\n}\n\nexport const TimeSeriesTooltip = memo(function TimeSeriesTooltip({\n chartRef,\n chartData,\n wrapLabels,\n unit,\n onUnpinClick,\n pinnedPos,\n}: TimeSeriesTooltipProps) {\n const [showAllSeries, setShowAllSeries] = useState(false);\n const mousePos = useMousePosition();\n const { height, width, ref: tooltipRef } = useResizeObserver();\n\n const isTooltipPinned = pinnedPos !== null;\n\n if (mousePos === null || mousePos.target === null) return null;\n\n // Ensure user is hovering over a chart before checking for nearby series.\n if (pinnedPos === null && (mousePos.target as HTMLElement).tagName !== 'CANVAS') return null;\n\n const chart = chartRef.current;\n const chartWidth = chart?.getWidth() ?? FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.\n const cursorTransform = assembleTransform(mousePos, chartWidth, pinnedPos, height ?? 0, width ?? 0);\n\n // Get series nearby the cursor and pass into tooltip content children.\n const nearbySeries = getNearbySeriesData({\n mousePos,\n chartData,\n pinnedPos,\n chart,\n unit,\n showAllSeries,\n });\n if (nearbySeries.length === 0) {\n return null;\n }\n\n const totalSeries = chartData.timeSeries.length;\n\n return (\n <Portal>\n <Box\n ref={tooltipRef}\n sx={(theme) => ({\n minWidth: TOOLTIP_MIN_WIDTH,\n maxWidth: TOOLTIP_MAX_WIDTH,\n maxHeight: TOOLTIP_MAX_HEIGHT,\n padding: 0,\n position: 'absolute',\n top: 0,\n left: 0,\n backgroundColor: theme.palette.designSystem?.grey[800] ?? TOOLTIP_BG_COLOR_FALLBACK,\n borderRadius: '6px',\n color: '#fff',\n fontSize: '11px',\n visibility: 'visible',\n opacity: 1,\n transition: 'all 0.1s ease-out',\n zIndex: theme.zIndex.tooltip,\n overflow: 'hidden',\n '&:hover': {\n overflowY: 'auto',\n },\n })}\n style={{\n transform: cursorTransform,\n }}\n >\n <Stack spacing={0.5}>\n <TooltipHeader\n nearbySeries={nearbySeries}\n totalSeries={totalSeries}\n isTooltipPinned={isTooltipPinned}\n showAllSeries={showAllSeries}\n onShowAllClick={(checked) => setShowAllSeries(checked)}\n onUnpinClick={onUnpinClick}\n />\n <TooltipContent series={nearbySeries} wrapLabels={wrapLabels} />\n </Stack>\n </Box>\n </Portal>\n );\n});\n"],"names":["Box","Portal","Stack","memo","useState","useResizeObserver","TooltipContent","TooltipHeader","getNearbySeriesData","FALLBACK_CHART_WIDTH","TOOLTIP_BG_COLOR_FALLBACK","TOOLTIP_MAX_HEIGHT","TOOLTIP_MAX_WIDTH","TOOLTIP_MIN_WIDTH","useMousePosition","assembleTransform","TimeSeriesTooltip","chartRef","chartData","wrapLabels","unit","onUnpinClick","pinnedPos","showAllSeries","setShowAllSeries","mousePos","height","width","ref","tooltipRef","isTooltipPinned","target","tagName","chart","current","chartWidth","getWidth","cursorTransform","nearbySeries","length","totalSeries","timeSeries","theme","sx","minWidth","maxWidth","maxHeight","padding","position","top","left","backgroundColor","palette","designSystem","grey","borderRadius","color","fontSize","visibility","opacity","transition","zIndex","tooltip","overflow","overflowY","style","transform","spacing","onShowAllClick","checked","series"],"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,SAASA,GAAG,EAAEC,MAAM,EAAEC,KAAK,QAAQ,eAAe,CAAC;AAEnD,SAASC,IAAI,EAAEC,QAAQ,QAAQ,OAAO,CAAC;AACvC,OAAOC,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,SAASC,cAAc,QAAQ,kBAAkB,CAAC;AAClD,SAASC,aAAa,QAAQ,iBAAiB,CAAC;AAChD,SAASC,mBAAmB,QAAQ,iBAAiB,CAAC;AACtD,SAEEC,oBAAoB,EACpBC,yBAAyB,EACzBC,kBAAkB,EAClBC,iBAAiB,EACjBC,iBAAiB,EACjBC,gBAAgB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;gBACLC,SAAS,EAAE7B,eAAe;aAC3B;sBAED,cAAA,MAACnC,KAAK;gBAACiE,OAAO,EAAE,GAAG;;kCACjB,KAAC5D,aAAa;wBACZ+B,YAAY,EAAEA,YAAY;wBAC1BE,WAAW,EAAEA,WAAW;wBACxBV,eAAe,EAAEA,eAAe;wBAChCP,aAAa,EAAEA,aAAa;wBAC5B6C,cAAc,EAAE,CAACC,OAAO,GAAK7C,gBAAgB,CAAC6C,OAAO,CAAC;wBACtDhD,YAAY,EAAEA,YAAY;sBAC1B;kCACF,KAACf,cAAc;wBAACgE,MAAM,EAAEhC,YAAY;wBAAEnB,UAAU,EAAEA,UAAU;sBAAI;;cAC1D;UACJ;MACC,CACT;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
import { NearbySeriesArray } from './nearby-series';
|
|
3
3
|
export interface TooltipContentProps {
|
|
4
4
|
series: NearbySeriesArray | null;
|
|
5
|
-
isTooltipPinned: boolean;
|
|
6
5
|
wrapLabels?: boolean;
|
|
7
|
-
onUnpinClick: () => void;
|
|
8
6
|
}
|
|
9
7
|
export declare function TooltipContent(props: TooltipContentProps): JSX.Element | null;
|
|
10
8
|
//# sourceMappingURL=TooltipContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipContent.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/TooltipContent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TooltipContent.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/TooltipContent.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,sBAsCxD"}
|
|
@@ -10,116 +10,40 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { useMemo } from 'react';
|
|
15
|
-
import
|
|
16
|
-
import Pin from 'mdi-material-ui/Pin';
|
|
17
|
-
import { Box, Divider, Stack, Typography } from '@mui/material';
|
|
18
|
-
import { useTimeZone } from '../context/TimeZoneProvider';
|
|
15
|
+
import { Box } from '@mui/material';
|
|
19
16
|
import { SeriesInfo } from './SeriesInfo';
|
|
20
17
|
export function TooltipContent(props) {
|
|
21
|
-
const { series , wrapLabels
|
|
22
|
-
const { formatWithUserTimeZone } = useTimeZone();
|
|
23
|
-
const seriesTime = series && series[0] && series[0].date ? series[0].date : null;
|
|
24
|
-
const formatTimeSeriesHeader = (timeMs)=>{
|
|
25
|
-
const date = new Date(timeMs);
|
|
26
|
-
const formattedDate = formatWithUserTimeZone(date, 'MMM dd, yyyy - ');
|
|
27
|
-
const formattedTime = formatWithUserTimeZone(date, 'HH:mm:ss');
|
|
28
|
-
return /*#__PURE__*/ _jsxs(Box, {
|
|
29
|
-
children: [
|
|
30
|
-
/*#__PURE__*/ _jsx(Typography, {
|
|
31
|
-
variant: "caption",
|
|
32
|
-
sx: (theme)=>({
|
|
33
|
-
color: theme.palette.common.white
|
|
34
|
-
}),
|
|
35
|
-
children: formattedDate
|
|
36
|
-
}),
|
|
37
|
-
/*#__PURE__*/ _jsx(Typography, {
|
|
38
|
-
variant: "caption",
|
|
39
|
-
children: /*#__PURE__*/ _jsx("strong", {
|
|
40
|
-
children: formattedTime
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
]
|
|
44
|
-
});
|
|
45
|
-
};
|
|
18
|
+
const { series , wrapLabels } = props;
|
|
46
19
|
const sortedFocusedSeries = useMemo(()=>{
|
|
47
20
|
if (series === null) return null;
|
|
48
21
|
return series.sort((a, b)=>a.y > b.y ? -1 : 1);
|
|
49
22
|
}, [
|
|
50
23
|
series
|
|
51
24
|
]);
|
|
52
|
-
if (
|
|
25
|
+
if (series === null || sortedFocusedSeries === null) {
|
|
53
26
|
return null;
|
|
54
27
|
}
|
|
55
28
|
// TODO: use react-virtuoso to improve performance
|
|
56
|
-
return /*#__PURE__*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/*#__PURE__*/ _jsxs(Box, {
|
|
61
|
-
sx: {
|
|
62
|
-
display: 'flex',
|
|
63
|
-
justifyContent: 'start',
|
|
64
|
-
alignItems: 'center'
|
|
65
|
-
},
|
|
66
|
-
children: [
|
|
67
|
-
formatTimeSeriesHeader(seriesTime),
|
|
68
|
-
/*#__PURE__*/ _jsxs(Stack, {
|
|
69
|
-
direction: "row",
|
|
70
|
-
gap: 1,
|
|
71
|
-
sx: {
|
|
72
|
-
marginLeft: 'auto'
|
|
73
|
-
},
|
|
74
|
-
children: [
|
|
75
|
-
/*#__PURE__*/ _jsxs(Typography, {
|
|
76
|
-
sx: {
|
|
77
|
-
fontSize: 11
|
|
78
|
-
},
|
|
79
|
-
children: [
|
|
80
|
-
"Click to ",
|
|
81
|
-
isTooltipPinned ? 'Unpin' : 'Pin'
|
|
82
|
-
]
|
|
83
|
-
}),
|
|
84
|
-
isTooltipPinned ? /*#__PURE__*/ _jsx(Pin, {
|
|
85
|
-
onClick: onUnpinClick,
|
|
86
|
-
sx: {
|
|
87
|
-
fontSize: 16,
|
|
88
|
-
cursor: 'pointer'
|
|
89
|
-
}
|
|
90
|
-
}) : /*#__PURE__*/ _jsx(PinOutline, {
|
|
91
|
-
sx: {
|
|
92
|
-
fontSize: 16
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
]
|
|
96
|
-
})
|
|
97
|
-
]
|
|
29
|
+
return /*#__PURE__*/ _jsx(Box, {
|
|
30
|
+
sx: (theme)=>({
|
|
31
|
+
display: 'table',
|
|
32
|
+
padding: theme.spacing(0.5, 2)
|
|
98
33
|
}),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
seriesName: seriesName,
|
|
113
|
-
y: y,
|
|
114
|
-
formattedY: formattedY,
|
|
115
|
-
markerColor: markerColor,
|
|
116
|
-
totalSeries: sortedFocusedSeries.length,
|
|
117
|
-
wrapLabels: wrapLabels,
|
|
118
|
-
emphasizeText: isClosestToCursor
|
|
119
|
-
}, key);
|
|
120
|
-
})
|
|
121
|
-
})
|
|
122
|
-
]
|
|
34
|
+
children: sortedFocusedSeries.map(({ datumIdx , seriesIdx , seriesName , y , formattedY , markerColor , isClosestToCursor })=>{
|
|
35
|
+
if (datumIdx === null || seriesIdx === null) return null;
|
|
36
|
+
const key = seriesIdx.toString() + datumIdx.toString();
|
|
37
|
+
return /*#__PURE__*/ _jsx(SeriesInfo, {
|
|
38
|
+
seriesName: seriesName,
|
|
39
|
+
y: y,
|
|
40
|
+
formattedY: formattedY,
|
|
41
|
+
markerColor: markerColor,
|
|
42
|
+
totalSeries: sortedFocusedSeries.length,
|
|
43
|
+
wrapLabels: wrapLabels,
|
|
44
|
+
emphasizeText: isClosestToCursor
|
|
45
|
+
}, key);
|
|
46
|
+
})
|
|
123
47
|
});
|
|
124
48
|
}
|
|
125
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/TooltipContent.tsx"],"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 { useMemo } from 'react';\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/TooltipContent.tsx"],"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 { useMemo } from 'react';\nimport { Box } from '@mui/material';\nimport { NearbySeriesArray } from './nearby-series';\nimport { SeriesInfo } from './SeriesInfo';\n\nexport interface TooltipContentProps {\n series: NearbySeriesArray | null;\n wrapLabels?: boolean;\n}\n\nexport function TooltipContent(props: TooltipContentProps) {\n const { series, wrapLabels } = props;\n\n const sortedFocusedSeries = useMemo(() => {\n if (series === null) return null;\n return series.sort((a, b) => (a.y > b.y ? -1 : 1));\n }, [series]);\n\n if (series === null || sortedFocusedSeries === null) {\n return null;\n }\n // TODO: use react-virtuoso to improve performance\n return (\n <Box\n sx={(theme) => ({\n display: 'table',\n padding: theme.spacing(0.5, 2),\n })}\n >\n {sortedFocusedSeries.map(({ datumIdx, seriesIdx, seriesName, y, formattedY, markerColor, isClosestToCursor }) => {\n if (datumIdx === null || seriesIdx === null) return null;\n const key = seriesIdx.toString() + datumIdx.toString();\n\n return (\n <SeriesInfo\n key={key}\n seriesName={seriesName}\n y={y}\n formattedY={formattedY}\n markerColor={markerColor}\n totalSeries={sortedFocusedSeries.length}\n wrapLabels={wrapLabels}\n emphasizeText={isClosestToCursor}\n />\n );\n })}\n </Box>\n );\n}\n"],"names":["useMemo","Box","SeriesInfo","TooltipContent","props","series","wrapLabels","sortedFocusedSeries","sort","a","b","y","sx","theme","display","padding","spacing","map","datumIdx","seriesIdx","seriesName","formattedY","markerColor","isClosestToCursor","key","toString","totalSeries","length","emphasizeText"],"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,SAASA,OAAO,QAAQ,OAAO,CAAC;AAChC,SAASC,GAAG,QAAQ,eAAe,CAAC;AAEpC,SAASC,UAAU,QAAQ,cAAc,CAAC;AAO1C,OAAO,SAASC,cAAc,CAACC,KAA0B,EAAE;IACzD,MAAM,EAAEC,MAAM,CAAA,EAAEC,UAAU,CAAA,EAAE,GAAGF,KAAK,AAAC;IAErC,MAAMG,mBAAmB,GAAGP,OAAO,CAAC,IAAM;QACxC,IAAIK,MAAM,KAAK,IAAI,EAAE,OAAO,IAAI,CAAC;QACjC,OAAOA,MAAM,CAACG,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,GAAMD,CAAC,CAACE,CAAC,GAAGD,CAAC,CAACC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,AAAC,CAAC,CAAC;IACrD,CAAC,EAAE;QAACN,MAAM;KAAC,CAAC,AAAC;IAEb,IAAIA,MAAM,KAAK,IAAI,IAAIE,mBAAmB,KAAK,IAAI,EAAE;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,kDAAkD;IAClD,qBACE,KAACN,GAAG;QACFW,EAAE,EAAE,CAACC,KAAK,GAAM,CAAA;gBACdC,OAAO,EAAE,OAAO;gBAChBC,OAAO,EAAEF,KAAK,CAACG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;aAC/B,CAAA,AAAC;kBAEDT,mBAAmB,CAACU,GAAG,CAAC,CAAC,EAAEC,QAAQ,CAAA,EAAEC,SAAS,CAAA,EAAEC,UAAU,CAAA,EAAET,CAAC,CAAA,EAAEU,UAAU,CAAA,EAAEC,WAAW,CAAA,EAAEC,iBAAiB,CAAA,EAAE,GAAK;YAC/G,IAAIL,QAAQ,KAAK,IAAI,IAAIC,SAAS,KAAK,IAAI,EAAE,OAAO,IAAI,CAAC;YACzD,MAAMK,GAAG,GAAGL,SAAS,CAACM,QAAQ,EAAE,GAAGP,QAAQ,CAACO,QAAQ,EAAE,AAAC;YAEvD,qBACE,KAACvB,UAAU;gBAETkB,UAAU,EAAEA,UAAU;gBACtBT,CAAC,EAAEA,CAAC;gBACJU,UAAU,EAAEA,UAAU;gBACtBC,WAAW,EAAEA,WAAW;gBACxBI,WAAW,EAAEnB,mBAAmB,CAACoB,MAAM;gBACvCrB,UAAU,EAAEA,UAAU;gBACtBsB,aAAa,EAAEL,iBAAiB;eAP3BC,GAAG,CAQR,CACF;QACJ,CAAC,CAAC;MACE,CACN;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NearbySeriesArray } from './nearby-series';
|
|
3
|
+
export interface TooltipHeaderProps {
|
|
4
|
+
nearbySeries: NearbySeriesArray;
|
|
5
|
+
totalSeries: number;
|
|
6
|
+
isTooltipPinned: boolean;
|
|
7
|
+
showAllSeries: boolean;
|
|
8
|
+
onShowAllClick?: (checked: boolean) => void;
|
|
9
|
+
onUnpinClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const TooltipHeader: import("react").NamedExoticComponent<TooltipHeaderProps>;
|
|
12
|
+
//# sourceMappingURL=TooltipHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipHeader.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/TooltipHeader.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,iBAAiB,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,0DAwHxB,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// Copyright 2023 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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Box, Divider, Typography, Stack, Switch } from '@mui/material';
|
|
15
|
+
import Pin from 'mdi-material-ui/Pin';
|
|
16
|
+
import PinOutline from 'mdi-material-ui/PinOutline';
|
|
17
|
+
import { memo } from 'react';
|
|
18
|
+
import { useTimeZone } from '../context/TimeZoneProvider';
|
|
19
|
+
import { TOOLTIP_BG_COLOR_FALLBACK, TOOLTIP_MAX_WIDTH } from './tooltip-model';
|
|
20
|
+
export const TooltipHeader = /*#__PURE__*/ memo(function TooltipHeader({ nearbySeries , totalSeries , isTooltipPinned , showAllSeries , onShowAllClick , onUnpinClick }) {
|
|
21
|
+
var ref;
|
|
22
|
+
const { formatWithUserTimeZone } = useTimeZone();
|
|
23
|
+
var ref1;
|
|
24
|
+
const seriesTimeMs = (ref1 = (ref = nearbySeries[0]) === null || ref === void 0 ? void 0 : ref.date) !== null && ref1 !== void 0 ? ref1 : null;
|
|
25
|
+
if (seriesTimeMs === null) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const formatTimeSeriesHeader = (timeMs)=>{
|
|
29
|
+
const date = new Date(timeMs);
|
|
30
|
+
const formattedDate = formatWithUserTimeZone(date, 'MMM dd, yyyy - ');
|
|
31
|
+
const formattedTime = formatWithUserTimeZone(date, 'HH:mm:ss');
|
|
32
|
+
return /*#__PURE__*/ _jsxs(Box, {
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
35
|
+
variant: "caption",
|
|
36
|
+
sx: (theme)=>({
|
|
37
|
+
color: theme.palette.common.white
|
|
38
|
+
}),
|
|
39
|
+
children: formattedDate
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
42
|
+
variant: "caption",
|
|
43
|
+
children: /*#__PURE__*/ _jsx("strong", {
|
|
44
|
+
children: formattedTime
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
// TODO: accurately calc whether more series are outside scrollable region using yBuffer, avg series name length, TOOLTIP_MAX_HEIGHT
|
|
51
|
+
const showAllSeriesToggle = totalSeries > 5;
|
|
52
|
+
var ref2;
|
|
53
|
+
return /*#__PURE__*/ _jsxs(Box, {
|
|
54
|
+
sx: (theme)=>{
|
|
55
|
+
var ref;
|
|
56
|
+
return {
|
|
57
|
+
width: '100%',
|
|
58
|
+
maxWidth: TOOLTIP_MAX_WIDTH,
|
|
59
|
+
padding: theme.spacing(1.5, 2, 0.5, 2),
|
|
60
|
+
backgroundColor: (ref2 = (ref = theme.palette.designSystem) === null || ref === void 0 ? void 0 : ref.grey[800]) !== null && ref2 !== void 0 ? ref2 : TOOLTIP_BG_COLOR_FALLBACK,
|
|
61
|
+
position: 'sticky',
|
|
62
|
+
top: 0,
|
|
63
|
+
left: 0
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
68
|
+
sx: {
|
|
69
|
+
width: '100%',
|
|
70
|
+
display: 'flex',
|
|
71
|
+
justifyContent: 'start',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
paddingBottom: 0.5
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
formatTimeSeriesHeader(seriesTimeMs),
|
|
77
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
78
|
+
direction: "row",
|
|
79
|
+
gap: 1,
|
|
80
|
+
sx: {
|
|
81
|
+
marginLeft: 'auto'
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
showAllSeriesToggle && /*#__PURE__*/ _jsxs(Stack, {
|
|
85
|
+
direction: "row",
|
|
86
|
+
gap: 0.5,
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
sx: {
|
|
89
|
+
textAlign: 'right'
|
|
90
|
+
},
|
|
91
|
+
children: [
|
|
92
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
93
|
+
sx: {
|
|
94
|
+
fontSize: 11
|
|
95
|
+
},
|
|
96
|
+
children: "Show All"
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ _jsx(Switch, {
|
|
99
|
+
checked: showAllSeries,
|
|
100
|
+
size: "small",
|
|
101
|
+
onChange: (_, checked)=>{
|
|
102
|
+
if (onShowAllClick !== undefined) {
|
|
103
|
+
return onShowAllClick(checked);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
sx: (theme)=>({
|
|
107
|
+
'& .MuiSwitch-switchBase': {
|
|
108
|
+
color: theme.palette.common.white
|
|
109
|
+
},
|
|
110
|
+
'& .MuiSwitch-track': {
|
|
111
|
+
backgroundColor: theme.palette.common.white
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}),
|
|
117
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
118
|
+
direction: "row",
|
|
119
|
+
alignItems: "center",
|
|
120
|
+
children: [
|
|
121
|
+
/*#__PURE__*/ _jsxs(Typography, {
|
|
122
|
+
sx: {
|
|
123
|
+
marginRight: 0.5,
|
|
124
|
+
fontSize: 11,
|
|
125
|
+
verticalAlign: 'middle'
|
|
126
|
+
},
|
|
127
|
+
children: [
|
|
128
|
+
"Click to ",
|
|
129
|
+
isTooltipPinned ? 'Unpin' : 'Pin'
|
|
130
|
+
]
|
|
131
|
+
}),
|
|
132
|
+
isTooltipPinned ? /*#__PURE__*/ _jsx(Pin, {
|
|
133
|
+
onClick: ()=>{
|
|
134
|
+
if (onUnpinClick !== undefined) {
|
|
135
|
+
onUnpinClick();
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
sx: {
|
|
139
|
+
fontSize: 16,
|
|
140
|
+
cursor: 'pointer'
|
|
141
|
+
}
|
|
142
|
+
}) : /*#__PURE__*/ _jsx(PinOutline, {
|
|
143
|
+
sx: {
|
|
144
|
+
fontSize: 16
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
}),
|
|
153
|
+
/*#__PURE__*/ _jsx(Divider, {
|
|
154
|
+
sx: (theme)=>({
|
|
155
|
+
width: '100%',
|
|
156
|
+
borderColor: theme.palette.grey['500']
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=TooltipHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/TooltipHeader.tsx"],"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 { Box, Divider, Typography, Stack, Switch } from '@mui/material';\nimport Pin from 'mdi-material-ui/Pin';\nimport PinOutline from 'mdi-material-ui/PinOutline';\nimport { memo } from 'react';\nimport { useTimeZone } from '../context/TimeZoneProvider';\nimport { NearbySeriesArray } from './nearby-series';\nimport { TOOLTIP_BG_COLOR_FALLBACK, TOOLTIP_MAX_WIDTH } from './tooltip-model';\n\nexport interface TooltipHeaderProps {\n nearbySeries: NearbySeriesArray;\n totalSeries: number;\n isTooltipPinned: boolean;\n showAllSeries: boolean;\n onShowAllClick?: (checked: boolean) => void;\n onUnpinClick?: () => void;\n}\n\nexport const TooltipHeader = memo(function TooltipHeader({\n nearbySeries,\n totalSeries,\n isTooltipPinned,\n showAllSeries,\n onShowAllClick,\n onUnpinClick,\n}: TooltipHeaderProps) {\n const { formatWithUserTimeZone } = useTimeZone();\n\n const seriesTimeMs = nearbySeries[0]?.date ?? null;\n if (seriesTimeMs === null) {\n return null;\n }\n\n const formatTimeSeriesHeader = (timeMs: number) => {\n const date = new Date(timeMs);\n const formattedDate = formatWithUserTimeZone(date, 'MMM dd, yyyy - ');\n const formattedTime = formatWithUserTimeZone(date, 'HH:mm:ss');\n return (\n <Box>\n <Typography\n variant=\"caption\"\n sx={(theme) => ({\n color: theme.palette.common.white,\n })}\n >\n {formattedDate}\n </Typography>\n <Typography variant=\"caption\">\n <strong>{formattedTime}</strong>\n </Typography>\n </Box>\n );\n };\n\n // TODO: accurately calc whether more series are outside scrollable region using yBuffer, avg series name length, TOOLTIP_MAX_HEIGHT\n const showAllSeriesToggle = totalSeries > 5;\n\n return (\n <Box\n sx={(theme) => ({\n width: '100%',\n maxWidth: TOOLTIP_MAX_WIDTH,\n padding: theme.spacing(1.5, 2, 0.5, 2),\n backgroundColor: theme.palette.designSystem?.grey[800] ?? TOOLTIP_BG_COLOR_FALLBACK,\n position: 'sticky',\n top: 0,\n left: 0,\n })}\n >\n <Box\n sx={{\n width: '100%',\n display: 'flex',\n justifyContent: 'start',\n alignItems: 'center',\n paddingBottom: 0.5,\n }}\n >\n {formatTimeSeriesHeader(seriesTimeMs)}\n <Stack direction=\"row\" gap={1} sx={{ marginLeft: 'auto' }}>\n {showAllSeriesToggle && (\n <Stack direction=\"row\" gap={0.5} alignItems=\"center\" sx={{ textAlign: 'right' }}>\n <Typography sx={{ fontSize: 11 }}>Show All</Typography>\n <Switch\n checked={showAllSeries}\n size=\"small\"\n onChange={(_, checked) => {\n if (onShowAllClick !== undefined) {\n return onShowAllClick(checked);\n }\n }}\n sx={(theme) => ({\n '& .MuiSwitch-switchBase': {\n color: theme.palette.common.white,\n },\n '& .MuiSwitch-track': {\n backgroundColor: theme.palette.common.white,\n },\n })}\n />\n </Stack>\n )}\n <Stack direction=\"row\" alignItems=\"center\">\n <Typography\n sx={{\n marginRight: 0.5,\n fontSize: 11,\n verticalAlign: 'middle',\n }}\n >\n Click to {isTooltipPinned ? 'Unpin' : 'Pin'}\n </Typography>\n {isTooltipPinned ? (\n <Pin\n onClick={() => {\n if (onUnpinClick !== undefined) {\n onUnpinClick();\n }\n }}\n sx={{\n fontSize: 16,\n cursor: 'pointer',\n }}\n />\n ) : (\n <PinOutline sx={{ fontSize: 16 }} />\n )}\n </Stack>\n </Stack>\n </Box>\n <Divider\n sx={(theme) => ({\n width: '100%',\n borderColor: theme.palette.grey['500'],\n })}\n />\n </Box>\n );\n});\n"],"names":["Box","Divider","Typography","Stack","Switch","Pin","PinOutline","memo","useTimeZone","TOOLTIP_BG_COLOR_FALLBACK","TOOLTIP_MAX_WIDTH","TooltipHeader","nearbySeries","totalSeries","isTooltipPinned","showAllSeries","onShowAllClick","onUnpinClick","formatWithUserTimeZone","seriesTimeMs","date","formatTimeSeriesHeader","timeMs","Date","formattedDate","formattedTime","variant","sx","theme","color","palette","common","white","strong","showAllSeriesToggle","width","maxWidth","padding","spacing","backgroundColor","designSystem","grey","position","top","left","display","justifyContent","alignItems","paddingBottom","direction","gap","marginLeft","textAlign","fontSize","checked","size","onChange","_","undefined","marginRight","verticalAlign","onClick","cursor","borderColor"],"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,SAASA,GAAG,EAAEC,OAAO,EAAEC,UAAU,EAAEC,KAAK,EAAEC,MAAM,QAAQ,eAAe,CAAC;AACxE,OAAOC,GAAG,MAAM,qBAAqB,CAAC;AACtC,OAAOC,UAAU,MAAM,4BAA4B,CAAC;AACpD,SAASC,IAAI,QAAQ,OAAO,CAAC;AAC7B,SAASC,WAAW,QAAQ,6BAA6B,CAAC;AAE1D,SAASC,yBAAyB,EAAEC,iBAAiB,QAAQ,iBAAiB,CAAC;AAW/E,OAAO,MAAMC,aAAa,iBAAGJ,IAAI,CAAC,SAASI,aAAa,CAAC,EACvDC,YAAY,CAAA,EACZC,WAAW,CAAA,EACXC,eAAe,CAAA,EACfC,aAAa,CAAA,EACbC,cAAc,CAAA,EACdC,YAAY,CAAA,EACO,EAAE;QAGAL,GAAe;IAFpC,MAAM,EAAEM,sBAAsB,CAAA,EAAE,GAAGV,WAAW,EAAE,AAAC;QAE5BI,IAAqB;IAA1C,MAAMO,YAAY,GAAGP,CAAAA,IAAqB,GAArBA,CAAAA,GAAe,GAAfA,YAAY,CAAC,CAAC,CAAC,cAAfA,GAAe,WAAM,GAArBA,KAAAA,CAAqB,GAArBA,GAAe,CAAEQ,IAAI,cAArBR,IAAqB,cAArBA,IAAqB,GAAI,IAAI,AAAC;IACnD,IAAIO,YAAY,KAAK,IAAI,EAAE;QACzB,OAAO,IAAI,CAA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,QAAQ;;kDACxC,MAAC7C,UAAU;wCACTyB,EAAE,EAAE;4CACFgC,WAAW,EAAE,GAAG;4CAChBN,QAAQ,EAAE,EAAE;4CACZO,aAAa,EAAE,QAAQ;yCACxB;;4CACF,WACU;4CAAC9C,eAAe,GAAG,OAAO,GAAG,KAAK;;sCAChC;oCACZA,eAAe,iBACd,KAACT,GAAG;wCACFwD,OAAO,EAAE,IAAM;4CACb,IAAI5C,YAAY,KAAKyC,SAAS,EAAE;gDAC9BzC,YAAY,EAAE,CAAC;4CACjB,CAAC;wCACH,CAAC;wCACDU,EAAE,EAAE;4CACF0B,QAAQ,EAAE,EAAE;4CACZS,MAAM,EAAE,SAAS;yCAClB;sCACD,iBAEF,KAACxD,UAAU;wCAACqB,EAAE,EAAE;4CAAE0B,QAAQ,EAAE,EAAE;yCAAE;sCAAI,AACrC;;8BACK;;sBACF;;cACJ;0BACN,KAACpD,OAAO;gBACN0B,EAAE,EAAE,CAACC,KAAK,GAAM,CAAA;wBACdO,KAAK,EAAE,MAAM;wBACb4B,WAAW,EAAEnC,KAAK,CAACE,OAAO,CAACW,IAAI,CAAC,KAAK,CAAC;qBACvC,CAAA,AAAC;cACF;;MACE,CACN;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@ export * from './SeriesInfo';
|
|
|
3
3
|
export * from './SeriesLabelsStack';
|
|
4
4
|
export * from './SeriesMarker';
|
|
5
5
|
export * from './TooltipContent';
|
|
6
|
+
export * from './TooltipHeader';
|
|
6
7
|
export * from './nearby-series';
|
|
7
8
|
export * from './tooltip-model';
|
|
8
9
|
export * from './utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TimeSeriesTooltip/index.ts"],"names":[],"mappings":"AAaA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
@@ -15,6 +15,7 @@ export * from './SeriesInfo';
|
|
|
15
15
|
export * from './SeriesLabelsStack';
|
|
16
16
|
export * from './SeriesMarker';
|
|
17
17
|
export * from './TooltipContent';
|
|
18
|
+
export * from './TooltipHeader';
|
|
18
19
|
export * from './nearby-series';
|
|
19
20
|
export * from './tooltip-model';
|
|
20
21
|
export * from './utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/TimeSeriesTooltip/index.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\nexport * from './TimeSeriesTooltip';\nexport * from './SeriesInfo';\nexport * from './SeriesLabelsStack';\nexport * from './SeriesMarker';\nexport * from './TooltipContent';\nexport * from './nearby-series';\nexport * from './tooltip-model';\nexport * from './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,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/TimeSeriesTooltip/index.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\nexport * from './TimeSeriesTooltip';\nexport * from './SeriesInfo';\nexport * from './SeriesLabelsStack';\nexport * from './SeriesMarker';\nexport * from './TooltipContent';\nexport * from './TooltipHeader';\nexport * from './nearby-series';\nexport * from './tooltip-model';\nexport * from './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,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|