@perses-dev/tracing-gantt-chart-plugin 0.10.0 → 0.11.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/css/async/263.d3010b86.css +1 -0
- package/__mf/css/async/341.d3010b86.css +1 -0
- package/__mf/css/async/759.d3010b86.css +1 -0
- package/__mf/js/{TracingGanttChart.b94e3f55.js → TracingGanttChart.4febbfb4.js} +3 -3
- package/__mf/js/async/{623.cd606b20.js → 177.ab9a582b.js} +6 -6
- package/__mf/js/async/{238.5c460cb2.js → 238.813da7cb.js} +1 -1
- package/__mf/js/async/63.0b6a8d45.js +39 -0
- package/__mf/js/async/711.1f4a48d0.js +22 -0
- package/__mf/js/async/{75.a3a29681.js → 75.4d502b5c.js} +1 -1
- package/__mf/js/async/783.976dc72b.js +1 -0
- package/__mf/js/async/813.de2c52ae.js +7 -0
- package/__mf/js/async/{897.f1628ec5.js → 971.0902cbf8.js} +1 -1
- package/__mf/js/async/__federation_expose_TracingGanttChart.13966d2e.js +1 -0
- package/__mf/js/{main.15b4550c.js → main.685d41e3.js} +3 -3
- package/lib/TracingGanttChart/DetailPane/Attributes.js +7 -3
- package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js +1 -1
- package/lib/TracingGanttChart/GanttTable/ResizableDivider.js.map +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js +1 -1
- package/lib/TracingGanttChart/MiniGanttChart/Canvas.js.map +1 -1
- package/lib/TracingGanttChart/TracingGanttChart.js +3 -1
- package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -1
- package/lib/cjs/TracingGanttChart/DetailPane/Attributes.js +7 -3
- package/lib/cjs/TracingGanttChart/GanttTable/ResizableDivider.js +3 -3
- package/lib/cjs/TracingGanttChart/MiniGanttChart/Canvas.js +3 -3
- package/lib/cjs/TracingGanttChart/TracingGanttChart.js +3 -1
- package/mf-manifest.json +17 -17
- package/mf-stats.json +17 -17
- package/package.json +4 -4
- package/__mf/css/async/263.6c6463ea.css +0 -1
- package/__mf/css/async/341.6c6463ea.css +0 -1
- package/__mf/css/async/759.6c6463ea.css +0 -1
- package/__mf/js/async/109.c4d43a49.js +0 -73
- package/__mf/js/async/387.23da505f.js +0 -1
- package/__mf/js/async/706.087513a7.js +0 -39
- package/__mf/js/async/854.45948aa2.js +0 -7
- package/__mf/js/async/__federation_expose_TracingGanttChart.0037e7cb.js +0 -1
- /package/__mf/js/async/{623.cd606b20.js.LICENSE.txt → 177.ab9a582b.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{706.087513a7.js.LICENSE.txt → 63.0b6a8d45.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{109.c4d43a49.js.LICENSE.txt → 711.1f4a48d0.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{854.45948aa2.js.LICENSE.txt → 813.de2c52ae.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/DetailPane/Attributes.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { Divider, Link, List, ListItem, ListItemText } from '@mui/material';\nimport { otlpcommonv1 } from '@perses-dev/core';\nimport { replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system';\nimport { Span, Trace } from '../trace';\nimport { formatDuration } from '../utils';\nimport { CustomLinks } from '../../gantt-chart-model';\n\nexport interface TraceAttributesProps {\n customLinks?: CustomLinks;\n trace: Trace;\n span: Span;\n}\n\nexport function TraceAttributes(props: TraceAttributesProps) {\n const { customLinks, trace, span } = props;\n\n return (\n <>\n <List>\n <AttributeItem name=\"span ID\" value={span.spanId} />\n <AttributeItem name=\"start\" value={formatDuration(span.startTimeUnixMs - trace.startTimeUnixMs)} />\n <AttributeItem name=\"duration\" value={formatDuration(span.endTimeUnixMs - span.startTimeUnixMs)} />\n </List>\n <Divider />\n {span.attributes.length > 0 && (\n <>\n <AttributeList\n customLinks={customLinks}\n attributes={span.attributes.toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n <Divider />\n </>\n )}\n <AttributeList\n customLinks={customLinks}\n attributes={span.resource.attributes.toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n </>\n );\n}\n\nexport interface AttributeListProps {\n customLinks?: CustomLinks;\n attributes: otlpcommonv1.KeyValue[];\n}\n\nexport function AttributeList(props: AttributeListProps): ReactElement {\n const { customLinks, attributes } = props;\n\n return (\n <List>\n <AttributeItems customLinks={customLinks} attributes={attributes} />\n </List>\n );\n}\n\ninterface AttributeItemsProps {\n customLinks?: CustomLinks;\n attributes: otlpcommonv1.KeyValue[];\n}\n\nexport function AttributeItems(props: AttributeItemsProps): ReactElement {\n const { customLinks, attributes } = props;\n const variableValues = useAllVariableValues();\n\n // turn array into map for fast access\n const attributeLinks = useMemo(() => {\n const attrs = (customLinks?.links.attributes ?? []).map((a) => [a.name, a.link]);\n return Object.fromEntries(attrs);\n }, [customLinks]);\n\n // some links require access to other attributes, for example a pod link \"/namespace/${k8s_namespace_name}/pod/${k8s_pod_name}\"\n const extraVariables = useMemo(() => {\n // replace dot with underscore in attribute name, because dot is not allowed in variable names\n const stringAttrs = attributes.map((attr) => [attr.key.replaceAll('.', '_'), renderAttributeValue(attr.value)]);\n\n return {\n ...customLinks?.variables,\n ...Object.fromEntries(stringAttrs),\n };\n }, [customLinks, attributes]);\n\n return (\n <>\n {attributes.map((attribute, i) => (\n <AttributeItem\n key={i}\n name={attribute.key}\n value={renderAttributeValue(attribute.value)}\n link={\n attributeLinks[attribute.key]\n ? replaceVariablesInString(attributeLinks[attribute.key], variableValues, extraVariables)\n : undefined\n }\n />\n ))}\n </>\n );\n}\n\ninterface AttributeItemProps {\n name: string;\n value: string;\n link?: string;\n}\n\nexport function AttributeItem(props: AttributeItemProps): ReactElement {\n const { name, value, link } = props;\n const { RouterComponent } = useRouterContext();\n\n const valueComponent =\n RouterComponent && link ? (\n <Link component={RouterComponent} to={link}>\n {value}\n </Link>\n ) : (\n value\n );\n\n return (\n <ListItem sx={{ px: 1, py: 0 }}>\n <ListItemText\n primary={name}\n secondary={valueComponent}\n slotProps={{\n primary: { variant: 'h5' },\n secondary: { variant: 'body1', sx: { wordBreak: 'break-word' } },\n }}\n />\n </ListItem>\n );\n}\n\nfunction renderAttributeValue(value: otlpcommonv1.AnyValue): string {\n if ('stringValue' in value) return value.stringValue
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/DetailPane/Attributes.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { Divider, Link, List, ListItem, ListItemText } from '@mui/material';\nimport { otlpcommonv1 } from '@perses-dev/core';\nimport { replaceVariablesInString, useAllVariableValues, useRouterContext } from '@perses-dev/plugin-system';\nimport { Span, Trace } from '../trace';\nimport { formatDuration } from '../utils';\nimport { CustomLinks } from '../../gantt-chart-model';\n\nexport interface TraceAttributesProps {\n customLinks?: CustomLinks;\n trace: Trace;\n span: Span;\n}\n\nexport function TraceAttributes(props: TraceAttributesProps) {\n const { customLinks, trace, span } = props;\n\n return (\n <>\n <List>\n <AttributeItem name=\"span ID\" value={span.spanId} />\n <AttributeItem name=\"start\" value={formatDuration(span.startTimeUnixMs - trace.startTimeUnixMs)} />\n <AttributeItem name=\"duration\" value={formatDuration(span.endTimeUnixMs - span.startTimeUnixMs)} />\n </List>\n <Divider />\n {span.attributes.length > 0 && (\n <>\n <AttributeList\n customLinks={customLinks}\n attributes={span.attributes.toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n <Divider />\n </>\n )}\n <AttributeList\n customLinks={customLinks}\n attributes={span.resource.attributes.toSorted((a, b) => a.key.localeCompare(b.key))}\n />\n </>\n );\n}\n\nexport interface AttributeListProps {\n customLinks?: CustomLinks;\n attributes: otlpcommonv1.KeyValue[];\n}\n\nexport function AttributeList(props: AttributeListProps): ReactElement {\n const { customLinks, attributes } = props;\n\n return (\n <List>\n <AttributeItems customLinks={customLinks} attributes={attributes} />\n </List>\n );\n}\n\ninterface AttributeItemsProps {\n customLinks?: CustomLinks;\n attributes: otlpcommonv1.KeyValue[];\n}\n\nexport function AttributeItems(props: AttributeItemsProps): ReactElement {\n const { customLinks, attributes } = props;\n const variableValues = useAllVariableValues();\n\n // turn array into map for fast access\n const attributeLinks = useMemo(() => {\n const attrs = (customLinks?.links.attributes ?? []).map((a) => [a.name, a.link]);\n return Object.fromEntries(attrs);\n }, [customLinks]);\n\n // some links require access to other attributes, for example a pod link \"/namespace/${k8s_namespace_name}/pod/${k8s_pod_name}\"\n const extraVariables = useMemo(() => {\n // replace dot with underscore in attribute name, because dot is not allowed in variable names\n const stringAttrs = attributes.map((attr) => [attr.key.replaceAll('.', '_'), renderAttributeValue(attr.value)]);\n\n return {\n ...customLinks?.variables,\n ...Object.fromEntries(stringAttrs),\n };\n }, [customLinks, attributes]);\n\n return (\n <>\n {attributes.map((attribute, i) => (\n <AttributeItem\n key={i}\n name={attribute.key}\n value={renderAttributeValue(attribute.value)}\n link={\n attributeLinks[attribute.key]\n ? replaceVariablesInString(attributeLinks[attribute.key], variableValues, extraVariables)\n : undefined\n }\n />\n ))}\n </>\n );\n}\n\ninterface AttributeItemProps {\n name: string;\n value: string;\n link?: string;\n}\n\nexport function AttributeItem(props: AttributeItemProps): ReactElement {\n const { name, value, link } = props;\n const { RouterComponent } = useRouterContext();\n\n const valueComponent =\n RouterComponent && link ? (\n <Link component={RouterComponent} to={link}>\n {value}\n </Link>\n ) : (\n value\n );\n\n return (\n <ListItem sx={{ px: 1, py: 0 }}>\n <ListItemText\n primary={name}\n secondary={valueComponent}\n slotProps={{\n primary: { variant: 'h5' },\n secondary: { variant: 'body1', sx: { wordBreak: 'break-word' } },\n }}\n />\n </ListItem>\n );\n}\n\nfunction renderAttributeValue(value: otlpcommonv1.AnyValue): string {\n if ('stringValue' in value) return value.stringValue || '<empty string>';\n if ('intValue' in value) return value.intValue;\n if ('doubleValue' in value) return String(value.doubleValue);\n if ('boolValue' in value) return String(value.boolValue);\n if ('arrayValue' in value) {\n const values = value.arrayValue.values;\n return values && values.length > 0 ? values.map(renderAttributeValue).join(', ') : '<empty array>';\n }\n return 'unknown';\n}\n"],"names":["useMemo","Divider","Link","List","ListItem","ListItemText","replaceVariablesInString","useAllVariableValues","useRouterContext","formatDuration","TraceAttributes","props","customLinks","trace","span","AttributeItem","name","value","spanId","startTimeUnixMs","endTimeUnixMs","attributes","length","AttributeList","toSorted","a","b","key","localeCompare","resource","AttributeItems","variableValues","attributeLinks","attrs","links","map","link","Object","fromEntries","extraVariables","stringAttrs","attr","replaceAll","renderAttributeValue","variables","attribute","i","undefined","RouterComponent","valueComponent","component","to","sx","px","py","primary","secondary","slotProps","variant","wordBreak","stringValue","intValue","String","doubleValue","boolValue","values","arrayValue","join"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEj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W;gBACTF,SAAS;oBAAEG,SAAS;gBAAK;gBACzBF,WAAW;oBAAEE,SAAS;oBAASN,IAAI;wBAAEO,WAAW;oBAAa;gBAAE;YACjE;;;AAIR;AAEA,SAAShB,qBAAqB1B,KAA4B;IACxD,IAAI,iBAAiBA,OAAO,OAAOA,MAAM2C,WAAW,IAAI;IACxD,IAAI,cAAc3C,OAAO,OAAOA,MAAM4C,QAAQ;IAC9C,IAAI,iBAAiB5C,OAAO,OAAO6C,OAAO7C,MAAM8C,WAAW;IAC3D,IAAI,eAAe9C,OAAO,OAAO6C,OAAO7C,MAAM+C,SAAS;IACvD,IAAI,gBAAgB/C,OAAO;QACzB,MAAMgD,SAAShD,MAAMiD,UAAU,CAACD,MAAM;QACtC,OAAOA,UAAUA,OAAO3C,MAAM,GAAG,IAAI2C,OAAO9B,GAAG,CAACQ,sBAAsBwB,IAAI,CAAC,QAAQ;IACrF;IACA,OAAO;AACT"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { useEffect, useState } from 'react';
|
|
15
15
|
import { Box, styled } from '@mui/material';
|
|
16
|
-
import { useEvent } from '@perses-dev/
|
|
16
|
+
import { useEvent } from '@perses-dev/plugin-system';
|
|
17
17
|
export function ResizableDivider(props) {
|
|
18
18
|
const { parentRef, spacing = 0, onMove } = props;
|
|
19
19
|
const [isResizing, setResizing] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/ResizableDivider.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 { MouseEvent as ReactMouseEvent, ReactElement, useEffect, useState } from 'react';\nimport { Box, styled } from '@mui/material';\nimport { useEvent } from '@perses-dev/
|
|
1
|
+
{"version":3,"sources":["../../../../src/TracingGanttChart/GanttTable/ResizableDivider.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 { 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 - parentRef.current.getBoundingClientRect().left + spacing;\n const leftPercent = offsetX / parentRef.current.getBoundingClientRect().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 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","offsetX","clientX","getBoundingClientRect","left","leftPercent","width","handleMouseUp","startMouseAction","window","addEventListener","document","body","style","cursor","stopMouseAction","removeEventListener","stopEventPropagation","stopPropagation","ResizableDividerBox","onMouseDown","onClick","theme","position","height","backgroundColor","palette","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,SAAsDA,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AACzF,SAASC,GAAG,EAAEC,MAAM,QAAQ,gBAAgB;AAC5C,SAASC,QAAQ,QAAQ,4BAA4B;AAQrD,OAAO,SAASC,iBAAiBC,KAA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AAQ;QACRC,iBAAiBH,MAAMI,OAAO,CAACC,OAAO;QACtCb,QAAQ;QAER,0CAA0C;QAC1C,YAAY;YACVS,UAAU;YACVjB,OAAO;YACPF,MAAM;YACNwB,KAAK;YACLC,QAAQ;YACRC,SAAS;YACTC,QAAQ;QACV;IACF,CAAA"}
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import { Box, styled, useTheme } from '@mui/material';
|
|
15
15
|
import useResizeObserver from 'use-resize-observer';
|
|
16
16
|
import { useEffect, useRef, useState, useCallback } from 'react';
|
|
17
|
-
import { useEvent } from '@perses-dev/
|
|
17
|
+
import { useEvent } from '@perses-dev/plugin-system';
|
|
18
18
|
import { useChartsTheme } from '@perses-dev/components';
|
|
19
19
|
import { Ticks } from '../Ticks';
|
|
20
20
|
import { getSpanColor } from '../utils';
|
|
@@ -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/core';\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,SAASA,GAAG,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,gBAAgB;AACtD,OAAOC,uBAAuB,sBAAsB;AACpD,SAASC,SAAS,EAAEC,MAAM,EAAiCC,QAAQ,EAAEC,WAAW,QAAsB,QAAQ;AAC9G,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,KAAK,QAAQ,WAAW;AACjC,SAASC,YAAY,QAAkB,WAAW;AAGlD,SAASC,SAAS,QAAQ,SAAS;AAEnC,MAAMC,gBAAgB;AActB,OAAO,SAASC,OAAOC,KAAkB;IACvC,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,EAAE,GAAGJ;IAClD,MAAMK,WAAWlB;IACjB,MAAMmB,cAAcZ;IACpB,0FAA0F;IAC1F,uFAAuF;IACvF,MAAM,EAAEa,KAAK,EAAEC,KAAKC,UAAU,EAAE,GAAGrB;IACnC,MAAMsB,SAASZ;IACf,MAAMa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C,CAAC;gBAAC;;0BACzF,KAACgD;gBAAQD,aAAU;gBAAcR,OAAO;oBAAExB,MAAM,GAAGf,qBAAqB,IAAI,CAAC,CAAC;gBAAC;;0BAC/E,KAACgD;gBAAQD,aAAU;gBAAeR,OAAO;oBAAEU,OAAO,GAAGhD,sBAAsB,IAAI,CAAC,CAAC;gBAAC;;0BAClF,KAAC6C;gBAAUC,aAAU;gBAAYR,OAAO;oBAAEU,OAAO;oBAAG5D,OAAO,GAAGY,sBAAsB,IAAI,CAAC,CAAC;gBAAC;;;;AAGjG;AAEA,MAAM6C,YAAY9E,OAAOD,KAAK;IAC5B4E,UAAU;IACVnD,QAAQ;IACR0D,iBAAiB;AACnB;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
|
+
{"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,SAASA,GAAG,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,gBAAgB;AACtD,OAAOC,uBAAuB,sBAAsB;AACpD,SAASC,SAAS,EAAEC,MAAM,EAAiCC,QAAQ,EAAEC,WAAW,QAAsB,QAAQ;AAC9G,SAASC,QAAQ,QAAQ,4BAA4B;AACrD,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,KAAK,QAAQ,WAAW;AACjC,SAASC,YAAY,QAAkB,WAAW;AAGlD,SAASC,SAAS,QAAQ,SAAS;AAEnC,MAAMC,gBAAgB;AActB,OAAO,SAASC,OAAOC,KAAkB;IACvC,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,EAAE,G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OAAOA;gBAAOG,QAAQA;gBAAQ+C,OAAO;oBAAEI,UAAU;gBAAW;;0BACpF,KAAClE;0BACD,KAACqE;gBAAUC,aAAU;gBAAYR,OAAO;oBAAExB,MAAM;oBAAG1B,OAAO,GAAGW,qBAAqB,IAAI,CAAC,CAAC;gBAAC;;0BACzF,KAACgD;gBAAQD,aAAU;gBAAcR,OAAO;oBAAExB,MAAM,GAAGf,qBAAqB,IAAI,CAAC,CAAC;gBAAC;;0BAC/E,KAACgD;gBAAQD,aAAU;gBAAeR,OAAO;oBAAEU,OAAO,GAAGhD,sBAAsB,IAAI,CAAC,CAAC;gBAAC;;0BAClF,KAAC6C;gBAAUC,aAAU;gBAAYR,OAAO;oBAAEU,OAAO;oBAAG5D,OAAO,GAAGY,sBAAsB,IAAI,CAAC,CAAC;gBAAC;;;;AAGjG;AAEA,MAAM6C,YAAY9E,OAAOD,KAAK;IAC5B4E,UAAU;IACVnD,QAAQ;IACR0D,iBAAiB;AACnB;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"}
|
|
@@ -91,8 +91,10 @@ import { TraceDetails } from './TraceDetails';
|
|
|
91
91
|
onMove: setTableWidth
|
|
92
92
|
}),
|
|
93
93
|
/*#__PURE__*/ _jsx(Box, {
|
|
94
|
+
style: {
|
|
95
|
+
width: `${(1 - tableWidth) * 100}%`
|
|
96
|
+
},
|
|
94
97
|
sx: {
|
|
95
|
-
width: `${(1 - tableWidth) * 100}%`,
|
|
96
98
|
overflow: 'auto'
|
|
97
99
|
},
|
|
98
100
|
children: /*#__PURE__*/ _jsx(DetailPane, {
|
|
@@ -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
|
|
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,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,aAAa,QAAc,UAAU;AAC9C,SAASC,YAAY,QAAQ,iBAAiB;AAQ9C;;;;;CAKC,GACD,OAAO,SAASC,kBAAkBC,KAA6B;IAC7D,MAAM,EAAEC,OAAO,EAAEC,WAAW,EAAEC,OAAOC,SAAS,EAAE,GAAGJ;IAEnD,MAAMK,QAAQd;IACd,MAAMY,QAAQjB,QAAQ;QACpB,IAAI;YACF,OAAOW,cAAcO;QACvB,EAAE,OAAOE,GAAG;YACV,MA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 @@ function AttributeItem(props) {
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
function renderAttributeValue(value) {
|
|
155
|
-
if ('stringValue' in value) return value.stringValue
|
|
155
|
+
if ('stringValue' in value) return value.stringValue || '<empty string>';
|
|
156
156
|
if ('intValue' in value) return value.intValue;
|
|
157
|
-
if ('
|
|
158
|
-
if ('
|
|
157
|
+
if ('doubleValue' in value) return String(value.doubleValue);
|
|
158
|
+
if ('boolValue' in value) return String(value.boolValue);
|
|
159
|
+
if ('arrayValue' in value) {
|
|
160
|
+
const values = value.arrayValue.values;
|
|
161
|
+
return values && values.length > 0 ? values.map(renderAttributeValue).join(', ') : '<empty array>';
|
|
162
|
+
}
|
|
159
163
|
return 'unknown';
|
|
160
164
|
}
|
|
@@ -23,7 +23,7 @@ Object.defineProperty(exports, "ResizableDivider", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _react = require("react");
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
|
-
const
|
|
26
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
function ResizableDivider(props) {
|
|
28
28
|
const { parentRef, spacing = 0, onMove } = props;
|
|
29
29
|
const [isResizing, setResizing] = (0, _react.useState)(false);
|
|
@@ -33,7 +33,7 @@ function ResizableDivider(props) {
|
|
|
33
33
|
setResizing(true);
|
|
34
34
|
};
|
|
35
35
|
// need stable reference for window.removeEventListener() in useEffect() below
|
|
36
|
-
const handleMouseMove = (0,
|
|
36
|
+
const handleMouseMove = (0, _pluginsystem.useEvent)((e)=>{
|
|
37
37
|
if (!parentRef.current) return;
|
|
38
38
|
const offsetX = e.clientX - parentRef.current.getBoundingClientRect().left + spacing;
|
|
39
39
|
const leftPercent = offsetX / parentRef.current.getBoundingClientRect().width;
|
|
@@ -42,7 +42,7 @@ function ResizableDivider(props) {
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
// need stable reference for window.removeEventListener() in useEffect() below
|
|
45
|
-
const handleMouseUp = (0,
|
|
45
|
+
const handleMouseUp = (0, _pluginsystem.useEvent)(()=>{
|
|
46
46
|
setResizing(false);
|
|
47
47
|
});
|
|
48
48
|
// capture mouseMove and mouseUp outside the element by attaching them to the window object
|
|
@@ -24,7 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _useresizeobserver = /*#__PURE__*/ _interop_require_default(require("use-resize-observer"));
|
|
26
26
|
const _react = require("react");
|
|
27
|
-
const
|
|
27
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
28
28
|
const _components = require("@perses-dev/components");
|
|
29
29
|
const _Ticks = require("../Ticks");
|
|
30
30
|
const _utils = require("../utils");
|
|
@@ -106,7 +106,7 @@ function Canvas(props) {
|
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
// need stable reference for window.removeEventListener() in useEffect() below
|
|
109
|
-
const handleMouseMove = (0,
|
|
109
|
+
const handleMouseMove = (0, _pluginsystem.useEvent)((e)=>{
|
|
110
110
|
e.preventDefault();
|
|
111
111
|
switch(mouseState.type){
|
|
112
112
|
case 'none':
|
|
@@ -150,7 +150,7 @@ function Canvas(props) {
|
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
// need stable reference for window.removeEventListener() in useEffect() below
|
|
153
|
-
const handleMouseUp = (0,
|
|
153
|
+
const handleMouseUp = (0, _pluginsystem.useEvent)((e)=>{
|
|
154
154
|
e.preventDefault();
|
|
155
155
|
setMouseState({
|
|
156
156
|
type: 'none'
|
|
@@ -96,8 +96,10 @@ function TracingGanttChart(props) {
|
|
|
96
96
|
onMove: setTableWidth
|
|
97
97
|
}),
|
|
98
98
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
99
|
+
style: {
|
|
100
|
+
width: `${(1 - tableWidth) * 100}%`
|
|
101
|
+
},
|
|
99
102
|
sx: {
|
|
100
|
-
width: `${(1 - tableWidth) * 100}%`,
|
|
101
103
|
overflow: 'auto'
|
|
102
104
|
},
|
|
103
105
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DetailPane.DetailPane, {
|
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.11.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.4febbfb4.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -87,14 +87,14 @@
|
|
|
87
87
|
{
|
|
88
88
|
"id": "TracingGanttChart:@perses-dev/components",
|
|
89
89
|
"name": "@perses-dev/components",
|
|
90
|
-
"version": "0.
|
|
90
|
+
"version": "0.53.0-beta.1",
|
|
91
91
|
"singleton": true,
|
|
92
|
-
"requiredVersion": "^0.
|
|
92
|
+
"requiredVersion": "^0.53.0-beta.1",
|
|
93
93
|
"assets": {
|
|
94
94
|
"js": {
|
|
95
95
|
"async": [],
|
|
96
96
|
"sync": [
|
|
97
|
-
"__mf/js/async/
|
|
97
|
+
"__mf/js/async/813.de2c52ae.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.
|
|
109
|
+
"version": "0.53.0-beta.1",
|
|
110
110
|
"singleton": true,
|
|
111
|
-
"requiredVersion": "^0.
|
|
111
|
+
"requiredVersion": "^0.53.0-beta.1",
|
|
112
112
|
"assets": {
|
|
113
113
|
"js": {
|
|
114
114
|
"async": [],
|
|
115
115
|
"sync": [
|
|
116
|
-
"__mf/js/async/
|
|
116
|
+
"__mf/js/async/711.1f4a48d0.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/75.
|
|
135
|
+
"__mf/js/async/75.4d502b5c.js"
|
|
136
136
|
]
|
|
137
137
|
},
|
|
138
138
|
"css": {
|
|
@@ -245,18 +245,18 @@
|
|
|
245
245
|
"assets": {
|
|
246
246
|
"js": {
|
|
247
247
|
"sync": [
|
|
248
|
-
"__mf/js/async/
|
|
249
|
-
"__mf/js/async/
|
|
250
|
-
"__mf/js/async/
|
|
248
|
+
"__mf/js/async/177.ab9a582b.js",
|
|
249
|
+
"__mf/js/async/783.976dc72b.js",
|
|
250
|
+
"__mf/js/async/971.0902cbf8.js",
|
|
251
251
|
"__mf/js/async/118.c1138755.js",
|
|
252
|
-
"__mf/js/async/__federation_expose_TracingGanttChart.
|
|
252
|
+
"__mf/js/async/__federation_expose_TracingGanttChart.13966d2e.js"
|
|
253
253
|
],
|
|
254
254
|
"async": [
|
|
255
|
-
"__mf/js/async/238.
|
|
255
|
+
"__mf/js/async/238.813da7cb.js",
|
|
256
256
|
"__mf/js/async/224.670da1e3.js",
|
|
257
257
|
"__mf/js/async/292.4821b1b1.js",
|
|
258
258
|
"__mf/js/async/814.c33b5f31.js",
|
|
259
|
-
"__mf/js/async/
|
|
259
|
+
"__mf/js/async/63.0b6a8d45.js",
|
|
260
260
|
"__mf/js/async/lib-router.ab6beae3.js",
|
|
261
261
|
"__mf/js/async/488.2d364feb.js"
|
|
262
262
|
]
|
|
@@ -264,8 +264,8 @@
|
|
|
264
264
|
"css": {
|
|
265
265
|
"sync": [],
|
|
266
266
|
"async": [
|
|
267
|
-
"__mf/css/async/341.
|
|
268
|
-
"__mf/css/async/263.
|
|
267
|
+
"__mf/css/async/341.d3010b86.css",
|
|
268
|
+
"__mf/css/async/263.d3010b86.css"
|
|
269
269
|
]
|
|
270
270
|
}
|
|
271
271
|
},
|
package/mf-stats.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "TracingGanttChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.
|
|
8
|
+
"buildVersion": "0.11.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.4febbfb4.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -95,17 +95,17 @@
|
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
"singleton": true,
|
|
98
|
-
"requiredVersion": "^0.
|
|
98
|
+
"requiredVersion": "^0.53.0-beta.1",
|
|
99
99
|
"shareScope": "default",
|
|
100
100
|
"name": "@perses-dev/components",
|
|
101
|
-
"version": "0.
|
|
101
|
+
"version": "0.53.0-beta.1",
|
|
102
102
|
"eager": false,
|
|
103
103
|
"id": "TracingGanttChart:@perses-dev/components",
|
|
104
104
|
"assets": {
|
|
105
105
|
"js": {
|
|
106
106
|
"async": [],
|
|
107
107
|
"sync": [
|
|
108
|
-
"__mf/js/async/
|
|
108
|
+
"__mf/js/async/813.de2c52ae.js"
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
111
|
"css": {
|
|
@@ -119,17 +119,17 @@
|
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
"singleton": true,
|
|
122
|
-
"requiredVersion": "^0.
|
|
122
|
+
"requiredVersion": "^0.53.0-beta.1",
|
|
123
123
|
"shareScope": "default",
|
|
124
124
|
"name": "@perses-dev/plugin-system",
|
|
125
|
-
"version": "0.
|
|
125
|
+
"version": "0.53.0-beta.1",
|
|
126
126
|
"eager": false,
|
|
127
127
|
"id": "TracingGanttChart:@perses-dev/plugin-system",
|
|
128
128
|
"assets": {
|
|
129
129
|
"js": {
|
|
130
130
|
"async": [],
|
|
131
131
|
"sync": [
|
|
132
|
-
"__mf/js/async/
|
|
132
|
+
"__mf/js/async/711.1f4a48d0.js"
|
|
133
133
|
]
|
|
134
134
|
},
|
|
135
135
|
"css": {
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"js": {
|
|
154
154
|
"async": [],
|
|
155
155
|
"sync": [
|
|
156
|
-
"__mf/js/async/75.
|
|
156
|
+
"__mf/js/async/75.4d502b5c.js"
|
|
157
157
|
]
|
|
158
158
|
},
|
|
159
159
|
"css": {
|
|
@@ -294,18 +294,18 @@
|
|
|
294
294
|
"assets": {
|
|
295
295
|
"js": {
|
|
296
296
|
"sync": [
|
|
297
|
-
"__mf/js/async/
|
|
298
|
-
"__mf/js/async/
|
|
299
|
-
"__mf/js/async/
|
|
297
|
+
"__mf/js/async/177.ab9a582b.js",
|
|
298
|
+
"__mf/js/async/783.976dc72b.js",
|
|
299
|
+
"__mf/js/async/971.0902cbf8.js",
|
|
300
300
|
"__mf/js/async/118.c1138755.js",
|
|
301
|
-
"__mf/js/async/__federation_expose_TracingGanttChart.
|
|
301
|
+
"__mf/js/async/__federation_expose_TracingGanttChart.13966d2e.js"
|
|
302
302
|
],
|
|
303
303
|
"async": [
|
|
304
|
-
"__mf/js/async/238.
|
|
304
|
+
"__mf/js/async/238.813da7cb.js",
|
|
305
305
|
"__mf/js/async/224.670da1e3.js",
|
|
306
306
|
"__mf/js/async/292.4821b1b1.js",
|
|
307
307
|
"__mf/js/async/814.c33b5f31.js",
|
|
308
|
-
"__mf/js/async/
|
|
308
|
+
"__mf/js/async/63.0b6a8d45.js",
|
|
309
309
|
"__mf/js/async/lib-router.ab6beae3.js",
|
|
310
310
|
"__mf/js/async/488.2d364feb.js"
|
|
311
311
|
]
|
|
@@ -313,8 +313,8 @@
|
|
|
313
313
|
"css": {
|
|
314
314
|
"sync": [],
|
|
315
315
|
"async": [
|
|
316
|
-
"__mf/css/async/341.
|
|
317
|
-
"__mf/css/async/263.
|
|
316
|
+
"__mf/css/async/341.d3010b86.css",
|
|
317
|
+
"__mf/css/async/263.d3010b86.css"
|
|
318
318
|
]
|
|
319
319
|
}
|
|
320
320
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/tracing-gantt-chart-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"homepage": "https://github.com/perses/plugins/blob/main/README.md",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@emotion/react": "^11.7.1",
|
|
31
31
|
"@emotion/styled": "^11.6.0",
|
|
32
32
|
"@hookform/resolvers": "^3.2.0",
|
|
33
|
-
"@perses-dev/components": "^0.
|
|
34
|
-
"@perses-dev/core": "^0.
|
|
35
|
-
"@perses-dev/plugin-system": "^0.
|
|
33
|
+
"@perses-dev/components": "^0.53.0-beta.1",
|
|
34
|
+
"@perses-dev/core": "^0.53.0-beta.1",
|
|
35
|
+
"@perses-dev/plugin-system": "^0.53.0-beta.1",
|
|
36
36
|
"date-fns": "^4.1.0",
|
|
37
37
|
"date-fns-tz": "^3.2.0",
|
|
38
38
|
"echarts": "5.5.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:300;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-300-normal.322bdf14.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:300;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-300-normal.c5195215.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-300-normal.322bdf14.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:400;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-400-normal.63513b00.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:400;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-400-normal.b7ffde23.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-400-normal.63513b00.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:700;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-700-normal.bb27db94.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:700;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-700-normal.d5eb20bc.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-700-normal.bb27db94.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:900;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-900-normal.a27049a3.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:900;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-900-normal.d884a71c.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-900-normal.a27049a3.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:300;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-300-normal.322bdf14.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:300;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-300-normal.c5195215.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-300-normal.322bdf14.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:400;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-400-normal.63513b00.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:400;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-400-normal.b7ffde23.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-400-normal.63513b00.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:700;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-700-normal.bb27db94.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:700;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-700-normal.d5eb20bc.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-700-normal.bb27db94.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:900;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-900-normal.a27049a3.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:900;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-900-normal.d884a71c.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-900-normal.a27049a3.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:300;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-300-normal.322bdf14.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:300;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-300-normal.c5195215.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-300-normal.322bdf14.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:400;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-400-normal.63513b00.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:400;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-400-normal.b7ffde23.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-400-normal.63513b00.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:700;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-700-normal.bb27db94.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:700;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-700-normal.d5eb20bc.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-700-normal.bb27db94.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:900;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-900-normal.a27049a3.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Lato;font-style:normal;font-display:swap;font-weight:900;src:url(/plugins/TracingGanttChart/__mf/font/lato-latin-900-normal.d884a71c.woff2)format("woff2"),url(/plugins/TracingGanttChart/__mf/font/lato-all-900-normal.a27049a3.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
|