@perses-dev/explore 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-explorer-plugin-c4a7621
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/cjs/components/ExploreManager/ExploreManager.js +109 -0
- package/dist/cjs/components/ExploreManager/ExplorerManagerProvider.js +84 -0
- package/dist/cjs/components/ExploreManager/ExplorerManagerProviderWithQueryParams.js +45 -0
- package/dist/cjs/components/ExploreManager/index.js +32 -0
- package/dist/cjs/components/ExploreManager/query-params.js +49 -0
- package/dist/cjs/components/index.js +31 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/views/ViewExplore/ViewExplore.js +2 -2
- package/dist/cjs/views/ViewExplore/ViewExploreApp.js +6 -9
- package/dist/components/ExploreManager/ExploreManager.d.ts +6 -0
- package/dist/components/ExploreManager/ExploreManager.d.ts.map +1 -0
- package/dist/components/ExploreManager/ExploreManager.js +101 -0
- package/dist/components/ExploreManager/ExploreManager.js.map +1 -0
- package/dist/components/ExploreManager/ExplorerManagerProvider.d.ts +20 -0
- package/dist/components/ExploreManager/ExplorerManagerProvider.d.ts.map +1 -0
- package/dist/components/ExploreManager/ExplorerManagerProvider.js +68 -0
- package/dist/components/ExploreManager/ExplorerManagerProvider.js.map +1 -0
- package/dist/components/ExploreManager/ExplorerManagerProviderWithQueryParams.d.ts +7 -0
- package/dist/components/ExploreManager/ExplorerManagerProviderWithQueryParams.d.ts.map +1 -0
- package/dist/components/ExploreManager/ExplorerManagerProviderWithQueryParams.js +32 -0
- package/dist/components/ExploreManager/ExplorerManagerProviderWithQueryParams.js.map +1 -0
- package/dist/components/ExploreManager/index.d.ts +4 -0
- package/dist/components/ExploreManager/index.d.ts.map +1 -0
- package/dist/components/ExploreManager/index.js +17 -0
- package/dist/components/ExploreManager/index.js.map +1 -0
- package/dist/components/ExploreManager/query-params.d.ts +17 -0
- package/dist/components/ExploreManager/query-params.d.ts.map +1 -0
- package/dist/components/ExploreManager/query-params.js +34 -0
- package/dist/components/ExploreManager/query-params.js.map +1 -0
- package/dist/components/ExploreToolbar/ExploreToolbar.d.ts +2 -2
- package/dist/components/ExploreToolbar/ExploreToolbar.d.ts.map +1 -1
- package/dist/components/ExploreToolbar/ExploreToolbar.js.map +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +16 -0
- package/dist/components/index.js.map +1 -0
- 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/views/ViewExplore/ViewExplore.d.ts +4 -4
- package/dist/views/ViewExplore/ViewExplore.d.ts.map +1 -1
- package/dist/views/ViewExplore/ViewExplore.js +3 -3
- package/dist/views/ViewExplore/ViewExplore.js.map +1 -1
- package/dist/views/ViewExplore/ViewExploreApp.d.ts +3 -3
- package/dist/views/ViewExplore/ViewExploreApp.d.ts.map +1 -1
- package/dist/views/ViewExplore/ViewExploreApp.js +6 -4
- package/dist/views/ViewExplore/ViewExploreApp.js.map +1 -1
- package/package.json +16 -12
- package/dist/cjs/components/TimeSeriesExplorer/TimeSeriesExplorer.js +0 -166
- package/dist/components/TimeSeriesExplorer/TimeSeriesExplorer.d.ts +0 -11
- package/dist/components/TimeSeriesExplorer/TimeSeriesExplorer.d.ts.map +0 -1
- package/dist/components/TimeSeriesExplorer/TimeSeriesExplorer.js +0 -109
- package/dist/components/TimeSeriesExplorer/TimeSeriesExplorer.js.map +0 -1
|
@@ -1,109 +0,0 @@
|
|
|
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 { DataQueriesProvider, TimeSeriesQueryEditor, useSuggestedStepMs } from '@perses-dev/plugin-system';
|
|
15
|
-
import { Box, Grid, Stack, Typography } from '@mui/material';
|
|
16
|
-
import { ErrorAlert, ErrorBoundary } from '@perses-dev/components';
|
|
17
|
-
import React, { useRef, useState } from 'react';
|
|
18
|
-
import { TimeSeriesChart } from '@perses-dev/panels-plugin';
|
|
19
|
-
import { ExploreToolbar } from '../ExploreToolbar';
|
|
20
|
-
const PANEL_PREVIEW_HEIGHT = 300;
|
|
21
|
-
const PANEL_PREVIEW_DEFAULT_WIDTH = 840;
|
|
22
|
-
export function TimeSeriesPanel({ queries }) {
|
|
23
|
-
const boxRef = useRef(null);
|
|
24
|
-
let width = PANEL_PREVIEW_DEFAULT_WIDTH;
|
|
25
|
-
if (boxRef.current !== null) {
|
|
26
|
-
width = boxRef.current.getBoundingClientRect().width;
|
|
27
|
-
}
|
|
28
|
-
const suggestedStepMs = useSuggestedStepMs(width);
|
|
29
|
-
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
30
|
-
const definitions = queries.length ? queries.map((query)=>{
|
|
31
|
-
return {
|
|
32
|
-
kind: query.spec.plugin.kind,
|
|
33
|
-
spec: query.spec.plugin.spec
|
|
34
|
-
};
|
|
35
|
-
}) : [];
|
|
36
|
-
return /*#__PURE__*/ _jsx(Box, {
|
|
37
|
-
ref: boxRef,
|
|
38
|
-
height: PANEL_PREVIEW_HEIGHT,
|
|
39
|
-
children: /*#__PURE__*/ _jsx(DataQueriesProvider, {
|
|
40
|
-
definitions: definitions,
|
|
41
|
-
options: {
|
|
42
|
-
suggestedStepMs
|
|
43
|
-
},
|
|
44
|
-
children: /*#__PURE__*/ _jsx(TimeSeriesChart.PanelComponent, {
|
|
45
|
-
contentDimensions: {
|
|
46
|
-
width,
|
|
47
|
-
height: PANEL_PREVIEW_HEIGHT
|
|
48
|
-
},
|
|
49
|
-
spec: {}
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
export function TimeSeriesExplorer(props) {
|
|
55
|
-
const { exploreTitleComponent } = props;
|
|
56
|
-
const [queries, setQueries] = useState();
|
|
57
|
-
return /*#__PURE__*/ _jsxs(Stack, {
|
|
58
|
-
sx: {
|
|
59
|
-
width: '100%'
|
|
60
|
-
},
|
|
61
|
-
px: 2,
|
|
62
|
-
pb: 2,
|
|
63
|
-
pt: 1.5,
|
|
64
|
-
gap: 2,
|
|
65
|
-
children: [
|
|
66
|
-
/*#__PURE__*/ _jsx(ExploreToolbar, {
|
|
67
|
-
exploreTitleComponent: exploreTitleComponent
|
|
68
|
-
}),
|
|
69
|
-
/*#__PURE__*/ _jsxs(Grid, {
|
|
70
|
-
container: true,
|
|
71
|
-
spacing: 2,
|
|
72
|
-
children: [
|
|
73
|
-
/*#__PURE__*/ _jsx(Grid, {
|
|
74
|
-
item: true,
|
|
75
|
-
xs: 12,
|
|
76
|
-
children: /*#__PURE__*/ _jsx(Stack, {
|
|
77
|
-
gap: 1,
|
|
78
|
-
children: /*#__PURE__*/ _jsx(TimeSeriesQueryEditor, {
|
|
79
|
-
onChange: setQueries,
|
|
80
|
-
queries: queries
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
-
}),
|
|
84
|
-
/*#__PURE__*/ _jsx(Grid, {
|
|
85
|
-
item: true,
|
|
86
|
-
xs: 12,
|
|
87
|
-
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
88
|
-
gap: 1,
|
|
89
|
-
children: [
|
|
90
|
-
/*#__PURE__*/ _jsx(Typography, {
|
|
91
|
-
variant: "h4",
|
|
92
|
-
children: "Preview"
|
|
93
|
-
}),
|
|
94
|
-
/*#__PURE__*/ _jsx(ErrorBoundary, {
|
|
95
|
-
FallbackComponent: ErrorAlert,
|
|
96
|
-
children: /*#__PURE__*/ _jsx(TimeSeriesPanel, {
|
|
97
|
-
queries: queries !== null && queries !== void 0 ? queries : []
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
]
|
|
101
|
-
})
|
|
102
|
-
})
|
|
103
|
-
]
|
|
104
|
-
})
|
|
105
|
-
]
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
//# sourceMappingURL=TimeSeriesExplorer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/TimeSeriesExplorer/TimeSeriesExplorer.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 { DataQueriesProvider, TimeSeriesQueryEditor, useSuggestedStepMs } from '@perses-dev/plugin-system';\nimport { Box, Grid, Stack, Typography } from '@mui/material';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { QueryDefinition } from '@perses-dev/core';\nimport React, { useRef, useState } from 'react';\nimport { TimeSeriesChart } from '@perses-dev/panels-plugin';\nimport { ExploreToolbar } from '../ExploreToolbar';\n\nexport interface TimeseriesExplorerProps {\n exploreTitleComponent?: React.ReactNode;\n}\n\nconst PANEL_PREVIEW_HEIGHT = 300;\nconst PANEL_PREVIEW_DEFAULT_WIDTH = 840;\n\nexport interface PanelPreviewValues {\n queries: QueryDefinition[];\n}\n\nexport function TimeSeriesPanel({ queries }: PanelPreviewValues) {\n const boxRef = useRef<HTMLDivElement>(null);\n let width = PANEL_PREVIEW_DEFAULT_WIDTH;\n if (boxRef.current !== null) {\n width = boxRef.current.getBoundingClientRect().width;\n }\n const suggestedStepMs = useSuggestedStepMs(width);\n\n // map TimeSeriesQueryDefinition to Definition<UnknownSpec>\n const definitions = queries.length\n ? queries.map((query) => {\n return {\n kind: query.spec.plugin.kind,\n spec: query.spec.plugin.spec,\n };\n })\n : [];\n\n return (\n <Box ref={boxRef} height={PANEL_PREVIEW_HEIGHT}>\n <DataQueriesProvider definitions={definitions} options={{ suggestedStepMs }}>\n <TimeSeriesChart.PanelComponent\n contentDimensions={{\n width,\n height: PANEL_PREVIEW_HEIGHT,\n }}\n spec={{}}\n />\n </DataQueriesProvider>\n </Box>\n );\n}\n\nexport function TimeSeriesExplorer(props: TimeseriesExplorerProps) {\n const { exploreTitleComponent } = props;\n\n const [queries, setQueries] = useState<QueryDefinition[]>();\n\n return (\n <Stack sx={{ width: '100%' }} px={2} pb={2} pt={1.5} gap={2}>\n <ExploreToolbar exploreTitleComponent={exploreTitleComponent} />\n <Grid container spacing={2}>\n <Grid item xs={12}>\n <Stack gap={1}>\n <TimeSeriesQueryEditor onChange={setQueries} queries={queries} />\n </Stack>\n </Grid>\n <Grid item xs={12}>\n <Stack gap={1}>\n <Typography variant=\"h4\">Preview</Typography>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <TimeSeriesPanel queries={queries ?? []} />\n </ErrorBoundary>\n </Stack>\n </Grid>\n </Grid>\n </Stack>\n );\n}\n"],"names":["DataQueriesProvider","TimeSeriesQueryEditor","useSuggestedStepMs","Box","Grid","Stack","Typography","ErrorAlert","ErrorBoundary","React","useRef","useState","TimeSeriesChart","ExploreToolbar","PANEL_PREVIEW_HEIGHT","PANEL_PREVIEW_DEFAULT_WIDTH","TimeSeriesPanel","queries","boxRef","width","current","getBoundingClientRect","suggestedStepMs","definitions","length","map","query","kind","spec","plugin","ref","height","options","PanelComponent","contentDimensions","TimeSeriesExplorer","props","exploreTitleComponent","setQueries","sx","px","pb","pt","gap","container","spacing","item","xs","onChange","variant","FallbackComponent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,mBAAmB,EAAEC,qBAAqB,EAAEC,kBAAkB,QAAQ,4BAA4B;AAC3G,SAASC,GAAG,EAAEC,IAAI,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAC7D,SAASC,UAAU,EAAEC,aAAa,QAAQ,yBAAyB;AAEnE,OAAOC,SAASC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAChD,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,cAAc,QAAQ,oBAAoB;AAMnD,MAAMC,uBAAuB;AAC7B,MAAMC,8BAA8B;AAMpC,OAAO,SAASC,gBAAgB,EAAEC,OAAO,EAAsB;IAC7D,MAAMC,SAASR,OAAuB;IACtC,IAAIS,QAAQJ;IACZ,IAAIG,OAAOE,OAAO,KAAK,MAAM;QAC3BD,QAAQD,OAAOE,OAAO,CAACC,qBAAqB,GAAGF,KAAK;IACtD;IACA,MAAMG,kBAAkBpB,mBAAmBiB;IAE3C,2DAA2D;IAC3D,MAAMI,cAAcN,QAAQO,MAAM,GAC9BP,QAAQQ,GAAG,CAAC,CAACC;QACX,OAAO;YACLC,MAAMD,MAAME,IAAI,CAACC,MAAM,CAACF,IAAI;YAC5BC,MAAMF,MAAME,IAAI,CAACC,MAAM,CAACD,IAAI;QAC9B;IACF,KACA,EAAE;IAEN,qBACE,KAACzB;QAAI2B,KAAKZ;QAAQa,QAAQjB;kBACxB,cAAA,KAACd;YAAoBuB,aAAaA;YAAaS,SAAS;gBAAEV;YAAgB;sBACxE,cAAA,KAACV,gBAAgBqB,cAAc;gBAC7BC,mBAAmB;oBACjBf;oBACAY,QAAQjB;gBACV;gBACAc,MAAM,CAAC;;;;AAKjB;AAEA,OAAO,SAASO,mBAAmBC,KAA8B;IAC/D,MAAM,EAAEC,qBAAqB,EAAE,GAAGD;IAElC,MAAM,CAACnB,SAASqB,WAAW,GAAG3B;IAE9B,qBACE,MAACN;QAAMkC,IAAI;YAAEpB,OAAO;QAAO;QAAGqB,IAAI;QAAGC,IAAI;QAAGC,IAAI;QAAKC,KAAK;;0BACxD,KAAC9B;gBAAewB,uBAAuBA;;0BACvC,MAACjC;gBAAKwC,SAAS;gBAACC,SAAS;;kCACvB,KAACzC;wBAAK0C,IAAI;wBAACC,IAAI;kCACb,cAAA,KAAC1C;4BAAMsC,KAAK;sCACV,cAAA,KAAC1C;gCAAsB+C,UAAUV;gCAAYrB,SAASA;;;;kCAG1D,KAACb;wBAAK0C,IAAI;wBAACC,IAAI;kCACb,cAAA,MAAC1C;4BAAMsC,KAAK;;8CACV,KAACrC;oCAAW2C,SAAQ;8CAAK;;8CACzB,KAACzC;oCAAc0C,mBAAmB3C;8CAChC,cAAA,KAACS;wCAAgBC,SAASA,oBAAAA,qBAAAA,UAAW,EAAE;;;;;;;;;;AAOrD"}
|