@perses-dev/components 0.37.1 → 0.38.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/README.md +1 -0
- package/dist/BarChart/BarChart.d.ts +16 -0
- package/dist/BarChart/BarChart.d.ts.map +1 -0
- package/dist/BarChart/BarChart.js +123 -0
- package/dist/BarChart/BarChart.js.map +1 -0
- package/dist/BarChart/index.d.ts +2 -0
- package/dist/BarChart/index.d.ts.map +1 -0
- package/dist/BarChart/index.js +15 -0
- package/dist/BarChart/index.js.map +1 -0
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +10 -0
- package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -0
- package/dist/Dialog/DiscardChangesConfirmationDialog.js +47 -0
- package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -0
- package/dist/Dialog/index.d.ts +1 -0
- package/dist/Dialog/index.d.ts.map +1 -1
- package/dist/Dialog/index.js +1 -0
- package/dist/Dialog/index.js.map +1 -1
- package/dist/Legend/ListLegendItem.d.ts +1 -1
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +2 -1
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/ModeSelector/ModeSelector.d.ts +9 -0
- package/dist/ModeSelector/ModeSelector.d.ts.map +1 -0
- package/dist/ModeSelector/ModeSelector.js +43 -0
- package/dist/ModeSelector/ModeSelector.js.map +1 -0
- package/dist/ModeSelector/index.d.ts +2 -0
- package/dist/ModeSelector/index.d.ts.map +1 -0
- package/dist/ModeSelector/index.js +15 -0
- package/dist/ModeSelector/index.js.map +1 -0
- package/dist/SortSelector/SortSelector.d.ts +8 -0
- package/dist/SortSelector/SortSelector.d.ts.map +1 -0
- package/dist/SortSelector/SortSelector.js +42 -0
- package/dist/SortSelector/SortSelector.js.map +1 -0
- package/dist/SortSelector/index.d.ts +2 -0
- package/dist/SortSelector/index.d.ts.map +1 -0
- package/dist/SortSelector/index.js +15 -0
- package/dist/SortSelector/index.js.map +1 -0
- package/dist/TimeChart/TimeChart.d.ts +1 -0
- package/dist/TimeChart/TimeChart.d.ts.map +1 -1
- package/dist/TimeChart/TimeChart.js +49 -12
- package/dist/TimeChart/TimeChart.js.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +5 -0
- package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.js +12 -5
- package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +9 -4
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +87 -96
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +1 -0
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +1 -0
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +11 -5
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/UnitSelector/UnitSelector.d.ts +2 -1
- package/dist/UnitSelector/UnitSelector.d.ts.map +1 -1
- package/dist/UnitSelector/UnitSelector.js +3 -2
- package/dist/UnitSelector/UnitSelector.js.map +1 -1
- package/dist/cjs/BarChart/BarChart.js +129 -0
- package/dist/cjs/BarChart/index.js +28 -0
- package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +53 -0
- package/dist/cjs/Dialog/index.js +1 -0
- package/dist/cjs/LineChart/LineChart.js +2 -1
- package/dist/cjs/ModeSelector/ModeSelector.js +49 -0
- package/dist/cjs/ModeSelector/index.js +28 -0
- package/dist/cjs/SortSelector/SortSelector.js +48 -0
- package/dist/cjs/SortSelector/index.js +28 -0
- package/dist/cjs/TimeChart/TimeChart.js +52 -10
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +11 -4
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +8 -3
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +87 -96
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +2 -0
- package/dist/cjs/TimeSeriesTooltip/utils.js +10 -4
- package/dist/cjs/UnitSelector/UnitSelector.js +3 -2
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/model/graph.js +35 -3
- package/dist/cjs/utils/chart-actions.js +61 -1
- package/dist/cjs/utils/theme-gen.js +34 -6
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/model/graph.d.ts +11 -2
- package/dist/model/graph.d.ts.map +1 -1
- package/dist/model/graph.js +25 -0
- package/dist/model/graph.js.map +1 -1
- package/dist/utils/chart-actions.d.ts +3 -0
- package/dist/utils/chart-actions.d.ts.map +1 -1
- package/dist/utils/chart-actions.js +66 -0
- package/dist/utils/chart-actions.js.map +1 -1
- package/dist/utils/theme-gen.d.ts.map +1 -1
- package/dist/utils/theme-gen.js +34 -6
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,3 +15,4 @@ For detailed examples of how to use certain components, see individual docs for:
|
|
|
15
15
|
- [LineChart.md](./src/LineChart/LineChart.md)
|
|
16
16
|
- [GaugeChart.md](./src/GaugeChart/GaugeChart.md)
|
|
17
17
|
- [StatChart.md](./src/StatChart/StatChart.md)
|
|
18
|
+
- [BarChart.md](./src/BarChart/BarChart.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UnitOptions } from '@perses-dev/core';
|
|
3
|
+
import { ModeOption } from '../ModeSelector';
|
|
4
|
+
export interface BarChartData {
|
|
5
|
+
label: string;
|
|
6
|
+
value: number | null;
|
|
7
|
+
}
|
|
8
|
+
export interface BarChartProps {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
data: BarChartData[] | null;
|
|
12
|
+
unit?: UnitOptions;
|
|
13
|
+
mode?: ModeOption;
|
|
14
|
+
}
|
|
15
|
+
export declare function BarChart(props: BarChartProps): JSX.Element;
|
|
16
|
+
//# sourceMappingURL=BarChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../src/BarChart/BarChart.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAQ5D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAO7C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,eA+E5C"}
|
|
@@ -0,0 +1,123 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
14
|
+
import { useMemo } from 'react';
|
|
15
|
+
import { formatValue } from '@perses-dev/core';
|
|
16
|
+
import { use } from 'echarts/core';
|
|
17
|
+
import { BarChart as EChartsBarChart } from 'echarts/charts';
|
|
18
|
+
import { GridComponent, DatasetComponent, TitleComponent, TooltipComponent } from 'echarts/components';
|
|
19
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
20
|
+
import { Box } from '@mui/material';
|
|
21
|
+
import { useChartsTheme } from '../context/ChartsThemeProvider';
|
|
22
|
+
import { EChart } from '../EChart';
|
|
23
|
+
use([
|
|
24
|
+
EChartsBarChart,
|
|
25
|
+
GridComponent,
|
|
26
|
+
DatasetComponent,
|
|
27
|
+
TitleComponent,
|
|
28
|
+
TooltipComponent,
|
|
29
|
+
CanvasRenderer
|
|
30
|
+
]);
|
|
31
|
+
const BAR_WIN_WIDTH = 14;
|
|
32
|
+
const BAR_GAP = 6;
|
|
33
|
+
export function BarChart(props) {
|
|
34
|
+
const { width , height , data , unit ={
|
|
35
|
+
kind: 'Decimal'
|
|
36
|
+
} , mode ='value' } = props;
|
|
37
|
+
const chartsTheme = useChartsTheme();
|
|
38
|
+
const option = useMemo(()=>{
|
|
39
|
+
if (data == null) return chartsTheme.noDataOption;
|
|
40
|
+
const source = [];
|
|
41
|
+
data.map((d)=>{
|
|
42
|
+
source.push([
|
|
43
|
+
d.label,
|
|
44
|
+
d.value
|
|
45
|
+
]);
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
title: {
|
|
49
|
+
show: false
|
|
50
|
+
},
|
|
51
|
+
dataset: [
|
|
52
|
+
{
|
|
53
|
+
dimensions: [
|
|
54
|
+
'label',
|
|
55
|
+
'value'
|
|
56
|
+
],
|
|
57
|
+
source: source
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
xAxis: {},
|
|
61
|
+
yAxis: {
|
|
62
|
+
type: 'category',
|
|
63
|
+
splitLine: {
|
|
64
|
+
show: false
|
|
65
|
+
},
|
|
66
|
+
axisLabel: {
|
|
67
|
+
overflow: 'truncate',
|
|
68
|
+
width: width / 3
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
series: {
|
|
72
|
+
type: 'bar',
|
|
73
|
+
label: {
|
|
74
|
+
show: true,
|
|
75
|
+
position: 'right',
|
|
76
|
+
formatter: (params)=>{
|
|
77
|
+
if (mode === 'percentage') {
|
|
78
|
+
return params.data[1] && formatValue(params.data[1], {
|
|
79
|
+
kind: 'Percent',
|
|
80
|
+
decimal_places: unit.decimal_places
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return params.data[1] && formatValue(params.data[1], unit);
|
|
84
|
+
},
|
|
85
|
+
barMinWidth: BAR_WIN_WIDTH,
|
|
86
|
+
barCategoryGap: BAR_GAP
|
|
87
|
+
},
|
|
88
|
+
itemStyle: {
|
|
89
|
+
borderRadius: 4,
|
|
90
|
+
color: chartsTheme.echartsTheme[0]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
tooltip: {
|
|
94
|
+
appendToBody: true,
|
|
95
|
+
confine: true,
|
|
96
|
+
formatter: (params)=>params.data[1] && `<b>${params.name}</b>   ${formatValue(params.data[1], unit)}`
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}, [
|
|
100
|
+
data,
|
|
101
|
+
chartsTheme,
|
|
102
|
+
width,
|
|
103
|
+
mode,
|
|
104
|
+
unit
|
|
105
|
+
]);
|
|
106
|
+
return /*#__PURE__*/ _jsx(Box, {
|
|
107
|
+
sx: {
|
|
108
|
+
width: width,
|
|
109
|
+
height: height,
|
|
110
|
+
overflow: 'auto'
|
|
111
|
+
},
|
|
112
|
+
children: /*#__PURE__*/ _jsx(EChart, {
|
|
113
|
+
sx: {
|
|
114
|
+
minHeight: height,
|
|
115
|
+
height: data ? data.length * (BAR_WIN_WIDTH + BAR_GAP) : '100%'
|
|
116
|
+
},
|
|
117
|
+
option: option,
|
|
118
|
+
theme: chartsTheme.echartsTheme
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=BarChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/BarChart/BarChart.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 { UnitOptions, formatValue } from '@perses-dev/core';\nimport { use, EChartsCoreOption } from 'echarts/core';\nimport { BarChart as EChartsBarChart } from 'echarts/charts';\nimport { GridComponent, DatasetComponent, TitleComponent, TooltipComponent } from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { Box } from '@mui/material';\nimport { useChartsTheme } from '../context/ChartsThemeProvider';\nimport { EChart } from '../EChart';\nimport { ModeOption } from '../ModeSelector';\n\nuse([EChartsBarChart, GridComponent, DatasetComponent, TitleComponent, TooltipComponent, CanvasRenderer]);\n\nconst BAR_WIN_WIDTH = 14;\nconst BAR_GAP = 6;\n\nexport interface BarChartData {\n label: string;\n value: number | null;\n}\n\nexport interface BarChartProps {\n width: number;\n height: number;\n data: BarChartData[] | null;\n unit?: UnitOptions;\n mode?: ModeOption;\n}\n\nexport function BarChart(props: BarChartProps) {\n const { width, height, data, unit = { kind: 'Decimal' }, mode = 'value' } = props;\n const chartsTheme = useChartsTheme();\n\n const option: EChartsCoreOption = useMemo(() => {\n if (data == null) return chartsTheme.noDataOption;\n\n const source: Array<Array<BarChartData['label'] | BarChartData['value']>> = [];\n data.map((d) => {\n source.push([d.label, d.value]);\n });\n\n return {\n title: {\n show: false,\n },\n dataset: [\n {\n dimensions: ['label', 'value'],\n source: source,\n },\n ],\n xAxis: {},\n yAxis: {\n type: 'category',\n splitLine: {\n show: false,\n },\n axisLabel: {\n overflow: 'truncate',\n width: width / 3,\n },\n },\n series: {\n type: 'bar',\n label: {\n show: true,\n position: 'right',\n formatter: (params: { data: number[] }) => {\n if (mode === 'percentage') {\n return (\n params.data[1] &&\n formatValue(params.data[1], {\n kind: 'Percent',\n decimal_places: unit.decimal_places,\n })\n );\n }\n return params.data[1] && formatValue(params.data[1], unit);\n },\n barMinWidth: BAR_WIN_WIDTH,\n barCategoryGap: BAR_GAP,\n },\n itemStyle: {\n borderRadius: 4,\n color: chartsTheme.echartsTheme[0],\n },\n },\n tooltip: {\n appendToBody: true,\n confine: true,\n formatter: (params: { name: string; data: number[] }) =>\n params.data[1] && `<b>${params.name}</b>   ${formatValue(params.data[1], unit)}`,\n },\n };\n }, [data, chartsTheme, width, mode, unit]);\n\n return (\n <Box sx={{ width: width, height: height, overflow: 'auto' }}>\n <EChart\n sx={{\n minHeight: height,\n height: data ? data.length * (BAR_WIN_WIDTH + BAR_GAP) : '100%',\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n />\n </Box>\n );\n}\n"],"names":["useMemo","formatValue","use","BarChart","EChartsBarChart","GridComponent","DatasetComponent","TitleComponent","TooltipComponent","CanvasRenderer","Box","useChartsTheme","EChart","BAR_WIN_WIDTH","BAR_GAP","props","width","height","data","unit","kind","mode","chartsTheme","option","noDataOption","source","map","d","push","label","value","title","show","dataset","dimensions","xAxis","yAxis","type","splitLine","axisLabel","overflow","series","position","formatter","params","decimal_places","barMinWidth","barCategoryGap","itemStyle","borderRadius","color","echartsTheme","tooltip","appendToBody","confine","name","sx","minHeight","length","theme"],"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,SAAsBC,WAAW,QAAQ,kBAAkB,CAAC;AAC5D,SAASC,GAAG,QAA2B,cAAc,CAAC;AACtD,SAASC,QAAQ,IAAIC,eAAe,QAAQ,gBAAgB,CAAC;AAC7D,SAASC,aAAa,EAAEC,gBAAgB,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,oBAAoB,CAAC;AACvG,SAASC,cAAc,QAAQ,mBAAmB,CAAC;AACnD,SAASC,GAAG,QAAQ,eAAe,CAAC;AACpC,SAASC,cAAc,QAAQ,gCAAgC,CAAC;AAChE,SAASC,MAAM,QAAQ,WAAW,CAAC;AAGnCV,GAAG,CAAC;IAACE,eAAe;IAAEC,aAAa;IAAEC,gBAAgB;IAAEC,cAAc;IAAEC,gBAAgB;IAAEC,cAAc;CAAC,CAAC,CAAC;AAE1G,MAAMI,aAAa,GAAG,EAAE,AAAC;AACzB,MAAMC,OAAO,GAAG,CAAC,AAAC;AAelB,OAAO,SAASX,QAAQ,CAACY,KAAoB,EAAE;IAC7C,MAAM,EAAEC,KAAK,CAAA,EAAEC,MAAM,CAAA,EAAEC,IAAI,CAAA,EAAEC,IAAI,EAAG;QAAEC,IAAI,EAAE,SAAS;KAAE,CAAA,EAAEC,IAAI,EAAG,OAAO,CAAA,EAAE,GAAGN,KAAK,AAAC;IAClF,MAAMO,WAAW,GAAGX,cAAc,EAAE,AAAC;IAErC,MAAMY,MAAM,GAAsBvB,OAAO,CAAC,IAAM;QAC9C,IAAIkB,IAAI,IAAI,IAAI,EAAE,OAAOI,WAAW,C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1BkC,cAAc,EAAEjC,OAAO;iBACxB;gBACDkC,SAAS,EAAE;oBACTC,YAAY,EAAE,CAAC;oBACfC,KAAK,EAAE5B,WAAW,CAAC6B,YAAY,CAAC,CAAC,CAAC;iBACnC;aACF;YACDC,OAAO,EAAE;gBACPC,YAAY,EAAE,IAAI;gBAClBC,OAAO,EAAE,IAAI;gBACbX,SAAS,EAAE,CAACC,MAAwC,GAClDA,MAAM,CAAC1B,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE0B,MAAM,CAACW,IAAI,CAAC,YAAY,EAAEtD,WAAW,CAAC2C,MAAM,CAAC1B,IAAI,CAAC,CAAC,CAAC,EAAEC,IAAI,CAAC,CAAC,CAAC;aACxF;SACF,CAAC;IACJ,CAAC,EAAE;QAACD,IAAI;QAAEI,WAAW;QAAEN,KAAK;QAAEK,IAAI;QAAEF,IAAI;KAAC,CAAC,AAAC;IAE3C,qBACE,KAACT,GAAG;QAAC8C,EAAE,EAAE;YAAExC,KAAK,EAAEA,KAAK;YAAEC,MAAM,EAAEA,MAAM;YAAEuB,QAAQ,EAAE,MAAM;SAAE;kBACzD,cAAA,KAAC5B,MAAM;YACL4C,EAAE,EAAE;gBACFC,SAAS,EAAExC,MAAM;gBACjBA,MAAM,EAAEC,IAAI,GAAGA,IAAI,CAACwC,MAAM,GAAI7C,CAAAA,aAAa,GAAGC,OAAO,CAAA,AAAC,GAAG,MAAM;aAChE;YACDS,MAAM,EAAEA,MAAM;YACdoC,KAAK,EAAErC,WAAW,CAAC6B,YAAY;UAC/B;MACE,CACN;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/BarChart/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
export * from './BarChart';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/BarChart/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 './BarChart';\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,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface DiscardChangesConfirmationDialogProps {
|
|
3
|
+
description: string;
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
onDiscardChanges: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const DiscardChangesConfirmationDialog: (props: DiscardChangesConfirmationDialogProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=DiscardChangesConfirmationDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscardChangesConfirmationDialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/DiscardChangesConfirmationDialog.tsx"],"names":[],"mappings":";AAgBA,UAAU,qCAAqC;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,gCAAgC,UAAW,qCAAqC,gBAiB5F,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { Button } from '@mui/material';
|
|
15
|
+
import { Dialog } from './Dialog';
|
|
16
|
+
export const DiscardChangesConfirmationDialog = (props)=>{
|
|
17
|
+
const { description , isOpen , onCancel , onDiscardChanges } = props;
|
|
18
|
+
return /*#__PURE__*/ _jsxs(Dialog, {
|
|
19
|
+
open: isOpen,
|
|
20
|
+
"aria-labelledby": "discard-dialog",
|
|
21
|
+
children: [
|
|
22
|
+
/*#__PURE__*/ _jsx(Dialog.Header, {
|
|
23
|
+
children: "Discard Changes"
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ _jsx(Dialog.Content, {
|
|
26
|
+
children: description
|
|
27
|
+
}),
|
|
28
|
+
/*#__PURE__*/ _jsxs(Dialog.Actions, {
|
|
29
|
+
children: [
|
|
30
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
31
|
+
variant: "contained",
|
|
32
|
+
onClick: onDiscardChanges,
|
|
33
|
+
children: "Discard Changes"
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
36
|
+
variant: "outlined",
|
|
37
|
+
color: "secondary",
|
|
38
|
+
onClick: onCancel,
|
|
39
|
+
children: "Cancel"
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=DiscardChangesConfirmationDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Dialog/DiscardChangesConfirmationDialog.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 { Button } from '@mui/material';\nimport { Dialog } from './Dialog';\n\ninterface DiscardChangesConfirmationDialogProps {\n description: string;\n isOpen: boolean;\n onCancel: () => void;\n onDiscardChanges: () => void;\n}\n\nexport const DiscardChangesConfirmationDialog = (props: DiscardChangesConfirmationDialogProps) => {\n const { description, isOpen, onCancel, onDiscardChanges } = props;\n\n return (\n <Dialog open={isOpen} aria-labelledby=\"discard-dialog\">\n <Dialog.Header>Discard Changes</Dialog.Header>\n <Dialog.Content>{description}</Dialog.Content>\n <Dialog.Actions>\n <Button variant=\"contained\" onClick={onDiscardChanges}>\n Discard Changes\n </Button>\n <Button variant=\"outlined\" color=\"secondary\" onClick={onCancel}>\n Cancel\n </Button>\n </Dialog.Actions>\n </Dialog>\n );\n};\n"],"names":["Button","Dialog","DiscardChangesConfirmationDialog","props","description","isOpen","onCancel","onDiscardChanges","open","aria-labelledby","Header","Content","Actions","variant","onClick","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;AAEjC;AAAA,SAASA,MAAM,QAAQ,eAAe,CAAC;AACvC,SAASC,MAAM,QAAQ,UAAU,CAAC;AASlC,OAAO,MAAMC,gCAAgC,GAAG,CAACC,KAA4C,GAAK;IAChG,MAAM,EAAEC,WAAW,CAAA,EAAEC,MAAM,CAAA,EAAEC,QAAQ,CAAA,EAAEC,gBAAgB,CAAA,EAAE,GAAGJ,KAAK,AAAC;IAElE,qBACE,MAACF,MAAM;QAACO,IAAI,EAAEH,MAAM;QAAEI,iBAAe,EAAC,gBAAgB;;0BACpD,KAACR,MAAM,CAACS,MAAM;0BAAC,iBAAe;cAAgB;0BAC9C,KAACT,MAAM,CAACU,OAAO;0BAAEP,WAAW;cAAkB;0BAC9C,MAACH,MAAM,CAACW,OAAO;;kCACb,KAACZ,MAAM;wBAACa,OAAO,EAAC,WAAW;wBAACC,OAAO,EAAEP,gBAAgB;kCAAE,iBAEvD;sBAAS;kCACT,KAACP,MAAM;wBAACa,OAAO,EAAC,UAAU;wBAACE,KAAK,EAAC,WAAW;wBAACD,OAAO,EAAER,QAAQ;kCAAE,QAEhE;sBAAS;;cACM;;MACV,CACT;AACJ,CAAC,CAAC"}
|
package/dist/Dialog/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Dialog/index.tsx"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Dialog/index.tsx"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,oCAAoC,CAAC"}
|
package/dist/Dialog/index.js
CHANGED
package/dist/Dialog/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Dialog/index.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\nexport * from './Dialog';\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"}
|
|
1
|
+
{"version":3,"sources":["../../src/Dialog/index.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\nexport * from './Dialog';\nexport * from './DiscardChangesConfirmationDialog';\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,oCAAoC,CAAC"}
|
|
@@ -30,5 +30,5 @@ export interface ListLegendItemProps extends Omit<ListItemProps<'div'>, 'onClick
|
|
|
30
30
|
*/
|
|
31
31
|
truncateLabel?: boolean;
|
|
32
32
|
}
|
|
33
|
-
export declare const ListLegendItem: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<ListLegendItemProps, "classes" | "className" | "style" | "children" | "sx" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "alignItems" | "disabled" | "selected" | "
|
|
33
|
+
export declare const ListLegendItem: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<ListLegendItemProps, "classes" | "className" | "style" | "children" | "sx" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "alignItems" | "disabled" | "selected" | "dense" | "components" | "ContainerComponent" | "ContainerProps" | "disableGutters" | "disablePadding" | "divider" | "secondaryAction" | "componentsProps" | "slotProps" | "slots" | "item" | "index" | "isVisuallySelected" | "truncateLabel"> & React.RefAttributes<HTMLDivElement>>>;
|
|
34
34
|
//# sourceMappingURL=ListLegendItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../src/LineChart/LineChart.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAc,UAAU,EAAkD,MAAM,OAAO,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EAEnB,qBAAqB,EACrB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAgBjB,OAAO,EAAE,iBAAiB,EAA0B,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE1F,OAAO,EAAuC,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1F,OAAO,EAOL,aAAa,EACd,MAAM,UAAU,CAAC;AAgBlB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,E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K,iBAAiB,CAAC;CAC1F;AAED,eAAO,MAAM,SAAS,0GAsPpB,CAAC"}
|
|
@@ -253,7 +253,8 @@ export const LineChart = /*#__PURE__*/ forwardRef(function LineChart({ height ,
|
|
|
253
253
|
unit: unit,
|
|
254
254
|
onUnpinClick: ()=>{
|
|
255
255
|
setTooltipPinnedCoords(null);
|
|
256
|
-
}
|
|
256
|
+
},
|
|
257
|
+
containerId: chartsTheme.tooltipPortalContainerId
|
|
257
258
|
}),
|
|
258
259
|
/*#__PURE__*/ _jsx(EChart, {
|
|
259
260
|
sx: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/LineChart/LineChart.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 { forwardRef, MouseEvent, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport { UnitOptions } from '@perses-dev/core';\nimport { Box } from '@mui/material';\nimport type {\n EChartsCoreOption,\n GridComponentOption,\n LineSeriesOption,\n LegendComponentOption,\n YAXisComponentOption,\n TooltipComponentOption,\n} from 'echarts';\nimport { ECharts as EChartsInstance, use } from 'echarts/core';\nimport { LineChart as EChartsLineChart } from 'echarts/charts';\nimport {\n GridComponent,\n DataZoomComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n LegendComponent,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { EChart, OnEventsType } from '../EChart';\nimport { EChartsDataFormat, ChartInstanceFocusOpts, ChartInstance } from '../model/graph';\nimport { useChartsTheme } from '../context/ChartsThemeProvider';\nimport { CursorCoordinates, LineChartTooltip, TooltipConfig } from '../TimeSeriesTooltip';\nimport { useTimeZone } from '../context/TimeZoneProvider';\nimport {\n clearHighlightedSeries,\n enableDataZoom,\n getDateRange,\n getFormattedDate,\n getYAxes,\n restoreChart,\n ZoomEventData,\n} from '../utils';\n\nuse([\n EChartsLineChart,\n GridComponent,\n DataZoomComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n LegendComponent,\n CanvasRenderer,\n]);\n\nexport interface LineChartProps {\n height: number;\n data: EChartsDataFormat;\n yAxis?: YAXisComponentOption;\n unit?: UnitOptions;\n grid?: GridComponentOption;\n legend?: LegendComponentOption;\n tooltipConfig?: TooltipConfig;\n noDataVariant?: 'chart' | 'message';\n syncGroup?: string;\n onDataZoom?: (e: ZoomEventData) => void;\n onDoubleClick?: (e: MouseEvent) => void;\n __experimentalEChartsOptionsOverride?: (options: EChartsCoreOption) => EChartsCoreOption;\n}\n\nexport const LineChart = forwardRef<ChartInstance, LineChartProps>(function LineChart(\n {\n height,\n data,\n yAxis,\n unit,\n grid,\n legend,\n tooltipConfig = { wrapLabels: true },\n noDataVariant = 'message',\n syncGroup,\n onDataZoom,\n onDoubleClick,\n __experimentalEChartsOptionsOverride,\n },\n ref\n) {\n const chartsTheme = useChartsTheme();\n const chartRef = useRef<EChartsInstance>();\n const [showTooltip, setShowTooltip] = useState<boolean>(true);\n const [tooltipPinnedCoords, setTooltipPinnedCoords] = useState<CursorCoordinates | null>(null);\n const { timeZone } = useTimeZone();\n\n const [isDragging, setIsDragging] = useState(false);\n const [startX, setStartX] = useState(0);\n\n useImperativeHandle(\n ref,\n () => {\n return {\n highlightSeries({ id }: ChartInstanceFocusOpts) {\n if (!chartRef.current) {\n // when chart undef, do not highlight series when hovering over legend\n return;\n }\n\n chartRef.current.dispatchAction({ type: 'highlight', seriesId: id });\n },\n clearHighlightedSeries: () => {\n if (!chartRef.current) {\n // when chart undef, do not clear highlight series\n return;\n }\n clearHighlightedSeries(chartRef.current, data.timeSeries.length);\n },\n };\n },\n [data.timeSeries.length]\n );\n\n const handleEvents: OnEventsType<LineSeriesOption['data'] | unknown> = useMemo(() => {\n return {\n datazoom: (params) => {\n if (onDataZoom === undefined) {\n setTimeout(() => {\n // workaround so unpin happens after click event\n setTooltipPinnedCoords(null);\n }, 10);\n }\n if (onDataZoom === undefined || params.batch[0] === undefined) return;\n const startIndex = params.batch[0].startValue ?? 0;\n const endIndex = params.batch[0].endValue ?? data.xAxis.length - 1;\n const xAxisStartValue = data.xAxis[startIndex];\n const xAxisEndValue = data.xAxis[endIndex];\n\n if (xAxisStartValue !== undefined && xAxisEndValue !== undefined) {\n const zoomEvent: ZoomEventData = {\n start: xAxisStartValue,\n end: xAxisEndValue,\n startIndex,\n endIndex,\n };\n onDataZoom(zoomEvent);\n }\n },\n };\n }, [data, onDataZoom, setTooltipPinnedCoords]);\n\n if (chartRef.current !== undefined) {\n enableDataZoom(chartRef.current);\n }\n\n const { noDataOption } = chartsTheme;\n\n const option: EChartsCoreOption = useMemo(() => {\n if (data.timeSeries === undefined) return {};\n\n // The \"chart\" `noDataVariant` is only used when the `timeSeries` is an\n // empty array because a `null` value will throw an error.\n if (data.timeSeries === null || (data.timeSeries.length === 0 && noDataVariant === 'message')) return noDataOption;\n\n const rangeMs = data.rangeMs ?? getDateRange(data.xAxis);\n\n const option: EChartsCoreOption = {\n series: data.timeSeries,\n xAxis: {\n type: 'category',\n data: data.xAxis,\n max: data.xAxisMax,\n axisLabel: {\n formatter: (value: number) => {\n return getFormattedDate(value, rangeMs, timeZone);\n },\n },\n },\n yAxis: getYAxes(yAxis, unit),\n animation: false,\n tooltip: {\n show: true,\n trigger: 'axis',\n showContent: false, // echarts tooltip content hidden since we use custom tooltip instead\n },\n // https://echarts.apache.org/en/option.html#axisPointer\n axisPointer: {\n type: 'line',\n z: 0, // ensure point symbol shows on top of dashed line\n triggerEmphasis: false, // https://github.com/apache/echarts/issues/18495\n triggerTooltip: false,\n snap: true,\n },\n toolbox: {\n feature: {\n dataZoom: {\n icon: null, // https://stackoverflow.com/a/67684076/17575201\n yAxisIndex: 'none',\n },\n },\n },\n grid,\n legend,\n };\n\n if (__experimentalEChartsOptionsOverride) {\n return __experimentalEChartsOptionsOverride(option);\n }\n return option;\n }, [data, yAxis, unit, grid, legend, noDataOption, timeZone, __experimentalEChartsOptionsOverride, noDataVariant]);\n\n return (\n <Box\n sx={{ height }}\n onClick={(e) => {\n // Pin and unpin when clicking on chart canvas but not tooltip text.\n if (e.target instanceof HTMLCanvasElement) {\n setTooltipPinnedCoords((current) => {\n if (current === null) {\n return {\n page: {\n x: e.pageX,\n y: e.pageY,\n },\n client: {\n x: e.clientX,\n y: e.clientY,\n },\n plotCanvas: {\n x: e.nativeEvent.offsetX,\n y: e.nativeEvent.offsetY,\n },\n target: e.target,\n };\n } else {\n return null;\n }\n });\n }\n }}\n onMouseDown={(e) => {\n const { clientX } = e;\n setIsDragging(true);\n setStartX(clientX);\n }}\n onMouseMove={(e) => {\n // Allow clicking inside tooltip to copy labels.\n if (!(e.target instanceof HTMLCanvasElement)) {\n return;\n }\n const { clientX } = e;\n if (isDragging) {\n const deltaX = clientX - startX;\n if (deltaX > 0) {\n // Hide tooltip when user drags to zoom.\n setShowTooltip(false);\n }\n }\n }}\n onMouseUp={() => {\n setIsDragging(false);\n setStartX(0);\n setShowTooltip(true);\n }}\n onMouseLeave={() => {\n if (tooltipPinnedCoords === null) {\n setShowTooltip(false);\n }\n if (chartRef.current !== undefined) {\n clearHighlightedSeries(chartRef.current, data.timeSeries.length);\n }\n }}\n onMouseEnter={() => {\n setShowTooltip(true);\n if (chartRef.current !== undefined) {\n enableDataZoom(chartRef.current);\n }\n }}\n onDoubleClick={(e) => {\n setTooltipPinnedCoords(null);\n // either dispatch ECharts restore action to return to orig state or allow consumer to define behavior\n if (onDoubleClick === undefined) {\n if (chartRef.current !== undefined) {\n restoreChart(chartRef.current);\n }\n } else {\n onDoubleClick(e);\n }\n }}\n >\n {/* Allows overrides prop to hide custom tooltip and use the ECharts option.tooltip instead */}\n {showTooltip === true &&\n (option.tooltip as TooltipComponentOption)?.showContent === false &&\n tooltipConfig.hidden !== true && (\n <LineChartTooltip\n chartRef={chartRef}\n chartData={data}\n wrapLabels={tooltipConfig.wrapLabels}\n pinnedPos={tooltipPinnedCoords}\n unit={unit}\n onUnpinClick={() => {\n setTooltipPinnedCoords(null);\n }}\n />\n )}\n <EChart\n sx={{\n width: '100%',\n height: '100%',\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n onEvents={handleEvents}\n _instance={chartRef}\n syncGroup={syncGroup}\n />\n </Box>\n );\n});\n"],"names":["forwardRef","useImperativeHandle","useMemo","useRef","useState","Box","use","LineChart","EChartsLineChart","GridComponent","DataZoomComponent","MarkAreaComponent","MarkLineComponent","MarkPointComponent","TitleComponent","ToolboxComponent","TooltipComponent","LegendComponent","CanvasRenderer","EChart","useChartsTheme","LineChartTooltip","useTimeZone","clearHighlightedSeries","enableDataZoom","getDateRange","getFormattedDate","getYAxes","restoreChart","height","data","yAxis","unit","grid","legend","tooltipConfig","wrapLabels","noDataVariant","syncGroup","onDataZoom","onDoubleClick","__experimentalEChartsOptionsOverride","ref","option","chartsTheme","chartRef","showTooltip","setShowTooltip","tooltipPinnedCoords","setTooltipPinnedCoords","timeZone","isDragging","setIsDragging","startX","setStartX","highlightSeries","id","current","dispatchAction","type","seriesId","timeSeries","length","handleEvents","datazoom","params","undefined","setTimeout","batch","startIndex","startValue","endIndex","endValue","xAxis","xAxisStartValue","xAxisEndValue","zoomEvent","start","end","noDataOption","rangeMs","series","max","xAxisMax","axisLabel","formatter","value","animation","tooltip","show","trigger","showContent","axisPointer","z","triggerEmphasis","triggerTooltip","snap","toolbox","feature","dataZoom","icon","yAxisIndex","sx","onClick","e","target","HTMLCanvasElement","page","x","pageX","y","pageY","client","clientX","clientY","plotCanvas","nativeEvent","offsetX","offsetY","onMouseDown","onMouseMove","deltaX","onMouseUp","onMouseLeave","onMouseEnter","hidden","chartData","pinnedPos","onUnpinClick","width","theme","echartsTheme","onEvents","_instance"],"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,UAAU,EAAcC,mBAAmB,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO,CAAC;AAE/F,SAASC,GAAG,QAAQ,eAAe,CAAC;AASpC,SAAqCC,GAAG,QAAQ,cAAc,CAAC;AAC/D,SAASC,SAAS,IAAIC,gBAAgB,QAAQ,gBAAgB,CAAC;AAC/D,SACEC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,cAAc,EACdC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,QACV,oBAAoB,CAAC;AAC5B,SAASC,cAAc,QAAQ,mBAAmB,CAAC;AACnD,SAASC,MAAM,QAAsB,WAAW,CAAC;AAEjD,SAASC,cAAc,QAAQ,gCAAgC,CAAC;AAChE,SAA4BC,gBAAgB,QAAuB,sBAAsB,CAAC;AAC1F,SAASC,WAAW,QAAQ,6BAA6B,CAAC;AAC1D,SACEC,sBAAsB,EACtBC,cAAc,EACdC,YAAY,EACZC,gBAAgB,EAChBC,QAAQ,EACRC,YAAY,QAEP,UAAU,CAAC;AAElBtB,GAAG,CAAC;IACFE,gBAAgB;IAChBC,aAAa;IACbC,iBAAiB;IACjBC,iBAAiB;IACjBC,iBAAiB;IACjBC,kBAAkB;IAClBC,cAAc;IACdC,gBAAgB;IAChBC,gBAAgB;IAChBC,eAAe;IACfC,cAAc;CACf,CAAC,CAAC;AAiBH,OAAO,MAAMX,SAAS,iBAAGP,UAAU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AAM;oBACbpG,MAAM,EAAE,MAAM;iBACf;gBACDc,MAAM,EAAEA,MAAM;gBACduF,KAAK,EAAEtF,WAAW,CAACuF,YAAY;gBAC/BC,QAAQ,EAAErE,YAAY;gBACtBsE,SAAS,EAAExF,QAAQ;gBACnBP,SAAS,EAAEA,SAAS;cACpB;;MACE,CACN;AACJ,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/LineChart/LineChart.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 { forwardRef, MouseEvent, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport { UnitOptions } from '@perses-dev/core';\nimport { Box } from '@mui/material';\nimport type {\n EChartsCoreOption,\n GridComponentOption,\n LineSeriesOption,\n LegendComponentOption,\n YAXisComponentOption,\n TooltipComponentOption,\n} from 'echarts';\nimport { ECharts as EChartsInstance, use } from 'echarts/core';\nimport { LineChart as EChartsLineChart } from 'echarts/charts';\nimport {\n GridComponent,\n DataZoomComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n LegendComponent,\n} from 'echarts/components';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport { EChart, OnEventsType } from '../EChart';\nimport { EChartsDataFormat, ChartInstanceFocusOpts, ChartInstance } from '../model/graph';\nimport { useChartsTheme } from '../context/ChartsThemeProvider';\nimport { CursorCoordinates, LineChartTooltip, TooltipConfig } from '../TimeSeriesTooltip';\nimport { useTimeZone } from '../context/TimeZoneProvider';\nimport {\n clearHighlightedSeries,\n enableDataZoom,\n getDateRange,\n getFormattedDate,\n getYAxes,\n restoreChart,\n ZoomEventData,\n} from '../utils';\n\nuse([\n EChartsLineChart,\n GridComponent,\n DataZoomComponent,\n MarkAreaComponent,\n MarkLineComponent,\n MarkPointComponent,\n TitleComponent,\n ToolboxComponent,\n TooltipComponent,\n LegendComponent,\n CanvasRenderer,\n]);\n\nexport interface LineChartProps {\n height: number;\n data: EChartsDataFormat;\n yAxis?: YAXisComponentOption;\n unit?: UnitOptions;\n grid?: GridComponentOption;\n legend?: LegendComponentOption;\n tooltipConfig?: TooltipConfig;\n noDataVariant?: 'chart' | 'message';\n syncGroup?: string;\n onDataZoom?: (e: ZoomEventData) => void;\n onDoubleClick?: (e: MouseEvent) => void;\n __experimentalEChartsOptionsOverride?: (options: EChartsCoreOption) => EChartsCoreOption;\n}\n\nexport const LineChart = forwardRef<ChartInstance, LineChartProps>(function LineChart(\n {\n height,\n data,\n yAxis,\n unit,\n grid,\n legend,\n tooltipConfig = { wrapLabels: true },\n noDataVariant = 'message',\n syncGroup,\n onDataZoom,\n onDoubleClick,\n __experimentalEChartsOptionsOverride,\n },\n ref\n) {\n const chartsTheme = useChartsTheme();\n const chartRef = useRef<EChartsInstance>();\n const [showTooltip, setShowTooltip] = useState<boolean>(true);\n const [tooltipPinnedCoords, setTooltipPinnedCoords] = useState<CursorCoordinates | null>(null);\n const { timeZone } = useTimeZone();\n\n const [isDragging, setIsDragging] = useState(false);\n const [startX, setStartX] = useState(0);\n\n useImperativeHandle(\n ref,\n () => {\n return {\n highlightSeries({ id }: ChartInstanceFocusOpts) {\n if (!chartRef.current) {\n // when chart undef, do not highlight series when hovering over legend\n return;\n }\n\n chartRef.current.dispatchAction({ type: 'highlight', seriesId: id });\n },\n clearHighlightedSeries: () => {\n if (!chartRef.current) {\n // when chart undef, do not clear highlight series\n return;\n }\n clearHighlightedSeries(chartRef.current, data.timeSeries.length);\n },\n };\n },\n [data.timeSeries.length]\n );\n\n const handleEvents: OnEventsType<LineSeriesOption['data'] | unknown> = useMemo(() => {\n return {\n datazoom: (params) => {\n if (onDataZoom === undefined) {\n setTimeout(() => {\n // workaround so unpin happens after click event\n setTooltipPinnedCoords(null);\n }, 10);\n }\n if (onDataZoom === undefined || params.batch[0] === undefined) return;\n const startIndex = params.batch[0].startValue ?? 0;\n const endIndex = params.batch[0].endValue ?? data.xAxis.length - 1;\n const xAxisStartValue = data.xAxis[startIndex];\n const xAxisEndValue = data.xAxis[endIndex];\n\n if (xAxisStartValue !== undefined && xAxisEndValue !== undefined) {\n const zoomEvent: ZoomEventData = {\n start: xAxisStartValue,\n end: xAxisEndValue,\n startIndex,\n endIndex,\n };\n onDataZoom(zoomEvent);\n }\n },\n };\n }, [data, onDataZoom, setTooltipPinnedCoords]);\n\n if (chartRef.current !== undefined) {\n enableDataZoom(chartRef.current);\n }\n\n const { noDataOption } = chartsTheme;\n\n const option: EChartsCoreOption = useMemo(() => {\n if (data.timeSeries === undefined) return {};\n\n // The \"chart\" `noDataVariant` is only used when the `timeSeries` is an\n // empty array because a `null` value will throw an error.\n if (data.timeSeries === null || (data.timeSeries.length === 0 && noDataVariant === 'message')) return noDataOption;\n\n const rangeMs = data.rangeMs ?? getDateRange(data.xAxis);\n\n const option: EChartsCoreOption = {\n series: data.timeSeries,\n xAxis: {\n type: 'category',\n data: data.xAxis,\n max: data.xAxisMax,\n axisLabel: {\n formatter: (value: number) => {\n return getFormattedDate(value, rangeMs, timeZone);\n },\n },\n },\n yAxis: getYAxes(yAxis, unit),\n animation: false,\n tooltip: {\n show: true,\n trigger: 'axis',\n showContent: false, // echarts tooltip content hidden since we use custom tooltip instead\n },\n // https://echarts.apache.org/en/option.html#axisPointer\n axisPointer: {\n type: 'line',\n z: 0, // ensure point symbol shows on top of dashed line\n triggerEmphasis: false, // https://github.com/apache/echarts/issues/18495\n triggerTooltip: false,\n snap: true,\n },\n toolbox: {\n feature: {\n dataZoom: {\n icon: null, // https://stackoverflow.com/a/67684076/17575201\n yAxisIndex: 'none',\n },\n },\n },\n grid,\n legend,\n };\n\n if (__experimentalEChartsOptionsOverride) {\n return __experimentalEChartsOptionsOverride(option);\n }\n return option;\n }, [data, yAxis, unit, grid, legend, noDataOption, timeZone, __experimentalEChartsOptionsOverride, noDataVariant]);\n\n return (\n <Box\n sx={{ height }}\n onClick={(e) => {\n // Pin and unpin when clicking on chart canvas but not tooltip text.\n if (e.target instanceof HTMLCanvasElement) {\n setTooltipPinnedCoords((current) => {\n if (current === null) {\n return {\n page: {\n x: e.pageX,\n y: e.pageY,\n },\n client: {\n x: e.clientX,\n y: e.clientY,\n },\n plotCanvas: {\n x: e.nativeEvent.offsetX,\n y: e.nativeEvent.offsetY,\n },\n target: e.target,\n };\n } else {\n return null;\n }\n });\n }\n }}\n onMouseDown={(e) => {\n const { clientX } = e;\n setIsDragging(true);\n setStartX(clientX);\n }}\n onMouseMove={(e) => {\n // Allow clicking inside tooltip to copy labels.\n if (!(e.target instanceof HTMLCanvasElement)) {\n return;\n }\n const { clientX } = e;\n if (isDragging) {\n const deltaX = clientX - startX;\n if (deltaX > 0) {\n // Hide tooltip when user drags to zoom.\n setShowTooltip(false);\n }\n }\n }}\n onMouseUp={() => {\n setIsDragging(false);\n setStartX(0);\n setShowTooltip(true);\n }}\n onMouseLeave={() => {\n if (tooltipPinnedCoords === null) {\n setShowTooltip(false);\n }\n if (chartRef.current !== undefined) {\n clearHighlightedSeries(chartRef.current, data.timeSeries.length);\n }\n }}\n onMouseEnter={() => {\n setShowTooltip(true);\n if (chartRef.current !== undefined) {\n enableDataZoom(chartRef.current);\n }\n }}\n onDoubleClick={(e) => {\n setTooltipPinnedCoords(null);\n // either dispatch ECharts restore action to return to orig state or allow consumer to define behavior\n if (onDoubleClick === undefined) {\n if (chartRef.current !== undefined) {\n restoreChart(chartRef.current);\n }\n } else {\n onDoubleClick(e);\n }\n }}\n >\n {/* Allows overrides prop to hide custom tooltip and use the ECharts option.tooltip instead */}\n {showTooltip === true &&\n (option.tooltip as TooltipComponentOption)?.showContent === false &&\n tooltipConfig.hidden !== true && (\n <LineChartTooltip\n chartRef={chartRef}\n chartData={data}\n wrapLabels={tooltipConfig.wrapLabels}\n pinnedPos={tooltipPinnedCoords}\n unit={unit}\n onUnpinClick={() => {\n setTooltipPinnedCoords(null);\n }}\n containerId={chartsTheme.tooltipPortalContainerId}\n />\n )}\n <EChart\n sx={{\n width: '100%',\n height: '100%',\n }}\n option={option}\n theme={chartsTheme.echartsTheme}\n onEvents={handleEvents}\n _instance={chartRef}\n syncGroup={syncGroup}\n />\n </Box>\n );\n});\n"],"names":["forwardRef","useImperativeHandle","useMemo","useRef","useState","Box","use","LineChart","EChartsLineChart","GridComponent","DataZoomComponent","MarkAreaComponent","MarkLineComponent","MarkPointComponent","TitleComponent","ToolboxComponent","TooltipComponent","LegendComponent","CanvasRenderer","EChart","useChartsTheme","LineChartTooltip","useTimeZone","clearHighlightedSeries","enableDataZoom","getDateRange","getFormattedDate","getYAxes","restoreChart","height","data","yAxis","unit","grid","legend","tooltipConfig","wrapLabels","noDataVariant","syncGroup","onDataZoom","onDoubleClick","__experimentalEChartsOptionsOverride","ref","option","chartsTheme","chartRef","showTooltip","setShowTooltip","tooltipPinnedCoords","setTooltipPinnedCoords","timeZone","isDragging","setIsDragging","startX","setStartX","highlightSeries","id","current","dispatchAction","type","seriesId","timeSeries","length","handleEvents","datazoom","params","undefined","setTimeout","batch","startIndex","startValue","endIndex","endValue","xAxis","xAxisStartValue","xAxisEndValue","zoomEvent","start","end","noDataOption","rangeMs","series","max","xAxisMax","axisLabel","formatter","value","animation","tooltip","show","trigger","showContent","axisPointer","z","triggerEmphasis","triggerTooltip","snap","toolbox","feature","dataZoom","icon","yAxisIndex","sx","onClick","e","target","HTMLCanvasElement","page","x","pageX","y","pageY","client","clientX","clientY","plotCanvas","nativeEvent","offsetX","offsetY","onMouseDown","onMouseMove","deltaX","onMouseUp","onMouseLeave","onMouseEnter","hidden","chartData","pinnedPos","onUnpinClick","containerId","tooltipPortalContainerId","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AM,EAAEA,MAAM;gBACdyF,KAAK,EAAExF,WAAW,CAACyF,YAAY;gBAC/BC,QAAQ,EAAEvE,YAAY;gBACtBwE,SAAS,EAAE1F,QAAQ;gBACnBP,SAAS,EAAEA,SAAS;cACpB;;MACE,CACN;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type ModeOption = 'value' | 'percentage';
|
|
3
|
+
export interface ModeSelectorProps {
|
|
4
|
+
disablePercentageMode: boolean;
|
|
5
|
+
onChange: (mode: ModeOption) => void;
|
|
6
|
+
value?: ModeOption;
|
|
7
|
+
}
|
|
8
|
+
export declare function ModeSelector({ disablePercentageMode, onChange, value }: ModeSelectorProps): JSX.Element;
|
|
9
|
+
//# sourceMappingURL=ModeSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModeSelector.d.ts","sourceRoot":"","sources":["../../src/ModeSelector/ModeSelector.tsx"],"names":[],"mappings":";AAqBA,oBAAY,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,qBAAqB,EAAE,QAAQ,EAAE,KAAe,EAAE,EAAE,iBAAiB,eAoBnG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
14
|
+
import { OptionsEditorControl } from '../OptionsEditorLayout';
|
|
15
|
+
import { SettingsAutocomplete } from '../SettingsAutocomplete';
|
|
16
|
+
const MODE_OPTIONS = [
|
|
17
|
+
{
|
|
18
|
+
id: 'value',
|
|
19
|
+
label: 'Value'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'percentage',
|
|
23
|
+
label: 'Percentage'
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
export function ModeSelector({ disablePercentageMode , onChange , value ='value' }) {
|
|
27
|
+
const handleModeChange = (_, { id })=>{
|
|
28
|
+
onChange(id);
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/ _jsx(OptionsEditorControl, {
|
|
31
|
+
label: "Mode",
|
|
32
|
+
control: /*#__PURE__*/ _jsx(SettingsAutocomplete, {
|
|
33
|
+
value: MODE_OPTIONS.find((o)=>o.id === value),
|
|
34
|
+
options: MODE_OPTIONS,
|
|
35
|
+
getOptionLabel: (o)=>o.label,
|
|
36
|
+
getOptionDisabled: (o)=>o.id === 'percentage' && disablePercentageMode,
|
|
37
|
+
onChange: handleModeChange,
|
|
38
|
+
disableClearable: true
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=ModeSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ModeSelector/ModeSelector.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 { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst MODE_OPTIONS: Array<{ id: ModeOption; label: string }> = [\n { id: 'value', label: 'Value' },\n { id: 'percentage', label: 'Percentage' },\n];\n\nexport type ModeOption = 'value' | 'percentage';\n\nexport interface ModeSelectorProps {\n disablePercentageMode: boolean;\n onChange: (mode: ModeOption) => void;\n value?: ModeOption;\n}\n\nexport function ModeSelector({ disablePercentageMode, onChange, value = 'value' }: ModeSelectorProps) {\n const handleModeChange = (_: unknown, { id }: { id: ModeOption }) => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <SettingsAutocomplete\n value={MODE_OPTIONS.find((o) => o.id === value)}\n options={MODE_OPTIONS}\n getOptionLabel={(o) => o.label}\n getOptionDisabled={(o) => o.id === 'percentage' && disablePercentageMode}\n onChange={handleModeChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","MODE_OPTIONS","id","label","ModeSelector","disablePercentageMode","onChange","value","handleModeChange","_","control","find","o","options","getOptionLabel","getOptionDisabled","disableClearable"],"mappings":"AAAA,oCAAoC;AACpC,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,oBAAoB,QAAQ,wBAAwB,CAAC;AAC9D,SAASC,oBAAoB,QAAQ,yBAAyB,CAAC;AAE/D,MAAMC,YAAY,GAA6C;IAC7D;QAAEC,EAAE,EAAE,OAAO;QAAEC,KAAK,EAAE,OAAO;KAAE;IAC/B;QAAED,EAAE,EAAE,YAAY;QAAEC,KAAK,EAAE,YAAY;KAAE;CAC1C,AAAC;AAUF,OAAO,SAASC,YAAY,CAAC,EAAEC,qBAAqB,CAAA,EAAEC,QAAQ,CAAA,EAAEC,KAAK,EAAG,OAAO,CAAA,EAAqB,EAAE;IACpG,MAAMC,gBAAgB,GAAG,CAACC,CAAU,EAAE,EAAEP,EAAE,CAAA,EAAsB,GAAK;QACnEI,QAAQ,CAACJ,EAAE,CAAC,CAAC;IACf,CAAC,AAAC;IAEF,qBACE,KAACH,oBAAoB;QACnBI,KAAK,EAAC,MAAM;QACZO,OAAO,gBACL,KAACV,oBAAoB;YACnBO,KAAK,EAAEN,YAAY,CAACU,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACV,EAAE,KAAKK,KAAK,CAAC;YAC/CM,OAAO,EAAEZ,YAAY;YACrBa,cAAc,EAAE,CAACF,CAAC,GAAKA,CAAC,CAACT,KAAK;YAC9BY,iBAAiB,EAAE,CAACH,CAAC,GAAKA,CAAC,CAACV,EAAE,KAAK,YAAY,IAAIG,qBAAqB;YACxEC,QAAQ,EAAEE,gBAAgB;YAC1BQ,gBAAgB;UAChB;MAEJ,CACF;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ModeSelector/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
export * from './ModeSelector';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ModeSelector/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 './ModeSelector';\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,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type SortOption = 'asc' | 'desc';
|
|
3
|
+
export interface SortSelectorProps {
|
|
4
|
+
onChange: (sort: SortOption) => void;
|
|
5
|
+
value?: SortOption;
|
|
6
|
+
}
|
|
7
|
+
export declare function SortSelector({ onChange, value }: SortSelectorProps): JSX.Element;
|
|
8
|
+
//# sourceMappingURL=SortSelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortSelector.d.ts","sourceRoot":"","sources":["../../src/SortSelector/SortSelector.tsx"],"names":[],"mappings":";AAqBA,oBAAY,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,KAAc,EAAE,EAAE,iBAAiB,eAmB3E"}
|