@perses-dev/tracing-gantt-chart-plugin 0.12.1 → 0.13.0-beta.1
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/__mf/css/async/785.85c2cbf6.css +1 -0
- package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
- package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
- package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
- package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
- package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
- package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
- package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
- package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
- package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
- package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
- package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
- package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
- package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
- package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
- package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
- package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
- package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
- package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
- package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
- package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
- package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
- package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
- package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
- package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
- package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
- package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
- package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
- package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
- package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
- package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
- package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
- package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
- package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
- package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
- package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
- package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
- package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
- package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
- package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
- package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
- package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
- package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
- package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
- package/__mf/js/TracingGanttChart.b2e20301.js +7 -0
- package/__mf/js/async/121.5475779f.js +2 -0
- package/__mf/js/async/177.50257b88.js +1 -0
- package/__mf/js/async/192.a0a2e63b.js +1 -0
- package/__mf/js/async/2.d2c2e5a6.js +1 -0
- package/__mf/js/async/207.dcd0ae82.js +110 -0
- package/__mf/js/async/{666.4cf9c453.js.LICENSE.txt → 207.dcd0ae82.js.LICENSE.txt} +1 -1
- package/__mf/js/async/235.b42801b1.js +1 -0
- package/__mf/js/async/260.9bec2000.js +39 -0
- package/__mf/js/async/{157.77f5f5a1.js.LICENSE.txt → 260.9bec2000.js.LICENSE.txt} +17 -1
- package/__mf/js/async/274.5c518455.js +2 -0
- package/__mf/js/async/356.fc2da489.js +1 -0
- package/__mf/js/async/392.6c066266.js +2 -0
- package/__mf/js/async/43.e395f769.js +2 -0
- package/__mf/js/async/470.4e137e17.js +2 -0
- package/__mf/js/async/472.8aa138b3.js +1 -0
- package/__mf/js/async/568.9ba2f5f6.js +24 -0
- package/__mf/js/async/{634.b68acb18.js.LICENSE.txt → 568.9ba2f5f6.js.LICENSE.txt} +0 -16
- package/__mf/js/async/581.530a1cbc.js +1 -0
- package/__mf/js/async/587.dbc05176.js +1 -0
- package/__mf/js/async/588.f5afdb25.js +1 -0
- package/__mf/js/async/616.268fac9b.js +1 -0
- package/__mf/js/async/71.79ef5248.js +1 -0
- package/__mf/js/async/785.187cf92a.js +7 -0
- package/__mf/js/async/{12.c9423551.js.LICENSE.txt → 785.187cf92a.js.LICENSE.txt} +19 -1
- package/__mf/js/async/873.76af63d7.js +1 -0
- package/__mf/js/async/940.39b5cb1d.js +1 -0
- package/__mf/js/async/941.70c6480d.js +2 -0
- package/__mf/js/async/968.68803274.js +1 -0
- package/__mf/js/async/978.ca0b1b55.js +1 -0
- package/__mf/js/async/__federation_expose_TracingGanttChart.bcd10502.js +1 -0
- package/__mf/js/async/lib-router.69a7062a.js +2 -0
- package/__mf/js/main.6c69ae4f.js +7 -0
- package/lib/PanelActions.d.ts +1 -1
- package/lib/PanelActions.d.ts.map +1 -1
- package/lib/PanelActions.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts +4 -3
- package/lib/TracingGanttChart/DetailPane/Attributes.d.ts.map +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.js +45 -8
- package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts +2 -0
- package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTable.js +64 -25
- package/lib/TracingGanttChart/GanttTable/GanttTable.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts +2 -2
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts +5 -0
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js +14 -2
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js +6 -2
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js +10 -10
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/draw.js +2 -6
- package/lib/TracingGanttChart/MiniGanttChart/draw.js.map +1 -1
- package/lib/TracingGanttChart/Search.d.ts +15 -0
- package/lib/TracingGanttChart/Search.d.ts.map +1 -0
- package/lib/TracingGanttChart/Search.js +133 -0
- package/lib/TracingGanttChart/Search.js.map +1 -0
- package/lib/TracingGanttChart/TraceHeaderBar.d.ts +9 -0
- package/lib/TracingGanttChart/TraceHeaderBar.d.ts.map +1 -0
- package/lib/TracingGanttChart/TraceHeaderBar.js +126 -0
- package/lib/TracingGanttChart/TraceHeaderBar.js.map +1 -0
- package/lib/TracingGanttChart/TracingGanttChart.d.ts +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.d.ts.map +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.js +14 -8
- package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -1
- package/lib/TracingGanttChart/trace.d.ts +7 -1
- package/lib/TracingGanttChart/trace.d.ts.map +1 -1
- package/lib/TracingGanttChart/trace.js +10 -0
- package/lib/TracingGanttChart/trace.js.map +1 -1
- package/lib/TracingGanttChart/utils.js +1 -1
- package/lib/TracingGanttChart/utils.js.map +1 -1
- package/lib/TracingGanttChartPanel.d.ts +1 -1
- package/lib/TracingGanttChartPanel.js.map +1 -1
- package/lib/cjs/TracingGanttChart/DetailPane/Attributes.js +47 -7
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTable.js +63 -24
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableProvider.js +1 -1
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableRow.js +14 -2
- package/lib/cjs/TracingGanttChart/GanttTable/ResizableDivider.js +6 -2
- package/lib/cjs/TracingGanttChart/GanttTable/SpanIndents.js +10 -10
- package/lib/cjs/TracingGanttChart/MiniGanttChart/draw.js +2 -6
- package/lib/cjs/TracingGanttChart/Search.js +154 -0
- package/lib/cjs/TracingGanttChart/TraceHeaderBar.js +139 -0
- package/lib/cjs/TracingGanttChart/TracingGanttChart.js +13 -7
- package/lib/cjs/TracingGanttChart/trace.js +18 -3
- package/lib/cjs/TracingGanttChart/utils.js +43 -2
- package/lib/test/convert/jaeger.d.ts +1 -1
- package/lib/test/convert/jaeger.d.ts.map +1 -1
- package/lib/test/convert/jaeger.js.map +1 -1
- package/mf-manifest.json +61 -50
- package/mf-stats.json +72 -50
- package/package.json +6 -5
- package/__mf/css/async/442.d3010b86.css +0 -1
- package/__mf/css/async/61.d3010b86.css +0 -1
- package/__mf/css/async/823.d3010b86.css +0 -1
- 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/TracingGanttChart.f5573ac3.js +0 -6
- package/__mf/js/async/12.c9423551.js +0 -7
- package/__mf/js/async/121.cb300887.js +0 -2
- package/__mf/js/async/157.77f5f5a1.js +0 -39
- package/__mf/js/async/177.cf9df204.js +0 -1
- package/__mf/js/async/192.f723a636.js +0 -1
- package/__mf/js/async/2.e3ce4ee4.js +0 -1
- package/__mf/js/async/235.806ca841.js +0 -1
- package/__mf/js/async/274.457dda65.js +0 -2
- package/__mf/js/async/356.7ea3eee9.js +0 -1
- package/__mf/js/async/392.c563796d.js +0 -2
- package/__mf/js/async/43.55c495e3.js +0 -2
- package/__mf/js/async/439.63c7b180.js +0 -1
- package/__mf/js/async/470.f5dfd429.js +0 -2
- package/__mf/js/async/587.3a4d8eed.js +0 -1
- package/__mf/js/async/588.a1fce2da.js +0 -1
- package/__mf/js/async/616.25399954.js +0 -1
- package/__mf/js/async/634.b68acb18.js +0 -24
- package/__mf/js/async/666.4cf9c453.js +0 -110
- package/__mf/js/async/71.ec1919d7.js +0 -1
- package/__mf/js/async/751.b7c40fc8.js +0 -1
- package/__mf/js/async/873.0f298220.js +0 -1
- package/__mf/js/async/895.eb528fc2.js +0 -1
- package/__mf/js/async/941.065a3eec.js +0 -2
- package/__mf/js/async/968.5f7ccf5e.js +0 -1
- package/__mf/js/async/978.151ab551.js +0 -1
- package/__mf/js/async/__federation_expose_TracingGanttChart.3ea317ee.js +0 -1
- package/__mf/js/async/lib-router.aed93ee9.js +0 -2
- package/__mf/js/main.237de7d0.js +0 -6
- package/lib/TracingGanttChart/TraceDetails.d.ts +0 -7
- package/lib/TracingGanttChart/TraceDetails.d.ts.map +0 -1
- package/lib/TracingGanttChart/TraceDetails.js +0 -90
- package/lib/TracingGanttChart/TraceDetails.js.map +0 -1
- package/lib/cjs/TracingGanttChart/TraceDetails.js +0 -98
- /package/__mf/js/async/{121.cb300887.js.LICENSE.txt → 121.5475779f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{274.457dda65.js.LICENSE.txt → 274.5c518455.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.c563796d.js.LICENSE.txt → 392.6c066266.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{43.55c495e3.js.LICENSE.txt → 43.e395f769.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{470.f5dfd429.js.LICENSE.txt → 470.4e137e17.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.065a3eec.js.LICENSE.txt → 941.70c6480d.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.aed93ee9.js.LICENSE.txt → lib-router.69a7062a.js.LICENSE.txt} +0 -0
|
@@ -12,36 +12,83 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
import { Virtuoso } from 'react-virtuoso';
|
|
15
|
-
import { useMemo, useRef, useState } from 'react';
|
|
15
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
16
16
|
import { Box, useTheme } from '@mui/material';
|
|
17
|
+
import { forEachSpan } from '../trace';
|
|
17
18
|
import { useGanttTableContext } from './GanttTableProvider';
|
|
18
19
|
import { GanttTableRow } from './GanttTableRow';
|
|
19
20
|
import { GanttTableHeader } from './GanttTableHeader';
|
|
20
21
|
import { ResizableDivider } from './ResizableDivider';
|
|
21
22
|
export function GanttTable(props) {
|
|
22
|
-
const { options, customLinks, trace, viewport, selectedSpan, onSpanClick } = props;
|
|
23
|
-
const { collapsedSpans, setVisibleSpans } = useGanttTableContext();
|
|
23
|
+
const { options, customLinks, trace, viewport, selectedSpan, onSpanClick, matchingSpanIds, focusedSpanId } = props;
|
|
24
|
+
const { collapsedSpans, setCollapsedSpans, setVisibleSpans } = useGanttTableContext();
|
|
24
25
|
const [nameColumnWidth, setNameColumnWidth] = useState(0.25);
|
|
25
26
|
const tableRef = useRef(null);
|
|
27
|
+
const virtuosoRef = useRef(null);
|
|
26
28
|
const theme = useTheme();
|
|
29
|
+
// Recursively flatten the span tree to a list of rows, hiding collapsed child spans.
|
|
27
30
|
const rows = useMemo(()=>{
|
|
28
31
|
const rows = [];
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
forEachSpan(trace.rootSpans, (span)=>{
|
|
33
|
+
rows.push(span);
|
|
34
|
+
if (collapsedSpans.has(span.spanId)) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
32
38
|
return rows;
|
|
33
39
|
}, [
|
|
34
40
|
trace.rootSpans,
|
|
35
41
|
collapsedSpans
|
|
36
42
|
]);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
const matchingSpanIdSet = useMemo(()=>new Set(matchingSpanIds ?? []), [
|
|
44
|
+
matchingSpanIds
|
|
45
|
+
]);
|
|
46
|
+
// Auto-expand collapsed ancestors when focusing a search match
|
|
47
|
+
useEffect(()=>{
|
|
48
|
+
if (!focusedSpanId) return;
|
|
49
|
+
const span = trace.spanById.get(focusedSpanId);
|
|
50
|
+
if (!span) return;
|
|
51
|
+
const ancestorIds = new Set();
|
|
52
|
+
let parent = span.parentSpan;
|
|
53
|
+
while(parent){
|
|
54
|
+
ancestorIds.add(parent.spanId);
|
|
55
|
+
parent = parent.parentSpan;
|
|
56
|
+
}
|
|
57
|
+
if (ancestorIds.size > 0) {
|
|
58
|
+
setCollapsedSpans((prev)=>{
|
|
59
|
+
const next = new Set(prev);
|
|
60
|
+
let changed = false;
|
|
61
|
+
for (const id of ancestorIds){
|
|
62
|
+
if (next.delete(id)) changed = true;
|
|
63
|
+
}
|
|
64
|
+
return changed ? next : prev;
|
|
65
|
+
});
|
|
43
66
|
}
|
|
44
|
-
|
|
67
|
+
}, [
|
|
68
|
+
focusedSpanId,
|
|
69
|
+
trace.spanById,
|
|
70
|
+
setCollapsedSpans
|
|
71
|
+
]);
|
|
72
|
+
// Scroll to focused span when using prev/next buttons in search bar.
|
|
73
|
+
useEffect(()=>{
|
|
74
|
+
if (!focusedSpanId || !virtuosoRef.current) return;
|
|
75
|
+
const index = rows.findIndex((r)=>r.spanId === focusedSpanId);
|
|
76
|
+
if (index >= 0) {
|
|
77
|
+
virtuosoRef.current.scrollToIndex({
|
|
78
|
+
index,
|
|
79
|
+
align: 'center'
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}, [
|
|
83
|
+
focusedSpanId,
|
|
84
|
+
rows
|
|
85
|
+
]);
|
|
86
|
+
// Set the top most index in the Virtuoso table to the selected span
|
|
87
|
+
// Required e.g. when navigating from another page.
|
|
88
|
+
const initialTopMostSpanIndex = useMemo(()=>{
|
|
89
|
+
if (!selectedSpan) return 0;
|
|
90
|
+
const index = rows.findIndex((r)=>r.spanId === selectedSpan.spanId);
|
|
91
|
+
return index >= 0 ? index : 0;
|
|
45
92
|
}, [
|
|
46
93
|
rows,
|
|
47
94
|
selectedSpan
|
|
@@ -75,14 +122,17 @@ export function GanttTable(props) {
|
|
|
75
122
|
divider: divider
|
|
76
123
|
}),
|
|
77
124
|
/*#__PURE__*/ _jsx(Virtuoso, {
|
|
125
|
+
ref: virtuosoRef,
|
|
78
126
|
data: rows,
|
|
79
|
-
initialTopMostItemIndex:
|
|
127
|
+
initialTopMostItemIndex: initialTopMostSpanIndex,
|
|
80
128
|
itemContent: (_, span)=>/*#__PURE__*/ _jsx(GanttTableRow, {
|
|
81
129
|
options: options,
|
|
82
130
|
customLinks: customLinks,
|
|
83
131
|
span: span,
|
|
84
132
|
viewport: viewport,
|
|
85
133
|
selected: span === selectedSpan,
|
|
134
|
+
matched: matchingSpanIdSet.has(span.spanId),
|
|
135
|
+
focused: span.spanId === focusedSpanId,
|
|
86
136
|
nameColumnWidth: nameColumnWidth,
|
|
87
137
|
divider: divider,
|
|
88
138
|
onClick: onSpanClick
|
|
@@ -92,16 +142,5 @@ export function GanttTable(props) {
|
|
|
92
142
|
]
|
|
93
143
|
});
|
|
94
144
|
}
|
|
95
|
-
/**
|
|
96
|
-
* treeToRows recursively transforms the span tree to a list of rows and
|
|
97
|
-
* hides collapsed child spans.
|
|
98
|
-
*/ function treeToRows(rows, span, collapsedSpans) {
|
|
99
|
-
rows.push(span);
|
|
100
|
-
if (!collapsedSpans.includes(span.spanId)) {
|
|
101
|
-
for (const child of span.childSpans){
|
|
102
|
-
treeToRows(rows, child, collapsedSpans);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
145
|
|
|
107
146
|
//# sourceMappingURL=GanttTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/GanttTable.tsx"],"sourcesContent":["// Copyright 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 { CustomLinks, 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 customLinks?: CustomLinks;\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, customLinks, 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
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/GanttTable.tsx"],"sourcesContent":["// Copyright 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, VirtuosoHandle, ListRange } from 'react-virtuoso';\nimport { ReactElement, useEffect, useMemo, useRef, useState } from 'react';\nimport { Box, useTheme } from '@mui/material';\nimport { Viewport } from '../utils';\nimport { CustomLinks, TracingGanttChartOptions } from '../../gantt-chart-model';\nimport { Span, Trace, forEachSpan } 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 customLinks?: CustomLinks;\n trace: Trace;\n viewport: Viewport;\n selectedSpan?: Span;\n onSpanClick: (span: Span) => void;\n matchingSpanIds?: string[];\n focusedSpanId?: string;\n}\n\nexport function GanttTable(props: GanttTableProps): ReactElement {\n const { options, customLinks, trace, viewport, selectedSpan, onSpanClick, matchingSpanIds, focusedSpanId } = props;\n const { collapsedSpans, setCollapsedSpans, setVisibleSpans } = useGanttTableContext();\n const [nameColumnWidth, setNameColumnWidth] = useState<number>(0.25);\n const tableRef = useRef<HTMLDivElement>(null);\n const virtuosoRef = useRef<VirtuosoHandle>(null);\n const theme = useTheme();\n\n // Recursively flatten the span tree to a list of rows, hiding collapsed child spans.\n const rows = useMemo(() => {\n const rows: Span[] = [];\n forEachSpan(trace.rootSpans, (span) => {\n rows.push(span);\n if (collapsedSpans.has(span.spanId)) {\n return false;\n }\n });\n return rows;\n }, [trace.rootSpans, collapsedSpans]);\n const matchingSpanIdSet = useMemo(() => new Set(matchingSpanIds ?? []), [matchingSpanIds]);\n\n // Auto-expand collapsed ancestors when focusing a search match\n useEffect(() => {\n if (!focusedSpanId) return;\n\n const span = trace.spanById.get(focusedSpanId);\n if (!span) return;\n\n const ancestorIds = new Set<string>();\n let parent = span.parentSpan;\n while (parent) {\n ancestorIds.add(parent.spanId);\n parent = parent.parentSpan;\n }\n if (ancestorIds.size > 0) {\n setCollapsedSpans((prev) => {\n const next = new Set(prev);\n let changed = false;\n for (const id of ancestorIds) {\n if (next.delete(id)) changed = true;\n }\n return changed ? next : prev;\n });\n }\n }, [focusedSpanId, trace.spanById, setCollapsedSpans]);\n\n // Scroll to focused span when using prev/next buttons in search bar.\n useEffect(() => {\n if (!focusedSpanId || !virtuosoRef.current) return;\n\n const index = rows.findIndex((r) => r.spanId === focusedSpanId);\n if (index >= 0) {\n virtuosoRef.current.scrollToIndex({ index, align: 'center' });\n }\n }, [focusedSpanId, rows]);\n\n // Set the top most index in the Virtuoso table to the selected span\n // Required e.g. when navigating from another page.\n const initialTopMostSpanIndex = useMemo(() => {\n if (!selectedSpan) return 0;\n const index = rows.findIndex((r) => r.spanId === selectedSpan.spanId);\n return index >= 0 ? index : 0;\n }, [rows, selectedSpan]);\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 ref={virtuosoRef}\n data={rows}\n initialTopMostItemIndex={initialTopMostSpanIndex}\n itemContent={(_, span) => (\n <GanttTableRow\n options={options}\n customLinks={customLinks}\n span={span}\n viewport={viewport}\n selected={span === selectedSpan}\n matched={matchingSpanIdSet.has(span.spanId)}\n focused={span.spanId === focusedSpanId}\n nameColumnWidth={nameColumnWidth}\n divider={divider}\n onClick={onSpanClick}\n />\n )}\n rangeChanged={handleRangeChange}\n />\n </Box>\n );\n}\n"],"names":["Virtuoso","useEffect","useMemo","useRef","useState","Box","useTheme","forEachSpan","useGanttTableContext","GanttTableRow","GanttTableHeader","ResizableDivider","GanttTable","props","options","customLinks","trace","viewport","selectedSpan","onSpanClick","matchingSpanIds","focusedSpanId","collapsedSpans","setCollapsedSpans","setVisibleSpans","nameColumnWidth","setNameColumnWidth","tableRef","virtuosoRef","theme","rows","rootSpans","span","push","has","spanId","matchingSpanIdSet","Set","spanById","get","ancestorIds","parent","parentSpan","add","size","prev","next","changed","id","delete","current","index","findIndex","r","scrollToIndex","align","initialTopMostSpanIndex","divider","parentRef","onMove","handleRangeChange","startIndex","endIndex","visibleSpans","i","ref","sx","display","flexDirection","flexGrow","border","palette","borderRadius","shape","data","initialTopMostItemIndex","itemContent","_","selected","matched","focused","onClick","rangeChanged"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,QAAQ,QAAmC,iBAAiB;AACrE,SAAuBC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAC3E,SAASC,GAAG,EAAEC,QAAQ,QAAQ,gBAAgB;AAG9C,SAAsBC,WAAW,QAAQ,WAAW;AACpD,SAASC,oBAAoB,QAAQ,uBAAuB;AAC5D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,gBAAgB,QAAQ,qBAAqB;AAatD,OAAO,SAASC,WAAWC,KAAsB;IAC/C,MAAM,EAAEC,OAAO,EAAEC,WAAW,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,WAAW,EAAEC,eAAe,EAAEC,aAAa,EAAE,GAAGR;IAC7G,MAAM,EAAES,cAAc,EAAEC,iBAAiB,EAAEC,eAAe,EAAE,GAAGhB;IAC/D,MAAM,CAACiB,iBAAiBC,mBAAmB,GAAGtB,SAAiB;IAC/D,MAAMuB,WAAWxB,OAAuB;IACxC,MAAMyB,cAAczB,OAAuB;IAC3C,MAAM0B,QAAQvB;IAEd,qFAAqF;IACrF,MAAMwB,OAAO5B,QAAQ;QACnB,MAAM4B,OAAe,EAAE;QACvBvB,YAAYS,MAAMe,SAAS,EAAE,CAACC;YAC5BF,KAAKG,IAAI,CAACD;YACV,IAAIV,eAAeY,GAAG,CAACF,KAAKG,MAAM,GAAG;gBACnC,OAAO;YACT;QACF;QACA,OAAOL;IACT,GAAG;QAACd,MAAMe,SAAS;QAAET;KAAe;IACpC,MAAMc,oBAAoBlC,QAAQ,IAAM,IAAImC,IAAIjB,mBAAmB,EAAE,GAAG;QAACA;KAAgB;IAEzF,+DAA+D;IAC/DnB,UAAU;QACR,IAAI,CAACoB,eAAe;QAEpB,MAAMW,OAAOhB,MAAMsB,QAAQ,CAACC,GAAG,CAAClB;QAChC,IAAI,CAACW,MAAM;QAEX,MAAMQ,cAAc,IAAIH;QACxB,IAAII,SAAST,KAAKU,UAAU;QAC5B,MAAOD,OAAQ;YACbD,YAAYG,GAAG,CAACF,OAAON,MAAM;YAC7BM,SAASA,OAAOC,UAAU;QAC5B;QACA,IAAIF,YAAYI,IAAI,GAAG,GAAG;YACxBrB,kBAAkB,CAACsB;gBACjB,MAAMC,OAAO,IAAIT,IAAIQ;gBACrB,IAAIE,UAAU;gBACd,KAAK,MAAMC,MAAMR,YAAa;oBAC5B,IAAIM,KAAKG,MAAM,CAACD,KAAKD,UAAU;gBACjC;gBACA,OAAOA,UAAUD,OAAOD;YAC1B;QACF;IACF,GAAG;QAACxB;QAAeL,MAAMsB,QAAQ;QAAEf;KAAkB;IAErD,qEAAqE;IACrEtB,UAAU;QACR,IAAI,CAACoB,iBAAiB,CAACO,YAAYsB,OAAO,EAAE;QAE5C,MAAMC,QAAQrB,KAAKsB,SAAS,CAAC,CAACC,IAAMA,EAAElB,MAAM,KAAKd;QACjD,IAAI8B,SAAS,GAAG;YACdvB,YAAYsB,OAAO,CAACI,aAAa,CAAC;gBAAEH;gBAAOI,OAAO;YAAS;QAC7D;IACF,GAAG;QAAClC;QAAeS;KAAK;IAExB,oEAAoE;IACpE,mDAAmD;IACnD,MAAM0B,0BAA0BtD,QAAQ;QACtC,IAAI,CAACgB,cAAc,OAAO;QAC1B,MAAMiC,QAAQrB,KAAKsB,SAAS,CAAC,CAACC,IAAMA,EAAElB,MAAM,KAAKjB,aAAaiB,MAAM;QACpE,OAAOgB,SAAS,IAAIA,QAAQ;IAC9B,GAAG;QAACrB;QAAMZ;KAAa;IAEvB,MAAMuC,wBAAU,KAAC9C;QAAiB+C,WAAW/B;QAAUgC,QAAQjC;;IAE/D,iCAAiC;IACjC,SAASkC,kBAAkB,EAAEC,UAAU,EAAEC,QAAQ,EAAa;QAC5D,MAAMC,eAAyB,EAAE;QACjC,IAAK,IAAIC,IAAIH,YAAYG,KAAKF,UAAUE,IAAK;YAC3CD,aAAa9B,IAAI,CAACH,IAAI,CAACkC,EAAE,CAAE7B,MAAM;QACnC;QACAX,gBAAgBuC;IAClB;IAEA,qBACE,MAAC1D;QACC4D,KAAKtC;QACLuC,IAAI;YACFC,SAAS;YACTC,eAAe;YACfC,UAAU;YACVC,QAAQ,CAAC,UAAU,EAAEzC,MAAM0C,OAAO,CAACd,OAAO,EAAE;YAC5Ce,cAAc,GAAG3C,MAAM4C,KAAK,CAACD,YAAY,CAAC,EAAE,CAAC;QAC/C;;0BAEA,KAAC9D;gBAAiBM,OAAOA;gBAAOC,UAAUA;gBAAUQ,iBAAiBA;gBAAiBgC,SAASA;;0BAC/F,KAACzD;gBACCiE,KAAKrC;gBACL8C,MAAM5C;gBACN6C,yBAAyBnB;gBACzBoB,aAAa,CAACC,GAAG7C,qBACf,KAACvB;wBACCK,SAASA;wBACTC,aAAaA;wBACbiB,MAAMA;wBACNf,UAAUA;wBACV6D,UAAU9C,SAASd;wBACnB6D,SAAS3C,kBAAkBF,GAAG,CAACF,KAAKG,MAAM;wBAC1C6C,SAAShD,KAAKG,MAAM,KAAKd;wBACzBI,iBAAiBA;wBACjBgC,SAASA;wBACTwB,SAAS9D;;gBAGb+D,cAActB;;;;AAItB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
interface GanttTableContextType {
|
|
3
|
-
collapsedSpans: string
|
|
4
|
-
setCollapsedSpans:
|
|
3
|
+
collapsedSpans: Set<string>;
|
|
4
|
+
setCollapsedSpans: React.Dispatch<React.SetStateAction<Set<string>>>;
|
|
5
5
|
visibleSpans: string[];
|
|
6
6
|
setVisibleSpans: (s: string[]) => void;
|
|
7
7
|
/** can be a spanId, an empty string for the root span or undefined for no hover */
|
|
@@ -1 +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,
|
|
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,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrE,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"}
|
|
@@ -19,7 +19,7 @@ import { createContext, useContext, useState } from 'react';
|
|
|
19
19
|
*/ export const GanttTableContext = /*#__PURE__*/ createContext(undefined);
|
|
20
20
|
export function GanttTableProvider(props) {
|
|
21
21
|
const { children } = props;
|
|
22
|
-
const [collapsedSpans, setCollapsedSpans] = useState(
|
|
22
|
+
const [collapsedSpans, setCollapsedSpans] = useState(new Set());
|
|
23
23
|
const [visibleSpans, setVisibleSpans] = useState([]);
|
|
24
24
|
const [hoveredParent, setHoveredParent] = useState(undefined);
|
|
25
25
|
return /*#__PURE__*/ _jsx(GanttTableContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/GanttTableProvider.tsx"],"sourcesContent":["// Copyright 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
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/GanttTableProvider.tsx"],"sourcesContent":["// Copyright 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: Set<string>;\n setCollapsedSpans: React.Dispatch<React.SetStateAction<Set<string>>>;\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<Set<string>>(new Set());\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","Set","visibleSpans","setVisibleSpans","hoveredParent","setHoveredParent","Provider","value","useGanttTableContext","ctx","Error"],"mappings":";AAAA,+BAA+B;AAC/B,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,SAAsB,IAAIQ;IACtE,MAAM,CAACC,cAAcC,gBAAgB,GAAGV,SAAmB,EAAE;IAC7D,MAAM,CAACW,eAAeC,iBAAiB,GAAGZ,SAA6BE;IAEvE,qBACE,KAACD,kBAAkBY,QAAQ;QACzBC,OAAO;YAAER;YAAgBC;YAAmBE;YAAcC;YAAiBC;YAAeC;QAAiB;kBAE1GP;;AAGP;AAEA,OAAO,SAASU;IACd,MAAMC,MAAMjB,WAAWE;IACvB,IAAIe,QAAQd,WAAW;QACrB,MAAM,IAAIe,MAAM;IAClB;IACA,OAAOD;AACT"}
|
|
@@ -6,7 +6,12 @@ interface GanttTableRowProps {
|
|
|
6
6
|
customLinks?: CustomLinks;
|
|
7
7
|
span: Span;
|
|
8
8
|
viewport: Viewport;
|
|
9
|
+
/** this span is opened in the attribute pane */
|
|
9
10
|
selected?: boolean;
|
|
11
|
+
/** this span is matched in the search results */
|
|
12
|
+
matched?: boolean;
|
|
13
|
+
/** this span is focused by clicking prev/next in the search bar */
|
|
14
|
+
focused?: boolean;
|
|
10
15
|
nameColumnWidth: number;
|
|
11
16
|
divider: React.ReactNode;
|
|
12
17
|
onClick: (span: Span) => void;
|
|
@@ -1 +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,WAAW,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhC,UAAU,kBAAkB;IAC1B,OAAO,EAAE,wBAAwB,CAAC;IAClC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,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,
|
|
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,WAAW,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhC,UAAU,kBAAkB;IAC1B,OAAO,EAAE,wBAAwB,CAAC;IAClC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,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,0DAmCxB,CAAC"}
|
|
@@ -17,16 +17,28 @@ import { rowHeight } from '../utils';
|
|
|
17
17
|
import { SpanName } from './SpanName';
|
|
18
18
|
import { SpanDuration } from './SpanDuration';
|
|
19
19
|
export const GanttTableRow = /*#__PURE__*/ memo(function GanttTableRow(props) {
|
|
20
|
-
const { options, customLinks, span, viewport, selected, nameColumnWidth, divider, onClick } = props;
|
|
20
|
+
const { options, customLinks, span, viewport, selected, matched, focused, nameColumnWidth, divider, onClick } = props;
|
|
21
21
|
const theme = useTheme();
|
|
22
22
|
const handleOnClick = ()=>{
|
|
23
23
|
// ignore event if triggered by selecting text
|
|
24
24
|
if (document.getSelection()?.type === 'Range') return;
|
|
25
25
|
onClick(span);
|
|
26
26
|
};
|
|
27
|
+
let backgroundColor;
|
|
28
|
+
if (selected) {
|
|
29
|
+
backgroundColor = theme.palette.action.focus;
|
|
30
|
+
} else if (focused) {
|
|
31
|
+
backgroundColor = theme.palette.action.selected;
|
|
32
|
+
} else if (matched) {
|
|
33
|
+
backgroundColor = theme.palette.action.hover;
|
|
34
|
+
}
|
|
27
35
|
return /*#__PURE__*/ _jsxs(RowContainer, {
|
|
28
36
|
sx: {
|
|
29
|
-
backgroundColor
|
|
37
|
+
backgroundColor,
|
|
38
|
+
// overwrite hover if background color is set (selected, focused or matched)
|
|
39
|
+
'&:hover': backgroundColor ? {
|
|
40
|
+
backgroundColor
|
|
41
|
+
} : undefined
|
|
30
42
|
},
|
|
31
43
|
direction: "row",
|
|
32
44
|
onClick: handleOnClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/GanttTableRow.tsx"],"sourcesContent":["// Copyright 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 { Stack, styled, useTheme } from '@mui/material';\nimport { memo } from 'react';\nimport { Viewport, rowHeight } from '../utils';\nimport { CustomLinks, TracingGanttChartOptions } from '../../gantt-chart-model';\nimport { Span } from '../trace';\nimport { SpanName } from './SpanName';\nimport { SpanDuration } from './SpanDuration';\n\ninterface GanttTableRowProps {\n options: TracingGanttChartOptions;\n customLinks?: CustomLinks;\n span: Span;\n viewport: Viewport;\n selected?: boolean;\n nameColumnWidth: number;\n divider: React.ReactNode;\n onClick: (span: Span) => void;\n}\n\nexport const GanttTableRow = memo(function GanttTableRow(props: GanttTableRowProps) {\n const { options, customLinks, span, viewport, selected, nameColumnWidth, divider, onClick } = props;\n const theme = useTheme();\n\n const handleOnClick = (): void => {\n // ignore event if triggered by selecting text\n if (document.getSelection()?.type === 'Range') return;\n\n onClick(span);\n };\n\n return (\n <RowContainer\n sx={{
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/GanttTableRow.tsx"],"sourcesContent":["// Copyright 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 { Stack, styled, useTheme } from '@mui/material';\nimport { memo } from 'react';\nimport { Viewport, rowHeight } from '../utils';\nimport { CustomLinks, TracingGanttChartOptions } from '../../gantt-chart-model';\nimport { Span } from '../trace';\nimport { SpanName } from './SpanName';\nimport { SpanDuration } from './SpanDuration';\n\ninterface GanttTableRowProps {\n options: TracingGanttChartOptions;\n customLinks?: CustomLinks;\n span: Span;\n viewport: Viewport;\n /** this span is opened in the attribute pane */\n selected?: boolean;\n /** this span is matched in the search results */\n matched?: boolean;\n /** this span is focused by clicking prev/next in the search bar */\n focused?: boolean;\n nameColumnWidth: number;\n divider: React.ReactNode;\n onClick: (span: Span) => void;\n}\n\nexport const GanttTableRow = memo(function GanttTableRow(props: GanttTableRowProps) {\n const { options, customLinks, span, viewport, selected, matched, focused, nameColumnWidth, divider, onClick } = props;\n const theme = useTheme();\n\n const handleOnClick = (): void => {\n // ignore event if triggered by selecting text\n if (document.getSelection()?.type === 'Range') return;\n\n onClick(span);\n };\n\n let backgroundColor: string | undefined;\n if (selected) {\n backgroundColor = theme.palette.action.focus;\n } else if (focused) {\n backgroundColor = theme.palette.action.selected;\n } else if (matched) {\n backgroundColor = theme.palette.action.hover;\n }\n\n return (\n <RowContainer\n sx={{\n backgroundColor,\n // overwrite hover if background color is set (selected, focused or matched)\n '&:hover': backgroundColor ? { backgroundColor } : undefined,\n }}\n direction=\"row\"\n onClick={handleOnClick}\n >\n <SpanName customLinks={customLinks} span={span} nameColumnWidth={nameColumnWidth} />\n {divider}\n <SpanDuration options={options} span={span} viewport={viewport} />\n </RowContainer>\n );\n});\n\nconst RowContainer = styled(Stack)(({ theme }) => ({\n height: rowHeight,\n '&:hover': {\n backgroundColor: theme.palette.action.hover,\n borderTop: `1px solid ${theme.palette.divider}`,\n borderBottom: `1px solid ${theme.palette.divider}`,\n },\n}));\n"],"names":["Stack","styled","useTheme","memo","rowHeight","SpanName","SpanDuration","GanttTableRow","props","options","customLinks","span","viewport","selected","matched","focused","nameColumnWidth","divider","onClick","theme","handleOnClick","document","getSelection","type","backgroundColor","palette","action","focus","hover","RowContainer","sx","undefined","direction","height","borderTop","borderBottom"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,KAAK,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,gBAAgB;AACxD,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAAmBC,SAAS,QAAQ,WAAW;AAG/C,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,YAAY,QAAQ,iBAAiB;AAkB9C,OAAO,MAAMC,8BAAgBJ,KAAK,SAASI,cAAcC,KAAyB;IAChF,MAAM,EAAEC,OAAO,EAAEC,WAAW,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,eAAe,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGV;IAChH,MAAMW,QAAQjB;IAEd,MAAMkB,gBAAgB;QACpB,8CAA8C;QAC9C,IAAIC,SAASC,YAAY,IAAIC,SAAS,SAAS;QAE/CL,QAAQP;IACV;IAEA,IAAIa;IACJ,IAAIX,UAAU;QACZW,kBAAkBL,MAAMM,OAAO,CAACC,MAAM,CAACC,KAAK;IAC9C,OAAO,IAAIZ,SAAS;QAClBS,kBAAkBL,MAAMM,OAAO,CAACC,MAAM,CAACb,QAAQ;IACjD,OAAO,IAAIC,SAAS;QAClBU,kBAAkBL,MAAMM,OAAO,CAACC,MAAM,CAACE,KAAK;IAC9C;IAEA,qBACE,MAACC;QACCC,IAAI;YACFN;YACA,4EAA4E;YAC5E,WAAWA,kBAAkB;gBAAEA;YAAgB,IAAIO;QACrD;QACAC,WAAU;QACVd,SAASE;;0BAET,KAACf;gBAASK,aAAaA;gBAAaC,MAAMA;gBAAMK,iBAAiBA;;YAChEC;0BACD,KAACX;gBAAaG,SAASA;gBAASE,MAAMA;gBAAMC,UAAUA;;;;AAG5D,GAAG;AAEH,MAAMiB,eAAe5B,OAAOD,OAAO,CAAC,EAAEmB,KAAK,EAAE,GAAM,CAAA;QACjDc,QAAQ7B;QACR,WAAW;YACToB,iBAAiBL,MAAMM,OAAO,CAACC,MAAM,CAACE,KAAK;YAC3CM,WAAW,CAAC,UAAU,EAAEf,MAAMM,OAAO,CAACR,OAAO,EAAE;YAC/CkB,cAAc,CAAC,UAAU,EAAEhB,MAAMM,OAAO,CAACR,OAAO,EAAE;QACpD;IACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizableDivider.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/GanttTable/ResizableDivider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAiC,YAAY,EAAuB,MAAM,OAAO,CAAC;AAIzF,UAAU,qBAAqB;IAC7B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"ResizableDivider.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/GanttTable/ResizableDivider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAiC,YAAY,EAAuB,MAAM,OAAO,CAAC;AAIzF,UAAU,qBAAqB;IAC7B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,CA2D3E"}
|
|
@@ -25,8 +25,11 @@ export function ResizableDivider(props) {
|
|
|
25
25
|
// need stable reference for window.removeEventListener() in useEffect() below
|
|
26
26
|
const handleMouseMove = useEvent((e)=>{
|
|
27
27
|
if (!parentRef.current) return;
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const parentRect = parentRef.current.getBoundingClientRect();
|
|
29
|
+
// The parent can be a flex row, for example: [leftPercent] [gap] [divider] [gap] [1-leftPercent].
|
|
30
|
+
// Without considering spacing, leftPercent would be wrong because it ignores the flex gap between the divider and the element.
|
|
31
|
+
const offsetX = e.clientX - parentRect.left + spacing;
|
|
32
|
+
const leftPercent = offsetX / parentRect.width;
|
|
30
33
|
if (0.05 <= leftPercent && leftPercent <= 0.95) {
|
|
31
34
|
onMove(leftPercent);
|
|
32
35
|
}
|
|
@@ -68,6 +71,7 @@ export function ResizableDivider(props) {
|
|
|
68
71
|
const ResizableDividerBox = styled(Box)(({ theme })=>({
|
|
69
72
|
position: 'relative',
|
|
70
73
|
width: '1px',
|
|
74
|
+
minWidth: '1px',
|
|
71
75
|
height: '100%',
|
|
72
76
|
backgroundColor: theme.palette.divider,
|
|
73
77
|
cursor: 'col-resize',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/ResizableDivider.tsx"],"sourcesContent":["// Copyright 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 { MouseEvent as ReactMouseEvent, ReactElement, useEffect, useState } from 'react';\nimport { Box, styled } from '@mui/material';\nimport { useEvent } from '@perses-dev/plugin-system';\n\ninterface ResizableDividerProps {\n parentRef: React.RefObject<Element>;\n spacing?: number;\n onMove: (left: number) => void;\n}\n\nexport function ResizableDivider(props: ResizableDividerProps): ReactElement {\n const { parentRef, spacing = 0, onMove } = props;\n const [isResizing, setResizing] = useState(false);\n\n const handleMouseDown = (e: ReactMouseEvent): void => {\n // disable any default actions (text selection, etc.)\n e.preventDefault();\n\n setResizing(true);\n };\n\n // need stable reference for window.removeEventListener() in useEffect() below\n const handleMouseMove = useEvent((e: MouseEvent) => {\n if (!parentRef.current) return;\n\n const offsetX = e.clientX -
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/ResizableDivider.tsx"],"sourcesContent":["// Copyright 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 { MouseEvent as ReactMouseEvent, ReactElement, useEffect, useState } from 'react';\nimport { Box, styled } from '@mui/material';\nimport { useEvent } from '@perses-dev/plugin-system';\n\ninterface ResizableDividerProps {\n parentRef: React.RefObject<Element>;\n spacing?: number;\n onMove: (left: number) => void;\n}\n\nexport function ResizableDivider(props: ResizableDividerProps): ReactElement {\n const { parentRef, spacing = 0, onMove } = props;\n const [isResizing, setResizing] = useState(false);\n\n const handleMouseDown = (e: ReactMouseEvent): void => {\n // disable any default actions (text selection, etc.)\n e.preventDefault();\n\n setResizing(true);\n };\n\n // need stable reference for window.removeEventListener() in useEffect() below\n const handleMouseMove = useEvent((e: MouseEvent) => {\n if (!parentRef.current) return;\n\n const parentRect = parentRef.current.getBoundingClientRect();\n\n // The parent can be a flex row, for example: [leftPercent] [gap] [divider] [gap] [1-leftPercent].\n // Without considering spacing, leftPercent would be wrong because it ignores the flex gap between the divider and the element.\n const offsetX = e.clientX - parentRect.left + spacing;\n const leftPercent = offsetX / parentRect.width;\n\n if (0.05 <= leftPercent && leftPercent <= 0.95) {\n onMove(leftPercent);\n }\n });\n\n // need stable reference for window.removeEventListener() in useEffect() below\n const handleMouseUp = useEvent(() => {\n setResizing(false);\n });\n\n // capture mouseMove and mouseUp outside the element by attaching them to the window object\n useEffect(() => {\n function startMouseAction(): void {\n window.addEventListener('mousemove', handleMouseMove);\n window.addEventListener('mouseup', handleMouseUp);\n document.body.style.cursor = 'col-resize';\n }\n\n function stopMouseAction(): void {\n window.removeEventListener('mousemove', handleMouseMove);\n window.removeEventListener('mouseup', handleMouseUp);\n document.body.style.cursor = 'inherit';\n }\n\n if (isResizing) {\n startMouseAction();\n } else {\n stopMouseAction();\n }\n\n return stopMouseAction;\n }, [isResizing, handleMouseMove, handleMouseUp]);\n\n // prevent onClick event when clicking on a divider\n const stopEventPropagation = (e: ReactMouseEvent): void => e.stopPropagation();\n\n return <ResizableDividerBox onMouseDown={handleMouseDown} onClick={stopEventPropagation} />;\n}\n\nconst ResizableDividerBox = styled(Box)(({ theme }) => ({\n position: 'relative',\n width: '1px',\n minWidth: '1px',\n height: '100%',\n backgroundColor: theme.palette.divider,\n cursor: 'col-resize',\n\n // increase clickable area from 1px to 7px\n '&:before': {\n position: 'absolute',\n width: '7px',\n left: '-3px',\n top: 0,\n bottom: 0,\n content: '\" \"',\n zIndex: 1, // without zIndex, the span duration row hides the right side of this element\n },\n}));\n"],"names":["useEffect","useState","Box","styled","useEvent","ResizableDivider","props","parentRef","spacing","onMove","isResizing","setResizing","handleMouseDown","e","preventDefault","handleMouseMove","current","parentRect","getBoundingClientRect","offsetX","clientX","left","leftPercent","width","handleMouseUp","startMouseAction","window","addEventListener","document","body","style","cursor","stopMouseAction","removeEventListener","stopEventPropagation","stopPropagation","ResizableDividerBox","onMouseDown","onClick","theme","position","minWidth","height","backgroundColor","palette","divider","top","bottom","content","zIndex"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAsDA,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AACzF,SAASC,GAAG,EAAEC,MAAM,QAAQ,gBAAgB;AAC5C,SAASC,QAAQ,QAAQ,4BAA4B;AAQrD,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EAAEC,SAAS,EAAEC,UAAU,CAAC,EAAEC,MAAM,EAAE,GAAGH;IAC3C,MAAM,CAACI,YAAYC,YAAY,GAAGV,SAAS;IAE3C,MAAMW,kBAAkB,CAACC;QACvB,qDAAqD;QACrDA,EAAEC,cAAc;QAEhBH,YAAY;IACd;IAEA,8EAA8E;IAC9E,MAAMI,kBAAkBX,SAAS,CAACS;QAChC,IAAI,CAACN,UAAUS,OAAO,EAAE;QAExB,MAAMC,aAAaV,UAAUS,OAAO,CAACE,qBAAqB;QAE1D,kGAAkG;QAClG,+HAA+H;QAC/H,MAAMC,UAAUN,EAAEO,OAAO,GAAGH,WAAWI,IAAI,GAAGb;QAC9C,MAAMc,cAAcH,UAAUF,WAAWM,KAAK;QAE9C,IAAI,QAAQD,eAAeA,eAAe,MAAM;YAC9Cb,OAAOa;QACT;IACF;IAEA,8EAA8E;IAC9E,MAAME,gBAAgBpB,SAAS;QAC7BO,YAAY;IACd;IAEA,2FAA2F;IAC3FX,UAAU;QACR,SAASyB;YACPC,OAAOC,gBAAgB,CAAC,aAAaZ;YACrCW,OAAOC,gBAAgB,CAAC,WAAWH;YACnCI,SAASC,IAAI,CAACC,KAAK,CAACC,MAAM,GAAG;QAC/B;QAEA,SAASC;YACPN,OAAOO,mBAAmB,CAAC,aAAalB;YACxCW,OAAOO,mBAAmB,CAAC,WAAWT;YACtCI,SAASC,IAAI,CAACC,KAAK,CAACC,MAAM,GAAG;QAC/B;QAEA,IAAIrB,YAAY;YACde;QACF,OAAO;YACLO;QACF;QAEA,OAAOA;IACT,GAAG;QAACtB;QAAYK;QAAiBS;KAAc;IAE/C,mDAAmD;IACnD,MAAMU,uBAAuB,CAACrB,IAA6BA,EAAEsB,eAAe;IAE5E,qBAAO,KAACC;QAAoBC,aAAazB;QAAiB0B,SAASJ;;AACrE;AAEA,MAAME,sBAAsBjC,OAAOD,KAAK,CAAC,EAAEqC,KAAK,EAAE,GAAM,CAAA;QACtDC,UAAU;QACVjB,OAAO;QACPkB,UAAU;QACVC,QAAQ;QACRC,iBAAiBJ,MAAMK,OAAO,CAACC,OAAO;QACtCd,QAAQ;QAER,0CAA0C;QAC1C,YAAY;YACVS,UAAU;YACVjB,OAAO;YACPF,MAAM;YACNyB,KAAK;YACLC,QAAQ;YACRC,SAAS;YACTC,QAAQ;QACV;IACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpanIndents.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/GanttTable/SpanIndents.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAc,YAAY,EAAe,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAMhC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"SpanIndents.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/GanttTable/SpanIndents.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAc,YAAY,EAAe,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAMhC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CA2DjE"}
|
|
@@ -30,17 +30,17 @@ const MAX_INDENT_WIDTH = 24;
|
|
|
30
30
|
const theme = useTheme();
|
|
31
31
|
const handleToggleClick = useCallback((e)=>{
|
|
32
32
|
e.stopPropagation();
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
span.spanId
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
setCollapsedSpans((prev)=>{
|
|
34
|
+
const next = new Set(prev);
|
|
35
|
+
if (next.has(span.spanId)) {
|
|
36
|
+
next.delete(span.spanId);
|
|
37
|
+
} else {
|
|
38
|
+
next.add(span.spanId);
|
|
39
|
+
}
|
|
40
|
+
return next;
|
|
41
|
+
});
|
|
41
42
|
}, [
|
|
42
43
|
span,
|
|
43
|
-
collapsedSpans,
|
|
44
44
|
setCollapsedSpans
|
|
45
45
|
]);
|
|
46
46
|
const handleIconMouseEnter = useCallback(()=>{
|
|
@@ -66,7 +66,7 @@ const MAX_INDENT_WIDTH = 24;
|
|
|
66
66
|
},
|
|
67
67
|
onMouseEnter: ()=>setHoveredParent(span.parentSpanId ?? ''),
|
|
68
68
|
onMouseLeave: ()=>setHoveredParent(undefined),
|
|
69
|
-
children: i === spans.length - 1 && span.childSpans.length > 0 && (collapsedSpans.
|
|
69
|
+
children: i === spans.length - 1 && span.childSpans.length > 0 && (collapsedSpans.has(span.spanId) ? /*#__PURE__*/ _jsx(ChevronRightIcon, {
|
|
70
70
|
titleAccess: "expand",
|
|
71
71
|
onClick: handleToggleClick,
|
|
72
72
|
onMouseEnter: handleIconMouseEnter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/SpanIndents.tsx"],"sourcesContent":["// Copyright 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 { styled, useTheme } from '@mui/material';\nimport ChevronDownIcon from 'mdi-material-ui/ChevronDown';\nimport ChevronRightIcon from 'mdi-material-ui/ChevronRight';\nimport { MouseEvent, ReactElement, useCallback } from 'react';\nimport { Span } from '../trace';\nimport { useGanttTableContext } from './GanttTableProvider';\n\nconst MIN_INDENT_WIDTH = 8;\nconst MAX_INDENT_WIDTH = 24;\n\nexport interface SpanIndentsProps {\n span: Span;\n}\n\n/**\n * SpanIndents renders the indention boxes,\n * and handles the click and mouseOver events\n *\n * Note: This component gets re-rendered on every hover of any indention box,\n * therefore rendering performance is essential.\n */\nexport function SpanIndents(props: SpanIndentsProps): ReactElement {\n const { span } = props;\n const { collapsedSpans, setCollapsedSpans, visibleSpans, hoveredParent, setHoveredParent } = useGanttTableContext();\n const theme = useTheme();\n\n const handleToggleClick = useCallback(\n (e: MouseEvent) => {\n e.stopPropagation();\n if (
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/SpanIndents.tsx"],"sourcesContent":["// Copyright 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 { styled, useTheme } from '@mui/material';\nimport ChevronDownIcon from 'mdi-material-ui/ChevronDown';\nimport ChevronRightIcon from 'mdi-material-ui/ChevronRight';\nimport { MouseEvent, ReactElement, useCallback } from 'react';\nimport { Span } from '../trace';\nimport { useGanttTableContext } from './GanttTableProvider';\n\nconst MIN_INDENT_WIDTH = 8;\nconst MAX_INDENT_WIDTH = 24;\n\nexport interface SpanIndentsProps {\n span: Span;\n}\n\n/**\n * SpanIndents renders the indention boxes,\n * and handles the click and mouseOver events\n *\n * Note: This component gets re-rendered on every hover of any indention box,\n * therefore rendering performance is essential.\n */\nexport function SpanIndents(props: SpanIndentsProps): ReactElement {\n const { span } = props;\n const { collapsedSpans, setCollapsedSpans, visibleSpans, hoveredParent, setHoveredParent } = useGanttTableContext();\n const theme = useTheme();\n\n const handleToggleClick = useCallback(\n (e: MouseEvent) => {\n e.stopPropagation();\n setCollapsedSpans((prev) => {\n const next = new Set(prev);\n if (next.has(span.spanId)) {\n next.delete(span.spanId);\n } else {\n next.add(span.spanId);\n }\n return next;\n });\n },\n [span, setCollapsedSpans]\n );\n\n const handleIconMouseEnter = useCallback(() => {\n setHoveredParent(span.spanId);\n }, [span, setHoveredParent]);\n\n const spans = [span];\n let parent = span.parentSpan;\n while (parent) {\n spans.unshift(parent);\n parent = parent.parentSpan;\n }\n\n // on first render visibleSpans is empty, therefore let's use MAX_INDENT_WIDTH to avoid an animation on page load.\n return (\n <>\n {spans.map((span, i) => (\n <SpanIndentBox\n key={span.spanId}\n style={{\n width:\n i === spans.length - 1 || visibleSpans.length === 0 || visibleSpans.includes(span.spanId)\n ? MAX_INDENT_WIDTH\n : MIN_INDENT_WIDTH,\n borderLeft: `${hoveredParent === (span.parentSpanId ?? '') ? 3 : 1}px solid ${theme.palette.divider}`,\n }}\n onMouseEnter={() => setHoveredParent(span.parentSpanId ?? '')}\n onMouseLeave={() => setHoveredParent(undefined)}\n >\n {i === spans.length - 1 &&\n span.childSpans.length > 0 &&\n (collapsedSpans.has(span.spanId) ? (\n <ChevronRightIcon titleAccess=\"expand\" onClick={handleToggleClick} onMouseEnter={handleIconMouseEnter} />\n ) : (\n <ChevronDownIcon titleAccess=\"collapse\" onClick={handleToggleClick} onMouseEnter={handleIconMouseEnter} />\n ))}\n </SpanIndentBox>\n ))}\n </>\n );\n}\n\nconst SpanIndentBox = styled('div')({\n display: 'flex',\n height: '100%',\n alignItems: 'center',\n justifyContent: 'flex-end',\n flexShrink: 0,\n transition: 'width 1s',\n});\n"],"names":["styled","useTheme","ChevronDownIcon","ChevronRightIcon","useCallback","useGanttTableContext","MIN_INDENT_WIDTH","MAX_INDENT_WIDTH","SpanIndents","props","span","collapsedSpans","setCollapsedSpans","visibleSpans","hoveredParent","setHoveredParent","theme","handleToggleClick","e","stopPropagation","prev","next","Set","has","spanId","delete","add","handleIconMouseEnter","spans","parent","parentSpan","unshift","map","i","SpanIndentBox","style","width","length","includes","borderLeft","parentSpanId","palette","divider","onMouseEnter","onMouseLeave","undefined","childSpans","titleAccess","onClick","display","height","alignItems","justifyContent","flexShrink","transition"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,MAAM,EAAEC,QAAQ,QAAQ,gBAAgB;AACjD,OAAOC,qBAAqB,8BAA8B;AAC1D,OAAOC,sBAAsB,+BAA+B;AAC5D,SAAmCC,WAAW,QAAQ,QAAQ;AAE9D,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,MAAMC,mBAAmB;AACzB,MAAMC,mBAAmB;AAMzB;;;;;;CAMC,GACD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,MAAM,EAAEE,cAAc,EAAEC,iBAAiB,EAAEC,YAAY,EAAEC,aAAa,EAAEC,gBAAgB,EAAE,GAAGV;IAC7F,MAAMW,QAAQf;IAEd,MAAMgB,oBAAoBb,YACxB,CAACc;QACCA,EAAEC,eAAe;QACjBP,kBAAkB,CAACQ;YACjB,MAAMC,OAAO,IAAIC,IAAIF;YACrB,IAAIC,KAAKE,GAAG,CAACb,KAAKc,MAAM,GAAG;gBACzBH,KAAKI,MAAM,CAACf,KAAKc,MAAM;YACzB,OAAO;gBACLH,KAAKK,GAAG,CAAChB,KAAKc,MAAM;YACtB;YACA,OAAOH;QACT;IACF,GACA;QAACX;QAAME;KAAkB;IAG3B,MAAMe,uBAAuBvB,YAAY;QACvCW,iBAAiBL,KAAKc,MAAM;IAC9B,GAAG;QAACd;QAAMK;KAAiB;IAE3B,MAAMa,QAAQ;QAAClB;KAAK;IACpB,IAAImB,SAASnB,KAAKoB,UAAU;IAC5B,MAAOD,OAAQ;QACbD,MAAMG,OAAO,CAACF;QACdA,SAASA,OAAOC,UAAU;IAC5B;IAEA,kHAAkH;IAClH,qBACE;kBACGF,MAAMI,GAAG,CAAC,CAACtB,MAAMuB,kBAChB,KAACC;gBAECC,OAAO;oBACLC,OACEH,MAAML,MAAMS,MAAM,GAAG,KAAKxB,aAAawB,MAAM,KAAK,KAAKxB,aAAayB,QAAQ,CAAC5B,KAAKc,MAAM,IACpFjB,mBACAD;oBACNiC,YAAY,GAAGzB,kBAAmBJ,CAAAA,KAAK8B,YAAY,IAAI,EAAC,IAAK,IAAI,EAAE,SAAS,EAAExB,MAAMyB,OAAO,CAACC,OAAO,EAAE;gBACvG;gBACAC,cAAc,IAAM5B,iBAAiBL,KAAK8B,YAAY,IAAI;gBAC1DI,cAAc,IAAM7B,iBAAiB8B;0BAEpCZ,MAAML,MAAMS,MAAM,GAAG,KACpB3B,KAAKoC,UAAU,CAACT,MAAM,GAAG,KACxB1B,CAAAA,eAAeY,GAAG,CAACb,KAAKc,MAAM,kBAC7B,KAACrB;oBAAiB4C,aAAY;oBAASC,SAAS/B;oBAAmB0B,cAAchB;mCAEjF,KAACzB;oBAAgB6C,aAAY;oBAAWC,SAAS/B;oBAAmB0B,cAAchB;kBACpF;eAjBGjB,KAAKc,MAAM;;AAsB1B;AAEA,MAAMU,gBAAgBlC,OAAO,OAAO;IAClCiD,SAAS;IACTC,QAAQ;IACRC,YAAY;IACZC,gBAAgB;IAChBC,YAAY;IACZC,YAAY;AACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/MiniGanttChart/draw.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/MiniGanttChart/draw.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAe,MAAM,UAAU,CAAC;AAMpD,wBAAgB,SAAS,CACvB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,GACzC,IAAI,CA2BN"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
+
import { forEachSpan } from '../trace';
|
|
13
14
|
import { minSpanWidthPx } from '../utils';
|
|
14
15
|
const MIN_BAR_HEIGHT = 1;
|
|
15
16
|
const MAX_BAR_HEIGHT = 7;
|
|
@@ -29,13 +30,8 @@ export function drawSpans(ctx, width, height, trace, spanColorGenerator) {
|
|
|
29
30
|
ctx.rect(Math.round(relativeStart * width), Math.round(y), Math.max(minSpanWidthPx, Math.round(relativeDuration * width)), barHeight);
|
|
30
31
|
ctx.fill();
|
|
31
32
|
y += yChange;
|
|
32
|
-
for (const childSpan of span.childSpans){
|
|
33
|
-
drawSpan(childSpan);
|
|
34
|
-
}
|
|
35
33
|
};
|
|
36
|
-
|
|
37
|
-
drawSpan(rootSpan);
|
|
38
|
-
}
|
|
34
|
+
forEachSpan(trace.rootSpans, drawSpan);
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
//# sourceMappingURL=draw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/MiniGanttChart/draw.ts"],"sourcesContent":["// Copyright 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 { Span, Trace } from '../trace';\nimport { minSpanWidthPx } from '../utils';\n\nconst MIN_BAR_HEIGHT = 1;\nconst MAX_BAR_HEIGHT = 7;\n\nexport function drawSpans(\n ctx: CanvasRenderingContext2D,\n width: number,\n height: number,\n trace: Trace,\n spanColorGenerator: (span: Span) => string\n): void {\n // calculate optimal height, enforce min and max bar height and finally round to an integer\n const numSpans = trace.spanById.size;\n const barHeight = Math.round(Math.min(Math.max(height / numSpans, MIN_BAR_HEIGHT), MAX_BAR_HEIGHT));\n\n const traceDuration = trace.endTimeUnixMs - trace.startTimeUnixMs;\n const yChange = height / numSpans;\n let y = 0;\n\n const drawSpan = (span: Span): void => {\n const spanDuration = span.endTimeUnixMs - span.startTimeUnixMs;\n const relativeDuration = spanDuration / traceDuration;\n const relativeStart = (span.startTimeUnixMs - trace.startTimeUnixMs) / traceDuration;\n\n ctx.fillStyle = spanColorGenerator(span);\n ctx.beginPath();\n ctx.rect(\n Math.round(relativeStart * width),\n Math.round(y),\n Math.max(minSpanWidthPx, Math.round(relativeDuration * width)),\n barHeight\n );\n ctx.fill();\n y += yChange;\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/MiniGanttChart/draw.ts"],"sourcesContent":["// Copyright 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 { Span, Trace, forEachSpan } from '../trace';\nimport { minSpanWidthPx } from '../utils';\n\nconst MIN_BAR_HEIGHT = 1;\nconst MAX_BAR_HEIGHT = 7;\n\nexport function drawSpans(\n ctx: CanvasRenderingContext2D,\n width: number,\n height: number,\n trace: Trace,\n spanColorGenerator: (span: Span) => string\n): void {\n // calculate optimal height, enforce min and max bar height and finally round to an integer\n const numSpans = trace.spanById.size;\n const barHeight = Math.round(Math.min(Math.max(height / numSpans, MIN_BAR_HEIGHT), MAX_BAR_HEIGHT));\n\n const traceDuration = trace.endTimeUnixMs - trace.startTimeUnixMs;\n const yChange = height / numSpans;\n let y = 0;\n\n const drawSpan = (span: Span): void => {\n const spanDuration = span.endTimeUnixMs - span.startTimeUnixMs;\n const relativeDuration = spanDuration / traceDuration;\n const relativeStart = (span.startTimeUnixMs - trace.startTimeUnixMs) / traceDuration;\n\n ctx.fillStyle = spanColorGenerator(span);\n ctx.beginPath();\n ctx.rect(\n Math.round(relativeStart * width),\n Math.round(y),\n Math.max(minSpanWidthPx, Math.round(relativeDuration * width)),\n barHeight\n );\n ctx.fill();\n y += yChange;\n };\n\n forEachSpan(trace.rootSpans, drawSpan);\n}\n"],"names":["forEachSpan","minSpanWidthPx","MIN_BAR_HEIGHT","MAX_BAR_HEIGHT","drawSpans","ctx","width","height","trace","spanColorGenerator","numSpans","spanById","size","barHeight","Math","round","min","max","traceDuration","endTimeUnixMs","startTimeUnixMs","yChange","y","drawSpan","span","spanDuration","relativeDuration","relativeStart","fillStyle","beginPath","rect","fill","rootSpans"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAsBA,WAAW,QAAQ,WAAW;AACpD,SAASC,cAAc,QAAQ,WAAW;AAE1C,MAAMC,iBAAiB;AACvB,MAAMC,iBAAiB;AAEvB,OAAO,SAASC,UACdC,GAA6B,EAC7BC,KAAa,EACbC,MAAc,EACdC,KAAY,EACZC,kBAA0C;IAE1C,2FAA2F;IAC3F,MAAMC,WAAWF,MAAMG,QAAQ,CAACC,IAAI;IACpC,MAAMC,YAAYC,KAAKC,KAAK,CAACD,KAAKE,GAAG,CAACF,KAAKG,GAAG,CAACV,SAASG,UAAUR,iBAAiBC;IAEnF,MAAMe,gBAAgBV,MAAMW,aAAa,GAAGX,MAAMY,eAAe;IACjE,MAAMC,UAAUd,SAASG;IACzB,IAAIY,IAAI;IAER,MAAMC,WAAW,CAACC;QAChB,MAAMC,eAAeD,KAAKL,aAAa,GAAGK,KAAKJ,eAAe;QAC9D,MAAMM,mBAAmBD,eAAeP;QACxC,MAAMS,gBAAgB,AAACH,CAAAA,KAAKJ,eAAe,GAAGZ,MAAMY,eAAe,AAAD,IAAKF;QAEvEb,IAAIuB,SAAS,GAAGnB,mBAAmBe;QACnCnB,IAAIwB,SAAS;QACbxB,IAAIyB,IAAI,CACNhB,KAAKC,KAAK,CAACY,gBAAgBrB,QAC3BQ,KAAKC,KAAK,CAACO,IACXR,KAAKG,GAAG,CAAChB,gBAAgBa,KAAKC,KAAK,CAACW,mBAAmBpB,SACvDO;QAEFR,IAAI0B,IAAI;QACRT,KAAKD;IACP;IAEArB,YAAYQ,MAAMwB,SAAS,EAAET;AAC/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Trace } from './trace';
|
|
3
|
+
export interface SearchBarProps {
|
|
4
|
+
search: SpanSearch;
|
|
5
|
+
}
|
|
6
|
+
export declare function SearchBar(props: SearchBarProps): ReactElement;
|
|
7
|
+
export interface SpanSearch {
|
|
8
|
+
searchQuery: string;
|
|
9
|
+
setSearchQuery: (query: string) => void;
|
|
10
|
+
matchingSpanIds: string[];
|
|
11
|
+
focusedMatchIndex: number;
|
|
12
|
+
setFocusedMatchIndex: (index: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function useSpanSearch(trace: Trace): SpanSearch;
|
|
15
|
+
//# sourceMappingURL=Search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../src/TracingGanttChart/Search.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAkC,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAQ,KAAK,EAAe,MAAM,SAAS,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,UAAU,CAAC;CACpB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CA2D7D;AAeD,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,CAuBtD"}
|