@perses-dev/tracing-gantt-chart-plugin 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +41 -0
- package/__mf/css/async/341.6c6463ea.css +1 -0
- package/__mf/css/async/759.6c6463ea.css +1 -0
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/788.91bbf7bd.js +5 -0
- package/__mf/js/TracingGanttChart.1a922a19.js +5 -0
- package/__mf/js/async/156.5a401ecb.js +1 -0
- package/__mf/js/async/173.6314a363.js +2 -0
- package/__mf/js/async/173.6314a363.js.LICENSE.txt +19 -0
- package/__mf/js/async/620.1d1ce390.js +2 -0
- package/__mf/js/async/620.1d1ce390.js.LICENSE.txt +9 -0
- package/__mf/js/async/651.3ea371e5.js +1 -0
- package/__mf/js/async/694.4580ad20.js +1 -0
- package/__mf/js/async/740.babbb403.js +1 -0
- package/__mf/js/async/75.d81e6bbf.js +1 -0
- package/__mf/js/async/770.5431adef.js +1 -0
- package/__mf/js/async/783.3c2c57f6.js +110 -0
- package/__mf/js/async/783.3c2c57f6.js.LICENSE.txt +27 -0
- package/__mf/js/async/844.556cc34d.js +66 -0
- package/__mf/js/async/844.556cc34d.js.LICENSE.txt +84 -0
- package/__mf/js/async/928.096f73eb.js +1 -0
- package/__mf/js/async/960.478a8f11.js +2 -0
- package/__mf/js/async/960.478a8f11.js.LICENSE.txt +8 -0
- package/__mf/js/async/964.a98cab40.js +2 -0
- package/__mf/js/async/964.a98cab40.js.LICENSE.txt +9 -0
- package/__mf/js/async/981.bc5132f8.js +2 -0
- package/__mf/js/async/981.bc5132f8.js.LICENSE.txt +8 -0
- package/__mf/js/async/__federation_expose_TracingGanttChart.5ab86c44.js +1 -0
- package/__mf/js/async/lib-router.36c0d526.js +2 -0
- package/__mf/js/async/lib-router.36c0d526.js.LICENSE.txt +32 -0
- package/__mf/js/main.e75dea7b.js +1 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts +9 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts.map +1 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.js +66 -0
- package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -0
- package/lib/TracingGanttChart/DetailPane/DetailPane.d.ts +14 -0
- package/lib/TracingGanttChart/DetailPane/DetailPane.d.ts.map +1 -0
- package/lib/TracingGanttChart/DetailPane/DetailPane.js +95 -0
- package/lib/TracingGanttChart/DetailPane/DetailPane.js.map +1 -0
- package/lib/TracingGanttChart/DetailPane/SpanEvents.d.ts +8 -0
- package/lib/TracingGanttChart/DetailPane/SpanEvents.d.ts.map +1 -0
- package/lib/TracingGanttChart/DetailPane/SpanEvents.js +54 -0
- package/lib/TracingGanttChart/DetailPane/SpanEvents.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts +13 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.js +93 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.d.ts +12 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js +56 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts +23 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js +45 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts +15 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js +56 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts +9 -0
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js +86 -0
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanDuration.d.ts +14 -0
- package/lib/TracingGanttChart/GanttTable/SpanDuration.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanDuration.js +75 -0
- package/lib/TracingGanttChart/GanttTable/SpanDuration.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts +14 -0
- package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js +90 -0
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanName.d.ts +11 -0
- package/lib/TracingGanttChart/GanttTable/SpanName.d.ts.map +1 -0
- package/lib/TracingGanttChart/GanttTable/SpanName.js +61 -0
- package/lib/TracingGanttChart/GanttTable/SpanName.js.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.d.ts +13 -0
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.d.ts.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js +243 -0
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.d.ts +13 -0
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.d.ts.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js +51 -0
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts +3 -0
- package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts.map +1 -0
- package/lib/TracingGanttChart/MiniGanttChart/draw.js +48 -0
- package/lib/TracingGanttChart/MiniGanttChart/draw.js.map +1 -0
- package/lib/TracingGanttChart/Ticks.d.ts +16 -0
- package/lib/TracingGanttChart/Ticks.d.ts.map +1 -0
- package/lib/TracingGanttChart/Ticks.js +94 -0
- package/lib/TracingGanttChart/Ticks.js.map +1 -0
- package/lib/TracingGanttChart/TracingGanttChart.d.ts +17 -0
- package/lib/TracingGanttChart/TracingGanttChart.d.ts.map +1 -0
- package/lib/TracingGanttChart/TracingGanttChart.js +106 -0
- package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -0
- package/lib/TracingGanttChart/palette.d.ts +6 -0
- package/lib/TracingGanttChart/palette.d.ts.map +1 -0
- package/lib/TracingGanttChart/palette.js +64 -0
- package/lib/TracingGanttChart/palette.js.map +1 -0
- package/lib/TracingGanttChart/trace.d.ts +45 -0
- package/lib/TracingGanttChart/trace.d.ts.map +1 -0
- package/lib/TracingGanttChart/trace.js +109 -0
- package/lib/TracingGanttChart/trace.js.map +1 -0
- package/lib/TracingGanttChart/utils.d.ts +18 -0
- package/lib/TracingGanttChart/utils.d.ts.map +1 -0
- package/lib/TracingGanttChart/utils.js +48 -0
- package/lib/TracingGanttChart/utils.js.map +1 -0
- package/lib/TracingGanttChart.d.ts +5 -0
- package/lib/TracingGanttChart.d.ts.map +1 -0
- package/lib/TracingGanttChart.js +23 -0
- package/lib/TracingGanttChart.js.map +1 -0
- package/lib/TracingGanttChartPanel.d.ts +17 -0
- package/lib/TracingGanttChartPanel.d.ts.map +1 -0
- package/lib/TracingGanttChartPanel.js +45 -0
- package/lib/TracingGanttChartPanel.js.map +1 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +19 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/TracingGanttChart/DetailPane/Attributes.js +74 -0
- package/lib/cjs/TracingGanttChart/DetailPane/DetailPane.js +106 -0
- package/lib/cjs/TracingGanttChart/DetailPane/SpanEvents.js +67 -0
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTable.js +101 -0
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableHeader.js +64 -0
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableProvider.js +60 -0
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableRow.js +64 -0
- package/lib/cjs/TracingGanttChart/GanttTable/ResizableDivider.js +94 -0
- package/lib/cjs/TracingGanttChart/GanttTable/SpanDuration.js +81 -0
- package/lib/cjs/TracingGanttChart/GanttTable/SpanIndents.js +97 -0
- package/lib/cjs/TracingGanttChart/GanttTable/SpanName.js +72 -0
- package/lib/cjs/TracingGanttChart/MiniGanttChart/Canvas.js +256 -0
- package/lib/cjs/TracingGanttChart/MiniGanttChart/MiniGanttChart.js +59 -0
- package/lib/cjs/TracingGanttChart/MiniGanttChart/draw.js +56 -0
- package/lib/cjs/TracingGanttChart/Ticks.js +106 -0
- package/lib/cjs/TracingGanttChart/TracingGanttChart.js +109 -0
- package/lib/cjs/TracingGanttChart/palette.js +83 -0
- package/lib/cjs/TracingGanttChart/trace.js +113 -0
- package/lib/cjs/TracingGanttChart/utils.js +76 -0
- package/lib/cjs/TracingGanttChart.js +31 -0
- package/lib/cjs/TracingGanttChartPanel.js +53 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/gantt-chart-model.js +28 -0
- package/lib/cjs/getPluginModule.js +27 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +27 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/cjs/test/convert/jaeger.js +86 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/gantt-chart-model.d.ts +17 -0
- package/lib/gantt-chart-model.d.ts.map +1 -0
- package/lib/gantt-chart-model.js +22 -0
- package/lib/gantt-chart-model.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +16 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/lib/test/convert/jaeger.d.ts +41 -0
- package/lib/test/convert/jaeger.d.ts.map +1 -0
- package/lib/test/convert/jaeger.js +78 -0
- package/lib/test/convert/jaeger.js.map +1 -0
- package/mf-manifest.json +233 -0
- package/mf-stats.json +269 -0
- package/package.json +58 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright 2024 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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { useMemo } from 'react';
|
|
15
|
+
import { Link, List, ListItem, ListItemText } from '@mui/material';
|
|
16
|
+
import { Link as RouterLink } from 'react-router-dom';
|
|
17
|
+
export function AttributeList(props) {
|
|
18
|
+
const { attributeLinks, attributes } = props;
|
|
19
|
+
const attributesMap = useMemo(()=>Object.fromEntries(attributes.map((attr)=>[
|
|
20
|
+
attr.key,
|
|
21
|
+
attr.value
|
|
22
|
+
])), [
|
|
23
|
+
attributes
|
|
24
|
+
]);
|
|
25
|
+
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
26
|
+
children: /*#__PURE__*/ _jsx(List, {
|
|
27
|
+
children: attributes.sort((a, b)=>a.key.localeCompare(b.key)).map((attribute, i)=>/*#__PURE__*/ _jsx(AttributeItem, {
|
|
28
|
+
attribute: attribute,
|
|
29
|
+
linkTo: attributeLinks?.[attribute.key]?.(attributesMap)
|
|
30
|
+
}, i))
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function AttributeItem(props) {
|
|
35
|
+
const { attribute, linkTo } = props;
|
|
36
|
+
const value = linkTo ? /*#__PURE__*/ _jsx(Link, {
|
|
37
|
+
component: RouterLink,
|
|
38
|
+
to: linkTo,
|
|
39
|
+
children: renderAttributeValue(attribute.value)
|
|
40
|
+
}) : renderAttributeValue(attribute.value);
|
|
41
|
+
return /*#__PURE__*/ _jsx(ListItem, {
|
|
42
|
+
disablePadding: true,
|
|
43
|
+
children: /*#__PURE__*/ _jsx(ListItemText, {
|
|
44
|
+
primary: attribute.key,
|
|
45
|
+
secondary: value,
|
|
46
|
+
primaryTypographyProps: {
|
|
47
|
+
variant: 'h5'
|
|
48
|
+
},
|
|
49
|
+
secondaryTypographyProps: {
|
|
50
|
+
variant: 'body1',
|
|
51
|
+
sx: {
|
|
52
|
+
wordBreak: 'break-word'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function renderAttributeValue(value) {
|
|
59
|
+
if ('stringValue' in value) return value.stringValue.length > 0 ? value.stringValue : '<empty string>';
|
|
60
|
+
if ('intValue' in value) return value.intValue;
|
|
61
|
+
if ('boolValue' in value) return value.boolValue.toString();
|
|
62
|
+
if ('arrayValue' in value) return value.arrayValue.values.map(renderAttributeValue).join(', ');
|
|
63
|
+
return 'unknown';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=Attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/DetailPane/Attributes.tsx"],"sourcesContent":["// Copyright 2024 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 { ReactElement, useMemo } from 'react';\nimport { Link, List, ListItem, ListItemText } from '@mui/material';\nimport { Link as RouterLink } from 'react-router-dom';\nimport { otlpcommonv1 } from '@perses-dev/core';\n\nexport type AttributeLinks = Record<string, (attributes: Record<string, otlpcommonv1.AnyValue>) => string>;\n\nexport interface AttributeListProps {\n attributeLinks?: AttributeLinks;\n attributes: otlpcommonv1.KeyValue[];\n}\n\nexport function AttributeList(props: AttributeListProps): ReactElement {\n const { attributeLinks, attributes } = props;\n const attributesMap = useMemo(\n () => Object.fromEntries(attributes.map((attr) => [attr.key, attr.value])),\n [attributes]\n );\n\n return (\n <>\n <List>\n {attributes\n .sort((a, b) => a.key.localeCompare(b.key))\n .map((attribute, i) => (\n <AttributeItem key={i} attribute={attribute} linkTo={attributeLinks?.[attribute.key]?.(attributesMap)} />\n ))}\n </List>\n </>\n );\n}\n\ninterface AttributeItemProps {\n attribute: otlpcommonv1.KeyValue;\n linkTo?: string;\n}\n\nfunction AttributeItem(props: AttributeItemProps): ReactElement {\n const { attribute, linkTo } = props;\n\n const value = linkTo ? (\n <Link component={RouterLink} to={linkTo}>\n {renderAttributeValue(attribute.value)}\n </Link>\n ) : (\n renderAttributeValue(attribute.value)\n );\n\n return (\n <ListItem disablePadding>\n <ListItemText\n primary={attribute.key}\n secondary={value}\n primaryTypographyProps={{ variant: 'h5' }}\n secondaryTypographyProps={{ variant: 'body1', sx: { wordBreak: 'break-word' } }}\n />\n </ListItem>\n );\n}\n\nfunction renderAttributeValue(value: otlpcommonv1.AnyValue): string {\n if ('stringValue' in value) return value.stringValue.length > 0 ? value.stringValue : '<empty string>';\n if ('intValue' in value) return value.intValue;\n if ('boolValue' in value) return value.boolValue.toString();\n if ('arrayValue' in value) return value.arrayValue.values.map(renderAttributeValue).join(', ');\n return 'unknown';\n}\n"],"names":["useMemo","Link","List","ListItem","ListItemText","RouterLink","AttributeList","props","attributeLinks","attributes","attributesMap","Object","fromEntries","map","attr","key","value","sort","a","b","localeCompare","attribute","i","AttributeItem","linkTo","component","to","renderAttributeValue","disablePadding","primary","secondary","primaryTypographyProps","variant","secondaryTypographyProps","sx","wordBreak","stringValue","length","intValue","boolValue","toString","arrayValue","values","join"],"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,SAAuBA,OAAO,QAAQ,QAAQ;AAC9C,SAASC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,YAAY,QAAQ,gBAAgB;AACnE,SAASH,QAAQI,UAAU,QAAQ,mBAAmB;AAUtD,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EAAEC,cAAc,EAAEC,UAAU,EAAE,GAAGF;IACvC,MAAMG,gBAAgBV,QACpB,IAAMW,OAAOC,WAAW,CAACH,WAAWI,GAAG,CAAC,CAACC,OAAS;gBAACA,KAAKC,GAAG;gBAAED,KAAKE,KAAK;aAAC,IACxE;QAACP;KAAW;IAGd,qBACE;kBACE,cAAA,KAACP;sBACEO,WACEQ,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEH,GAAG,CAACK,aAAa,CAACD,EAAEJ,GAAG,GACxCF,GAAG,CAAC,CAACQ,WAAWC,kBACf,KAACC;oBAAsBF,WAAWA;oBAAWG,QAAQhB,gBAAgB,CAACa,UAAUN,GAAG,CAAC,GAAGL;mBAAnEY;;;AAKhC;AAOA,SAASC,cAAchB,KAAyB;IAC9C,MAAM,EAAEc,SAAS,EAAEG,MAAM,EAAE,GAAGjB;IAE9B,MAAMS,QAAQQ,uBACZ,KAACvB;QAAKwB,WAAWpB;QAAYqB,IAAIF;kBAC9BG,qBAAqBN,UAAUL,KAAK;SAGvCW,qBAAqBN,UAAUL,KAAK;IAGtC,qBACE,KAACb;QAASyB,cAAc;kBACtB,cAAA,KAACxB;YACCyB,SAASR,UAAUN,GAAG;YACtBe,WAAWd;YACXe,wBAAwB;gBAAEC,SAAS;YAAK;YACxCC,0BAA0B;gBAAED,SAAS;gBAASE,IAAI;oBAAEC,WAAW;gBAAa;YAAE;;;AAItF;AAEA,SAASR,qBAAqBX,KAA4B;IACxD,IAAI,iBAAiBA,OAAO,OAAOA,MAAMoB,WAAW,CAACC,MAAM,GAAG,IAAIrB,MAAMoB,WAAW,GAAG;IACtF,IAAI,cAAcpB,OAAO,OAAOA,MAAMsB,QAAQ;IAC9C,IAAI,eAAetB,OAAO,OAAOA,MAAMuB,SAAS,CAACC,QAAQ;IACzD,IAAI,gBAAgBxB,OAAO,OAAOA,MAAMyB,UAAU,CAACC,MAAM,CAAC7B,GAAG,CAACc,sBAAsBgB,IAAI,CAAC;IACzF,OAAO;AACT"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Span, Trace } from '../trace';
|
|
3
|
+
import { AttributeLinks } from './Attributes';
|
|
4
|
+
export interface DetailPaneProps {
|
|
5
|
+
attributeLinks?: AttributeLinks;
|
|
6
|
+
trace: Trace;
|
|
7
|
+
span: Span;
|
|
8
|
+
onCloseBtnClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* DetailPane renders a sidebar showing the span attributes etc.
|
|
12
|
+
*/
|
|
13
|
+
export declare function DetailPane(props: DetailPaneProps): ReactElement;
|
|
14
|
+
//# sourceMappingURL=DetailPane.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetailPane.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/DetailPane/DetailPane.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAG7D,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAmC/D"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Copyright 2024 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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { Box, Divider, IconButton, Tab, Tabs, Typography } from '@mui/material';
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
import CloseIcon from 'mdi-material-ui/Close';
|
|
17
|
+
import { AttributeList } from './Attributes';
|
|
18
|
+
import { SpanEventList } from './SpanEvents';
|
|
19
|
+
/**
|
|
20
|
+
* DetailPane renders a sidebar showing the span attributes etc.
|
|
21
|
+
*/ export function DetailPane(props) {
|
|
22
|
+
const { attributeLinks, trace, span, onCloseBtnClick } = props;
|
|
23
|
+
const [tab, setTab] = useState('attributes');
|
|
24
|
+
// if the events tab is selected, and then a span without events is clicked,
|
|
25
|
+
// we need to switch the current selected tab back to the attributes tab.
|
|
26
|
+
if (tab === 'events' && span.events.length === 0) {
|
|
27
|
+
setTab('attributes');
|
|
28
|
+
}
|
|
29
|
+
return /*#__PURE__*/ _jsxs(Box, {
|
|
30
|
+
children: [
|
|
31
|
+
/*#__PURE__*/ _jsx(IconButton, {
|
|
32
|
+
sx: {
|
|
33
|
+
float: 'right'
|
|
34
|
+
},
|
|
35
|
+
onClick: onCloseBtnClick,
|
|
36
|
+
children: /*#__PURE__*/ _jsx(CloseIcon, {})
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
39
|
+
sx: {
|
|
40
|
+
wordBreak: 'break-word'
|
|
41
|
+
},
|
|
42
|
+
children: span.resource.serviceName
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
45
|
+
variant: "h2",
|
|
46
|
+
sx: {
|
|
47
|
+
wordBreak: 'break-word'
|
|
48
|
+
},
|
|
49
|
+
children: span.name
|
|
50
|
+
}),
|
|
51
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
52
|
+
sx: {
|
|
53
|
+
borderBottom: 1,
|
|
54
|
+
borderColor: 'divider'
|
|
55
|
+
},
|
|
56
|
+
children: /*#__PURE__*/ _jsxs(Tabs, {
|
|
57
|
+
value: tab,
|
|
58
|
+
onChange: (_, tab)=>setTab(tab),
|
|
59
|
+
children: [
|
|
60
|
+
/*#__PURE__*/ _jsx(Tab, {
|
|
61
|
+
sx: {
|
|
62
|
+
p: 0
|
|
63
|
+
},
|
|
64
|
+
value: "attributes",
|
|
65
|
+
label: "Attributes"
|
|
66
|
+
}),
|
|
67
|
+
span.events.length > 0 && /*#__PURE__*/ _jsx(Tab, {
|
|
68
|
+
value: "events",
|
|
69
|
+
label: "Events"
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
})
|
|
73
|
+
}),
|
|
74
|
+
tab === 'attributes' && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
75
|
+
children: [
|
|
76
|
+
span.attributes.length > 0 && /*#__PURE__*/ _jsx(AttributeList, {
|
|
77
|
+
attributeLinks: attributeLinks,
|
|
78
|
+
attributes: span.attributes
|
|
79
|
+
}),
|
|
80
|
+
span.attributes.length > 0 && /*#__PURE__*/ _jsx(Divider, {}),
|
|
81
|
+
/*#__PURE__*/ _jsx(AttributeList, {
|
|
82
|
+
attributeLinks: attributeLinks,
|
|
83
|
+
attributes: span.resource.attributes
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
}),
|
|
87
|
+
tab === 'events' && /*#__PURE__*/ _jsx(SpanEventList, {
|
|
88
|
+
trace: trace,
|
|
89
|
+
span: span
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=DetailPane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/DetailPane/DetailPane.tsx"],"sourcesContent":["// Copyright 2024 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, IconButton, Tab, Tabs, Typography } from '@mui/material';\nimport { ReactElement, useState } from 'react';\nimport CloseIcon from 'mdi-material-ui/Close';\nimport { Span, Trace } from '../trace';\nimport { AttributeLinks, AttributeList } from './Attributes';\nimport { SpanEventList } from './SpanEvents';\n\nexport interface DetailPaneProps {\n attributeLinks?: AttributeLinks;\n trace: Trace;\n span: Span;\n onCloseBtnClick: () => void;\n}\n\n/**\n * DetailPane renders a sidebar showing the span attributes etc.\n */\nexport function DetailPane(props: DetailPaneProps): ReactElement {\n const { attributeLinks, trace, span, onCloseBtnClick } = props;\n const [tab, setTab] = useState<'attributes' | 'events'>('attributes');\n\n // if the events tab is selected, and then a span without events is clicked,\n // we need to switch the current selected tab back to the attributes tab.\n if (tab === 'events' && span.events.length === 0) {\n setTab('attributes');\n }\n\n return (\n <Box>\n <IconButton sx={{ float: 'right' }} onClick={onCloseBtnClick}>\n <CloseIcon />\n </IconButton>\n <Typography sx={{ wordBreak: 'break-word' }}>{span.resource.serviceName}</Typography>\n <Typography variant=\"h2\" sx={{ wordBreak: 'break-word' }}>\n {span.name}\n </Typography>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <Tabs value={tab} onChange={(_, tab) => setTab(tab)}>\n <Tab sx={{ p: 0 }} value=\"attributes\" label=\"Attributes\" />\n {span.events.length > 0 && <Tab value=\"events\" label=\"Events\" />}\n </Tabs>\n </Box>\n {tab === 'attributes' && (\n <>\n {span.attributes.length > 0 && <AttributeList attributeLinks={attributeLinks} attributes={span.attributes} />}\n {span.attributes.length > 0 && <Divider />}\n <AttributeList attributeLinks={attributeLinks} attributes={span.resource.attributes} />\n </>\n )}\n {tab === 'events' && <SpanEventList trace={trace} span={span} />}\n </Box>\n );\n}\n"],"names":["Box","Divider","IconButton","Tab","Tabs","Typography","useState","CloseIcon","AttributeList","SpanEventList","DetailPane","props","attributeLinks","trace","span","onCloseBtnClick","tab","setTab","events","length","sx","float","onClick","wordBreak","resource","serviceName","variant","name","borderBottom","borderColor","value","onChange","_","p","label","attributes"],"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,GAAG,EAAEC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAEC,IAAI,EAAEC,UAAU,QAAQ,gBAAgB;AAChF,SAAuBC,QAAQ,QAAQ,QAAQ;AAC/C,OAAOC,eAAe,wBAAwB;AAE9C,SAAyBC,aAAa,QAAQ,eAAe;AAC7D,SAASC,aAAa,QAAQ,eAAe;AAS7C;;CAEC,GACD,OAAO,SAASC,WAAWC,KAAsB;IAC/C,MAAM,EAAEC,cAAc,EAAEC,KAAK,EAAEC,IAAI,EAAEC,eAAe,EAAE,GAAGJ;IACzD,MAAM,CAACK,KAAKC,OAAO,GAAGX,SAAkC;IAExD,4EAA4E;IAC5E,yEAAyE;IACzE,IAAIU,QAAQ,YAAYF,KAAKI,MAAM,CAACC,MAAM,KAAK,GAAG;QAChDF,OAAO;IACT;IAEA,qBACE,MAACjB;;0BACC,KAACE;gBAAWkB,IAAI;oBAAEC,OAAO;gBAAQ;gBAAGC,SAASP;0BAC3C,cAAA,KAACR;;0BAEH,KAACF;gBAAWe,IAAI;oBAAEG,WAAW;gBAAa;0BAAIT,KAAKU,QAAQ,CAACC,WAAW;;0BACvE,KAACpB;gBAAWqB,SAAQ;gBAAKN,IAAI;oBAAEG,WAAW;gBAAa;0BACpDT,KAAKa,IAAI;;0BAEZ,KAAC3B;gBAAIoB,IAAI;oBAAEQ,cAAc;oBAAGC,aAAa;gBAAU;0BACjD,cAAA,MAACzB;oBAAK0B,OAAOd;oBAAKe,UAAU,CAACC,GAAGhB,MAAQC,OAAOD;;sCAC7C,KAACb;4BAAIiB,IAAI;gCAAEa,GAAG;4BAAE;4BAAGH,OAAM;4BAAaI,OAAM;;wBAC3CpB,KAAKI,MAAM,CAACC,MAAM,GAAG,mBAAK,KAAChB;4BAAI2B,OAAM;4BAASI,OAAM;;;;;YAGxDlB,QAAQ,8BACP;;oBACGF,KAAKqB,UAAU,CAAChB,MAAM,GAAG,mBAAK,KAACX;wBAAcI,gBAAgBA;wBAAgBuB,YAAYrB,KAAKqB,UAAU;;oBACxGrB,KAAKqB,UAAU,CAAChB,MAAM,GAAG,mBAAK,KAAClB;kCAChC,KAACO;wBAAcI,gBAAgBA;wBAAgBuB,YAAYrB,KAAKU,QAAQ,CAACW,UAAU;;;;YAGtFnB,QAAQ,0BAAY,KAACP;gBAAcI,OAAOA;gBAAOC,MAAMA;;;;AAG9D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Trace, Span } from '../trace';
|
|
3
|
+
export interface SpanEventListProps {
|
|
4
|
+
trace: Trace;
|
|
5
|
+
span: Span;
|
|
6
|
+
}
|
|
7
|
+
export declare function SpanEventList(props: SpanEventListProps): ReactElement;
|
|
8
|
+
//# sourceMappingURL=SpanEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpanEvents.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/DetailPane/SpanEvents.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAS,MAAM,UAAU,CAAC;AAG9C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAYrE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright 2024 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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { Accordion, AccordionDetails, AccordionSummary, Typography } from '@mui/material';
|
|
15
|
+
import ExpandMoreIcon from 'mdi-material-ui/ChevronDown';
|
|
16
|
+
import { formatDuration } from '../utils';
|
|
17
|
+
import { AttributeList } from './Attributes';
|
|
18
|
+
export function SpanEventList(props) {
|
|
19
|
+
const { trace, span } = props;
|
|
20
|
+
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
21
|
+
children: span.events.sort((a, b)=>a.timeUnixMs - b.timeUnixMs).map((event, i)=>/*#__PURE__*/ _jsx(SpanEventItem, {
|
|
22
|
+
trace: trace,
|
|
23
|
+
event: event
|
|
24
|
+
}, i))
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function SpanEventItem(props) {
|
|
28
|
+
const { trace, event } = props;
|
|
29
|
+
const relativeTime = event.timeUnixMs - trace.startTimeUnixMs;
|
|
30
|
+
return /*#__PURE__*/ _jsxs(Accordion, {
|
|
31
|
+
disableGutters: true,
|
|
32
|
+
children: [
|
|
33
|
+
/*#__PURE__*/ _jsx(AccordionSummary, {
|
|
34
|
+
expandIcon: /*#__PURE__*/ _jsx(ExpandMoreIcon, {}),
|
|
35
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
36
|
+
children: formatDuration(relativeTime)
|
|
37
|
+
})
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ _jsxs(AccordionDetails, {
|
|
40
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
42
|
+
variant: "subtitle1",
|
|
43
|
+
children: event.name
|
|
44
|
+
}),
|
|
45
|
+
/*#__PURE__*/ _jsx(AttributeList, {
|
|
46
|
+
attributes: event.attributes
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=SpanEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/DetailPane/SpanEvents.tsx"],"sourcesContent":["// Copyright 2024 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 { Accordion, AccordionDetails, AccordionSummary, Typography } from '@mui/material';\nimport ExpandMoreIcon from 'mdi-material-ui/ChevronDown';\nimport { ReactElement } from 'react';\nimport { formatDuration } from '../utils';\nimport { Trace, Span, Event } from '../trace';\nimport { AttributeList } from './Attributes';\n\nexport interface SpanEventListProps {\n trace: Trace;\n span: Span;\n}\n\nexport function SpanEventList(props: SpanEventListProps): ReactElement {\n const { trace, span } = props;\n\n return (\n <>\n {span.events\n .sort((a, b) => a.timeUnixMs - b.timeUnixMs)\n .map((event, i) => (\n <SpanEventItem key={i} trace={trace} event={event} />\n ))}\n </>\n );\n}\n\ninterface SpanEventItemProps {\n trace: Trace;\n event: Event;\n}\n\nfunction SpanEventItem(props: SpanEventItemProps): ReactElement {\n const { trace, event } = props;\n const relativeTime = event.timeUnixMs - trace.startTimeUnixMs;\n\n return (\n <Accordion disableGutters>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>{formatDuration(relativeTime)}</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Typography variant=\"subtitle1\">{event.name}</Typography>\n <AttributeList attributes={event.attributes} />\n </AccordionDetails>\n </Accordion>\n );\n}\n"],"names":["Accordion","AccordionDetails","AccordionSummary","Typography","ExpandMoreIcon","formatDuration","AttributeList","SpanEventList","props","trace","span","events","sort","a","b","timeUnixMs","map","event","i","SpanEventItem","relativeTime","startTimeUnixMs","disableGutters","expandIcon","variant","name","attributes"],"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,SAAS,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,gBAAgB;AAC1F,OAAOC,oBAAoB,8BAA8B;AAEzD,SAASC,cAAc,QAAQ,WAAW;AAE1C,SAASC,aAAa,QAAQ,eAAe;AAO7C,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGF;IAExB,qBACE;kBACGE,KAAKC,MAAM,CACTC,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEE,UAAU,GAAGD,EAAEC,UAAU,EAC1CC,GAAG,CAAC,CAACC,OAAOC,kBACX,KAACC;gBAAsBV,OAAOA;gBAAOQ,OAAOA;eAAxBC;;AAI9B;AAOA,SAASC,cAAcX,KAAyB;IAC9C,MAAM,EAAEC,KAAK,EAAEQ,KAAK,EAAE,GAAGT;IACzB,MAAMY,eAAeH,MAAMF,UAAU,GAAGN,MAAMY,eAAe;IAE7D,qBACE,MAACrB;QAAUsB,cAAc;;0BACvB,KAACpB;gBAAiBqB,0BAAY,KAACnB;0BAC7B,cAAA,KAACD;8BAAYE,eAAee;;;0BAE9B,MAACnB;;kCACC,KAACE;wBAAWqB,SAAQ;kCAAaP,MAAMQ,IAAI;;kCAC3C,KAACnB;wBAAcoB,YAAYT,MAAMS,UAAU;;;;;;AAInD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Viewport } from '../utils';
|
|
3
|
+
import { TracingGanttChartOptions } from '../../gantt-chart-model';
|
|
4
|
+
import { Span, Trace } from '../trace';
|
|
5
|
+
export interface GanttTableProps {
|
|
6
|
+
options: TracingGanttChartOptions;
|
|
7
|
+
trace: Trace;
|
|
8
|
+
viewport: Viewport;
|
|
9
|
+
selectedSpan?: Span;
|
|
10
|
+
onSpanClick: (span: Span) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function GanttTable(props: GanttTableProps): ReactElement;
|
|
13
|
+
//# sourceMappingURL=GanttTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttTable.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/GanttTable/GanttTable.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAA6B,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAMvC,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,wBAAwB,CAAC;IAClC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACnC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAuD/D"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Copyright 2024 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 { Virtuoso } from 'react-virtuoso';
|
|
15
|
+
import { useMemo, useRef, useState } from 'react';
|
|
16
|
+
import { Box, useTheme } from '@mui/material';
|
|
17
|
+
import { useGanttTableContext } from './GanttTableProvider';
|
|
18
|
+
import { GanttTableRow } from './GanttTableRow';
|
|
19
|
+
import { GanttTableHeader } from './GanttTableHeader';
|
|
20
|
+
import { ResizableDivider } from './ResizableDivider';
|
|
21
|
+
export function GanttTable(props) {
|
|
22
|
+
const { options, trace, viewport, selectedSpan, onSpanClick } = props;
|
|
23
|
+
const { collapsedSpans, setVisibleSpans } = useGanttTableContext();
|
|
24
|
+
const [nameColumnWidth, setNameColumnWidth] = useState(0.25);
|
|
25
|
+
const tableRef = useRef(null);
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
const rows = useMemo(()=>{
|
|
28
|
+
const rows = [];
|
|
29
|
+
for (const rootSpan of trace.rootSpans){
|
|
30
|
+
treeToRows(rows, rootSpan, collapsedSpans);
|
|
31
|
+
}
|
|
32
|
+
return rows;
|
|
33
|
+
}, [
|
|
34
|
+
trace.rootSpans,
|
|
35
|
+
collapsedSpans
|
|
36
|
+
]);
|
|
37
|
+
const divider = /*#__PURE__*/ _jsx(ResizableDivider, {
|
|
38
|
+
parentRef: tableRef,
|
|
39
|
+
onMove: setNameColumnWidth
|
|
40
|
+
});
|
|
41
|
+
// update currently visible spans
|
|
42
|
+
function handleRangeChange({ startIndex, endIndex }) {
|
|
43
|
+
const visibleSpans = [];
|
|
44
|
+
for(let i = startIndex; i <= endIndex; i++){
|
|
45
|
+
visibleSpans.push(rows[i].spanId);
|
|
46
|
+
}
|
|
47
|
+
setVisibleSpans(visibleSpans);
|
|
48
|
+
}
|
|
49
|
+
return /*#__PURE__*/ _jsxs(Box, {
|
|
50
|
+
ref: tableRef,
|
|
51
|
+
sx: {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
flexDirection: 'column',
|
|
54
|
+
flexGrow: 1,
|
|
55
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
56
|
+
borderRadius: `${theme.shape.borderRadius}px`
|
|
57
|
+
},
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ _jsx(GanttTableHeader, {
|
|
60
|
+
trace: trace,
|
|
61
|
+
viewport: viewport,
|
|
62
|
+
nameColumnWidth: nameColumnWidth,
|
|
63
|
+
divider: divider
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ _jsx(Virtuoso, {
|
|
66
|
+
data: rows,
|
|
67
|
+
itemContent: (_, span)=>/*#__PURE__*/ _jsx(GanttTableRow, {
|
|
68
|
+
options: options,
|
|
69
|
+
span: span,
|
|
70
|
+
viewport: viewport,
|
|
71
|
+
selected: span === selectedSpan,
|
|
72
|
+
nameColumnWidth: nameColumnWidth,
|
|
73
|
+
divider: divider,
|
|
74
|
+
onClick: onSpanClick
|
|
75
|
+
}),
|
|
76
|
+
rangeChanged: handleRangeChange
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* treeToRows recursively transforms the span tree to a list of rows and
|
|
83
|
+
* hides collapsed child spans.
|
|
84
|
+
*/ function treeToRows(rows, span, collapsedSpans) {
|
|
85
|
+
rows.push(span);
|
|
86
|
+
if (!collapsedSpans.includes(span.spanId)) {
|
|
87
|
+
for (const child of span.childSpans){
|
|
88
|
+
treeToRows(rows, child, collapsedSpans);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
//# sourceMappingURL=GanttTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/GanttTable.tsx"],"sourcesContent":["// Copyright 2024 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 { Virtuoso, ListRange } from 'react-virtuoso';\nimport { ReactElement, useMemo, useRef, useState } from 'react';\nimport { Box, useTheme } from '@mui/material';\nimport { Viewport } from '../utils';\nimport { TracingGanttChartOptions } from '../../gantt-chart-model';\nimport { Span, Trace } from '../trace';\nimport { useGanttTableContext } from './GanttTableProvider';\nimport { GanttTableRow } from './GanttTableRow';\nimport { GanttTableHeader } from './GanttTableHeader';\nimport { ResizableDivider } from './ResizableDivider';\n\nexport interface GanttTableProps {\n options: TracingGanttChartOptions;\n trace: Trace;\n viewport: Viewport;\n selectedSpan?: Span;\n onSpanClick: (span: Span) => void;\n}\n\nexport function GanttTable(props: GanttTableProps): ReactElement {\n const { options, trace, viewport, selectedSpan, onSpanClick } = props;\n const { collapsedSpans, setVisibleSpans } = useGanttTableContext();\n const [nameColumnWidth, setNameColumnWidth] = useState<number>(0.25);\n const tableRef = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n\n const rows = useMemo(() => {\n const rows: Span[] = [];\n for (const rootSpan of trace.rootSpans) {\n treeToRows(rows, rootSpan, collapsedSpans);\n }\n return rows;\n }, [trace.rootSpans, collapsedSpans]);\n\n const divider = <ResizableDivider parentRef={tableRef} onMove={setNameColumnWidth} />;\n\n // update currently visible spans\n function handleRangeChange({ startIndex, endIndex }: ListRange): void {\n const visibleSpans: string[] = [];\n for (let i = startIndex; i <= endIndex; i++) {\n visibleSpans.push(rows[i]!.spanId);\n }\n setVisibleSpans(visibleSpans);\n }\n\n return (\n <Box\n ref={tableRef}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n border: `1px solid ${theme.palette.divider}`,\n borderRadius: `${theme.shape.borderRadius}px`,\n }}\n >\n <GanttTableHeader trace={trace} viewport={viewport} nameColumnWidth={nameColumnWidth} divider={divider} />\n <Virtuoso\n data={rows}\n itemContent={(_, span) => (\n <GanttTableRow\n options={options}\n span={span}\n viewport={viewport}\n selected={span === selectedSpan}\n nameColumnWidth={nameColumnWidth}\n divider={divider}\n onClick={onSpanClick}\n />\n )}\n rangeChanged={handleRangeChange}\n />\n </Box>\n );\n}\n\n/**\n * treeToRows recursively transforms the span tree to a list of rows and\n * hides collapsed child spans.\n */\nfunction treeToRows(rows: Span[], span: Span, collapsedSpans: string[]): void {\n rows.push(span);\n if (!collapsedSpans.includes(span.spanId)) {\n for (const child of span.childSpans) {\n treeToRows(rows, child, collapsedSpans);\n }\n }\n}\n"],"names":["Virtuoso","useMemo","useRef","useState","Box","useTheme","useGanttTableContext","GanttTableRow","GanttTableHeader","ResizableDivider","GanttTable","props","options","trace","viewport","selectedSpan","onSpanClick","collapsedSpans","setVisibleSpans","nameColumnWidth","setNameColumnWidth","tableRef","theme","rows","rootSpan","rootSpans","treeToRows","divider","parentRef","onMove","handleRangeChange","startIndex","endIndex","visibleSpans","i","push","spanId","ref","sx","display","flexDirection","flexGrow","border","palette","borderRadius","shape","data","itemContent","_","span","selected","onClick","rangeChanged","includes","child","childSpans"],"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,QAAQ,QAAmB,iBAAiB;AACrD,SAAuBC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAChE,SAASC,GAAG,EAAEC,QAAQ,QAAQ,gBAAgB;AAI9C,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,gBAAgB,QAAQ,qBAAqB;AAUtD,OAAO,SAASC,WAAWC,KAAsB;IAC/C,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,WAAW,EAAE,GAAGL;IAChE,MAAM,EAAEM,cAAc,EAAEC,eAAe,EAAE,GAAGZ;IAC5C,MAAM,CAACa,iBAAiBC,mBAAmB,GAAGjB,SAAiB;IAC/D,MAAMkB,WAAWnB,OAAuB;IACxC,MAAMoB,QAAQjB;IAEd,MAAMkB,OAAOtB,QAAQ;QACnB,MAAMsB,OAAe,EAAE;QACvB,KAAK,MAAMC,YAAYX,MAAMY,SAAS,CAAE;YACtCC,WAAWH,MAAMC,UAAUP;QAC7B;QACA,OAAOM;IACT,GAAG;QAACV,MAAMY,SAAS;QAAER;KAAe;IAEpC,MAAMU,wBAAU,KAAClB;QAAiBmB,WAAWP;QAAUQ,QAAQT;;IAE/D,iCAAiC;IACjC,SAASU,kBAAkB,EAAEC,UAAU,EAAEC,QAAQ,EAAa;QAC5D,MAAMC,eAAyB,EAAE;QACjC,IAAK,IAAIC,IAAIH,YAAYG,KAAKF,UAAUE,IAAK;YAC3CD,aAAaE,IAAI,CAACZ,IAAI,CAACW,EAAE,CAAEE,MAAM;QACnC;QACAlB,gBAAgBe;IAClB;IAEA,qBACE,MAAC7B;QACCiC,KAAKhB;QACLiB,IAAI;YACFC,SAAS;YACTC,eAAe;YACfC,UAAU;YACVC,QAAQ,CAAC,UAAU,EAAEpB,MAAMqB,OAAO,CAAChB,OAAO,EAAE;YAC5CiB,cAAc,GAAGtB,MAAMuB,KAAK,CAACD,YAAY,CAAC,EAAE,CAAC;QAC/C;;0BAEA,KAACpC;gBAAiBK,OAAOA;gBAAOC,UAAUA;gBAAUK,iBAAiBA;gBAAiBQ,SAASA;;0BAC/F,KAAC3B;gBACC8C,MAAMvB;gBACNwB,aAAa,CAACC,GAAGC,qBACf,KAAC1C;wBACCK,SAASA;wBACTqC,MAAMA;wBACNnC,UAAUA;wBACVoC,UAAUD,SAASlC;wBACnBI,iBAAiBA;wBACjBQ,SAASA;wBACTwB,SAASnC;;gBAGboC,cAActB;;;;AAItB;AAEA;;;CAGC,GACD,SAASJ,WAAWH,IAAY,EAAE0B,IAAU,EAAEhC,cAAwB;IACpEM,KAAKY,IAAI,CAACc;IACV,IAAI,CAAChC,eAAeoC,QAAQ,CAACJ,KAAKb,MAAM,GAAG;QACzC,KAAK,MAAMkB,SAASL,KAAKM,UAAU,CAAE;YACnC7B,WAAWH,MAAM+B,OAAOrC;QAC1B;IACF;AACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Viewport } from '../utils';
|
|
3
|
+
import { Trace } from '../trace';
|
|
4
|
+
interface GanttTableHeaderProps {
|
|
5
|
+
trace: Trace;
|
|
6
|
+
viewport: Viewport;
|
|
7
|
+
nameColumnWidth: number;
|
|
8
|
+
divider: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function GanttTableHeader(props: GanttTableHeaderProps): ReactElement;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=GanttTableHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttTableHeader.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/GanttTable/GanttTableHeader.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAa,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,UAAU,qBAAqB;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,CAuB3E"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Copyright 2024 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, Stack, useTheme } from '@mui/material';
|
|
15
|
+
import { rowHeight } from '../utils';
|
|
16
|
+
import { TicksHeader } from '../Ticks';
|
|
17
|
+
export function GanttTableHeader(props) {
|
|
18
|
+
const { trace, viewport, nameColumnWidth, divider } = props;
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
21
|
+
direction: "row",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
sx: {
|
|
24
|
+
height: rowHeight,
|
|
25
|
+
fontSize: '0.9rem',
|
|
26
|
+
borderBottom: `1px solid ${theme.palette.divider}`
|
|
27
|
+
},
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
30
|
+
style: {
|
|
31
|
+
width: `${nameColumnWidth * 100}%`
|
|
32
|
+
},
|
|
33
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
34
|
+
style: {
|
|
35
|
+
padding: '.25rem'
|
|
36
|
+
},
|
|
37
|
+
children: "Service & Operation"
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
divider,
|
|
41
|
+
/*#__PURE__*/ _jsx(Box, {
|
|
42
|
+
sx: {
|
|
43
|
+
position: 'relative',
|
|
44
|
+
height: '100%',
|
|
45
|
+
flexGrow: 1
|
|
46
|
+
},
|
|
47
|
+
children: /*#__PURE__*/ _jsx(TicksHeader, {
|
|
48
|
+
trace: trace,
|
|
49
|
+
viewport: viewport
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=GanttTableHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/GanttTableHeader.tsx"],"sourcesContent":["// Copyright 2024 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, Stack, useTheme } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { Viewport, rowHeight } from '../utils';\nimport { TicksHeader } from '../Ticks';\nimport { Trace } from '../trace';\n\ninterface GanttTableHeaderProps {\n trace: Trace;\n viewport: Viewport;\n nameColumnWidth: number;\n divider: React.ReactNode;\n}\n\nexport function GanttTableHeader(props: GanttTableHeaderProps): ReactElement {\n const { trace, viewport, nameColumnWidth, divider } = props;\n const theme = useTheme();\n\n return (\n <Stack\n direction=\"row\"\n alignItems=\"center\"\n sx={{\n height: rowHeight,\n fontSize: '0.9rem',\n borderBottom: `1px solid ${theme.palette.divider}`,\n }}\n >\n <Box style={{ width: `${nameColumnWidth * 100}%` }}>\n <span style={{ padding: '.25rem' }}>Service & Operation</span>\n </Box>\n {divider}\n <Box sx={{ position: 'relative', height: '100%', flexGrow: 1 }}>\n <TicksHeader trace={trace} viewport={viewport} />\n </Box>\n </Stack>\n );\n}\n"],"names":["Box","Stack","useTheme","rowHeight","TicksHeader","GanttTableHeader","props","trace","viewport","nameColumnWidth","divider","theme","direction","alignItems","sx","height","fontSize","borderBottom","palette","style","width","span","padding","position","flexGrow"],"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,GAAG,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,gBAAgB;AAErD,SAAmBC,SAAS,QAAQ,WAAW;AAC/C,SAASC,WAAW,QAAQ,WAAW;AAUvC,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,eAAe,EAAEC,OAAO,EAAE,GAAGJ;IACtD,MAAMK,QAAQT;IAEd,qBACE,MAACD;QACCW,WAAU;QACVC,YAAW;QACXC,IAAI;YACFC,QAAQZ;YACRa,UAAU;YACVC,cAAc,CAAC,UAAU,EAAEN,MAAMO,OAAO,CAACR,OAAO,EAAE;QACpD;;0BAEA,KAACV;gBAAImB,OAAO;oBAAEC,OAAO,GAAGX,kBAAkB,IAAI,CAAC,CAAC;gBAAC;0BAC/C,cAAA,KAACY;oBAAKF,OAAO;wBAAEG,SAAS;oBAAS;8BAAG;;;YAErCZ;0BACD,KAACV;gBAAIc,IAAI;oBAAES,UAAU;oBAAYR,QAAQ;oBAAQS,UAAU;gBAAE;0BAC3D,cAAA,KAACpB;oBAAYG,OAAOA;oBAAOC,UAAUA;;;;;AAI7C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
interface GanttTableContextType {
|
|
3
|
+
collapsedSpans: string[];
|
|
4
|
+
setCollapsedSpans: (s: string[]) => void;
|
|
5
|
+
visibleSpans: string[];
|
|
6
|
+
setVisibleSpans: (s: string[]) => void;
|
|
7
|
+
/** can be a spanId, an empty string for the root span or undefined for no hover */
|
|
8
|
+
hoveredParent?: string;
|
|
9
|
+
setHoveredParent: (s?: string) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* GanttTableContext stores UI state of the rows.
|
|
13
|
+
* Required for passing down state to deeply nested <SpanIndents>,
|
|
14
|
+
* without re-rendering intermediate components.
|
|
15
|
+
*/
|
|
16
|
+
export declare const GanttTableContext: import("react").Context<GanttTableContextType | undefined>;
|
|
17
|
+
interface GanttTableProviderProps {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare function GanttTableProvider(props: GanttTableProviderProps): ReactElement;
|
|
21
|
+
export declare function useGanttTableContext(): GanttTableContextType;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=GanttTableProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttTableProvider.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/GanttTable/GanttTableProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAiB,YAAY,EAAwB,MAAM,OAAO,CAAC;AAE1E,UAAU,qBAAqB;IAC7B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACvC,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,4DAA8D,CAAC;AAE7F,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,CAa/E;AAED,wBAAgB,oBAAoB,IAAI,qBAAqB,CAM5D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright 2024 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 { createContext, useContext, useState } from 'react';
|
|
15
|
+
/**
|
|
16
|
+
* GanttTableContext stores UI state of the rows.
|
|
17
|
+
* Required for passing down state to deeply nested <SpanIndents>,
|
|
18
|
+
* without re-rendering intermediate components.
|
|
19
|
+
*/ export const GanttTableContext = /*#__PURE__*/ createContext(undefined);
|
|
20
|
+
export function GanttTableProvider(props) {
|
|
21
|
+
const { children } = props;
|
|
22
|
+
const [collapsedSpans, setCollapsedSpans] = useState([]);
|
|
23
|
+
const [visibleSpans, setVisibleSpans] = useState([]);
|
|
24
|
+
const [hoveredParent, setHoveredParent] = useState(undefined);
|
|
25
|
+
return /*#__PURE__*/ _jsx(GanttTableContext.Provider, {
|
|
26
|
+
value: {
|
|
27
|
+
collapsedSpans,
|
|
28
|
+
setCollapsedSpans,
|
|
29
|
+
visibleSpans,
|
|
30
|
+
setVisibleSpans,
|
|
31
|
+
hoveredParent,
|
|
32
|
+
setHoveredParent
|
|
33
|
+
},
|
|
34
|
+
children: children
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export function useGanttTableContext() {
|
|
38
|
+
const ctx = useContext(GanttTableContext);
|
|
39
|
+
if (ctx === undefined) {
|
|
40
|
+
throw new Error('No GanttTableContext found. Did you forget a Provider?');
|
|
41
|
+
}
|
|
42
|
+
return ctx;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=GanttTableProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/GanttTableProvider.tsx"],"sourcesContent":["// Copyright 2024 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 { createContext, ReactElement, useContext, useState } from 'react';\n\ninterface GanttTableContextType {\n collapsedSpans: string[];\n setCollapsedSpans: (s: string[]) => void;\n visibleSpans: string[];\n setVisibleSpans: (s: string[]) => void;\n /** can be a spanId, an empty string for the root span or undefined for no hover */\n hoveredParent?: string;\n setHoveredParent: (s?: string) => void;\n}\n\n/**\n * GanttTableContext stores UI state of the rows.\n * Required for passing down state to deeply nested <SpanIndents>,\n * without re-rendering intermediate components.\n */\nexport const GanttTableContext = createContext<GanttTableContextType | undefined>(undefined);\n\ninterface GanttTableProviderProps {\n children?: React.ReactNode;\n}\n\nexport function GanttTableProvider(props: GanttTableProviderProps): ReactElement {\n const { children } = props;\n const [collapsedSpans, setCollapsedSpans] = useState<string[]>([]);\n const [visibleSpans, setVisibleSpans] = useState<string[]>([]);\n const [hoveredParent, setHoveredParent] = useState<string | undefined>(undefined);\n\n return (\n <GanttTableContext.Provider\n value={{ collapsedSpans, setCollapsedSpans, visibleSpans, setVisibleSpans, hoveredParent, setHoveredParent }}\n >\n {children}\n </GanttTableContext.Provider>\n );\n}\n\nexport function useGanttTableContext(): GanttTableContextType {\n const ctx = useContext(GanttTableContext);\n if (ctx === undefined) {\n throw new Error('No GanttTableContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n"],"names":["createContext","useContext","useState","GanttTableContext","undefined","GanttTableProvider","props","children","collapsedSpans","setCollapsedSpans","visibleSpans","setVisibleSpans","hoveredParent","setHoveredParent","Provider","value","useGanttTableContext","ctx","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,aAAa,EAAgBC,UAAU,EAAEC,QAAQ,QAAQ,QAAQ;AAY1E;;;;CAIC,GACD,OAAO,MAAMC,kCAAoBH,cAAiDI,WAAW;AAM7F,OAAO,SAASC,mBAAmBC,KAA8B;IAC/D,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAAM,CAACE,gBAAgBC,kBAAkB,GAAGP,SAAmB,EAAE;IACjE,MAAM,CAACQ,cAAcC,gBAAgB,GAAGT,SAAmB,EAAE;IAC7D,MAAM,CAACU,eAAeC,iBAAiB,GAAGX,SAA6BE;IAEvE,qBACE,KAACD,kBAAkBW,QAAQ;QACzBC,OAAO;YAAEP;YAAgBC;YAAmBC;YAAcC;YAAiBC;YAAeC;QAAiB;kBAE1GN;;AAGP;AAEA,OAAO,SAASS;IACd,MAAMC,MAAMhB,WAAWE;IACvB,IAAIc,QAAQb,WAAW;QACrB,MAAM,IAAIc,MAAM;IAClB;IACA,OAAOD;AACT"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Viewport } from '../utils';
|
|
2
|
+
import { TracingGanttChartOptions } from '../../gantt-chart-model';
|
|
3
|
+
import { Span } from '../trace';
|
|
4
|
+
interface GanttTableRowProps {
|
|
5
|
+
options: TracingGanttChartOptions;
|
|
6
|
+
span: Span;
|
|
7
|
+
viewport: Viewport;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
nameColumnWidth: number;
|
|
10
|
+
divider: React.ReactNode;
|
|
11
|
+
onClick: (span: Span) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const GanttTableRow: import("react").NamedExoticComponent<GanttTableRowProps>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=GanttTableRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttTableRow.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/GanttTable/GanttTableRow.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,QAAQ,EAAa,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhC,UAAU,kBAAkB;IAC1B,OAAO,EAAE,wBAAwB,CAAC;IAClC,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAC/B;AAED,eAAO,MAAM,aAAa,0DAsBxB,CAAC"}
|