@perses-dev/tracing-gantt-chart-plugin 0.6.1 → 0.7.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/{788.6df3bbbe.js → 788.d9986a69.js} +1 -1
- package/__mf/js/{TracingGanttChart.7010d1d5.js → TracingGanttChart.906bee00.js} +3 -3
- package/__mf/js/async/193.12ce9ab1.js +44 -0
- package/__mf/js/async/{644.1dfea83f.js.LICENSE.txt → 193.12ce9ab1.js.LICENSE.txt} +1 -17
- package/__mf/js/async/{__federation_expose_TracingGanttChart.c32313ba.js → __federation_expose_TracingGanttChart.cfa547a5.js} +1 -1
- package/__mf/js/main.2f3ef69f.js +1 -0
- package/mf-manifest.json +10 -10
- package/mf-stats.json +10 -10
- package/package.json +4 -4
- package/__mf/js/async/644.1dfea83f.js +0 -66
- package/__mf/js/main.665fb712.js +0 -1
|
@@ -30,14 +30,6 @@
|
|
|
30
30
|
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
/*!
|
|
34
|
-
* decimal.js v10.5.0
|
|
35
|
-
* An arbitrary-precision Decimal type for JavaScript.
|
|
36
|
-
* https://github.com/MikeMcl/decimal.js
|
|
37
|
-
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
38
|
-
* MIT Licence
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
33
|
/*! *****************************************************************************
|
|
42
34
|
Copyright (c) Microsoft Corporation.
|
|
43
35
|
|
|
@@ -73,12 +65,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
73
65
|
* LICENSE.md file in the root directory of this source tree.
|
|
74
66
|
*
|
|
75
67
|
* @license MIT
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @license Fraction.js v4.3.7 31/08/2023
|
|
80
|
-
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
|
|
81
|
-
*
|
|
82
|
-
* Copyright (c) 2023, Robert Eisele (robert@raw.org)
|
|
83
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
84
|
-
**/
|
|
68
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkTracingGanttChart=self.webpackChunkTracingGanttChart||[]).push([["76"],{1896:function(e,t,n){n.r(t),n.d(t,{TracingGanttChart:()=>eh});var r=n(4246),i=n(8264),s=n(6372),o=n(4538),a=n(4776),l=n(5283),d=n(2709),u=n(9581),c=n(3915);let x=new c.Z({hue:{min:20,max:360}}),p=new c.Z({hue:{min:0,max:20}}),h={},m="2rem",f=e=>{var t;return(null===(t=e.status)||void 0===t?void 0:t.code)===u.np};function v(e,t,n,r){return function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return"categorical"===n?function(e,t,n,r){let i=t?r:n;if(0===i.length)return console.warn("getConsistentCategoricalColor() called with empty color palette, fallback to #000"),"#000";let s=0;for(let t=0;t<e.length;t++)s=e.charCodeAt(t)+((s<<5)-s);return i[Math.abs(s)%i.length]??"#000"}(r,i,t.echartsTheme.color,[e.palette.error.light,e.palette.error.main,e.palette.error.dark]):function(e,t){let n=`${e}_____${t}`,r=h[n];return r||(r=function(e,t){let[n,r,i]=t?p.hsl(e):x.hsl(e),s=`${(100*r).toFixed(0)}%`,o=`${(100*i).toFixed(0)}%`;return`hsla(${n.toFixed(2)},${s},${o},0.9)`}(e,t),h[n]=r),r}(r,i)}(e,t,n,r.resource.serviceName??"",f(r))}function g(e){return e<1?`${Math.round(1e3*e)}μs`:e<1e3?`${+e.toFixed(2)}ms`:`${+(e/1e3).toFixed(2)}s`}function j(e){let{trace:t,viewport:n}=e,i=n.endTimeUnixMs-n.startTimeUnixMs,s=n.startTimeUnixMs-t.startTimeUnixMs;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b,{style:{left:"0%",borderWidth:0},children:g(s+0*i)}),(0,r.jsx)(b,{style:{left:"25%"},children:g(s+.25*i)}),(0,r.jsx)(b,{style:{left:"50%"},children:g(s+.5*i)}),(0,r.jsx)(b,{style:{left:"75%"},children:g(s+.75*i)}),(0,r.jsx)(b,{style:{left:"100%"},children:(0,r.jsx)("span",{style:{position:"absolute",right:".75rem"},children:g(s+ +i)})})]})}function M(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b,{style:{left:"25%"}}),(0,r.jsx)(b,{style:{left:"50%"}}),(0,r.jsx)(b,{style:{left:"75%"}})]})}let b=(0,d.ZP)(s.Z)(e=>{let{theme:t}=e;return{position:"absolute",height:"100%",borderLeft:`1px solid ${t.palette.divider}`,padding:".25rem"}});var T=n(5276),w=n(7469);function y(e){var t,n;let{options:l,trace:d,viewport:u,setViewport:c}=e,x=(0,a.Z)(),p=(0,i.useChartsTheme)(),{width:h,ref:m}=(0,T.Z)(),f=(0,o.useRef)(null),[g,j]=(0,o.useState)({type:"none"}),b=d.endTimeUnixMs-d.startTimeUnixMs,y=(u.startTimeUnixMs-d.startTimeUnixMs)/b,k=(d.endTimeUnixMs-u.endTimeUnixMs)/b,C=(0,o.useCallback)(e=>{var t,n;return v(x,p,null===(n=l.visual)||void 0===n?void 0:null===(t=n.palette)||void 0===t?void 0:t.mode,e)},[x,p,null===(n=l.visual)||void 0===n?void 0:null===(t=n.palette)||void 0===t?void 0:t.mode]);(0,o.useEffect)(()=>{if(!f.current||!h)return;let e=f.current.getContext("2d");e&&function(e,t,n,r,i){let s=r.rootSpans.map(function e(t){let n=1;for(let r of t.childSpans)n+=e(r);return n}).reduce((e,t)=>e+t,0),o=Math.round(Math.min(Math.max(60/s,1),7)),a=r.endTimeUnixMs-r.startTimeUnixMs,l=60/s,d=0,u=n=>{let s=n.endTimeUnixMs-n.startTimeUnixMs,c=(n.startTimeUnixMs-r.startTimeUnixMs)/a;for(let r of(e.fillStyle=i(n),e.beginPath(),e.rect(Math.round(c*t),Math.round(d),Math.max(2,Math.round(s/a*t)),o),e.fill(),d+=l,n.childSpans))u(r)};for(let e of r.rootSpans)u(e)}(e,h,60,d,C)},[h,60,d,C]);let S=e=>{if(!f.current||!h)return 0;let t=e.clientX-f.current.getBoundingClientRect().left;return d.startTimeUnixMs+t/h*b},$=(0,w.z)(e=>{switch(e.preventDefault(),g.type){case"none":return;case"resize":{let t,n;let r=g.fixedPoint,i=S(e);r<i?(t=r,n=i):(t=i,n=r),c({startTimeUnixMs:Math.max(t,d.startTimeUnixMs),endTimeUnixMs:Math.min(n,d.endTimeUnixMs)});return}case"drag":{let{start:t,end:n}=g,r=S(e);r-t<d.startTimeUnixMs&&(r=d.startTimeUnixMs+t),r+n>d.endTimeUnixMs&&(r=d.endTimeUnixMs-n),c({startTimeUnixMs:r-t,endTimeUnixMs:r+n});return}}}),I=(0,w.z)(e=>{e.preventDefault(),j({type:"none"}),u.startTimeUnixMs===u.endTimeUnixMs&&c({startTimeUnixMs:d.startTimeUnixMs,endTimeUnixMs:d.endTimeUnixMs})});return(0,o.useEffect)(()=>{function e(){window.removeEventListener("mousemove",$),window.removeEventListener("mouseup",I),document.body.style.cursor="inherit"}return"none"===g.type?e():(window.addEventListener("mousemove",$),window.addEventListener("mouseup",I),document.body.style.cursor="resize"===g.type?"col-resize":"move"),e},[g,$,I]),(0,r.jsxs)(s.Z,{ref:m,sx:{position:"relative",height:60},onMouseDown:e=>{if(e.preventDefault(),!(e.target instanceof HTMLElement))return;let t=u.startTimeUnixMs===d.startTimeUnixMs&&u.endTimeUnixMs===d.endTimeUnixMs,n=e.target.dataset.elem,r=S(e);"resizerLeft"===n?j({type:"resize",fixedPoint:u.endTimeUnixMs}):"resizerRight"===n?j({type:"resize",fixedPoint:u.startTimeUnixMs}):"cutoffBox"===n||t?(j({type:"resize",fixedPoint:r}),c({startTimeUnixMs:r,endTimeUnixMs:r})):j({type:"drag",start:r-u.startTimeUnixMs,end:u.endTimeUnixMs-r})},children:[(0,r.jsx)("canvas",{ref:f,width:h,height:60,style:{position:"absolute"}}),(0,r.jsx)(M,{}),(0,r.jsx)(U,{"data-elem":"cutoffBox",style:{left:0,width:`${100*y}%`}}),(0,r.jsx)(Z,{"data-elem":"resizerLeft",style:{left:`${100*y}%`}}),(0,r.jsx)(Z,{"data-elem":"resizerRight",style:{right:`${100*k}%`}}),(0,r.jsx)(U,{"data-elem":"cutoffBox",style:{right:0,width:`${100*k}%`}})]})}let U=(0,d.ZP)(s.Z)({position:"absolute",height:"100%",backgroundColor:"rgba(225, 225, 225, .5)"}),Z=(0,d.ZP)(s.Z)(e=>{let{theme:t}=e;return{position:"absolute",height:"100%",backgroundColor:t.palette.divider,width:"2px",cursor:"col-resize","&:before":{position:"absolute",width:"8px",left:"-3px",top:0,bottom:0,content:'" "',zIndex:1}}});function k(e){let{options:t,trace:n,viewport:i,setViewport:o}=e,l=(0,a.Z)();return(0,r.jsxs)(s.Z,{sx:{border:`1px solid ${l.palette.divider}`,borderRadius:`${l.shape.borderRadius}px`},children:[(0,r.jsx)(s.Z,{sx:{position:"relative",height:m,borderBottom:`1px solid ${l.palette.divider}`},children:(0,r.jsx)(j,{trace:n,viewport:{startTimeUnixMs:n.startTimeUnixMs,endTimeUnixMs:n.endTimeUnixMs}})}),(0,r.jsx)(y,{options:t,trace:n,viewport:i,setViewport:o})]})}var C=n(5094),S=n(2054),$=n(1781),I=n(9408),z=n(9119),E=n(763),P=n(1852),L=n(886),R=n(2259),B=n(2577),V=n(7430);function F(e){let{attributeLinks:t,attributes:n}=e,i=(0,o.useMemo)(()=>Object.fromEntries(n.map(e=>[e.key,e.value])),[n]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(P.Z,{children:n.sort((e,t)=>e.key.localeCompare(t.key)).map((e,n)=>{var s;return(0,r.jsx)(D,{attribute:e,linkTo:null==t?void 0:null===(s=t[e.key])||void 0===s?void 0:s.call(t,i)},n)})})})}function D(e){let{attribute:t,linkTo:n}=e,i=n?(0,r.jsx)(L.Z,{component:V.Link,to:n,children:G(t.value)}):G(t.value);return(0,r.jsx)(R.ZP,{disablePadding:!0,children:(0,r.jsx)(B.Z,{primary:t.key,secondary:i,primaryTypographyProps:{variant:"h5"},secondaryTypographyProps:{variant:"body1",sx:{wordBreak:"break-word"}}})})}function G(e){return"stringValue"in e?e.stringValue.length>0?e.stringValue:"<empty string>":"intValue"in e?e.intValue:"boolValue"in e?e.boolValue.toString():"arrayValue"in e?e.arrayValue.values.map(G).join(", "):"unknown"}var N=n(1357),O=n(6656),A=n(5474),W=n(2449);function _(e){let{trace:t,span:n}=e;return(0,r.jsx)(r.Fragment,{children:n.events.sort((e,t)=>e.timeUnixMs-t.timeUnixMs).map((e,n)=>(0,r.jsx)(X,{trace:t,event:e},n))})}function X(e){let{trace:t,event:n}=e,i=n.timeUnixMs-t.startTimeUnixMs;return(0,r.jsxs)(N.Z,{disableGutters:!0,children:[(0,r.jsx)(O.Z,{expandIcon:(0,r.jsx)(W.default,{}),children:(0,r.jsx)(S.Z,{children:g(i)})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(S.Z,{variant:"subtitle1",children:n.name}),(0,r.jsx)(F,{attributes:n.attributes})]})]})}function H(e){let{attributeLinks:t,trace:n,span:i,onCloseBtnClick:a}=e,[l,d]=(0,o.useState)("attributes");return"events"===l&&0===i.events.length&&d("attributes"),(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(C.Z,{sx:{float:"right"},onClick:a,children:(0,r.jsx)(E.default,{})}),(0,r.jsx)(S.Z,{sx:{wordBreak:"break-word"},children:i.resource.serviceName}),(0,r.jsx)(S.Z,{variant:"h2",sx:{wordBreak:"break-word"},children:i.name}),(0,r.jsx)(s.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsxs)($.Z,{value:l,onChange:(e,t)=>d(t),children:[(0,r.jsx)(I.Z,{sx:{p:0},value:"attributes",label:"Attributes"}),i.events.length>0&&(0,r.jsx)(I.Z,{value:"events",label:"Events"})]})}),"attributes"===l&&(0,r.jsxs)(r.Fragment,{children:[i.attributes.length>0&&(0,r.jsx)(F,{attributeLinks:t,attributes:i.attributes}),i.attributes.length>0&&(0,r.jsx)(z.Z,{}),(0,r.jsx)(F,{attributeLinks:t,attributes:i.resource.attributes})]}),"events"===l&&(0,r.jsx)(_,{trace:n,span:i})]})}var Q=n(3675);let Y=(0,o.createContext)(void 0);function q(e){let{children:t}=e,[n,i]=(0,o.useState)([]),[s,a]=(0,o.useState)([]),[l,d]=(0,o.useState)(void 0);return(0,r.jsx)(Y.Provider,{value:{collapsedSpans:n,setCollapsedSpans:i,visibleSpans:s,setVisibleSpans:a,hoveredParent:l,setHoveredParent:d},children:t})}function J(){let e=(0,o.useContext)(Y);if(void 0===e)throw Error("No GanttTableContext found. Did you forget a Provider?");return e}var K=n(4944),ee=n(4974);function et(e){let{span:t}=e,{collapsedSpans:n,setCollapsedSpans:i,visibleSpans:s,hoveredParent:l,setHoveredParent:d}=J(),u=(0,a.Z)(),c=(0,o.useCallback)(e=>{e.stopPropagation(),n.includes(t.spanId)?i(n.filter(e=>e!==t.spanId)):i([...n,t.spanId])},[t,n,i]),x=(0,o.useCallback)(()=>{d(t.spanId)},[t,d]),p=[t],h=t.parentSpan;for(;h;)p.unshift(h),h=h.parentSpan;return(0,r.jsx)(r.Fragment,{children:p.map((e,t)=>(0,r.jsx)(en,{style:{width:t===p.length-1||0===s.length||s.includes(e.spanId)?24:8,borderLeft:`${l===(e.parentSpanId??"")?3:1}px solid ${u.palette.divider}`},onMouseEnter:()=>d(e.parentSpanId??""),onMouseLeave:()=>d(void 0),children:t===p.length-1&&e.childSpans.length>0&&(n.includes(e.spanId)?(0,r.jsx)(ee.default,{titleAccess:"expand",onClick:c,onMouseEnter:x}):(0,r.jsx)(W.default,{titleAccess:"collapse",onClick:c,onMouseEnter:x}))},e.spanId))})}let en=(0,d.ZP)("div")({display:"flex",height:"100%",alignItems:"center",justifyContent:"flex-end",flexShrink:0,transition:"width 1s"});function er(e){let{span:t,nameColumnWidth:n}=e;return(0,r.jsxs)(l.Z,{direction:"row",sx:{alignItems:"center"},style:{width:`${100*n}%`},children:[(0,r.jsx)(et,{span:t}),f(t)&&(0,r.jsx)(K.default,{titleAccess:"error",color:"error",sx:{marginRight:"5px"}}),(0,r.jsxs)(s.Z,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:[(0,r.jsxs)("strong",{children:[t.resource.serviceName,":"]})," ",t.name]})]})}function ei(e){var t,n;let{options:o,span:l,viewport:d}=e,u=(0,a.Z)(),c=(0,i.useChartsTheme)(),x=l.endTimeUnixMs-l.startTimeUnixMs,p=d.endTimeUnixMs-d.startTimeUnixMs,h=x/p,m=(l.startTimeUnixMs-d.startTimeUnixMs)/p;return(0,r.jsxs)(s.Z,{sx:{position:"relative",height:"100%",flexGrow:1,overflow:"hidden"},children:[(0,r.jsx)(M,{}),(0,r.jsx)(s.Z,{"data-testid":"span-duration-bar",sx:{position:"absolute",top:0,bottom:0,margin:"auto",minWidth:"2px",height:"8px",borderRadius:u.shape.borderRadius},style:{left:`${100*m}%`,width:`${100*h}%`,backgroundColor:v(u,c,null===(n=o.visual)||void 0===n?void 0:null===(t=n.palette)||void 0===t?void 0:t.mode,l)}}),(0,r.jsx)(s.Z,{sx:{position:"absolute",top:"50%",transform:"translateY(-50%)",padding:"0 8px",color:u.palette.grey[700],fontSize:".7rem"},style:m+h<.95?{left:`${(m+h)*100}%`}:{left:`${100*m}%`,transform:"translateY(-50%) translateX(-100%)"},children:g(x)})]})}let es=(0,o.memo)(function(e){let{options:t,span:n,viewport:i,selected:s,nameColumnWidth:o,divider:l,onClick:d}=e,u=(0,a.Z)();return(0,r.jsxs)(eo,{sx:{backgroundColor:s?u.palette.action.selected:"inherit"},direction:"row",onClick:()=>{var e;(null===(e=document.getSelection())||void 0===e?void 0:e.type)!=="Range"&&d(n)},children:[(0,r.jsx)(er,{span:n,nameColumnWidth:o}),l,(0,r.jsx)(ei,{options:t,span:n,viewport:i})]})}),eo=(0,d.ZP)(l.Z)(e=>{let{theme:t}=e;return{height:m,"&:hover":{backgroundColor:t.palette.action.hover,borderTop:`1px solid ${t.palette.divider}`,borderBottom:`1px solid ${t.palette.divider}`}}});function ea(e){let{trace:t,viewport:n,nameColumnWidth:i,divider:o}=e,d=(0,a.Z)();return(0,r.jsxs)(l.Z,{direction:"row",alignItems:"center",sx:{height:m,fontSize:"0.9rem",borderBottom:`1px solid ${d.palette.divider}`},children:[(0,r.jsx)(s.Z,{style:{width:`${100*i}%`},children:(0,r.jsx)("span",{style:{padding:".25rem"},children:"Service & Operation"})}),o,(0,r.jsx)(s.Z,{sx:{position:"relative",height:"100%",flexGrow:1},children:(0,r.jsx)(j,{trace:t,viewport:n})})]})}function el(e){let{parentRef:t,spacing:n=0,onMove:i}=e,[s,a]=(0,o.useState)(!1),l=(0,w.z)(e=>{if(!t.current)return;let r=(e.clientX-t.current.getBoundingClientRect().left+n)/t.current.getBoundingClientRect().width;.05<=r&&r<=.95&&i(r)}),d=(0,w.z)(()=>{a(!1)});return(0,o.useEffect)(()=>{function e(){window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",d),document.body.style.cursor="inherit"}return s?(window.addEventListener("mousemove",l),window.addEventListener("mouseup",d),document.body.style.cursor="col-resize"):e(),e},[s,l,d]),(0,r.jsx)(ed,{onMouseDown:e=>{e.preventDefault(),a(!0)},onClick:e=>e.stopPropagation()})}let ed=(0,d.ZP)(s.Z)(e=>{let{theme:t}=e;return{position:"relative",width:"1px",height:"100%",backgroundColor:t.palette.divider,cursor:"col-resize","&:before":{position:"absolute",width:"7px",left:"-3px",top:0,bottom:0,content:'" "',zIndex:1}}});function eu(e){let{options:t,trace:n,viewport:i,selectedSpan:l,onSpanClick:d}=e,{collapsedSpans:u,setVisibleSpans:c}=J(),[x,p]=(0,o.useState)(.25),h=(0,o.useRef)(null),m=(0,a.Z)(),f=(0,o.useMemo)(()=>{let e=[];for(let t of n.rootSpans)!function e(t,n,r){if(t.push(n),!r.includes(n.spanId))for(let i of n.childSpans)e(t,i,r)}(e,t,u);return e},[n.rootSpans,u]),v=(0,r.jsx)(el,{parentRef:h,onMove:p});return(0,r.jsxs)(s.Z,{ref:h,sx:{display:"flex",flexDirection:"column",flexGrow:1,border:`1px solid ${m.palette.divider}`,borderRadius:`${m.shape.borderRadius}px`},children:[(0,r.jsx)(ea,{trace:n,viewport:i,nameColumnWidth:x,divider:v}),(0,r.jsx)(Q.OO,{data:f,itemContent:(e,n)=>(0,r.jsx)(es,{options:t,span:n,viewport:i,selected:n===l,nameColumnWidth:x,divider:v,onClick:d}),rangeChanged:function(e){let{startIndex:t,endIndex:n}=e,r=[];for(let e=t;e<=n;e++)r.push(f[e].spanId);c(r)}})]})}var ec=n(3098);function ex(e){return{timeUnixMs:1e-6*parseInt(e.timeUnixNano),name:e.name,attributes:e.attributes??[]}}function ep(e){let{options:t,attributeLinks:n,trace:i}=e,d=(0,a.Z)(),u=(0,o.useMemo)(()=>{try{return function(e){let t=new Map,n=[],r=0,i=0;for(let n of e.resourceSpans){let e=function(e){let t="unknown";for(let n of(null==e?void 0:e.attributes)??[])if("service.name"===n.key&&"stringValue"in n.value){t=n.value.stringValue;break}return{serviceName:t,attributes:(null==e?void 0:e.attributes)??[]}}(n.resource);for(let o of n.scopeSpans){let n=o.scope??{};for(let a of o.spans){var s;let o={resource:e,scope:n,childSpans:[],traceId:(s=a).traceId,spanId:s.spanId,parentSpanId:s.parentSpanId,name:s.name,kind:s.kind,startTimeUnixMs:1e-6*parseInt(s.startTimeUnixNano),endTimeUnixMs:1e-6*parseInt(s.endTimeUnixNano),attributes:s.attributes??[],events:(s.events??[]).map(ex),status:s.status??{}};t.set(a.spanId,o),(0===r||o.startTimeUnixMs<r)&&(r=o.startTimeUnixMs),(0===i||o.endTimeUnixMs>i)&&(i=o.endTimeUnixMs)}}}for(let[,e]of t){if(!e.parentSpanId){n.push(e);continue}let r=t.get(e.parentSpanId);if(!r){console.trace(`span ${e.spanId} has parent ${e.parentSpanId} which has not been received yet`),n.push(e);continue}e.parentSpan=r;let i=(0,ec.sortedIndexBy)(r.childSpans,e,e=>e.startTimeUnixMs);r.childSpans.splice(i,0,e)}return{trace:e,rootSpans:n,startTimeUnixMs:r,endTimeUnixMs:i}}(i)}catch(e){throw Error(`Error: unable to parse trace: ${e}`)}},[i]),[c,x]=(0,o.useState)({startTimeUnixMs:u.startTimeUnixMs,endTimeUnixMs:u.endTimeUnixMs}),[p,h]=(0,o.useState)(void 0),m=(0,o.useRef)(null),[f,v]=(0,o.useState)(.82);return(0,r.jsxs)(l.Z,{ref:m,direction:"row",sx:{height:"100%",minHeight:"240px",gap:2},children:[(0,r.jsxs)(l.Z,{sx:{flexGrow:1,gap:2},children:[(0,r.jsx)(k,{options:t,trace:u,viewport:c,setViewport:x}),(0,r.jsx)(q,{children:(0,r.jsx)(eu,{options:t,trace:u,viewport:c,selectedSpan:p,onSpanClick:h})})]}),p&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el,{parentRef:m,spacing:parseInt(d.spacing(2)),onMove:v}),(0,r.jsx)(s.Z,{sx:{width:`${(1-f)*100}%`,overflow:"auto"},children:(0,r.jsx)(H,{attributeLinks:n,trace:u,span:p,onCloseBtnClick:()=>h(void 0)})})]})]})}let eh={PanelComponent:function(e){var t;let{spec:n,queryResults:o,attributeLinks:a}=e,l=(0,i.useChartsTheme)().container.padding.default;if(o.length>1)return(0,r.jsx)(i.TextOverlay,{message:"This panel does not support more than one query."});let d=null===(t=o[0])||void 0===t?void 0:t.data.trace;return d?(0,r.jsx)(s.Z,{sx:{height:"100%",padding:`${l}px`},children:(0,r.jsx)(ep,{options:n,attributeLinks:a,trace:d})}):(0,r.jsx)(i.NoDataOverlay,{resource:"trace"})},supportedQueryTypes:["TraceQuery"],createInitialOptions:function(){return{}}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkTracingGanttChart=self.webpackChunkTracingGanttChart||[]).push([["76"],{1896:function(e,t,n){n.r(t),n.d(t,{TracingGanttChart:()=>eh});var r=n(4246),i=n(2629),s=n(6372),o=n(4538),a=n(4776),l=n(5283),d=n(2709),u=n(9581),c=n(3915);let x=new c.Z({hue:{min:20,max:360}}),p=new c.Z({hue:{min:0,max:20}}),h={},m="2rem",f=e=>{var t;return(null===(t=e.status)||void 0===t?void 0:t.code)===u.np};function v(e,t,n,r){return function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return"categorical"===n?function(e,t,n,r){let i=t?r:n;if(0===i.length)return console.warn("getConsistentCategoricalColor() called with empty color palette, fallback to #000"),"#000";let s=0;for(let t=0;t<e.length;t++)s=e.charCodeAt(t)+((s<<5)-s);return i[Math.abs(s)%i.length]??"#000"}(r,i,t.echartsTheme.color,[e.palette.error.light,e.palette.error.main,e.palette.error.dark]):function(e,t){let n=`${e}_____${t}`,r=h[n];return r||(r=function(e,t){let[n,r,i]=t?p.hsl(e):x.hsl(e),s=`${(100*r).toFixed(0)}%`,o=`${(100*i).toFixed(0)}%`;return`hsla(${n.toFixed(2)},${s},${o},0.9)`}(e,t),h[n]=r),r}(r,i)}(e,t,n,r.resource.serviceName??"",f(r))}function g(e){return e<1?`${Math.round(1e3*e)}μs`:e<1e3?`${+e.toFixed(2)}ms`:`${+(e/1e3).toFixed(2)}s`}function j(e){let{trace:t,viewport:n}=e,i=n.endTimeUnixMs-n.startTimeUnixMs,s=n.startTimeUnixMs-t.startTimeUnixMs;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b,{style:{left:"0%",borderWidth:0},children:g(s+0*i)}),(0,r.jsx)(b,{style:{left:"25%"},children:g(s+.25*i)}),(0,r.jsx)(b,{style:{left:"50%"},children:g(s+.5*i)}),(0,r.jsx)(b,{style:{left:"75%"},children:g(s+.75*i)}),(0,r.jsx)(b,{style:{left:"100%"},children:(0,r.jsx)("span",{style:{position:"absolute",right:".75rem"},children:g(s+ +i)})})]})}function M(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b,{style:{left:"25%"}}),(0,r.jsx)(b,{style:{left:"50%"}}),(0,r.jsx)(b,{style:{left:"75%"}})]})}let b=(0,d.ZP)(s.Z)(e=>{let{theme:t}=e;return{position:"absolute",height:"100%",borderLeft:`1px solid ${t.palette.divider}`,padding:".25rem"}});var T=n(5276),w=n(7469);function y(e){var t,n;let{options:l,trace:d,viewport:u,setViewport:c}=e,x=(0,a.Z)(),p=(0,i.useChartsTheme)(),{width:h,ref:m}=(0,T.Z)(),f=(0,o.useRef)(null),[g,j]=(0,o.useState)({type:"none"}),b=d.endTimeUnixMs-d.startTimeUnixMs,y=(u.startTimeUnixMs-d.startTimeUnixMs)/b,k=(d.endTimeUnixMs-u.endTimeUnixMs)/b,C=(0,o.useCallback)(e=>{var t,n;return v(x,p,null===(n=l.visual)||void 0===n?void 0:null===(t=n.palette)||void 0===t?void 0:t.mode,e)},[x,p,null===(n=l.visual)||void 0===n?void 0:null===(t=n.palette)||void 0===t?void 0:t.mode]);(0,o.useEffect)(()=>{if(!f.current||!h)return;let e=f.current.getContext("2d");e&&function(e,t,n,r,i){let s=r.rootSpans.map(function e(t){let n=1;for(let r of t.childSpans)n+=e(r);return n}).reduce((e,t)=>e+t,0),o=Math.round(Math.min(Math.max(60/s,1),7)),a=r.endTimeUnixMs-r.startTimeUnixMs,l=60/s,d=0,u=n=>{let s=n.endTimeUnixMs-n.startTimeUnixMs,c=(n.startTimeUnixMs-r.startTimeUnixMs)/a;for(let r of(e.fillStyle=i(n),e.beginPath(),e.rect(Math.round(c*t),Math.round(d),Math.max(2,Math.round(s/a*t)),o),e.fill(),d+=l,n.childSpans))u(r)};for(let e of r.rootSpans)u(e)}(e,h,60,d,C)},[h,60,d,C]);let S=e=>{if(!f.current||!h)return 0;let t=e.clientX-f.current.getBoundingClientRect().left;return d.startTimeUnixMs+t/h*b},$=(0,w.z)(e=>{switch(e.preventDefault(),g.type){case"none":return;case"resize":{let t,n;let r=g.fixedPoint,i=S(e);r<i?(t=r,n=i):(t=i,n=r),c({startTimeUnixMs:Math.max(t,d.startTimeUnixMs),endTimeUnixMs:Math.min(n,d.endTimeUnixMs)});return}case"drag":{let{start:t,end:n}=g,r=S(e);r-t<d.startTimeUnixMs&&(r=d.startTimeUnixMs+t),r+n>d.endTimeUnixMs&&(r=d.endTimeUnixMs-n),c({startTimeUnixMs:r-t,endTimeUnixMs:r+n});return}}}),I=(0,w.z)(e=>{e.preventDefault(),j({type:"none"}),u.startTimeUnixMs===u.endTimeUnixMs&&c({startTimeUnixMs:d.startTimeUnixMs,endTimeUnixMs:d.endTimeUnixMs})});return(0,o.useEffect)(()=>{function e(){window.removeEventListener("mousemove",$),window.removeEventListener("mouseup",I),document.body.style.cursor="inherit"}return"none"===g.type?e():(window.addEventListener("mousemove",$),window.addEventListener("mouseup",I),document.body.style.cursor="resize"===g.type?"col-resize":"move"),e},[g,$,I]),(0,r.jsxs)(s.Z,{ref:m,sx:{position:"relative",height:60},onMouseDown:e=>{if(e.preventDefault(),!(e.target instanceof HTMLElement))return;let t=u.startTimeUnixMs===d.startTimeUnixMs&&u.endTimeUnixMs===d.endTimeUnixMs,n=e.target.dataset.elem,r=S(e);"resizerLeft"===n?j({type:"resize",fixedPoint:u.endTimeUnixMs}):"resizerRight"===n?j({type:"resize",fixedPoint:u.startTimeUnixMs}):"cutoffBox"===n||t?(j({type:"resize",fixedPoint:r}),c({startTimeUnixMs:r,endTimeUnixMs:r})):j({type:"drag",start:r-u.startTimeUnixMs,end:u.endTimeUnixMs-r})},children:[(0,r.jsx)("canvas",{ref:f,width:h,height:60,style:{position:"absolute"}}),(0,r.jsx)(M,{}),(0,r.jsx)(U,{"data-elem":"cutoffBox",style:{left:0,width:`${100*y}%`}}),(0,r.jsx)(Z,{"data-elem":"resizerLeft",style:{left:`${100*y}%`}}),(0,r.jsx)(Z,{"data-elem":"resizerRight",style:{right:`${100*k}%`}}),(0,r.jsx)(U,{"data-elem":"cutoffBox",style:{right:0,width:`${100*k}%`}})]})}let U=(0,d.ZP)(s.Z)({position:"absolute",height:"100%",backgroundColor:"rgba(225, 225, 225, .5)"}),Z=(0,d.ZP)(s.Z)(e=>{let{theme:t}=e;return{position:"absolute",height:"100%",backgroundColor:t.palette.divider,width:"2px",cursor:"col-resize","&:before":{position:"absolute",width:"8px",left:"-3px",top:0,bottom:0,content:'" "',zIndex:1}}});function k(e){let{options:t,trace:n,viewport:i,setViewport:o}=e,l=(0,a.Z)();return(0,r.jsxs)(s.Z,{sx:{border:`1px solid ${l.palette.divider}`,borderRadius:`${l.shape.borderRadius}px`},children:[(0,r.jsx)(s.Z,{sx:{position:"relative",height:m,borderBottom:`1px solid ${l.palette.divider}`},children:(0,r.jsx)(j,{trace:n,viewport:{startTimeUnixMs:n.startTimeUnixMs,endTimeUnixMs:n.endTimeUnixMs}})}),(0,r.jsx)(y,{options:t,trace:n,viewport:i,setViewport:o})]})}var C=n(5094),S=n(2054),$=n(1781),I=n(9408),z=n(9119),E=n(763),P=n(1852),L=n(886),R=n(2259),B=n(2577),V=n(7430);function F(e){let{attributeLinks:t,attributes:n}=e,i=(0,o.useMemo)(()=>Object.fromEntries(n.map(e=>[e.key,e.value])),[n]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(P.Z,{children:n.sort((e,t)=>e.key.localeCompare(t.key)).map((e,n)=>{var s;return(0,r.jsx)(D,{attribute:e,linkTo:null==t?void 0:null===(s=t[e.key])||void 0===s?void 0:s.call(t,i)},n)})})})}function D(e){let{attribute:t,linkTo:n}=e,i=n?(0,r.jsx)(L.Z,{component:V.Link,to:n,children:G(t.value)}):G(t.value);return(0,r.jsx)(R.ZP,{disablePadding:!0,children:(0,r.jsx)(B.Z,{primary:t.key,secondary:i,primaryTypographyProps:{variant:"h5"},secondaryTypographyProps:{variant:"body1",sx:{wordBreak:"break-word"}}})})}function G(e){return"stringValue"in e?e.stringValue.length>0?e.stringValue:"<empty string>":"intValue"in e?e.intValue:"boolValue"in e?e.boolValue.toString():"arrayValue"in e?e.arrayValue.values.map(G).join(", "):"unknown"}var N=n(1357),O=n(6656),A=n(5474),W=n(2449);function _(e){let{trace:t,span:n}=e;return(0,r.jsx)(r.Fragment,{children:n.events.sort((e,t)=>e.timeUnixMs-t.timeUnixMs).map((e,n)=>(0,r.jsx)(X,{trace:t,event:e},n))})}function X(e){let{trace:t,event:n}=e,i=n.timeUnixMs-t.startTimeUnixMs;return(0,r.jsxs)(N.Z,{disableGutters:!0,children:[(0,r.jsx)(O.Z,{expandIcon:(0,r.jsx)(W.default,{}),children:(0,r.jsx)(S.Z,{children:g(i)})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(S.Z,{variant:"subtitle1",children:n.name}),(0,r.jsx)(F,{attributes:n.attributes})]})]})}function H(e){let{attributeLinks:t,trace:n,span:i,onCloseBtnClick:a}=e,[l,d]=(0,o.useState)("attributes");return"events"===l&&0===i.events.length&&d("attributes"),(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(C.Z,{sx:{float:"right"},onClick:a,children:(0,r.jsx)(E.default,{})}),(0,r.jsx)(S.Z,{sx:{wordBreak:"break-word"},children:i.resource.serviceName}),(0,r.jsx)(S.Z,{variant:"h2",sx:{wordBreak:"break-word"},children:i.name}),(0,r.jsx)(s.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsxs)($.Z,{value:l,onChange:(e,t)=>d(t),children:[(0,r.jsx)(I.Z,{sx:{p:0},value:"attributes",label:"Attributes"}),i.events.length>0&&(0,r.jsx)(I.Z,{value:"events",label:"Events"})]})}),"attributes"===l&&(0,r.jsxs)(r.Fragment,{children:[i.attributes.length>0&&(0,r.jsx)(F,{attributeLinks:t,attributes:i.attributes}),i.attributes.length>0&&(0,r.jsx)(z.Z,{}),(0,r.jsx)(F,{attributeLinks:t,attributes:i.resource.attributes})]}),"events"===l&&(0,r.jsx)(_,{trace:n,span:i})]})}var Q=n(3675);let Y=(0,o.createContext)(void 0);function q(e){let{children:t}=e,[n,i]=(0,o.useState)([]),[s,a]=(0,o.useState)([]),[l,d]=(0,o.useState)(void 0);return(0,r.jsx)(Y.Provider,{value:{collapsedSpans:n,setCollapsedSpans:i,visibleSpans:s,setVisibleSpans:a,hoveredParent:l,setHoveredParent:d},children:t})}function J(){let e=(0,o.useContext)(Y);if(void 0===e)throw Error("No GanttTableContext found. Did you forget a Provider?");return e}var K=n(4944),ee=n(4974);function et(e){let{span:t}=e,{collapsedSpans:n,setCollapsedSpans:i,visibleSpans:s,hoveredParent:l,setHoveredParent:d}=J(),u=(0,a.Z)(),c=(0,o.useCallback)(e=>{e.stopPropagation(),n.includes(t.spanId)?i(n.filter(e=>e!==t.spanId)):i([...n,t.spanId])},[t,n,i]),x=(0,o.useCallback)(()=>{d(t.spanId)},[t,d]),p=[t],h=t.parentSpan;for(;h;)p.unshift(h),h=h.parentSpan;return(0,r.jsx)(r.Fragment,{children:p.map((e,t)=>(0,r.jsx)(en,{style:{width:t===p.length-1||0===s.length||s.includes(e.spanId)?24:8,borderLeft:`${l===(e.parentSpanId??"")?3:1}px solid ${u.palette.divider}`},onMouseEnter:()=>d(e.parentSpanId??""),onMouseLeave:()=>d(void 0),children:t===p.length-1&&e.childSpans.length>0&&(n.includes(e.spanId)?(0,r.jsx)(ee.default,{titleAccess:"expand",onClick:c,onMouseEnter:x}):(0,r.jsx)(W.default,{titleAccess:"collapse",onClick:c,onMouseEnter:x}))},e.spanId))})}let en=(0,d.ZP)("div")({display:"flex",height:"100%",alignItems:"center",justifyContent:"flex-end",flexShrink:0,transition:"width 1s"});function er(e){let{span:t,nameColumnWidth:n}=e;return(0,r.jsxs)(l.Z,{direction:"row",sx:{alignItems:"center"},style:{width:`${100*n}%`},children:[(0,r.jsx)(et,{span:t}),f(t)&&(0,r.jsx)(K.default,{titleAccess:"error",color:"error",sx:{marginRight:"5px"}}),(0,r.jsxs)(s.Z,{sx:{whiteSpace:"nowrap",overflow:"hidden"},children:[(0,r.jsxs)("strong",{children:[t.resource.serviceName,":"]})," ",t.name]})]})}function ei(e){var t,n;let{options:o,span:l,viewport:d}=e,u=(0,a.Z)(),c=(0,i.useChartsTheme)(),x=l.endTimeUnixMs-l.startTimeUnixMs,p=d.endTimeUnixMs-d.startTimeUnixMs,h=x/p,m=(l.startTimeUnixMs-d.startTimeUnixMs)/p;return(0,r.jsxs)(s.Z,{sx:{position:"relative",height:"100%",flexGrow:1,overflow:"hidden"},children:[(0,r.jsx)(M,{}),(0,r.jsx)(s.Z,{"data-testid":"span-duration-bar",sx:{position:"absolute",top:0,bottom:0,margin:"auto",minWidth:"2px",height:"8px",borderRadius:u.shape.borderRadius},style:{left:`${100*m}%`,width:`${100*h}%`,backgroundColor:v(u,c,null===(n=o.visual)||void 0===n?void 0:null===(t=n.palette)||void 0===t?void 0:t.mode,l)}}),(0,r.jsx)(s.Z,{sx:{position:"absolute",top:"50%",transform:"translateY(-50%)",padding:"0 8px",color:u.palette.grey[700],fontSize:".7rem"},style:m+h<.95?{left:`${(m+h)*100}%`}:{left:`${100*m}%`,transform:"translateY(-50%) translateX(-100%)"},children:g(x)})]})}let es=(0,o.memo)(function(e){let{options:t,span:n,viewport:i,selected:s,nameColumnWidth:o,divider:l,onClick:d}=e,u=(0,a.Z)();return(0,r.jsxs)(eo,{sx:{backgroundColor:s?u.palette.action.selected:"inherit"},direction:"row",onClick:()=>{var e;(null===(e=document.getSelection())||void 0===e?void 0:e.type)!=="Range"&&d(n)},children:[(0,r.jsx)(er,{span:n,nameColumnWidth:o}),l,(0,r.jsx)(ei,{options:t,span:n,viewport:i})]})}),eo=(0,d.ZP)(l.Z)(e=>{let{theme:t}=e;return{height:m,"&:hover":{backgroundColor:t.palette.action.hover,borderTop:`1px solid ${t.palette.divider}`,borderBottom:`1px solid ${t.palette.divider}`}}});function ea(e){let{trace:t,viewport:n,nameColumnWidth:i,divider:o}=e,d=(0,a.Z)();return(0,r.jsxs)(l.Z,{direction:"row",alignItems:"center",sx:{height:m,fontSize:"0.9rem",borderBottom:`1px solid ${d.palette.divider}`},children:[(0,r.jsx)(s.Z,{style:{width:`${100*i}%`},children:(0,r.jsx)("span",{style:{padding:".25rem"},children:"Service & Operation"})}),o,(0,r.jsx)(s.Z,{sx:{position:"relative",height:"100%",flexGrow:1},children:(0,r.jsx)(j,{trace:t,viewport:n})})]})}function el(e){let{parentRef:t,spacing:n=0,onMove:i}=e,[s,a]=(0,o.useState)(!1),l=(0,w.z)(e=>{if(!t.current)return;let r=(e.clientX-t.current.getBoundingClientRect().left+n)/t.current.getBoundingClientRect().width;.05<=r&&r<=.95&&i(r)}),d=(0,w.z)(()=>{a(!1)});return(0,o.useEffect)(()=>{function e(){window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",d),document.body.style.cursor="inherit"}return s?(window.addEventListener("mousemove",l),window.addEventListener("mouseup",d),document.body.style.cursor="col-resize"):e(),e},[s,l,d]),(0,r.jsx)(ed,{onMouseDown:e=>{e.preventDefault(),a(!0)},onClick:e=>e.stopPropagation()})}let ed=(0,d.ZP)(s.Z)(e=>{let{theme:t}=e;return{position:"relative",width:"1px",height:"100%",backgroundColor:t.palette.divider,cursor:"col-resize","&:before":{position:"absolute",width:"7px",left:"-3px",top:0,bottom:0,content:'" "',zIndex:1}}});function eu(e){let{options:t,trace:n,viewport:i,selectedSpan:l,onSpanClick:d}=e,{collapsedSpans:u,setVisibleSpans:c}=J(),[x,p]=(0,o.useState)(.25),h=(0,o.useRef)(null),m=(0,a.Z)(),f=(0,o.useMemo)(()=>{let e=[];for(let t of n.rootSpans)!function e(t,n,r){if(t.push(n),!r.includes(n.spanId))for(let i of n.childSpans)e(t,i,r)}(e,t,u);return e},[n.rootSpans,u]),v=(0,r.jsx)(el,{parentRef:h,onMove:p});return(0,r.jsxs)(s.Z,{ref:h,sx:{display:"flex",flexDirection:"column",flexGrow:1,border:`1px solid ${m.palette.divider}`,borderRadius:`${m.shape.borderRadius}px`},children:[(0,r.jsx)(ea,{trace:n,viewport:i,nameColumnWidth:x,divider:v}),(0,r.jsx)(Q.OO,{data:f,itemContent:(e,n)=>(0,r.jsx)(es,{options:t,span:n,viewport:i,selected:n===l,nameColumnWidth:x,divider:v,onClick:d}),rangeChanged:function(e){let{startIndex:t,endIndex:n}=e,r=[];for(let e=t;e<=n;e++)r.push(f[e].spanId);c(r)}})]})}var ec=n(3098);function ex(e){return{timeUnixMs:1e-6*parseInt(e.timeUnixNano),name:e.name,attributes:e.attributes??[]}}function ep(e){let{options:t,attributeLinks:n,trace:i}=e,d=(0,a.Z)(),u=(0,o.useMemo)(()=>{try{return function(e){let t=new Map,n=[],r=0,i=0;for(let n of e.resourceSpans){let e=function(e){let t="unknown";for(let n of(null==e?void 0:e.attributes)??[])if("service.name"===n.key&&"stringValue"in n.value){t=n.value.stringValue;break}return{serviceName:t,attributes:(null==e?void 0:e.attributes)??[]}}(n.resource);for(let o of n.scopeSpans){let n=o.scope??{};for(let a of o.spans){var s;let o={resource:e,scope:n,childSpans:[],traceId:(s=a).traceId,spanId:s.spanId,parentSpanId:s.parentSpanId,name:s.name,kind:s.kind,startTimeUnixMs:1e-6*parseInt(s.startTimeUnixNano),endTimeUnixMs:1e-6*parseInt(s.endTimeUnixNano),attributes:s.attributes??[],events:(s.events??[]).map(ex),status:s.status??{}};t.set(a.spanId,o),(0===r||o.startTimeUnixMs<r)&&(r=o.startTimeUnixMs),(0===i||o.endTimeUnixMs>i)&&(i=o.endTimeUnixMs)}}}for(let[,e]of t){if(!e.parentSpanId){n.push(e);continue}let r=t.get(e.parentSpanId);if(!r){console.trace(`span ${e.spanId} has parent ${e.parentSpanId} which has not been received yet`),n.push(e);continue}e.parentSpan=r;let i=(0,ec.sortedIndexBy)(r.childSpans,e,e=>e.startTimeUnixMs);r.childSpans.splice(i,0,e)}return{trace:e,rootSpans:n,startTimeUnixMs:r,endTimeUnixMs:i}}(i)}catch(e){throw Error(`Error: unable to parse trace: ${e}`)}},[i]),[c,x]=(0,o.useState)({startTimeUnixMs:u.startTimeUnixMs,endTimeUnixMs:u.endTimeUnixMs}),[p,h]=(0,o.useState)(void 0),m=(0,o.useRef)(null),[f,v]=(0,o.useState)(.82);return(0,r.jsxs)(l.Z,{ref:m,direction:"row",sx:{height:"100%",minHeight:"240px",gap:2},children:[(0,r.jsxs)(l.Z,{sx:{flexGrow:1,gap:2},children:[(0,r.jsx)(k,{options:t,trace:u,viewport:c,setViewport:x}),(0,r.jsx)(q,{children:(0,r.jsx)(eu,{options:t,trace:u,viewport:c,selectedSpan:p,onSpanClick:h})})]}),p&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el,{parentRef:m,spacing:parseInt(d.spacing(2)),onMove:v}),(0,r.jsx)(s.Z,{sx:{width:`${(1-f)*100}%`,overflow:"auto"},children:(0,r.jsx)(H,{attributeLinks:n,trace:u,span:p,onCloseBtnClick:()=>h(void 0)})})]})]})}let eh={PanelComponent:function(e){var t;let{spec:n,queryResults:o,attributeLinks:a}=e,l=(0,i.useChartsTheme)().container.padding.default;if(o.length>1)return(0,r.jsx)(i.TextOverlay,{message:"This panel does not support more than one query."});let d=null===(t=o[0])||void 0===t?void 0:t.data.trace;return d?(0,r.jsx)(s.Z,{sx:{height:"100%",padding:`${l}px`},children:(0,r.jsx)(ep,{options:n,attributeLinks:a,trace:d})}):(0,r.jsx)(i.NoDataOverlay,{resource:"trace"})},supportedQueryTypes:["TraceQuery"],createInitialOptions:function(){return{}}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={5311:function(e,r,t){Promise.all([t.e("677"),t.e("179"),t.e("620")]).then(t.bind(t,9161))}},r={};function t(n){var a=r[n];if(void 0!==a)return a.exports;var o=r[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}t.m=e,t.c=r,t.federation||(t.federation={chunkMatcher:function(e){return!/^(1(57|61|79)|494|677|759|946)$/.test(e)}}),t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((r,n)=>(t.f[n](e,r),r),[])),t.u=e=>"__mf/js/async/"+e+"."+({156:"5a401ecb",173:"6314a363",193:"12ce9ab1",377:"59c252c4",620:"1d1ce390",651:"3ea371e5",694:"4580ad20",740:"babbb403",75:"d81e6bbf",770:"5431adef",783:"3c2c57f6",960:"478a8f11",964:"a98cab40",981:"bc5132f8"})[e]+".js",t.miniCssF=e=>"__mf/css/async/"+e+".6c6463ea.css",t.h=()=>"8fad548b4e7cd68c",(()=>{t.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={},r="TracingGanttChart:";t.l=function(n,a,o,i){if(e[n]){e[n].push(a);return}if(void 0!==o)for(var s,l,c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==r+o){s=u;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,t.nc&&s.setAttribute("nonce",t.nc),s.setAttribute("data-webpack",r+o),s.src=n),e[n]=[a];var f=function(r,t){s.onerror=s.onload=null,clearTimeout(h);var a=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach(function(e){return e(t)}),r)return r(t)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror),s.onload=f.bind(null,s.onload),l&&document.head.appendChild(s)}})(),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.nc=void 0,(()=>{var e=[];t.O=(r,n,a,o)=>{if(n){o=o||0;for(var i=e.length;i>0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[n,a,o];return}for(var s=1/0,i=0;i<e.length;i++){for(var[n,a,o]=e[i],l=!0,c=0;c<n.length;c++)(!1&o||s>=o)&&Object.keys(t.O).every(e=>t.O[e](n[c]))?n.splice(c--,1):(l=!1,o<s&&(s=o));if(l){e.splice(i--,1);var d=a();void 0!==d&&(r=d)}}return r}})(),t.p="/plugins/TracingGanttChart/",t.rv=()=>"1.2.8",t.j="909",t.S={},t.initializeSharingData={scopeToSharingDataMapping:{default:[{name:"@emotion/react",version:"11.14.0",factory:()=>Promise.all([t.e("960"),t.e("677"),t.e("651")]).then(()=>()=>t(6434)),eager:0,singleton:1,requiredVersion:"^11.11.3"},{name:"@emotion/styled",version:"11.14.0",factory:()=>Promise.all([t.e("677"),t.e("157"),t.e("770")]).then(()=>()=>t(1958)),eager:0,singleton:1},{name:"@perses-dev/components",version:"0.51.0-rc.1",factory:()=>Promise.all([t.e("156"),t.e("193"),t.e("783"),t.e("677"),t.e("179"),t.e("157"),t.e("161"),t.e("946"),t.e("759")]).then(()=>()=>t(2084)),eager:0,singleton:1},{name:"date-fns",version:"4.1.0",factory:()=>Promise.all([t.e("156"),t.e("75")]).then(()=>()=>t(9657)),eager:0,singleton:1},{name:"lodash",version:"4.17.21",factory:()=>t.e("981").then(()=>()=>t(8784)),eager:0,singleton:1},{name:"react-dom",version:"18.3.1",factory:()=>Promise.all([t.e("173"),t.e("677")]).then(()=>()=>t(2652)),eager:0,singleton:1,requiredVersion:"18.2.0"},{name:"react-router-dom",version:"6.30.0",factory:()=>Promise.all([t.e("377"),t.e("677"),t.e("179")]).then(()=>()=>t(5895)),eager:0,singleton:1},{name:"react",version:"18.3.1",factory:()=>t.e("964").then(()=>()=>t(7378)),eager:0,singleton:1,requiredVersion:"18.2.0"}]},uniqueName:"TracingGanttChart"},t.I=t.I||function(){throw Error("should have __webpack_require__.I")},t.consumesLoadingData={chunkMapping:{161:["4665","461"],494:["7871"],946:["5913"],179:["6085"],157:["2116"],677:["4538"]},moduleIdToConsumeDataMapping:{461:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^4.1.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("75").then(()=>()=>t(9657))},5913:{shareScope:"default",shareKey:"@emotion/styled",import:"@emotion/styled",requiredVersion:"^11.3.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("694").then(()=>()=>t(1958))},4538:{shareScope:"default",shareKey:"react",import:"react",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("964").then(()=>()=>t(7378))},4665:{shareScope:"default",shareKey:"date-fns-tz",import:"date-fns-tz",requiredVersion:"^3.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>Promise.all([t.e("740"),t.e("494")]).then(()=>()=>t(8872))},7871:{shareScope:"default",shareKey:"date-fns",import:"date-fns",requiredVersion:"^3.0.0 || ^4.0.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("75").then(()=>()=>t(9657))},6085:{shareScope:"default",shareKey:"react-dom",import:"react-dom",requiredVersion:"18.2.0",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("173").then(()=>()=>t(2652))},2116:{shareScope:"default",shareKey:"@emotion/react",import:"@emotion/react",requiredVersion:"^11.11.3",strictVersion:!1,singleton:!0,eager:!1,fallback:()=>t.e("960").then(()=>()=>t(6434))}},initialConsumes:[]},t.f.consumes=t.f.consumes||function(){throw Error("should have __webpack_require__.f.consumes")},(()=>{if("undefined"!=typeof document){var e=function(e,r,n,a,o){var i=document.createElement("link");return i.rel="stylesheet",i.type="text/css",t.nc&&(i.nonce=t.nc),i.onerror=i.onload=function(t){if(i.onerror=i.onload=null,"load"===t.type)a();else{var n=t&&("load"===t.type?"missing":t.type),s=t&&t.target&&t.target.href||r,l=Error("Loading CSS chunk "+e+" failed.\\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=n,l.request=s,i.parentNode&&i.parentNode.removeChild(i),o(l)}},i.href=r,n?n.parentNode.insertBefore(i,n.nextSibling):document.head.appendChild(i),i},r=function(e,r){for(var t=document.getElementsByTagName("link"),n=0;n<t.length;n++){var a=t[n],o=a.getAttribute("data-href")||a.getAttribute("href");if("stylesheet"===a.rel&&(o===e||o===r))return a}for(var i=document.getElementsByTagName("style"),n=0;n<i.length;n++){var a=i[n],o=a.getAttribute("data-href");if(o===e||o===r)return a}},n={909:0};t.f.miniCss=function(a,o){if(n[a])o.push(n[a]);else if(0!==n[a]&&({759:1})[a])o.push(n[a]=new Promise(function(n,o){var i=t.miniCssF(a),s=t.p+i;if(r(i,s))return n();e(a,s,null,n,o)}).then(function(){n[a]=0},function(e){throw delete n[a],e}))}}})(),(()=>{var e={909:0};t.f.j=function(r,n){var a=t.o(e,r)?e[r]:void 0;if(0!==a){if(a)n.push(a[2]);else if(/^(1(57|61|79)|494|677|759|946)$/.test(r))e[r]=0;else{var o=new Promise((t,n)=>a=e[r]=[t,n]);n.push(a[2]=o);var i=t.p+t.u(r),s=Error();t.l(i,function(n){if(t.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+r+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,a[1](s)}},"chunk-"+r,r)}}},t.O.j=r=>0===e[r];var r=(r,n)=>{var a,o,[i,s,l]=n,c=0;if(i.some(r=>0!==e[r])){for(a in s)t.o(s,a)&&(t.m[a]=s[a]);if(l)var d=l(t)}for(r&&r(n);c<i.length;c++)o=i[c],t.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return t.O(d)},n=self.webpackChunkTracingGanttChart=self.webpackChunkTracingGanttChart||[];n.forEach(r.bind(null,0)),n.push=r.bind(null,n.push.bind(n))})(),t.ruid="bundler=rspack@1.2.8",t.O(void 0,["788"],function(){return t(2429)});var n=t.O(void 0,["788"],function(){return t(5311)});n=t.O(n)})();
|
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.7.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.906bee00.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
{
|
|
73
73
|
"id": "TracingGanttChart:@perses-dev/components",
|
|
74
74
|
"name": "@perses-dev/components",
|
|
75
|
-
"version": "0.51.0-rc.
|
|
75
|
+
"version": "0.51.0-rc.1",
|
|
76
76
|
"singleton": true,
|
|
77
|
-
"requiredVersion": "^0.51.0-rc.
|
|
77
|
+
"requiredVersion": "^0.51.0-rc.1",
|
|
78
78
|
"assets": {
|
|
79
79
|
"js": {
|
|
80
80
|
"async": [
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
"__mf/js/async/173.6314a363.js",
|
|
83
83
|
"__mf/js/async/960.478a8f11.js",
|
|
84
84
|
"__mf/js/async/694.4580ad20.js",
|
|
85
|
-
"__mf/js/async/
|
|
86
|
-
"__mf/js/async/
|
|
85
|
+
"__mf/js/async/75.d81e6bbf.js",
|
|
86
|
+
"__mf/js/async/740.babbb403.js"
|
|
87
87
|
],
|
|
88
88
|
"sync": [
|
|
89
|
-
"__mf/js/async/
|
|
89
|
+
"__mf/js/async/193.12ce9ab1.js"
|
|
90
90
|
]
|
|
91
91
|
},
|
|
92
92
|
"css": {
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
"sync": [
|
|
228
228
|
"__mf/js/async/783.3c2c57f6.js",
|
|
229
229
|
"__mf/js/async/511.b81ea373.js",
|
|
230
|
-
"__mf/js/async/__federation_expose_TracingGanttChart.
|
|
230
|
+
"__mf/js/async/__federation_expose_TracingGanttChart.cfa547a5.js"
|
|
231
231
|
],
|
|
232
232
|
"async": [
|
|
233
233
|
"__mf/js/async/964.a98cab40.js",
|
|
@@ -235,9 +235,9 @@
|
|
|
235
235
|
"__mf/js/async/960.478a8f11.js",
|
|
236
236
|
"__mf/js/async/694.4580ad20.js",
|
|
237
237
|
"__mf/js/async/156.5a401ecb.js",
|
|
238
|
-
"__mf/js/async/
|
|
239
|
-
"__mf/js/async/740.babbb403.js",
|
|
238
|
+
"__mf/js/async/193.12ce9ab1.js",
|
|
240
239
|
"__mf/js/async/75.d81e6bbf.js",
|
|
240
|
+
"__mf/js/async/740.babbb403.js",
|
|
241
241
|
"__mf/js/async/377.59c252c4.js",
|
|
242
242
|
"__mf/js/async/981.bc5132f8.js"
|
|
243
243
|
]
|
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.7.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.906bee00.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"singleton": true,
|
|
80
|
-
"requiredVersion": "^0.51.0-rc.
|
|
80
|
+
"requiredVersion": "^0.51.0-rc.1",
|
|
81
81
|
"shareScope": "default",
|
|
82
82
|
"name": "@perses-dev/components",
|
|
83
|
-
"version": "0.51.0-rc.
|
|
83
|
+
"version": "0.51.0-rc.1",
|
|
84
84
|
"eager": false,
|
|
85
85
|
"id": "TracingGanttChart:@perses-dev/components",
|
|
86
86
|
"assets": {
|
|
@@ -90,11 +90,11 @@
|
|
|
90
90
|
"__mf/js/async/173.6314a363.js",
|
|
91
91
|
"__mf/js/async/960.478a8f11.js",
|
|
92
92
|
"__mf/js/async/694.4580ad20.js",
|
|
93
|
-
"__mf/js/async/
|
|
94
|
-
"__mf/js/async/
|
|
93
|
+
"__mf/js/async/75.d81e6bbf.js",
|
|
94
|
+
"__mf/js/async/740.babbb403.js"
|
|
95
95
|
],
|
|
96
96
|
"sync": [
|
|
97
|
-
"__mf/js/async/
|
|
97
|
+
"__mf/js/async/193.12ce9ab1.js"
|
|
98
98
|
]
|
|
99
99
|
},
|
|
100
100
|
"css": {
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
"sync": [
|
|
271
271
|
"__mf/js/async/783.3c2c57f6.js",
|
|
272
272
|
"__mf/js/async/511.b81ea373.js",
|
|
273
|
-
"__mf/js/async/__federation_expose_TracingGanttChart.
|
|
273
|
+
"__mf/js/async/__federation_expose_TracingGanttChart.cfa547a5.js"
|
|
274
274
|
],
|
|
275
275
|
"async": [
|
|
276
276
|
"__mf/js/async/964.a98cab40.js",
|
|
@@ -278,9 +278,9 @@
|
|
|
278
278
|
"__mf/js/async/960.478a8f11.js",
|
|
279
279
|
"__mf/js/async/694.4580ad20.js",
|
|
280
280
|
"__mf/js/async/156.5a401ecb.js",
|
|
281
|
-
"__mf/js/async/
|
|
282
|
-
"__mf/js/async/740.babbb403.js",
|
|
281
|
+
"__mf/js/async/193.12ce9ab1.js",
|
|
283
282
|
"__mf/js/async/75.d81e6bbf.js",
|
|
283
|
+
"__mf/js/async/740.babbb403.js",
|
|
284
284
|
"__mf/js/async/377.59c252c4.js",
|
|
285
285
|
"__mf/js/async/981.bc5132f8.js"
|
|
286
286
|
]
|
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.7.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "rsbuild dev",
|
|
6
6
|
"build": "npm run build-mf && concurrently \"npm:build:*\"",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"@emotion/react": "^11.7.1",
|
|
23
23
|
"@emotion/styled": "^11.6.0",
|
|
24
24
|
"@hookform/resolvers": "^3.2.0",
|
|
25
|
-
"@perses-dev/components": "^0.51.0-rc.
|
|
26
|
-
"@perses-dev/core": "^0.51.0-rc.
|
|
27
|
-
"@perses-dev/plugin-system": "^0.51.0-rc.
|
|
25
|
+
"@perses-dev/components": "^0.51.0-rc.1",
|
|
26
|
+
"@perses-dev/core": "^0.51.0-rc.1",
|
|
27
|
+
"@perses-dev/plugin-system": "^0.51.0-rc.1",
|
|
28
28
|
"date-fns": "^4.1.0",
|
|
29
29
|
"date-fns-tz": "^3.2.0",
|
|
30
30
|
"echarts": "5.5.0",
|