@perses-dev/tracing-gantt-chart-plugin 0.11.0 → 0.12.0-beta.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/__mf/js/TracingGanttChart.f1ef6924.js +6 -0
- package/__mf/js/async/{964.3f12c3f5.js → 121.cb300887.js} +2 -2
- package/__mf/js/async/{488.2d364feb.js → 177.cf9df204.js} +1 -1
- package/__mf/js/async/192.f723a636.js +1 -0
- package/__mf/js/async/2.e3ce4ee4.js +1 -0
- package/__mf/js/async/235.806ca841.js +1 -0
- package/__mf/js/async/252.0e9814ef.js +22 -0
- package/__mf/js/async/274.457dda65.js +2 -0
- package/__mf/js/async/356.7ea3eee9.js +1 -0
- package/__mf/js/async/392.6a9270a8.js +2 -0
- package/__mf/js/async/43.55c495e3.js +2 -0
- package/__mf/js/async/470.f5dfd429.js +2 -0
- package/__mf/js/async/{118.c1138755.js → 557.d2605567.js} +1 -1
- package/__mf/js/async/{62.1a6f8c05.js → 558.a4e7ed47.js} +1 -1
- package/__mf/js/async/{214.8bf3e03e.js → 587.3a4d8eed.js} +1 -1
- package/__mf/js/async/588.a1fce2da.js +1 -0
- package/__mf/js/async/616.25399954.js +1 -0
- package/__mf/js/async/622.632bfcaa.js +7 -0
- package/__mf/js/async/71.ec1919d7.js +1 -0
- package/__mf/js/async/728.b805adfd.js +1 -0
- package/__mf/js/async/754.2f82ce32.js +39 -0
- package/__mf/js/async/873.0f298220.js +1 -0
- package/__mf/js/async/941.065a3eec.js +2 -0
- package/__mf/js/async/953.c4774074.js +1 -0
- package/__mf/js/async/{738.7d9e5092.js → 968.5f7ccf5e.js} +1 -1
- package/__mf/js/async/978.151ab551.js +1 -0
- package/__mf/js/async/986.56030b97.js +110 -0
- package/__mf/js/async/__federation_expose_TracingGanttChart.eeb93a1d.js +1 -0
- package/__mf/js/async/lib-router.1f330b2a.js +2 -0
- package/__mf/js/main.e0f131ec.js +6 -0
- package/lib/PanelActions.js +1 -1
- package/lib/PanelActions.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.js +1 -1
- package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/DetailPane.js +1 -1
- package/lib/TracingGanttChart/DetailPane/DetailPane.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/SpanEvents.js +1 -1
- package/lib/TracingGanttChart/DetailPane/SpanEvents.js.map +1 -1
- package/lib/TracingGanttChart/DetailPane/SpanLinks.js +1 -1
- package/lib/TracingGanttChart/DetailPane/SpanLinks.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTable.js +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTable.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js.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.js +1 -1
- package/lib/TracingGanttChart/GanttTable/GanttTableRow.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanDuration.js +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanDuration.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanIndents.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanLinksButton.js +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanLinksButton.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanName.js +1 -1
- package/lib/TracingGanttChart/GanttTable/SpanName.js.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js.map +1 -1
- package/lib/TracingGanttChart/Ticks.js +1 -1
- package/lib/TracingGanttChart/Ticks.js.map +1 -1
- package/lib/TracingGanttChart/TraceDetails.js +1 -1
- package/lib/TracingGanttChart/TraceDetails.js.map +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.js +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -1
- package/lib/bootstrap.js +1 -1
- package/lib/bootstrap.js.map +1 -1
- package/lib/cjs/PanelActions.js +3 -3
- package/lib/cjs/TracingGanttChart/DetailPane/Attributes.js +5 -5
- package/lib/cjs/TracingGanttChart/GanttTable/GanttTableProvider.js +4 -4
- package/lib/cjs/TracingGanttChart/Ticks.js +3 -3
- package/lib/cjs/TracingGanttChart/palette.js +3 -3
- package/lib/cjs/TracingGanttChart/utils.js +7 -7
- package/lib/cjs/index-federation.js +12 -12
- package/mf-manifest.json +34 -34
- package/mf-stats.json +34 -34
- package/package.json +4 -4
- package/__mf/js/TracingGanttChart.4febbfb4.js +0 -5
- package/__mf/js/async/173.66fc423e.js +0 -2
- package/__mf/js/async/177.ab9a582b.js +0 -110
- package/__mf/js/async/224.670da1e3.js +0 -1
- package/__mf/js/async/238.813da7cb.js +0 -1
- package/__mf/js/async/292.4821b1b1.js +0 -1
- package/__mf/js/async/409.12b6365d.js +0 -1
- package/__mf/js/async/63.0b6a8d45.js +0 -39
- package/__mf/js/async/651.bcb43163.js +0 -1
- package/__mf/js/async/694.fe491393.js +0 -1
- package/__mf/js/async/711.1f4a48d0.js +0 -22
- package/__mf/js/async/740.fa3debdf.js +0 -1
- package/__mf/js/async/75.4d502b5c.js +0 -1
- package/__mf/js/async/770.65ae427e.js +0 -1
- package/__mf/js/async/783.976dc72b.js +0 -1
- package/__mf/js/async/813.de2c52ae.js +0 -7
- package/__mf/js/async/814.c33b5f31.js +0 -2
- package/__mf/js/async/863.0e6501cd.js +0 -2
- package/__mf/js/async/960.89291786.js +0 -2
- package/__mf/js/async/971.0902cbf8.js +0 -1
- package/__mf/js/async/981.1c640ffc.js +0 -2
- package/__mf/js/async/__federation_expose_TracingGanttChart.13966d2e.js +0 -1
- package/__mf/js/async/lib-router.ab6beae3.js +0 -2
- package/__mf/js/main.685d41e3.js +0 -5
- /package/__mf/css/async/{263.d3010b86.css → 442.d3010b86.css} +0 -0
- /package/__mf/css/async/{341.d3010b86.css → 61.d3010b86.css} +0 -0
- /package/__mf/css/async/{759.d3010b86.css → 823.d3010b86.css} +0 -0
- /package/__mf/js/async/{964.3f12c3f5.js.LICENSE.txt → 121.cb300887.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{711.1f4a48d0.js.LICENSE.txt → 252.0e9814ef.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{960.89291786.js.LICENSE.txt → 274.457dda65.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{981.1c640ffc.js.LICENSE.txt → 392.6a9270a8.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{814.c33b5f31.js.LICENSE.txt → 43.55c495e3.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{173.66fc423e.js.LICENSE.txt → 470.f5dfd429.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{813.de2c52ae.js.LICENSE.txt → 622.632bfcaa.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{63.0b6a8d45.js.LICENSE.txt → 754.2f82ce32.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{863.0e6501cd.js.LICENSE.txt → 941.065a3eec.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{177.ab9a582b.js.LICENSE.txt → 986.56030b97.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.ab6beae3.js.LICENSE.txt → lib-router.1f330b2a.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/MiniGanttChart/Canvas.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, styled, useTheme } from '@mui/material';\nimport useResizeObserver from 'use-resize-observer';\nimport { useEffect, useRef, MouseEvent as ReactMouseEvent, useState, useCallback, ReactElement } from 'react';\nimport { useEvent } from '@perses-dev/plugin-system';\nimport { useChartsTheme } from '@perses-dev/components';\nimport { Ticks } from '../Ticks';\nimport { getSpanColor, Viewport } from '../utils';\nimport { TracingGanttChartOptions } from '../../gantt-chart-model';\nimport { Span, Trace } from '../trace';\nimport { drawSpans } from './draw';\n\nconst CANVAS_HEIGHT = 60;\n\ninterface CanvasProps {\n options: TracingGanttChartOptions;\n trace: Trace;\n viewport: Viewport;\n setViewport: (v: Viewport) => void;\n}\n\ntype MouseState =\n | { type: 'none' }\n | { type: 'resize'; fixedPoint: number }\n | { type: 'drag'; start: number; end: number };\n\nexport function Canvas(props: CanvasProps): ReactElement {\n const { options, trace, viewport, setViewport } = props;\n const muiTheme = useTheme();\n const chartsTheme = useChartsTheme();\n // the <canvas> element must have an absolute width and height to avoid rendering problems\n // the wrapper box is required to get the available dimensions for the <canvas> element\n const { width, ref: wrapperRef } = useResizeObserver();\n const height = CANVAS_HEIGHT;\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [mouseState, setMouseState] = useState<MouseState>({ type: 'none' });\n\n const traceDuration = trace.endTimeUnixMs - trace.startTimeUnixMs;\n const relativeCutoffLeft = (viewport.startTimeUnixMs - trace.startTimeUnixMs) / traceDuration;\n const relativeCutoffRight = (trace.endTimeUnixMs - viewport.endTimeUnixMs) / traceDuration;\n\n const spanColorGenerator = useCallback(\n (span: Span) => getSpanColor(muiTheme, chartsTheme, options.visual?.palette?.mode, span),\n [muiTheme, chartsTheme, options.visual?.palette?.mode]\n );\n\n useEffect(() => {\n if (!canvasRef.current || !width || !height) return;\n\n const ctx = canvasRef.current.getContext('2d');\n if (!ctx) return;\n\n drawSpans(ctx, width, height, trace, spanColorGenerator);\n }, [width, height, trace, spanColorGenerator]);\n\n const translateCursorToTime = (e: ReactMouseEvent | MouseEvent): number => {\n if (!canvasRef.current || !width) return 0;\n // e.nativeEvent.offsetX doesn't work when sliding over a tick box\n const offsetX = e.clientX - canvasRef.current.getBoundingClientRect().left;\n return trace.startTimeUnixMs + (offsetX / width) * traceDuration;\n };\n\n const handleMouseDown = (e: ReactMouseEvent<HTMLDivElement>): void => {\n e.preventDefault();\n if (!(e.target instanceof HTMLElement)) return;\n\n const isDefaultViewport =\n viewport.startTimeUnixMs === trace.startTimeUnixMs && viewport.endTimeUnixMs === trace.endTimeUnixMs;\n const elem = e.target.dataset['elem'];\n const cursor = translateCursorToTime(e);\n\n if (elem === 'resizerLeft') {\n setMouseState({ type: 'resize', fixedPoint: viewport.endTimeUnixMs });\n } else if (elem === 'resizerRight') {\n setMouseState({ type: 'resize', fixedPoint: viewport.startTimeUnixMs });\n } else if (elem === 'cutoffBox' || isDefaultViewport) {\n setMouseState({ type: 'resize', fixedPoint: cursor });\n setViewport({ startTimeUnixMs: cursor, endTimeUnixMs: cursor });\n } else {\n setMouseState({\n type: 'drag',\n start: cursor - viewport.startTimeUnixMs,\n end: viewport.endTimeUnixMs - cursor,\n });\n }\n };\n\n // need stable reference for window.removeEventListener() in useEffect() below\n const handleMouseMove = useEvent((e: MouseEvent) => {\n e.preventDefault();\n\n switch (mouseState.type) {\n case 'none':\n return;\n\n case 'resize': {\n const pointA = mouseState.fixedPoint;\n const pointB = translateCursorToTime(e);\n\n let start, end;\n if (pointA < pointB) {\n start = pointA;\n end = pointB;\n } else {\n start = pointB;\n end = pointA;\n }\n\n setViewport({\n startTimeUnixMs: Math.max(start, trace.startTimeUnixMs),\n endTimeUnixMs: Math.min(end, trace.endTimeUnixMs),\n });\n return;\n }\n\n case 'drag': {\n // avoid using e.movementX here, as it skips events in chrome,\n // resulting in the mouse pointer moving faster than the viewport box\n const { start, end } = mouseState;\n let cursor = translateCursorToTime(e);\n\n if (cursor - start < trace.startTimeUnixMs) {\n cursor = trace.startTimeUnixMs + start;\n }\n if (cursor + end > trace.endTimeUnixMs) {\n cursor = trace.endTimeUnixMs - end;\n }\n\n setViewport({\n startTimeUnixMs: cursor - start,\n endTimeUnixMs: cursor + end,\n });\n return;\n }\n }\n });\n\n // need stable reference for window.removeEventListener() in useEffect() below\n const handleMouseUp = useEvent((e: MouseEvent) => {\n e.preventDefault();\n setMouseState({ type: 'none' });\n\n // reset viewport if start === end, i.e. a click without movement\n if (viewport.startTimeUnixMs === viewport.endTimeUnixMs) {\n setViewport({ startTimeUnixMs: trace.startTimeUnixMs, endTimeUnixMs: trace.endTimeUnixMs });\n }\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 = mouseState.type === 'resize' ? 'col-resize' : 'move';\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 (mouseState.type === 'none') {\n stopMouseAction();\n } else {\n startMouseAction();\n }\n\n return stopMouseAction;\n }, [mouseState, handleMouseMove, handleMouseUp]);\n\n return (\n <Box ref={wrapperRef} sx={{ position: 'relative', height }} onMouseDown={handleMouseDown}>\n <canvas ref={canvasRef} width={width} height={height} style={{ position: 'absolute' }} />\n <Ticks />\n <CutoffBox data-elem=\"cutoffBox\" style={{ left: 0, width: `${relativeCutoffLeft * 100}%` }} />\n <Resizer data-elem=\"resizerLeft\" style={{ left: `${relativeCutoffLeft * 100}%` }} />\n <Resizer data-elem=\"resizerRight\" style={{ right: `${relativeCutoffRight * 100}%` }} />\n <CutoffBox data-elem=\"cutoffBox\" style={{ right: 0, width: `${relativeCutoffRight * 100}%` }} />\n </Box>\n );\n}\n\nconst CutoffBox = styled(Box)({\n position: 'absolute',\n height: '100%',\n backgroundColor: 'rgba(225, 225, 225, .5)',\n});\n\nconst Resizer = styled(Box)(({ theme }) => ({\n position: 'absolute',\n height: '100%',\n backgroundColor: theme.palette.divider,\n width: '2px',\n cursor: 'col-resize',\n\n // increase clickable area from 2px to 8px\n '&:before': {\n position: 'absolute',\n width: '8px',\n left: '-3px',\n top: 0,\n bottom: 0,\n content: '\" \"',\n zIndex: 1, // without zIndex, the cutoff boxes partially hide this element\n },\n}));\n"],"names":["Box","styled","useTheme","useResizeObserver","useEffect","useRef","useState","useCallback","useEvent","useChartsTheme","Ticks","getSpanColor","drawSpans","CANVAS_HEIGHT","Canvas","props","options","trace","viewport","setViewport","muiTheme","chartsTheme","width","ref","wrapperRef","height","canvasRef","mouseState","setMouseState","type","traceDuration","endTimeUnixMs","startTimeUnixMs","relativeCutoffLeft","relativeCutoffRight","spanColorGenerator","span","visual","palette","mode","current","ctx","getContext","translateCursorToTime","e","offsetX","clientX","getBoundingClientRect","left","handleMouseDown","preventDefault","target","HTMLElement","isDefaultViewport","elem","dataset","cursor","fixedPoint","start","end","handleMouseMove","pointA","pointB","Math","max","min","handleMouseUp","startMouseAction","window","addEventListener","document","body","style","stopMouseAction","removeEventListener","sx","position","onMouseDown","canvas","CutoffBox","data-elem","Resizer","right","backgroundColor","theme","divider","top","bottom","content","zIndex"],"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,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AQ;QAER,0CAA0C;QAC1C,YAAY;YACVoB,UAAU;YACVtD,OAAO;YACP0B,MAAM;YACNsC,KAAK;YACLC,QAAQ;YACRC,SAAS;YACTC,QAAQ;QACV;IACF,CAAA"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/MiniGanttChart/Canvas.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, styled, useTheme } from '@mui/material';\nimport useResizeObserver from 'use-resize-observer';\nimport { useEffect, useRef, MouseEvent as ReactMouseEvent, useState, useCallback, ReactElement } from 'react';\nimport { useEvent } from '@perses-dev/plugin-system';\nimport { useChartsTheme } from '@perses-dev/components';\nimport { Ticks } from '../Ticks';\nimport { getSpanColor, Viewport } from '../utils';\nimport { TracingGanttChartOptions } from '../../gantt-chart-model';\nimport { Span, Trace } from '../trace';\nimport { drawSpans } from './draw';\n\nconst CANVAS_HEIGHT = 60;\n\ninterface CanvasProps {\n options: TracingGanttChartOptions;\n trace: Trace;\n viewport: Viewport;\n setViewport: (v: Viewport) => void;\n}\n\ntype MouseState =\n | { type: 'none' }\n | { type: 'resize'; fixedPoint: number }\n | { type: 'drag'; start: number; end: number };\n\nexport function Canvas(props: CanvasProps): ReactElement {\n const { options, trace, viewport, setViewport } = props;\n const muiTheme = useTheme();\n const chartsTheme = useChartsTheme();\n // the <canvas> element must have an absolute width and height to avoid rendering problems\n // the wrapper box is required to get the available dimensions for the <canvas> element\n const { width, ref: wrapperRef } = useResizeObserver();\n const height = CANVAS_HEIGHT;\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [mouseState, setMouseState] = useState<MouseState>({ type: 'none' });\n\n const traceDuration = trace.endTimeUnixMs - trace.startTimeUnixMs;\n const relativeCutoffLeft = (viewport.startTimeUnixMs - trace.startTimeUnixMs) / traceDuration;\n const relativeCutoffRight = (trace.endTimeUnixMs - viewport.endTimeUnixMs) / traceDuration;\n\n const spanColorGenerator = useCallback(\n (span: Span) => getSpanColor(muiTheme, chartsTheme, options.visual?.palette?.mode, span),\n [muiTheme, chartsTheme, options.visual?.palette?.mode]\n );\n\n useEffect(() => {\n if (!canvasRef.current || !width || !height) return;\n\n const ctx = canvasRef.current.getContext('2d');\n if (!ctx) return;\n\n drawSpans(ctx, width, height, trace, spanColorGenerator);\n }, [width, height, trace, spanColorGenerator]);\n\n const translateCursorToTime = (e: ReactMouseEvent | MouseEvent): number => {\n if (!canvasRef.current || !width) return 0;\n // e.nativeEvent.offsetX doesn't work when sliding over a tick box\n const offsetX = e.clientX - canvasRef.current.getBoundingClientRect().left;\n return trace.startTimeUnixMs + (offsetX / width) * traceDuration;\n };\n\n const handleMouseDown = (e: ReactMouseEvent<HTMLDivElement>): void => {\n e.preventDefault();\n if (!(e.target instanceof HTMLElement)) return;\n\n const isDefaultViewport =\n viewport.startTimeUnixMs === trace.startTimeUnixMs && viewport.endTimeUnixMs === trace.endTimeUnixMs;\n const elem = e.target.dataset['elem'];\n const cursor = translateCursorToTime(e);\n\n if (elem === 'resizerLeft') {\n setMouseState({ type: 'resize', fixedPoint: viewport.endTimeUnixMs });\n } else if (elem === 'resizerRight') {\n setMouseState({ type: 'resize', fixedPoint: viewport.startTimeUnixMs });\n } else if (elem === 'cutoffBox' || isDefaultViewport) {\n setMouseState({ type: 'resize', fixedPoint: cursor });\n setViewport({ startTimeUnixMs: cursor, endTimeUnixMs: cursor });\n } else {\n setMouseState({\n type: 'drag',\n start: cursor - viewport.startTimeUnixMs,\n end: viewport.endTimeUnixMs - cursor,\n });\n }\n };\n\n // need stable reference for window.removeEventListener() in useEffect() below\n const handleMouseMove = useEvent((e: MouseEvent) => {\n e.preventDefault();\n\n switch (mouseState.type) {\n case 'none':\n return;\n\n case 'resize': {\n const pointA = mouseState.fixedPoint;\n const pointB = translateCursorToTime(e);\n\n let start, end;\n if (pointA < pointB) {\n start = pointA;\n end = pointB;\n } else {\n start = pointB;\n end = pointA;\n }\n\n setViewport({\n startTimeUnixMs: Math.max(start, trace.startTimeUnixMs),\n endTimeUnixMs: Math.min(end, trace.endTimeUnixMs),\n });\n return;\n }\n\n case 'drag': {\n // avoid using e.movementX here, as it skips events in chrome,\n // resulting in the mouse pointer moving faster than the viewport box\n const { start, end } = mouseState;\n let cursor = translateCursorToTime(e);\n\n if (cursor - start < trace.startTimeUnixMs) {\n cursor = trace.startTimeUnixMs + start;\n }\n if (cursor + end > trace.endTimeUnixMs) {\n cursor = trace.endTimeUnixMs - end;\n }\n\n setViewport({\n startTimeUnixMs: cursor - start,\n endTimeUnixMs: cursor + end,\n });\n return;\n }\n }\n });\n\n // need stable reference for window.removeEventListener() in useEffect() below\n const handleMouseUp = useEvent((e: MouseEvent) => {\n e.preventDefault();\n setMouseState({ type: 'none' });\n\n // reset viewport if start === end, i.e. a click without movement\n if (viewport.startTimeUnixMs === viewport.endTimeUnixMs) {\n setViewport({ startTimeUnixMs: trace.startTimeUnixMs, endTimeUnixMs: trace.endTimeUnixMs });\n }\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 = mouseState.type === 'resize' ? 'col-resize' : 'move';\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 (mouseState.type === 'none') {\n stopMouseAction();\n } else {\n startMouseAction();\n }\n\n return stopMouseAction;\n }, [mouseState, handleMouseMove, handleMouseUp]);\n\n return (\n <Box ref={wrapperRef} sx={{ position: 'relative', height }} onMouseDown={handleMouseDown}>\n <canvas ref={canvasRef} width={width} height={height} style={{ position: 'absolute' }} />\n <Ticks />\n <CutoffBox data-elem=\"cutoffBox\" style={{ left: 0, width: `${relativeCutoffLeft * 100}%` }} />\n <Resizer data-elem=\"resizerLeft\" style={{ left: `${relativeCutoffLeft * 100}%` }} />\n <Resizer data-elem=\"resizerRight\" style={{ right: `${relativeCutoffRight * 100}%` }} />\n <CutoffBox data-elem=\"cutoffBox\" style={{ right: 0, width: `${relativeCutoffRight * 100}%` }} />\n </Box>\n );\n}\n\nconst CutoffBox = styled(Box)({\n position: 'absolute',\n height: '100%',\n backgroundColor: 'rgba(225, 225, 225, .5)',\n});\n\nconst Resizer = styled(Box)(({ theme }) => ({\n position: 'absolute',\n height: '100%',\n backgroundColor: theme.palette.divider,\n width: '2px',\n cursor: 'col-resize',\n\n // increase clickable area from 2px to 8px\n '&:before': {\n position: 'absolute',\n width: '8px',\n left: '-3px',\n top: 0,\n bottom: 0,\n content: '\" \"',\n zIndex: 1, // without zIndex, the cutoff boxes partially hide this element\n },\n}));\n"],"names":["Box","styled","useTheme","useResizeObserver","useEffect","useRef","useState","useCallback","useEvent","useChartsTheme","Ticks","getSpanColor","drawSpans","CANVAS_HEIGHT","Canvas","props","options","trace","viewport","setViewport","muiTheme","chartsTheme","width","ref","wrapperRef","height","canvasRef","mouseState","setMouseState","type","traceDuration","endTimeUnixMs","startTimeUnixMs","relativeCutoffLeft","relativeCutoffRight","spanColorGenerator","span","visual","palette","mode","current","ctx","getContext","translateCursorToTime","e","offsetX","clientX","getBoundingClientRect","left","handleMouseDown","preventDefault","target","HTMLElement","isDefaultViewport","elem","dataset","cursor","fixedPoint","start","end","handleMouseMove","pointA","pointB","Math","max","min","handleMouseUp","startMouseAction","window","addEventListener","document","body","style","stopMouseAction","removeEventListener","sx","position","onMouseDown","canvas","CutoffBox","data-elem","Resizer","right","backgroundColor","theme","divider","top","bottom","content","zIndex"],"mappings":";AAA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;AAEA,MAAMF,UAAUhF,OAAOD,KAAK,CAAC,EAAEoF,KAAK,EAAE,GAAM,CAAA;QAC1CR,UAAU;QACVnD,QAAQ;QACR0D,iBAAiBC,MAAM9C,OAAO,CAAC+C,OAAO;QACtC/D,OAAO;QACPkC,QAAQ;QAER,0CAA0C;QAC1C,YAAY;YACVoB,UAAU;YACVtD,OAAO;YACP0B,MAAM;YACNsC,KAAK;YACLC,QAAQ;YACRC,SAAS;YACTC,QAAQ;QACV;IACF,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 2024 The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Box, useTheme } from '@mui/material';
|
|
15
15
|
import { TicksHeader } from '../Ticks';
|
|
16
16
|
import { rowHeight } from '../utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/MiniGanttChart/MiniGanttChart.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, useTheme } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TicksHeader } from '../Ticks';\nimport { Viewport, rowHeight } from '../utils';\nimport { TracingGanttChartOptions } from '../../gantt-chart-model';\nimport { Trace } from '../trace';\nimport { Canvas } from './Canvas';\n\ninterface MiniGanttChartProps {\n options: TracingGanttChartOptions;\n trace: Trace;\n viewport: Viewport;\n setViewport: (v: Viewport) => void;\n}\n\nexport function MiniGanttChart(props: MiniGanttChartProps): ReactElement {\n const { options, trace, viewport, setViewport } = props;\n const theme = useTheme();\n\n return (\n <Box\n sx={{\n border: `1px solid ${theme.palette.divider}`,\n borderRadius: `${theme.shape.borderRadius}px`,\n }}\n >\n <Box sx={{ position: 'relative', height: rowHeight, borderBottom: `1px solid ${theme.palette.divider}` }}>\n <TicksHeader\n trace={trace}\n viewport={{ startTimeUnixMs: trace.startTimeUnixMs, endTimeUnixMs: trace.endTimeUnixMs }}\n />\n </Box>\n <Canvas options={options} trace={trace} viewport={viewport} setViewport={setViewport} />\n </Box>\n );\n}\n"],"names":["Box","useTheme","TicksHeader","rowHeight","Canvas","MiniGanttChart","props","options","trace","viewport","setViewport","theme","sx","border","palette","divider","borderRadius","shape","position","height","borderBottom","startTimeUnixMs","endTimeUnixMs"],"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
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/MiniGanttChart/MiniGanttChart.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, useTheme } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TicksHeader } from '../Ticks';\nimport { Viewport, rowHeight } from '../utils';\nimport { TracingGanttChartOptions } from '../../gantt-chart-model';\nimport { Trace } from '../trace';\nimport { Canvas } from './Canvas';\n\ninterface MiniGanttChartProps {\n options: TracingGanttChartOptions;\n trace: Trace;\n viewport: Viewport;\n setViewport: (v: Viewport) => void;\n}\n\nexport function MiniGanttChart(props: MiniGanttChartProps): ReactElement {\n const { options, trace, viewport, setViewport } = props;\n const theme = useTheme();\n\n return (\n <Box\n sx={{\n border: `1px solid ${theme.palette.divider}`,\n borderRadius: `${theme.shape.borderRadius}px`,\n }}\n >\n <Box sx={{ position: 'relative', height: rowHeight, borderBottom: `1px solid ${theme.palette.divider}` }}>\n <TicksHeader\n trace={trace}\n viewport={{ startTimeUnixMs: trace.startTimeUnixMs, endTimeUnixMs: trace.endTimeUnixMs }}\n />\n </Box>\n <Canvas options={options} trace={trace} viewport={viewport} setViewport={setViewport} />\n </Box>\n );\n}\n"],"names":["Box","useTheme","TicksHeader","rowHeight","Canvas","MiniGanttChart","props","options","trace","viewport","setViewport","theme","sx","border","palette","divider","borderRadius","shape","position","height","borderBottom","startTimeUnixMs","endTimeUnixMs"],"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,QAAQ,QAAQ,gBAAgB;AAE9C,SAASC,WAAW,QAAQ,WAAW;AACvC,SAAmBC,SAAS,QAAQ,WAAW;AAG/C,SAASC,MAAM,QAAQ,WAAW;AASlC,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,EAAE,GAAGJ;IAClD,MAAMK,QAAQV;IAEd,qBACE,MAACD;QACCY,IAAI;YACFC,QAAQ,CAAC,UAAU,EAAEF,MAAMG,OAAO,CAACC,OAAO,EAAE;YAC5CC,cAAc,GAAGL,MAAMM,KAAK,CAACD,YAAY,CAAC,EAAE,CAAC;QAC/C;;0BAEA,KAAChB;gBAAIY,IAAI;oBAAEM,UAAU;oBAAYC,QAAQhB;oBAAWiB,cAAc,CAAC,UAAU,EAAET,MAAMG,OAAO,CAACC,OAAO,EAAE;gBAAC;0BACrG,cAAA,KAACb;oBACCM,OAAOA;oBACPC,UAAU;wBAAEY,iBAAiBb,MAAMa,eAAe;wBAAEC,eAAed,MAAMc,aAAa;oBAAC;;;0BAG3F,KAAClB;gBAAOG,SAASA;gBAASC,OAAOA;gBAAOC,UAAUA;gBAAUC,aAAaA;;;;AAG/E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 2024 The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
import { Box, styled } from '@mui/material';
|
|
15
15
|
import { formatDuration } from './utils';
|
|
16
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/TracingGanttChart/Ticks.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, styled } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { Viewport, formatDuration } from './utils';\nimport { Trace } from './trace';\n\nexport interface TicksHeaderProps {\n trace: Trace;\n viewport: Viewport;\n}\n\n/**\n * TicksHeader renders all tick labels in the header\n */\nexport function TicksHeader(props: TicksHeaderProps): ReactElement {\n const { trace, viewport } = props;\n\n const duration = viewport.endTimeUnixMs - viewport.startTimeUnixMs;\n const startAt = viewport.startTimeUnixMs - trace.startTimeUnixMs;\n\n return (\n <>\n <TickBox style={{ left: '0%', borderWidth: 0 }}>{formatDuration(startAt + duration * 0)}</TickBox>\n <TickBox style={{ left: '25%' }}>{formatDuration(startAt + duration * 0.25)}</TickBox>\n <TickBox style={{ left: '50%' }}>{formatDuration(startAt + duration * 0.5)}</TickBox>\n <TickBox style={{ left: '75%' }}>{formatDuration(startAt + duration * 0.75)}</TickBox>\n <TickBox style={{ left: '100%' }}>\n <span style={{ position: 'absolute', right: '.75rem' }}>{formatDuration(startAt + duration * 1)}</span>\n </TickBox>\n </>\n );\n}\n\n/**\n * Ticks renders all ticks in the span duration\n */\nexport function Ticks(): ReactElement {\n return (\n <>\n <TickBox style={{ left: '25%' }} />\n <TickBox style={{ left: '50%' }} />\n <TickBox style={{ left: '75%' }} />\n </>\n );\n}\n\nconst TickBox = styled(Box)(({ theme }) => ({\n position: 'absolute',\n height: '100%',\n borderLeft: `1px solid ${theme.palette.divider}`,\n padding: '.25rem',\n}));\n"],"names":["Box","styled","formatDuration","TicksHeader","props","trace","viewport","duration","endTimeUnixMs","startTimeUnixMs","startAt","TickBox","style","left","borderWidth","span","position","right","Ticks","theme","height","borderLeft","palette","divider","padding"],"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
|
|
1
|
+
{"version":3,"sources":["../../../src/TracingGanttChart/Ticks.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, styled } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { Viewport, formatDuration } from './utils';\nimport { Trace } from './trace';\n\nexport interface TicksHeaderProps {\n trace: Trace;\n viewport: Viewport;\n}\n\n/**\n * TicksHeader renders all tick labels in the header\n */\nexport function TicksHeader(props: TicksHeaderProps): ReactElement {\n const { trace, viewport } = props;\n\n const duration = viewport.endTimeUnixMs - viewport.startTimeUnixMs;\n const startAt = viewport.startTimeUnixMs - trace.startTimeUnixMs;\n\n return (\n <>\n <TickBox style={{ left: '0%', borderWidth: 0 }}>{formatDuration(startAt + duration * 0)}</TickBox>\n <TickBox style={{ left: '25%' }}>{formatDuration(startAt + duration * 0.25)}</TickBox>\n <TickBox style={{ left: '50%' }}>{formatDuration(startAt + duration * 0.5)}</TickBox>\n <TickBox style={{ left: '75%' }}>{formatDuration(startAt + duration * 0.75)}</TickBox>\n <TickBox style={{ left: '100%' }}>\n <span style={{ position: 'absolute', right: '.75rem' }}>{formatDuration(startAt + duration * 1)}</span>\n </TickBox>\n </>\n );\n}\n\n/**\n * Ticks renders all ticks in the span duration\n */\nexport function Ticks(): ReactElement {\n return (\n <>\n <TickBox style={{ left: '25%' }} />\n <TickBox style={{ left: '50%' }} />\n <TickBox style={{ left: '75%' }} />\n </>\n );\n}\n\nconst TickBox = styled(Box)(({ theme }) => ({\n position: 'absolute',\n height: '100%',\n borderLeft: `1px solid ${theme.palette.divider}`,\n padding: '.25rem',\n}));\n"],"names":["Box","styled","formatDuration","TicksHeader","props","trace","viewport","duration","endTimeUnixMs","startTimeUnixMs","startAt","TickBox","style","left","borderWidth","span","position","right","Ticks","theme","height","borderLeft","palette","divider","padding"],"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,MAAM,QAAQ,gBAAgB;AAE5C,SAAmBC,cAAc,QAAQ,UAAU;AAQnD;;CAEC,GACD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;IAE5B,MAAMG,WAAWD,SAASE,aAAa,GAAGF,SAASG,eAAe;IAClE,MAAMC,UAAUJ,SAASG,eAAe,GAAGJ,MAAMI,eAAe;IAEhE,qBACE;;0BACE,KAACE;gBAAQC,OAAO;oBAAEC,MAAM;oBAAMC,aAAa;gBAAE;0BAAIZ,eAAeQ,UAAUH,WAAW;;0BACrF,KAACI;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;0BAAIX,eAAeQ,UAAUH,WAAW;;0BACtE,KAACI;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;0BAAIX,eAAeQ,UAAUH,WAAW;;0BACtE,KAACI;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;0BAAIX,eAAeQ,UAAUH,WAAW;;0BACtE,KAACI;gBAAQC,OAAO;oBAAEC,MAAM;gBAAO;0BAC7B,cAAA,KAACE;oBAAKH,OAAO;wBAAEI,UAAU;wBAAYC,OAAO;oBAAS;8BAAIf,eAAeQ,UAAUH,WAAW;;;;;AAIrG;AAEA;;CAEC,GACD,OAAO,SAASW;IACd,qBACE;;0BACE,KAACP;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;;0BAC9B,KAACF;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;;0BAC9B,KAACF;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;;;;AAGpC;AAEA,MAAMF,UAAUV,OAAOD,KAAK,CAAC,EAAEmB,KAAK,EAAE,GAAM,CAAA;QAC1CH,UAAU;QACVI,QAAQ;QACRC,YAAY,CAAC,UAAU,EAAEF,MAAMG,OAAO,CAACC,OAAO,EAAE;QAChDC,SAAS;IACX,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 2025 The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Stack, Typography } from '@mui/material';
|
|
15
15
|
import { useTimeZone } from '@perses-dev/components';
|
|
16
16
|
import { formatDuration } from './utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/TracingGanttChart/TraceDetails.tsx"],"sourcesContent":["// Copyright 2025 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, Typography } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { useTimeZone } from '@perses-dev/components';\nimport { formatDuration } from './utils';\nimport { Trace } from './trace';\n\nconst DATE_FORMAT_OPTIONS: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n fractionalSecondDigits: 3,\n timeZoneName: 'short',\n};\n\nexport interface TraceDetailsProps {\n trace: Trace;\n}\n\nexport function TraceDetails(props: TraceDetailsProps): ReactElement {\n const { trace } = props;\n\n const { dateFormatOptionsWithUserTimeZone } = useTimeZone();\n const dateFormatOptions = dateFormatOptionsWithUserTimeZone(DATE_FORMAT_OPTIONS);\n const dateFormatter = new Intl.DateTimeFormat(undefined, dateFormatOptions);\n\n const rootSpan = trace.rootSpans[0];\n if (!rootSpan) {\n return <Typography>Trace contains no spans.</Typography>;\n }\n\n return (\n <Stack direction=\"row\" sx={{ justifyContent: 'space-between' }}>\n <Typography variant=\"h3\">\n {rootSpan.resource.serviceName}: {rootSpan.name} ({formatDuration(trace.endTimeUnixMs - trace.startTimeUnixMs)})\n </Typography>\n <Typography variant=\"h4\">\n <Typography component=\"span\" sx={{ px: 1 }}>\n <strong>Start:</strong> {dateFormatter.format(trace.startTimeUnixMs)}\n </Typography>\n <Typography component=\"span\" sx={{ px: 1 }}>\n <strong>Trace ID:</strong> {rootSpan.traceId}\n </Typography>\n </Typography>\n </Stack>\n );\n}\n"],"names":["Stack","Typography","useTimeZone","formatDuration","DATE_FORMAT_OPTIONS","year","month","day","hour","minute","second","fractionalSecondDigits","timeZoneName","TraceDetails","props","trace","dateFormatOptionsWithUserTimeZone","dateFormatOptions","dateFormatter","Intl","DateTimeFormat","undefined","rootSpan","rootSpans","direction","sx","justifyContent","variant","resource","serviceName","name","endTimeUnixMs","startTimeUnixMs","component","px","strong","format","traceId"],"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
|
|
1
|
+
{"version":3,"sources":["../../../src/TracingGanttChart/TraceDetails.tsx"],"sourcesContent":["// Copyright 2025 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, Typography } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { useTimeZone } from '@perses-dev/components';\nimport { formatDuration } from './utils';\nimport { Trace } from './trace';\n\nconst DATE_FORMAT_OPTIONS: Intl.DateTimeFormatOptions = {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n fractionalSecondDigits: 3,\n timeZoneName: 'short',\n};\n\nexport interface TraceDetailsProps {\n trace: Trace;\n}\n\nexport function TraceDetails(props: TraceDetailsProps): ReactElement {\n const { trace } = props;\n\n const { dateFormatOptionsWithUserTimeZone } = useTimeZone();\n const dateFormatOptions = dateFormatOptionsWithUserTimeZone(DATE_FORMAT_OPTIONS);\n const dateFormatter = new Intl.DateTimeFormat(undefined, dateFormatOptions);\n\n const rootSpan = trace.rootSpans[0];\n if (!rootSpan) {\n return <Typography>Trace contains no spans.</Typography>;\n }\n\n return (\n <Stack direction=\"row\" sx={{ justifyContent: 'space-between' }}>\n <Typography variant=\"h3\">\n {rootSpan.resource.serviceName}: {rootSpan.name} ({formatDuration(trace.endTimeUnixMs - trace.startTimeUnixMs)})\n </Typography>\n <Typography variant=\"h4\">\n <Typography component=\"span\" sx={{ px: 1 }}>\n <strong>Start:</strong> {dateFormatter.format(trace.startTimeUnixMs)}\n </Typography>\n <Typography component=\"span\" sx={{ px: 1 }}>\n <strong>Trace ID:</strong> {rootSpan.traceId}\n </Typography>\n </Typography>\n </Stack>\n );\n}\n"],"names":["Stack","Typography","useTimeZone","formatDuration","DATE_FORMAT_OPTIONS","year","month","day","hour","minute","second","fractionalSecondDigits","timeZoneName","TraceDetails","props","trace","dateFormatOptionsWithUserTimeZone","dateFormatOptions","dateFormatter","Intl","DateTimeFormat","undefined","rootSpan","rootSpans","direction","sx","justifyContent","variant","resource","serviceName","name","endTimeUnixMs","startTimeUnixMs","component","px","strong","format","traceId"],"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,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAElD,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,cAAc,QAAQ,UAAU;AAGzC,MAAMC,sBAAkD;IACtDC,MAAM;IACNC,OAAO;IACPC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,QAAQ;IACRC,wBAAwB;IACxBC,cAAc;AAChB;AAMA,OAAO,SAASC,aAAaC,KAAwB;IACnD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAElB,MAAM,EAAEE,iCAAiC,EAAE,GAAGd;IAC9C,MAAMe,oBAAoBD,kCAAkCZ;IAC5D,MAAMc,gBAAgB,IAAIC,KAAKC,cAAc,CAACC,WAAWJ;IAEzD,MAAMK,WAAWP,MAAMQ,SAAS,CAAC,EAAE;IACnC,IAAI,CAACD,UAAU;QACb,qBAAO,KAACrB;sBAAW;;IACrB;IAEA,qBACE,MAACD;QAAMwB,WAAU;QAAMC,IAAI;YAAEC,gBAAgB;QAAgB;;0BAC3D,MAACzB;gBAAW0B,SAAQ;;oBACjBL,SAASM,QAAQ,CAACC,WAAW;oBAAC;oBAAGP,SAASQ,IAAI;oBAAC;oBAAG3B,eAAeY,MAAMgB,aAAa,GAAGhB,MAAMiB,eAAe;oBAAE;;;0BAEjH,MAAC/B;gBAAW0B,SAAQ;;kCAClB,MAAC1B;wBAAWgC,WAAU;wBAAOR,IAAI;4BAAES,IAAI;wBAAE;;0CACvC,KAACC;0CAAO;;4BAAe;4BAAEjB,cAAckB,MAAM,CAACrB,MAAMiB,eAAe;;;kCAErE,MAAC/B;wBAAWgC,WAAU;wBAAOR,IAAI;4BAAES,IAAI;wBAAE;;0CACvC,KAACC;0CAAO;;4BAAkB;4BAAEb,SAASe,OAAO;;;;;;;AAKtD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 2024 The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
import { useMemo, useRef, useState } from 'react';
|
|
15
15
|
import { Box, Stack, useTheme } from '@mui/material';
|
|
16
16
|
import { MiniGanttChart } from './MiniGanttChart/MiniGanttChart';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/TracingGanttChart/TracingGanttChart.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, useRef, useState } from 'react';\nimport { Box, Stack, useTheme } from '@mui/material';\nimport { otlptracev1 } from '@perses-dev/core';\nimport { CustomLinks, TracingGanttChartOptions } from '../gantt-chart-model';\nimport { MiniGanttChart } from './MiniGanttChart/MiniGanttChart';\nimport { DetailPane } from './DetailPane/DetailPane';\nimport { Viewport } from './utils';\nimport { GanttTable } from './GanttTable/GanttTable';\nimport { GanttTableProvider } from './GanttTable/GanttTableProvider';\nimport { ResizableDivider } from './GanttTable/ResizableDivider';\nimport { getTraceModel, Span } from './trace';\nimport { TraceDetails } from './TraceDetails';\n\nexport interface TracingGanttChartProps {\n options: TracingGanttChartOptions;\n customLinks?: CustomLinks;\n trace: otlptracev1.TracesData;\n}\n\n/**\n * The core GanttChart panel for Perses.\n *\n * The UI/UX of this panel is based on Jaeger UI, licensed under Apache License, Version 2.0.\n * https://github.com/jaegertracing/jaeger-ui\n */\nexport function TracingGanttChart(props: TracingGanttChartProps): ReactElement {\n const { options, customLinks, trace: otlpTrace } = props;\n\n const theme = useTheme();\n const trace = useMemo(() => {\n try {\n return getTraceModel(otlpTrace);\n } catch (e) {\n throw new Error(`Error: unable to parse trace: ${e}`);\n }\n }, [otlpTrace]);\n const [viewport, setViewport] = useState<Viewport>({\n startTimeUnixMs: trace.startTimeUnixMs,\n endTimeUnixMs: trace.endTimeUnixMs,\n });\n const [selectedSpan, setSelectedSpan] = useState<Span | undefined>(() =>\n options.selectedSpanId ? trace.spanById.get(options.selectedSpanId) : undefined\n );\n\n const ganttChart = useRef<HTMLDivElement>(null);\n // tableWidth only comes to effect if the detail pane is visible.\n // setTableWidth() is only called by <ResizableDivider />\n const [tableWidth, setTableWidth] = useState<number>(0.82);\n const gap = 2;\n\n return (\n <Stack ref={ganttChart} direction=\"row\" sx={{ height: '100%', minHeight: '240px', gap }}>\n <Stack sx={{ flexGrow: 1, gap }}>\n <TraceDetails trace={trace} />\n <MiniGanttChart options={options} trace={trace} viewport={viewport} setViewport={setViewport} />\n <GanttTableProvider>\n <GanttTable\n options={options}\n customLinks={customLinks}\n trace={trace}\n viewport={viewport}\n selectedSpan={selectedSpan}\n onSpanClick={setSelectedSpan}\n />\n </GanttTableProvider>\n </Stack>\n {selectedSpan && (\n <>\n <ResizableDivider parentRef={ganttChart} spacing={parseInt(theme.spacing(gap))} onMove={setTableWidth} />\n <Box style={{ width: `${(1 - tableWidth) * 100}%` }} sx={{ overflow: 'auto' }}>\n <DetailPane\n customLinks={customLinks}\n trace={trace}\n span={selectedSpan}\n onCloseBtnClick={() => setSelectedSpan(undefined)}\n />\n </Box>\n </>\n )}\n </Stack>\n );\n}\n"],"names":["useMemo","useRef","useState","Box","Stack","useTheme","MiniGanttChart","DetailPane","GanttTable","GanttTableProvider","ResizableDivider","getTraceModel","TraceDetails","TracingGanttChart","props","options","customLinks","trace","otlpTrace","theme","e","Error","viewport","setViewport","startTimeUnixMs","endTimeUnixMs","selectedSpan","setSelectedSpan","selectedSpanId","spanById","get","undefined","ganttChart","tableWidth","setTableWidth","gap","ref","direction","sx","height","minHeight","flexGrow","onSpanClick","parentRef","spacing","parseInt","onMove","style","width","overflow","span","onCloseBtnClick"],"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
|
|
1
|
+
{"version":3,"sources":["../../../src/TracingGanttChart/TracingGanttChart.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, useRef, useState } from 'react';\nimport { Box, Stack, useTheme } from '@mui/material';\nimport { otlptracev1 } from '@perses-dev/core';\nimport { CustomLinks, TracingGanttChartOptions } from '../gantt-chart-model';\nimport { MiniGanttChart } from './MiniGanttChart/MiniGanttChart';\nimport { DetailPane } from './DetailPane/DetailPane';\nimport { Viewport } from './utils';\nimport { GanttTable } from './GanttTable/GanttTable';\nimport { GanttTableProvider } from './GanttTable/GanttTableProvider';\nimport { ResizableDivider } from './GanttTable/ResizableDivider';\nimport { getTraceModel, Span } from './trace';\nimport { TraceDetails } from './TraceDetails';\n\nexport interface TracingGanttChartProps {\n options: TracingGanttChartOptions;\n customLinks?: CustomLinks;\n trace: otlptracev1.TracesData;\n}\n\n/**\n * The core GanttChart panel for Perses.\n *\n * The UI/UX of this panel is based on Jaeger UI, licensed under Apache License, Version 2.0.\n * https://github.com/jaegertracing/jaeger-ui\n */\nexport function TracingGanttChart(props: TracingGanttChartProps): ReactElement {\n const { options, customLinks, trace: otlpTrace } = props;\n\n const theme = useTheme();\n const trace = useMemo(() => {\n try {\n return getTraceModel(otlpTrace);\n } catch (e) {\n throw new Error(`Error: unable to parse trace: ${e}`);\n }\n }, [otlpTrace]);\n const [viewport, setViewport] = useState<Viewport>({\n startTimeUnixMs: trace.startTimeUnixMs,\n endTimeUnixMs: trace.endTimeUnixMs,\n });\n const [selectedSpan, setSelectedSpan] = useState<Span | undefined>(() =>\n options.selectedSpanId ? trace.spanById.get(options.selectedSpanId) : undefined\n );\n\n const ganttChart = useRef<HTMLDivElement>(null);\n // tableWidth only comes to effect if the detail pane is visible.\n // setTableWidth() is only called by <ResizableDivider />\n const [tableWidth, setTableWidth] = useState<number>(0.82);\n const gap = 2;\n\n return (\n <Stack ref={ganttChart} direction=\"row\" sx={{ height: '100%', minHeight: '240px', gap }}>\n <Stack sx={{ flexGrow: 1, gap }}>\n <TraceDetails trace={trace} />\n <MiniGanttChart options={options} trace={trace} viewport={viewport} setViewport={setViewport} />\n <GanttTableProvider>\n <GanttTable\n options={options}\n customLinks={customLinks}\n trace={trace}\n viewport={viewport}\n selectedSpan={selectedSpan}\n onSpanClick={setSelectedSpan}\n />\n </GanttTableProvider>\n </Stack>\n {selectedSpan && (\n <>\n <ResizableDivider parentRef={ganttChart} spacing={parseInt(theme.spacing(gap))} onMove={setTableWidth} />\n <Box style={{ width: `${(1 - tableWidth) * 100}%` }} sx={{ overflow: 'auto' }}>\n <DetailPane\n customLinks={customLinks}\n trace={trace}\n span={selectedSpan}\n onCloseBtnClick={() => setSelectedSpan(undefined)}\n />\n </Box>\n </>\n )}\n </Stack>\n );\n}\n"],"names":["useMemo","useRef","useState","Box","Stack","useTheme","MiniGanttChart","DetailPane","GanttTable","GanttTableProvider","ResizableDivider","getTraceModel","TraceDetails","TracingGanttChart","props","options","customLinks","trace","otlpTrace","theme","e","Error","viewport","setViewport","startTimeUnixMs","endTimeUnixMs","selectedSpan","setSelectedSpan","selectedSpanId","spanById","get","undefined","ganttChart","tableWidth","setTableWidth","gap","ref","direction","sx","height","minHeight","flexGrow","onSpanClick","parentRef","spacing","parseInt","onMove","style","width","overflow","span","onCloseBtnClick"],"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,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAChE,SAASC,GAAG,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,gBAAgB;AAGrD,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,UAAU,QAAQ,0BAA0B;AAErD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B,aAAaf;;;;;YAIlBD,8BACC;;kCACE,KAAChB;wBAAiBiC,WAAWX;wBAAYY,SAASC,SAAS1B,MAAMyB,OAAO,CAACT;wBAAOW,QAAQZ;;kCACxF,KAAC/B;wBAAI4C,OAAO;4BAAEC,OAAO,GAAG,AAAC,CAAA,IAAIf,UAAS,IAAK,IAAI,CAAC,CAAC;wBAAC;wBAAGK,IAAI;4BAAEW,UAAU;wBAAO;kCAC1E,cAAA,KAAC1C;4BACCS,aAAaA;4BACbC,OAAOA;4BACPiC,MAAMxB;4BACNyB,iBAAiB,IAAMxB,gBAAgBI;;;;;;;AAOrD"}
|
package/lib/bootstrap.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
// Copyright 2024 The Perses Authors
|
|
2
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -10,7 +11,6 @@
|
|
|
10
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
12
|
// See the License for the specific language governing permissions and
|
|
12
13
|
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import ReactDOM from 'react-dom/client';
|
|
16
16
|
const root = ReactDOM.createRoot(document.getElementById('root'));
|
package/lib/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bootstrap.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 React from 'react';\nimport ReactDOM from 'react-dom/client';\n\nconst root = ReactDOM.createRoot(document.getElementById('root')!);\nroot.render(<React.StrictMode></React.StrictMode>);\n"],"names":["React","ReactDOM","root","createRoot","document","getElementById","render","StrictMode"],"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
|
|
1
|
+
{"version":3,"sources":["../../src/bootstrap.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 React from 'react';\nimport ReactDOM from 'react-dom/client';\n\nconst root = ReactDOM.createRoot(document.getElementById('root')!);\nroot.render(<React.StrictMode></React.StrictMode>);\n"],"names":["React","ReactDOM","root","createRoot","document","getElementById","render","StrictMode"],"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,OAAOA,WAAW,QAAQ;AAC1B,OAAOC,cAAc,mBAAmB;AAExC,MAAMC,OAAOD,SAASE,UAAU,CAACC,SAASC,cAAc,CAAC;AACzDH,KAAKI,MAAM,eAAC,KAACN,MAAMO,UAAU"}
|
package/lib/cjs/PanelActions.js
CHANGED
|
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
DownloadTraceAction
|
|
24
|
+
get DownloadTraceAction () {
|
|
25
25
|
return DownloadTraceAction;
|
|
26
26
|
},
|
|
27
|
-
getFilename
|
|
27
|
+
get getFilename () {
|
|
28
28
|
return getFilename;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -17,20 +17,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
AttributeItem
|
|
24
|
+
get AttributeItem () {
|
|
25
25
|
return AttributeItem;
|
|
26
26
|
},
|
|
27
|
-
AttributeItems
|
|
27
|
+
get AttributeItems () {
|
|
28
28
|
return AttributeItems;
|
|
29
29
|
},
|
|
30
|
-
AttributeList
|
|
30
|
+
get AttributeList () {
|
|
31
31
|
return AttributeList;
|
|
32
32
|
},
|
|
33
|
-
TraceAttributes
|
|
33
|
+
get TraceAttributes () {
|
|
34
34
|
return TraceAttributes;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
@@ -17,17 +17,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
GanttTableContext
|
|
24
|
+
get GanttTableContext () {
|
|
25
25
|
return GanttTableContext;
|
|
26
26
|
},
|
|
27
|
-
GanttTableProvider
|
|
27
|
+
get GanttTableProvider () {
|
|
28
28
|
return GanttTableProvider;
|
|
29
29
|
},
|
|
30
|
-
useGanttTableContext
|
|
30
|
+
get useGanttTableContext () {
|
|
31
31
|
return useGanttTableContext;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
Ticks
|
|
24
|
+
get Ticks () {
|
|
25
25
|
return Ticks;
|
|
26
26
|
},
|
|
27
|
-
TicksHeader
|
|
27
|
+
get TicksHeader () {
|
|
28
28
|
return TicksHeader;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
getConsistentCategoricalColor
|
|
24
|
+
get getConsistentCategoricalColor () {
|
|
25
25
|
return getConsistentCategoricalColor;
|
|
26
26
|
},
|
|
27
|
-
getConsistentColor
|
|
27
|
+
get getConsistentColor () {
|
|
28
28
|
return getConsistentColor;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -17,26 +17,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
17
17
|
function _export(target, all) {
|
|
18
18
|
for(var name in all)Object.defineProperty(target, name, {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: all
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
formatDuration
|
|
24
|
+
get formatDuration () {
|
|
25
25
|
return formatDuration;
|
|
26
26
|
},
|
|
27
|
-
getServiceColor
|
|
27
|
+
get getServiceColor () {
|
|
28
28
|
return getServiceColor;
|
|
29
29
|
},
|
|
30
|
-
getSpanColor
|
|
30
|
+
get getSpanColor () {
|
|
31
31
|
return getSpanColor;
|
|
32
32
|
},
|
|
33
|
-
minSpanWidthPx
|
|
33
|
+
get minSpanWidthPx () {
|
|
34
34
|
return minSpanWidthPx;
|
|
35
35
|
},
|
|
36
|
-
rowHeight
|
|
36
|
+
get rowHeight () {
|
|
37
37
|
return rowHeight;
|
|
38
38
|
},
|
|
39
|
-
spanHasError
|
|
39
|
+
get spanHasError () {
|
|
40
40
|
return spanHasError;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -1,15 +1,3 @@
|
|
|
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
1
|
"use strict";
|
|
14
2
|
function _getRequireWildcardCache(nodeInterop) {
|
|
15
3
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -52,4 +40,16 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
52
40
|
}
|
|
53
41
|
return newObj;
|
|
54
42
|
}
|
|
43
|
+
// Copyright 2024 The Perses Authors
|
|
44
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
45
|
+
// you may not use this file except in compliance with the License.
|
|
46
|
+
// You may obtain a copy of the License at
|
|
47
|
+
//
|
|
48
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
49
|
+
//
|
|
50
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
51
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
52
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
53
|
+
// See the License for the specific language governing permissions and
|
|
54
|
+
// limitations under the License.
|
|
55
55
|
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "TracingGanttChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.
|
|
8
|
+
"buildVersion": "0.12.0-beta.0",
|
|
9
9
|
"buildName": "@perses-dev/tracing-gantt-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/TracingGanttChart.
|
|
12
|
+
"name": "__mf/js/TracingGanttChart.f1ef6924.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"api": ""
|
|
21
21
|
},
|
|
22
22
|
"globalName": "TracingGanttChart",
|
|
23
|
-
"pluginVersion": "0.
|
|
23
|
+
"pluginVersion": "0.21.6",
|
|
24
24
|
"prefetchInterface": false,
|
|
25
25
|
"getPublicPath": "function() { const prefix = window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\"; return prefix + \"/plugins/TracingGanttChart/\"; }"
|
|
26
26
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"js": {
|
|
36
36
|
"async": [],
|
|
37
37
|
"sync": [
|
|
38
|
-
"__mf/js/async/
|
|
38
|
+
"__mf/js/async/274.457dda65.js"
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
41
|
"css": {
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"js": {
|
|
55
55
|
"async": [],
|
|
56
56
|
"sync": [
|
|
57
|
-
"__mf/js/async/
|
|
58
|
-
"__mf/js/async/
|
|
57
|
+
"__mf/js/async/235.806ca841.js",
|
|
58
|
+
"__mf/js/async/616.25399954.js"
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
61
|
"css": {
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"js": {
|
|
75
75
|
"async": [],
|
|
76
76
|
"sync": [
|
|
77
|
-
"__mf/js/async/
|
|
78
|
-
"__mf/js/async/
|
|
77
|
+
"__mf/js/async/587.3a4d8eed.js",
|
|
78
|
+
"__mf/js/async/968.5f7ccf5e.js"
|
|
79
79
|
]
|
|
80
80
|
},
|
|
81
81
|
"css": {
|
|
@@ -87,14 +87,14 @@
|
|
|
87
87
|
{
|
|
88
88
|
"id": "TracingGanttChart:@perses-dev/components",
|
|
89
89
|
"name": "@perses-dev/components",
|
|
90
|
-
"version": "0.53.0-beta.
|
|
90
|
+
"version": "0.53.0-beta.4",
|
|
91
91
|
"singleton": true,
|
|
92
|
-
"requiredVersion": "^0.53.0-beta.
|
|
92
|
+
"requiredVersion": "^0.53.0-beta.4",
|
|
93
93
|
"assets": {
|
|
94
94
|
"js": {
|
|
95
95
|
"async": [],
|
|
96
96
|
"sync": [
|
|
97
|
-
"__mf/js/async/
|
|
97
|
+
"__mf/js/async/622.632bfcaa.js"
|
|
98
98
|
]
|
|
99
99
|
},
|
|
100
100
|
"css": {
|
|
@@ -106,14 +106,14 @@
|
|
|
106
106
|
{
|
|
107
107
|
"id": "TracingGanttChart:@perses-dev/plugin-system",
|
|
108
108
|
"name": "@perses-dev/plugin-system",
|
|
109
|
-
"version": "0.53.0-beta.
|
|
109
|
+
"version": "0.53.0-beta.4",
|
|
110
110
|
"singleton": true,
|
|
111
|
-
"requiredVersion": "^0.53.0-beta.
|
|
111
|
+
"requiredVersion": "^0.53.0-beta.4",
|
|
112
112
|
"assets": {
|
|
113
113
|
"js": {
|
|
114
114
|
"async": [],
|
|
115
115
|
"sync": [
|
|
116
|
-
"__mf/js/async/
|
|
116
|
+
"__mf/js/async/252.0e9814ef.js"
|
|
117
117
|
]
|
|
118
118
|
},
|
|
119
119
|
"css": {
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"js": {
|
|
133
133
|
"async": [],
|
|
134
134
|
"sync": [
|
|
135
|
-
"__mf/js/async/
|
|
135
|
+
"__mf/js/async/192.f723a636.js"
|
|
136
136
|
]
|
|
137
137
|
},
|
|
138
138
|
"css": {
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"js": {
|
|
152
152
|
"async": [],
|
|
153
153
|
"sync": [
|
|
154
|
-
"__mf/js/async/
|
|
154
|
+
"__mf/js/async/873.0f298220.js"
|
|
155
155
|
]
|
|
156
156
|
},
|
|
157
157
|
"css": {
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"js": {
|
|
171
171
|
"async": [],
|
|
172
172
|
"sync": [
|
|
173
|
-
"__mf/js/async/
|
|
173
|
+
"__mf/js/async/392.6a9270a8.js"
|
|
174
174
|
]
|
|
175
175
|
},
|
|
176
176
|
"css": {
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"js": {
|
|
190
190
|
"async": [],
|
|
191
191
|
"sync": [
|
|
192
|
-
"__mf/js/async/
|
|
192
|
+
"__mf/js/async/470.f5dfd429.js"
|
|
193
193
|
]
|
|
194
194
|
},
|
|
195
195
|
"css": {
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
"js": {
|
|
209
209
|
"async": [],
|
|
210
210
|
"sync": [
|
|
211
|
-
"__mf/js/async/
|
|
211
|
+
"__mf/js/async/121.cb300887.js"
|
|
212
212
|
]
|
|
213
213
|
},
|
|
214
214
|
"css": {
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
"js": {
|
|
228
228
|
"async": [],
|
|
229
229
|
"sync": [
|
|
230
|
-
"__mf/js/async/
|
|
230
|
+
"__mf/js/async/978.151ab551.js"
|
|
231
231
|
]
|
|
232
232
|
},
|
|
233
233
|
"css": {
|
|
@@ -245,27 +245,27 @@
|
|
|
245
245
|
"assets": {
|
|
246
246
|
"js": {
|
|
247
247
|
"sync": [
|
|
248
|
-
"__mf/js/async/
|
|
249
|
-
"__mf/js/async/
|
|
250
|
-
"__mf/js/async/
|
|
251
|
-
"__mf/js/async/
|
|
252
|
-
"__mf/js/async/__federation_expose_TracingGanttChart.
|
|
248
|
+
"__mf/js/async/986.56030b97.js",
|
|
249
|
+
"__mf/js/async/728.b805adfd.js",
|
|
250
|
+
"__mf/js/async/953.c4774074.js",
|
|
251
|
+
"__mf/js/async/557.d2605567.js",
|
|
252
|
+
"__mf/js/async/__federation_expose_TracingGanttChart.eeb93a1d.js"
|
|
253
253
|
],
|
|
254
254
|
"async": [
|
|
255
|
-
"__mf/js/async/
|
|
256
|
-
"__mf/js/async/
|
|
257
|
-
"__mf/js/async/
|
|
258
|
-
"__mf/js/async/
|
|
259
|
-
"__mf/js/async/
|
|
260
|
-
"__mf/js/async/lib-router.
|
|
261
|
-
"__mf/js/async/
|
|
255
|
+
"__mf/js/async/588.a1fce2da.js",
|
|
256
|
+
"__mf/js/async/71.ec1919d7.js",
|
|
257
|
+
"__mf/js/async/356.7ea3eee9.js",
|
|
258
|
+
"__mf/js/async/43.55c495e3.js",
|
|
259
|
+
"__mf/js/async/754.2f82ce32.js",
|
|
260
|
+
"__mf/js/async/lib-router.1f330b2a.js",
|
|
261
|
+
"__mf/js/async/177.cf9df204.js"
|
|
262
262
|
]
|
|
263
263
|
},
|
|
264
264
|
"css": {
|
|
265
265
|
"sync": [],
|
|
266
266
|
"async": [
|
|
267
|
-
"__mf/css/async/
|
|
268
|
-
"__mf/css/async/
|
|
267
|
+
"__mf/css/async/61.d3010b86.css",
|
|
268
|
+
"__mf/css/async/823.d3010b86.css"
|
|
269
269
|
]
|
|
270
270
|
}
|
|
271
271
|
},
|