@perses-dev/tracing-gantt-chart-plugin 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +41 -0
  3. package/__mf/css/async/341.6c6463ea.css +1 -0
  4. package/__mf/css/async/759.6c6463ea.css +1 -0
  5. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  6. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  7. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  8. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  9. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  10. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  11. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  12. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  13. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  14. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  15. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  16. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  17. package/__mf/js/788.91bbf7bd.js +5 -0
  18. package/__mf/js/TracingGanttChart.1a922a19.js +5 -0
  19. package/__mf/js/async/156.5a401ecb.js +1 -0
  20. package/__mf/js/async/173.6314a363.js +2 -0
  21. package/__mf/js/async/173.6314a363.js.LICENSE.txt +19 -0
  22. package/__mf/js/async/620.1d1ce390.js +2 -0
  23. package/__mf/js/async/620.1d1ce390.js.LICENSE.txt +9 -0
  24. package/__mf/js/async/651.3ea371e5.js +1 -0
  25. package/__mf/js/async/694.4580ad20.js +1 -0
  26. package/__mf/js/async/740.babbb403.js +1 -0
  27. package/__mf/js/async/75.d81e6bbf.js +1 -0
  28. package/__mf/js/async/770.5431adef.js +1 -0
  29. package/__mf/js/async/783.3c2c57f6.js +110 -0
  30. package/__mf/js/async/783.3c2c57f6.js.LICENSE.txt +27 -0
  31. package/__mf/js/async/844.556cc34d.js +66 -0
  32. package/__mf/js/async/844.556cc34d.js.LICENSE.txt +84 -0
  33. package/__mf/js/async/928.096f73eb.js +1 -0
  34. package/__mf/js/async/960.478a8f11.js +2 -0
  35. package/__mf/js/async/960.478a8f11.js.LICENSE.txt +8 -0
  36. package/__mf/js/async/964.a98cab40.js +2 -0
  37. package/__mf/js/async/964.a98cab40.js.LICENSE.txt +9 -0
  38. package/__mf/js/async/981.bc5132f8.js +2 -0
  39. package/__mf/js/async/981.bc5132f8.js.LICENSE.txt +8 -0
  40. package/__mf/js/async/__federation_expose_TracingGanttChart.5ab86c44.js +1 -0
  41. package/__mf/js/async/lib-router.36c0d526.js +2 -0
  42. package/__mf/js/async/lib-router.36c0d526.js.LICENSE.txt +32 -0
  43. package/__mf/js/main.e75dea7b.js +1 -0
  44. package/lib/TracingGanttChart/DetailPane/Attributes.d.ts +9 -0
  45. package/lib/TracingGanttChart/DetailPane/Attributes.d.ts.map +1 -0
  46. package/lib/TracingGanttChart/DetailPane/Attributes.js +66 -0
  47. package/lib/TracingGanttChart/DetailPane/Attributes.js.map +1 -0
  48. package/lib/TracingGanttChart/DetailPane/DetailPane.d.ts +14 -0
  49. package/lib/TracingGanttChart/DetailPane/DetailPane.d.ts.map +1 -0
  50. package/lib/TracingGanttChart/DetailPane/DetailPane.js +95 -0
  51. package/lib/TracingGanttChart/DetailPane/DetailPane.js.map +1 -0
  52. package/lib/TracingGanttChart/DetailPane/SpanEvents.d.ts +8 -0
  53. package/lib/TracingGanttChart/DetailPane/SpanEvents.d.ts.map +1 -0
  54. package/lib/TracingGanttChart/DetailPane/SpanEvents.js +54 -0
  55. package/lib/TracingGanttChart/DetailPane/SpanEvents.js.map +1 -0
  56. package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts +13 -0
  57. package/lib/TracingGanttChart/GanttTable/GanttTable.d.ts.map +1 -0
  58. package/lib/TracingGanttChart/GanttTable/GanttTable.js +93 -0
  59. package/lib/TracingGanttChart/GanttTable/GanttTable.js.map +1 -0
  60. package/lib/TracingGanttChart/GanttTable/GanttTableHeader.d.ts +12 -0
  61. package/lib/TracingGanttChart/GanttTable/GanttTableHeader.d.ts.map +1 -0
  62. package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js +56 -0
  63. package/lib/TracingGanttChart/GanttTable/GanttTableHeader.js.map +1 -0
  64. package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts +23 -0
  65. package/lib/TracingGanttChart/GanttTable/GanttTableProvider.d.ts.map +1 -0
  66. package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js +45 -0
  67. package/lib/TracingGanttChart/GanttTable/GanttTableProvider.js.map +1 -0
  68. package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts +15 -0
  69. package/lib/TracingGanttChart/GanttTable/GanttTableRow.d.ts.map +1 -0
  70. package/lib/TracingGanttChart/GanttTable/GanttTableRow.js +56 -0
  71. package/lib/TracingGanttChart/GanttTable/GanttTableRow.js.map +1 -0
  72. package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts +9 -0
  73. package/lib/TracingGanttChart/GanttTable/ResizableDivider.d.ts.map +1 -0
  74. package/lib/TracingGanttChart/GanttTable/ResizableDivider.js +86 -0
  75. package/lib/TracingGanttChart/GanttTable/ResizableDivider.js.map +1 -0
  76. package/lib/TracingGanttChart/GanttTable/SpanDuration.d.ts +14 -0
  77. package/lib/TracingGanttChart/GanttTable/SpanDuration.d.ts.map +1 -0
  78. package/lib/TracingGanttChart/GanttTable/SpanDuration.js +75 -0
  79. package/lib/TracingGanttChart/GanttTable/SpanDuration.js.map +1 -0
  80. package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts +14 -0
  81. package/lib/TracingGanttChart/GanttTable/SpanIndents.d.ts.map +1 -0
  82. package/lib/TracingGanttChart/GanttTable/SpanIndents.js +90 -0
  83. package/lib/TracingGanttChart/GanttTable/SpanIndents.js.map +1 -0
  84. package/lib/TracingGanttChart/GanttTable/SpanName.d.ts +11 -0
  85. package/lib/TracingGanttChart/GanttTable/SpanName.d.ts.map +1 -0
  86. package/lib/TracingGanttChart/GanttTable/SpanName.js +61 -0
  87. package/lib/TracingGanttChart/GanttTable/SpanName.js.map +1 -0
  88. package/lib/TracingGanttChart/MiniGanttChart/Canvas.d.ts +13 -0
  89. package/lib/TracingGanttChart/MiniGanttChart/Canvas.d.ts.map +1 -0
  90. package/lib/TracingGanttChart/MiniGanttChart/Canvas.js +243 -0
  91. package/lib/TracingGanttChart/MiniGanttChart/Canvas.js.map +1 -0
  92. package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.d.ts +13 -0
  93. package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.d.ts.map +1 -0
  94. package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js +51 -0
  95. package/lib/TracingGanttChart/MiniGanttChart/MiniGanttChart.js.map +1 -0
  96. package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts +3 -0
  97. package/lib/TracingGanttChart/MiniGanttChart/draw.d.ts.map +1 -0
  98. package/lib/TracingGanttChart/MiniGanttChart/draw.js +48 -0
  99. package/lib/TracingGanttChart/MiniGanttChart/draw.js.map +1 -0
  100. package/lib/TracingGanttChart/Ticks.d.ts +16 -0
  101. package/lib/TracingGanttChart/Ticks.d.ts.map +1 -0
  102. package/lib/TracingGanttChart/Ticks.js +94 -0
  103. package/lib/TracingGanttChart/Ticks.js.map +1 -0
  104. package/lib/TracingGanttChart/TracingGanttChart.d.ts +17 -0
  105. package/lib/TracingGanttChart/TracingGanttChart.d.ts.map +1 -0
  106. package/lib/TracingGanttChart/TracingGanttChart.js +106 -0
  107. package/lib/TracingGanttChart/TracingGanttChart.js.map +1 -0
  108. package/lib/TracingGanttChart/palette.d.ts +6 -0
  109. package/lib/TracingGanttChart/palette.d.ts.map +1 -0
  110. package/lib/TracingGanttChart/palette.js +64 -0
  111. package/lib/TracingGanttChart/palette.js.map +1 -0
  112. package/lib/TracingGanttChart/trace.d.ts +45 -0
  113. package/lib/TracingGanttChart/trace.d.ts.map +1 -0
  114. package/lib/TracingGanttChart/trace.js +109 -0
  115. package/lib/TracingGanttChart/trace.js.map +1 -0
  116. package/lib/TracingGanttChart/utils.d.ts +18 -0
  117. package/lib/TracingGanttChart/utils.d.ts.map +1 -0
  118. package/lib/TracingGanttChart/utils.js +48 -0
  119. package/lib/TracingGanttChart/utils.js.map +1 -0
  120. package/lib/TracingGanttChart.d.ts +5 -0
  121. package/lib/TracingGanttChart.d.ts.map +1 -0
  122. package/lib/TracingGanttChart.js +23 -0
  123. package/lib/TracingGanttChart.js.map +1 -0
  124. package/lib/TracingGanttChartPanel.d.ts +17 -0
  125. package/lib/TracingGanttChartPanel.d.ts.map +1 -0
  126. package/lib/TracingGanttChartPanel.js +45 -0
  127. package/lib/TracingGanttChartPanel.js.map +1 -0
  128. package/lib/bootstrap.d.ts +2 -0
  129. package/lib/bootstrap.d.ts.map +1 -0
  130. package/lib/bootstrap.js +19 -0
  131. package/lib/bootstrap.js.map +1 -0
  132. package/lib/cjs/TracingGanttChart/DetailPane/Attributes.js +74 -0
  133. package/lib/cjs/TracingGanttChart/DetailPane/DetailPane.js +106 -0
  134. package/lib/cjs/TracingGanttChart/DetailPane/SpanEvents.js +67 -0
  135. package/lib/cjs/TracingGanttChart/GanttTable/GanttTable.js +101 -0
  136. package/lib/cjs/TracingGanttChart/GanttTable/GanttTableHeader.js +64 -0
  137. package/lib/cjs/TracingGanttChart/GanttTable/GanttTableProvider.js +60 -0
  138. package/lib/cjs/TracingGanttChart/GanttTable/GanttTableRow.js +64 -0
  139. package/lib/cjs/TracingGanttChart/GanttTable/ResizableDivider.js +94 -0
  140. package/lib/cjs/TracingGanttChart/GanttTable/SpanDuration.js +81 -0
  141. package/lib/cjs/TracingGanttChart/GanttTable/SpanIndents.js +97 -0
  142. package/lib/cjs/TracingGanttChart/GanttTable/SpanName.js +72 -0
  143. package/lib/cjs/TracingGanttChart/MiniGanttChart/Canvas.js +256 -0
  144. package/lib/cjs/TracingGanttChart/MiniGanttChart/MiniGanttChart.js +59 -0
  145. package/lib/cjs/TracingGanttChart/MiniGanttChart/draw.js +56 -0
  146. package/lib/cjs/TracingGanttChart/Ticks.js +106 -0
  147. package/lib/cjs/TracingGanttChart/TracingGanttChart.js +109 -0
  148. package/lib/cjs/TracingGanttChart/palette.js +83 -0
  149. package/lib/cjs/TracingGanttChart/trace.js +113 -0
  150. package/lib/cjs/TracingGanttChart/utils.js +76 -0
  151. package/lib/cjs/TracingGanttChart.js +31 -0
  152. package/lib/cjs/TracingGanttChartPanel.js +53 -0
  153. package/lib/cjs/bootstrap.js +26 -0
  154. package/lib/cjs/env.d.js +14 -0
  155. package/lib/cjs/gantt-chart-model.js +28 -0
  156. package/lib/cjs/getPluginModule.js +27 -0
  157. package/lib/cjs/index-federation.js +55 -0
  158. package/lib/cjs/index.js +27 -0
  159. package/lib/cjs/setup-tests.js +19 -0
  160. package/lib/cjs/test/convert/jaeger.js +86 -0
  161. package/lib/env.d.js +15 -0
  162. package/lib/env.d.js.map +1 -0
  163. package/lib/gantt-chart-model.d.ts +17 -0
  164. package/lib/gantt-chart-model.d.ts.map +1 -0
  165. package/lib/gantt-chart-model.js +22 -0
  166. package/lib/gantt-chart-model.js.map +1 -0
  167. package/lib/getPluginModule.d.ts +6 -0
  168. package/lib/getPluginModule.d.ts.map +1 -0
  169. package/lib/getPluginModule.js +16 -0
  170. package/lib/getPluginModule.js.map +1 -0
  171. package/lib/index-federation.d.ts +1 -0
  172. package/lib/index-federation.d.ts.map +1 -0
  173. package/lib/index-federation.js +15 -0
  174. package/lib/index-federation.js.map +1 -0
  175. package/lib/index.d.ts +5 -0
  176. package/lib/index.d.ts.map +1 -0
  177. package/lib/index.js +6 -0
  178. package/lib/index.js.map +1 -0
  179. package/lib/setup-tests.d.ts +2 -0
  180. package/lib/setup-tests.d.ts.map +1 -0
  181. package/lib/setup-tests.js +17 -0
  182. package/lib/setup-tests.js.map +1 -0
  183. package/lib/test/convert/jaeger.d.ts +41 -0
  184. package/lib/test/convert/jaeger.d.ts.map +1 -0
  185. package/lib/test/convert/jaeger.js +78 -0
  186. package/lib/test/convert/jaeger.js.map +1 -0
  187. package/mf-manifest.json +233 -0
  188. package/mf-stats.json +269 -0
  189. package/package.json +58 -0
@@ -0,0 +1,243 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Box, styled, useTheme } from '@mui/material';
15
+ import useResizeObserver from 'use-resize-observer';
16
+ import { useEffect, useRef, useState, useCallback } from 'react';
17
+ import { useEvent } from '@perses-dev/core';
18
+ import { useChartsTheme } from '@perses-dev/components';
19
+ import { Ticks } from '../Ticks';
20
+ import { getSpanColor } from '../utils';
21
+ import { drawSpans } from './draw';
22
+ const CANVAS_HEIGHT = 60;
23
+ export function Canvas(props) {
24
+ const { options, trace, viewport, setViewport } = props;
25
+ const muiTheme = useTheme();
26
+ const chartsTheme = useChartsTheme();
27
+ // the <canvas> element must have an absolute width and height to avoid rendering problems
28
+ // the wrapper box is required to get the available dimensions for the <canvas> element
29
+ const { width, ref: wrapperRef } = useResizeObserver();
30
+ const height = CANVAS_HEIGHT;
31
+ const canvasRef = useRef(null);
32
+ const [mouseState, setMouseState] = useState({
33
+ type: 'none'
34
+ });
35
+ const traceDuration = trace.endTimeUnixMs - trace.startTimeUnixMs;
36
+ const relativeCutoffLeft = (viewport.startTimeUnixMs - trace.startTimeUnixMs) / traceDuration;
37
+ const relativeCutoffRight = (trace.endTimeUnixMs - viewport.endTimeUnixMs) / traceDuration;
38
+ const spanColorGenerator = useCallback((span)=>getSpanColor(muiTheme, chartsTheme, options.visual?.palette?.mode, span), [
39
+ muiTheme,
40
+ chartsTheme,
41
+ options.visual?.palette?.mode
42
+ ]);
43
+ useEffect(()=>{
44
+ if (!canvasRef.current || !width || !height) return;
45
+ const ctx = canvasRef.current.getContext('2d');
46
+ if (!ctx) return;
47
+ drawSpans(ctx, width, height, trace, spanColorGenerator);
48
+ }, [
49
+ width,
50
+ height,
51
+ trace,
52
+ spanColorGenerator
53
+ ]);
54
+ const translateCursorToTime = (e)=>{
55
+ if (!canvasRef.current || !width) return 0;
56
+ // e.nativeEvent.offsetX doesn't work when sliding over a tick box
57
+ const offsetX = e.clientX - canvasRef.current.getBoundingClientRect().left;
58
+ return trace.startTimeUnixMs + offsetX / width * traceDuration;
59
+ };
60
+ const handleMouseDown = (e)=>{
61
+ e.preventDefault();
62
+ if (!(e.target instanceof HTMLElement)) return;
63
+ const isDefaultViewport = viewport.startTimeUnixMs === trace.startTimeUnixMs && viewport.endTimeUnixMs === trace.endTimeUnixMs;
64
+ const elem = e.target.dataset['elem'];
65
+ const cursor = translateCursorToTime(e);
66
+ if (elem === 'resizerLeft') {
67
+ setMouseState({
68
+ type: 'resize',
69
+ fixedPoint: viewport.endTimeUnixMs
70
+ });
71
+ } else if (elem === 'resizerRight') {
72
+ setMouseState({
73
+ type: 'resize',
74
+ fixedPoint: viewport.startTimeUnixMs
75
+ });
76
+ } else if (elem === 'cutoffBox' || isDefaultViewport) {
77
+ setMouseState({
78
+ type: 'resize',
79
+ fixedPoint: cursor
80
+ });
81
+ setViewport({
82
+ startTimeUnixMs: cursor,
83
+ endTimeUnixMs: cursor
84
+ });
85
+ } else {
86
+ setMouseState({
87
+ type: 'drag',
88
+ start: cursor - viewport.startTimeUnixMs,
89
+ end: viewport.endTimeUnixMs - cursor
90
+ });
91
+ }
92
+ };
93
+ // need stable reference for window.removeEventListener() in useEffect() below
94
+ const handleMouseMove = useEvent((e)=>{
95
+ e.preventDefault();
96
+ switch(mouseState.type){
97
+ case 'none':
98
+ return;
99
+ case 'resize':
100
+ {
101
+ const pointA = mouseState.fixedPoint;
102
+ const pointB = translateCursorToTime(e);
103
+ let start, end;
104
+ if (pointA < pointB) {
105
+ start = pointA;
106
+ end = pointB;
107
+ } else {
108
+ start = pointB;
109
+ end = pointA;
110
+ }
111
+ setViewport({
112
+ startTimeUnixMs: Math.max(start, trace.startTimeUnixMs),
113
+ endTimeUnixMs: Math.min(end, trace.endTimeUnixMs)
114
+ });
115
+ return;
116
+ }
117
+ case 'drag':
118
+ {
119
+ // avoid using e.movementX here, as it skips events in chrome,
120
+ // resulting in the mouse pointer moving faster than the viewport box
121
+ const { start, end } = mouseState;
122
+ let cursor = translateCursorToTime(e);
123
+ if (cursor - start < trace.startTimeUnixMs) {
124
+ cursor = trace.startTimeUnixMs + start;
125
+ }
126
+ if (cursor + end > trace.endTimeUnixMs) {
127
+ cursor = trace.endTimeUnixMs - end;
128
+ }
129
+ setViewport({
130
+ startTimeUnixMs: cursor - start,
131
+ endTimeUnixMs: cursor + end
132
+ });
133
+ return;
134
+ }
135
+ }
136
+ });
137
+ // need stable reference for window.removeEventListener() in useEffect() below
138
+ const handleMouseUp = useEvent((e)=>{
139
+ e.preventDefault();
140
+ setMouseState({
141
+ type: 'none'
142
+ });
143
+ // reset viewport if start === end, i.e. a click without movement
144
+ if (viewport.startTimeUnixMs === viewport.endTimeUnixMs) {
145
+ setViewport({
146
+ startTimeUnixMs: trace.startTimeUnixMs,
147
+ endTimeUnixMs: trace.endTimeUnixMs
148
+ });
149
+ }
150
+ });
151
+ // capture mouseMove and mouseUp outside the element by attaching them to the window object
152
+ useEffect(()=>{
153
+ function startMouseAction() {
154
+ window.addEventListener('mousemove', handleMouseMove);
155
+ window.addEventListener('mouseup', handleMouseUp);
156
+ document.body.style.cursor = mouseState.type === 'resize' ? 'col-resize' : 'move';
157
+ }
158
+ function stopMouseAction() {
159
+ window.removeEventListener('mousemove', handleMouseMove);
160
+ window.removeEventListener('mouseup', handleMouseUp);
161
+ document.body.style.cursor = 'inherit';
162
+ }
163
+ if (mouseState.type === 'none') {
164
+ stopMouseAction();
165
+ } else {
166
+ startMouseAction();
167
+ }
168
+ return stopMouseAction;
169
+ }, [
170
+ mouseState,
171
+ handleMouseMove,
172
+ handleMouseUp
173
+ ]);
174
+ return /*#__PURE__*/ _jsxs(Box, {
175
+ ref: wrapperRef,
176
+ sx: {
177
+ position: 'relative',
178
+ height
179
+ },
180
+ onMouseDown: handleMouseDown,
181
+ children: [
182
+ /*#__PURE__*/ _jsx("canvas", {
183
+ ref: canvasRef,
184
+ width: width,
185
+ height: height,
186
+ style: {
187
+ position: 'absolute'
188
+ }
189
+ }),
190
+ /*#__PURE__*/ _jsx(Ticks, {}),
191
+ /*#__PURE__*/ _jsx(CutoffBox, {
192
+ "data-elem": "cutoffBox",
193
+ style: {
194
+ left: 0,
195
+ width: `${relativeCutoffLeft * 100}%`
196
+ }
197
+ }),
198
+ /*#__PURE__*/ _jsx(Resizer, {
199
+ "data-elem": "resizerLeft",
200
+ style: {
201
+ left: `${relativeCutoffLeft * 100}%`
202
+ }
203
+ }),
204
+ /*#__PURE__*/ _jsx(Resizer, {
205
+ "data-elem": "resizerRight",
206
+ style: {
207
+ right: `${relativeCutoffRight * 100}%`
208
+ }
209
+ }),
210
+ /*#__PURE__*/ _jsx(CutoffBox, {
211
+ "data-elem": "cutoffBox",
212
+ style: {
213
+ right: 0,
214
+ width: `${relativeCutoffRight * 100}%`
215
+ }
216
+ })
217
+ ]
218
+ });
219
+ }
220
+ const CutoffBox = styled(Box)({
221
+ position: 'absolute',
222
+ height: '100%',
223
+ backgroundColor: 'rgba(225, 225, 225, .5)'
224
+ });
225
+ const Resizer = styled(Box)(({ theme })=>({
226
+ position: 'absolute',
227
+ height: '100%',
228
+ backgroundColor: theme.palette.divider,
229
+ width: '2px',
230
+ cursor: 'col-resize',
231
+ // increase clickable area from 2px to 8px
232
+ '&:before': {
233
+ position: 'absolute',
234
+ width: '8px',
235
+ left: '-3px',
236
+ top: 0,
237
+ bottom: 0,
238
+ content: '" "',
239
+ zIndex: 1
240
+ }
241
+ }));
242
+
243
+ //# sourceMappingURL=Canvas.js.map
@@ -0,0 +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":"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"}
@@ -0,0 +1,13 @@
1
+ import { ReactElement } from 'react';
2
+ import { Viewport } from '../utils';
3
+ import { TracingGanttChartOptions } from '../../gantt-chart-model';
4
+ import { Trace } from '../trace';
5
+ interface MiniGanttChartProps {
6
+ options: TracingGanttChartOptions;
7
+ trace: Trace;
8
+ viewport: Viewport;
9
+ setViewport: (v: Viewport) => void;
10
+ }
11
+ export declare function MiniGanttChart(props: MiniGanttChartProps): ReactElement;
12
+ export {};
13
+ //# sourceMappingURL=MiniGanttChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MiniGanttChart.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/MiniGanttChart/MiniGanttChart.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAa,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGjC,UAAU,mBAAmB;IAC3B,OAAO,EAAE,wBAAwB,CAAC;IAClC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,CAAC,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAC;CACpC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAoBvE"}
@@ -0,0 +1,51 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { Box, useTheme } from '@mui/material';
15
+ import { TicksHeader } from '../Ticks';
16
+ import { rowHeight } from '../utils';
17
+ import { Canvas } from './Canvas';
18
+ export function MiniGanttChart(props) {
19
+ const { options, trace, viewport, setViewport } = props;
20
+ const theme = useTheme();
21
+ return /*#__PURE__*/ _jsxs(Box, {
22
+ sx: {
23
+ border: `1px solid ${theme.palette.divider}`,
24
+ borderRadius: `${theme.shape.borderRadius}px`
25
+ },
26
+ children: [
27
+ /*#__PURE__*/ _jsx(Box, {
28
+ sx: {
29
+ position: 'relative',
30
+ height: rowHeight,
31
+ borderBottom: `1px solid ${theme.palette.divider}`
32
+ },
33
+ children: /*#__PURE__*/ _jsx(TicksHeader, {
34
+ trace: trace,
35
+ viewport: {
36
+ startTimeUnixMs: trace.startTimeUnixMs,
37
+ endTimeUnixMs: trace.endTimeUnixMs
38
+ }
39
+ })
40
+ }),
41
+ /*#__PURE__*/ _jsx(Canvas, {
42
+ options: options,
43
+ trace: trace,
44
+ viewport: viewport,
45
+ setViewport: setViewport
46
+ })
47
+ ]
48
+ });
49
+ }
50
+
51
+ //# sourceMappingURL=MiniGanttChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/TracingGanttChart/MiniGanttChart/MiniGanttChart.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, useTheme } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TicksHeader } from '../Ticks';\nimport { Viewport, rowHeight } from '../utils';\nimport { TracingGanttChartOptions } from '../../gantt-chart-model';\nimport { Trace } from '../trace';\nimport { Canvas } from './Canvas';\n\ninterface MiniGanttChartProps {\n options: TracingGanttChartOptions;\n trace: Trace;\n viewport: Viewport;\n setViewport: (v: Viewport) => void;\n}\n\nexport function MiniGanttChart(props: MiniGanttChartProps): ReactElement {\n const { options, trace, viewport, setViewport } = props;\n const theme = useTheme();\n\n return (\n <Box\n sx={{\n border: `1px solid ${theme.palette.divider}`,\n borderRadius: `${theme.shape.borderRadius}px`,\n }}\n >\n <Box sx={{ position: 'relative', height: rowHeight, borderBottom: `1px solid ${theme.palette.divider}` }}>\n <TicksHeader\n trace={trace}\n viewport={{ startTimeUnixMs: trace.startTimeUnixMs, endTimeUnixMs: trace.endTimeUnixMs }}\n />\n </Box>\n <Canvas options={options} trace={trace} viewport={viewport} setViewport={setViewport} />\n </Box>\n );\n}\n"],"names":["Box","useTheme","TicksHeader","rowHeight","Canvas","MiniGanttChart","props","options","trace","viewport","setViewport","theme","sx","border","palette","divider","borderRadius","shape","position","height","borderBottom","startTimeUnixMs","endTimeUnixMs"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAEC,QAAQ,QAAQ,gBAAgB;AAE9C,SAASC,WAAW,QAAQ,WAAW;AACvC,SAAmBC,SAAS,QAAQ,WAAW;AAG/C,SAASC,MAAM,QAAQ,WAAW;AASlC,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,EAAE,GAAGJ;IAClD,MAAMK,QAAQV;IAEd,qBACE,MAACD;QACCY,IAAI;YACFC,QAAQ,CAAC,UAAU,EAAEF,MAAMG,OAAO,CAACC,OAAO,EAAE;YAC5CC,cAAc,GAAGL,MAAMM,KAAK,CAACD,YAAY,CAAC,EAAE,CAAC;QAC/C;;0BAEA,KAAChB;gBAAIY,IAAI;oBAAEM,UAAU;oBAAYC,QAAQhB;oBAAWiB,cAAc,CAAC,UAAU,EAAET,MAAMG,OAAO,CAACC,OAAO,EAAE;gBAAC;0BACrG,cAAA,KAACb;oBACCM,OAAOA;oBACPC,UAAU;wBAAEY,iBAAiBb,MAAMa,eAAe;wBAAEC,eAAed,MAAMc,aAAa;oBAAC;;;0BAG3F,KAAClB;gBAAOG,SAASA;gBAASC,OAAOA;gBAAOC,UAAUA;gBAAUC,aAAaA;;;;AAG/E"}
@@ -0,0 +1,3 @@
1
+ import { Span, Trace } from '../trace';
2
+ export declare function drawSpans(ctx: CanvasRenderingContext2D, width: number, height: number, trace: Trace, spanColorGenerator: (span: Span) => string): void;
3
+ //# sourceMappingURL=draw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../../../src/TracingGanttChart/MiniGanttChart/draw.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAcvC,wBAAgB,SAAS,CACvB,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,GACzC,IAAI,CAiCN"}
@@ -0,0 +1,48 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { minSpanWidthPx } from '../utils';
14
+ const MIN_BAR_HEIGHT = 1;
15
+ const MAX_BAR_HEIGHT = 7;
16
+ function countSpans(span) {
17
+ let n = 1;
18
+ for (const childSpan of span.childSpans){
19
+ n += countSpans(childSpan);
20
+ }
21
+ return n;
22
+ }
23
+ export function drawSpans(ctx, width, height, trace, spanColorGenerator) {
24
+ // calculate optimal height, enforce min and max bar height and finally round to an integer
25
+ const numSpans = trace.rootSpans.map(countSpans).reduce((acc, n)=>acc + n, 0);
26
+ const barHeight = Math.round(Math.min(Math.max(height / numSpans, MIN_BAR_HEIGHT), MAX_BAR_HEIGHT));
27
+ const traceDuration = trace.endTimeUnixMs - trace.startTimeUnixMs;
28
+ const yChange = height / numSpans;
29
+ let y = 0;
30
+ const drawSpan = (span)=>{
31
+ const spanDuration = span.endTimeUnixMs - span.startTimeUnixMs;
32
+ const relativeDuration = spanDuration / traceDuration;
33
+ const relativeStart = (span.startTimeUnixMs - trace.startTimeUnixMs) / traceDuration;
34
+ ctx.fillStyle = spanColorGenerator(span);
35
+ ctx.beginPath();
36
+ ctx.rect(Math.round(relativeStart * width), Math.round(y), Math.max(minSpanWidthPx, Math.round(relativeDuration * width)), barHeight);
37
+ ctx.fill();
38
+ y += yChange;
39
+ for (const childSpan of span.childSpans){
40
+ drawSpan(childSpan);
41
+ }
42
+ };
43
+ for (const rootSpan of trace.rootSpans){
44
+ drawSpan(rootSpan);
45
+ }
46
+ }
47
+
48
+ //# sourceMappingURL=draw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/TracingGanttChart/MiniGanttChart/draw.ts"],"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 { Span, Trace } from '../trace';\nimport { minSpanWidthPx } from '../utils';\n\nconst MIN_BAR_HEIGHT = 1;\nconst MAX_BAR_HEIGHT = 7;\n\nfunction countSpans(span: Span): number {\n let n = 1;\n for (const childSpan of span.childSpans) {\n n += countSpans(childSpan);\n }\n return n;\n}\n\nexport function drawSpans(\n ctx: CanvasRenderingContext2D,\n width: number,\n height: number,\n trace: Trace,\n spanColorGenerator: (span: Span) => string\n): void {\n // calculate optimal height, enforce min and max bar height and finally round to an integer\n const numSpans = trace.rootSpans.map(countSpans).reduce((acc, n) => acc + n, 0);\n const barHeight = Math.round(Math.min(Math.max(height / numSpans, MIN_BAR_HEIGHT), MAX_BAR_HEIGHT));\n\n const traceDuration = trace.endTimeUnixMs - trace.startTimeUnixMs;\n const yChange = height / numSpans;\n let y = 0;\n\n const drawSpan = (span: Span): void => {\n const spanDuration = span.endTimeUnixMs - span.startTimeUnixMs;\n const relativeDuration = spanDuration / traceDuration;\n const relativeStart = (span.startTimeUnixMs - trace.startTimeUnixMs) / traceDuration;\n\n ctx.fillStyle = spanColorGenerator(span);\n ctx.beginPath();\n ctx.rect(\n Math.round(relativeStart * width),\n Math.round(y),\n Math.max(minSpanWidthPx, Math.round(relativeDuration * width)),\n barHeight\n );\n ctx.fill();\n y += yChange;\n\n for (const childSpan of span.childSpans) {\n drawSpan(childSpan);\n }\n };\n\n for (const rootSpan of trace.rootSpans) {\n drawSpan(rootSpan);\n }\n}\n"],"names":["minSpanWidthPx","MIN_BAR_HEIGHT","MAX_BAR_HEIGHT","countSpans","span","n","childSpan","childSpans","drawSpans","ctx","width","height","trace","spanColorGenerator","numSpans","rootSpans","map","reduce","acc","barHeight","Math","round","min","max","traceDuration","endTimeUnixMs","startTimeUnixMs","yChange","y","drawSpan","spanDuration","relativeDuration","relativeStart","fillStyle","beginPath","rect","fill","rootSpan"],"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;AAGjC,SAASA,cAAc,QAAQ,WAAW;AAE1C,MAAMC,iBAAiB;AACvB,MAAMC,iBAAiB;AAEvB,SAASC,WAAWC,IAAU;IAC5B,IAAIC,IAAI;IACR,KAAK,MAAMC,aAAaF,KAAKG,UAAU,CAAE;QACvCF,KAAKF,WAAWG;IAClB;IACA,OAAOD;AACT;AAEA,OAAO,SAASG,UACdC,GAA6B,EAC7BC,KAAa,EACbC,MAAc,EACdC,KAAY,EACZC,kBAA0C;IAE1C,2FAA2F;IAC3F,MAAMC,WAAWF,MAAMG,SAAS,CAACC,GAAG,CAACb,YAAYc,MAAM,CAAC,CAACC,KAAKb,IAAMa,MAAMb,GAAG;IAC7E,MAAMc,YAAYC,KAAKC,KAAK,CAACD,KAAKE,GAAG,CAACF,KAAKG,GAAG,CAACZ,SAASG,UAAUb,iBAAiBC;IAEnF,MAAMsB,gBAAgBZ,MAAMa,aAAa,GAAGb,MAAMc,eAAe;IACjE,MAAMC,UAAUhB,SAASG;IACzB,IAAIc,IAAI;IAER,MAAMC,WAAW,CAACzB;QAChB,MAAM0B,eAAe1B,KAAKqB,aAAa,GAAGrB,KAAKsB,eAAe;QAC9D,MAAMK,mBAAmBD,eAAeN;QACxC,MAAMQ,gBAAgB,AAAC5B,CAAAA,KAAKsB,eAAe,GAAGd,MAAMc,eAAe,AAAD,IAAKF;QAEvEf,IAAIwB,SAAS,GAAGpB,mBAAmBT;QACnCK,IAAIyB,SAAS;QACbzB,IAAI0B,IAAI,CACNf,KAAKC,KAAK,CAACW,gBAAgBtB,QAC3BU,KAAKC,KAAK,CAACO,IACXR,KAAKG,GAAG,CAACvB,gBAAgBoB,KAAKC,KAAK,CAACU,mBAAmBrB,SACvDS;QAEFV,IAAI2B,IAAI;QACRR,KAAKD;QAEL,KAAK,MAAMrB,aAAaF,KAAKG,UAAU,CAAE;YACvCsB,SAASvB;QACX;IACF;IAEA,KAAK,MAAM+B,YAAYzB,MAAMG,SAAS,CAAE;QACtCc,SAASQ;IACX;AACF"}
@@ -0,0 +1,16 @@
1
+ import { ReactElement } from 'react';
2
+ import { Viewport } from './utils';
3
+ import { Trace } from './trace';
4
+ export interface TicksHeaderProps {
5
+ trace: Trace;
6
+ viewport: Viewport;
7
+ }
8
+ /**
9
+ * TicksHeader renders all tick labels in the header
10
+ */
11
+ export declare function TicksHeader(props: TicksHeaderProps): ReactElement;
12
+ /**
13
+ * Ticks renders all ticks in the span duration
14
+ */
15
+ export declare function Ticks(): ReactElement;
16
+ //# sourceMappingURL=Ticks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ticks.d.ts","sourceRoot":"","sources":["../../../src/TracingGanttChart/Ticks.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAkB,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAiBjE;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,YAAY,CAQpC"}
@@ -0,0 +1,94 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { Box, styled } from '@mui/material';
15
+ import { formatDuration } from './utils';
16
+ /**
17
+ * TicksHeader renders all tick labels in the header
18
+ */ export function TicksHeader(props) {
19
+ const { trace, viewport } = props;
20
+ const duration = viewport.endTimeUnixMs - viewport.startTimeUnixMs;
21
+ const startAt = viewport.startTimeUnixMs - trace.startTimeUnixMs;
22
+ return /*#__PURE__*/ _jsxs(_Fragment, {
23
+ children: [
24
+ /*#__PURE__*/ _jsx(TickBox, {
25
+ style: {
26
+ left: '0%',
27
+ borderWidth: 0
28
+ },
29
+ children: formatDuration(startAt + duration * 0)
30
+ }),
31
+ /*#__PURE__*/ _jsx(TickBox, {
32
+ style: {
33
+ left: '25%'
34
+ },
35
+ children: formatDuration(startAt + duration * 0.25)
36
+ }),
37
+ /*#__PURE__*/ _jsx(TickBox, {
38
+ style: {
39
+ left: '50%'
40
+ },
41
+ children: formatDuration(startAt + duration * 0.5)
42
+ }),
43
+ /*#__PURE__*/ _jsx(TickBox, {
44
+ style: {
45
+ left: '75%'
46
+ },
47
+ children: formatDuration(startAt + duration * 0.75)
48
+ }),
49
+ /*#__PURE__*/ _jsx(TickBox, {
50
+ style: {
51
+ left: '100%'
52
+ },
53
+ children: /*#__PURE__*/ _jsx("span", {
54
+ style: {
55
+ position: 'absolute',
56
+ right: '.75rem'
57
+ },
58
+ children: formatDuration(startAt + duration * 1)
59
+ })
60
+ })
61
+ ]
62
+ });
63
+ }
64
+ /**
65
+ * Ticks renders all ticks in the span duration
66
+ */ export function Ticks() {
67
+ return /*#__PURE__*/ _jsxs(_Fragment, {
68
+ children: [
69
+ /*#__PURE__*/ _jsx(TickBox, {
70
+ style: {
71
+ left: '25%'
72
+ }
73
+ }),
74
+ /*#__PURE__*/ _jsx(TickBox, {
75
+ style: {
76
+ left: '50%'
77
+ }
78
+ }),
79
+ /*#__PURE__*/ _jsx(TickBox, {
80
+ style: {
81
+ left: '75%'
82
+ }
83
+ })
84
+ ]
85
+ });
86
+ }
87
+ const TickBox = styled(Box)(({ theme })=>({
88
+ position: 'absolute',
89
+ height: '100%',
90
+ borderLeft: `1px solid ${theme.palette.divider}`,
91
+ padding: '.25rem'
92
+ }));
93
+
94
+ //# sourceMappingURL=Ticks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/TracingGanttChart/Ticks.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, styled } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { Viewport, formatDuration } from './utils';\nimport { Trace } from './trace';\n\nexport interface TicksHeaderProps {\n trace: Trace;\n viewport: Viewport;\n}\n\n/**\n * TicksHeader renders all tick labels in the header\n */\nexport function TicksHeader(props: TicksHeaderProps): ReactElement {\n const { trace, viewport } = props;\n\n const duration = viewport.endTimeUnixMs - viewport.startTimeUnixMs;\n const startAt = viewport.startTimeUnixMs - trace.startTimeUnixMs;\n\n return (\n <>\n <TickBox style={{ left: '0%', borderWidth: 0 }}>{formatDuration(startAt + duration * 0)}</TickBox>\n <TickBox style={{ left: '25%' }}>{formatDuration(startAt + duration * 0.25)}</TickBox>\n <TickBox style={{ left: '50%' }}>{formatDuration(startAt + duration * 0.5)}</TickBox>\n <TickBox style={{ left: '75%' }}>{formatDuration(startAt + duration * 0.75)}</TickBox>\n <TickBox style={{ left: '100%' }}>\n <span style={{ position: 'absolute', right: '.75rem' }}>{formatDuration(startAt + duration * 1)}</span>\n </TickBox>\n </>\n );\n}\n\n/**\n * Ticks renders all ticks in the span duration\n */\nexport function Ticks(): ReactElement {\n return (\n <>\n <TickBox style={{ left: '25%' }} />\n <TickBox style={{ left: '50%' }} />\n <TickBox style={{ left: '75%' }} />\n </>\n );\n}\n\nconst TickBox = styled(Box)(({ theme }) => ({\n position: 'absolute',\n height: '100%',\n borderLeft: `1px solid ${theme.palette.divider}`,\n padding: '.25rem',\n}));\n"],"names":["Box","styled","formatDuration","TicksHeader","props","trace","viewport","duration","endTimeUnixMs","startTimeUnixMs","startAt","TickBox","style","left","borderWidth","span","position","right","Ticks","theme","height","borderLeft","palette","divider","padding"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,EAAEC,MAAM,QAAQ,gBAAgB;AAE5C,SAAmBC,cAAc,QAAQ,UAAU;AAQnD;;CAEC,GACD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;IAE5B,MAAMG,WAAWD,SAASE,aAAa,GAAGF,SAASG,eAAe;IAClE,MAAMC,UAAUJ,SAASG,eAAe,GAAGJ,MAAMI,eAAe;IAEhE,qBACE;;0BACE,KAACE;gBAAQC,OAAO;oBAAEC,MAAM;oBAAMC,aAAa;gBAAE;0BAAIZ,eAAeQ,UAAUH,WAAW;;0BACrF,KAACI;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;0BAAIX,eAAeQ,UAAUH,WAAW;;0BACtE,KAACI;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;0BAAIX,eAAeQ,UAAUH,WAAW;;0BACtE,KAACI;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;0BAAIX,eAAeQ,UAAUH,WAAW;;0BACtE,KAACI;gBAAQC,OAAO;oBAAEC,MAAM;gBAAO;0BAC7B,cAAA,KAACE;oBAAKH,OAAO;wBAAEI,UAAU;wBAAYC,OAAO;oBAAS;8BAAIf,eAAeQ,UAAUH,WAAW;;;;;AAIrG;AAEA;;CAEC,GACD,OAAO,SAASW;IACd,qBACE;;0BACE,KAACP;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;;0BAC9B,KAACF;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;;0BAC9B,KAACF;gBAAQC,OAAO;oBAAEC,MAAM;gBAAM;;;;AAGpC;AAEA,MAAMF,UAAUV,OAAOD,KAAK,CAAC,EAAEmB,KAAK,EAAE,GAAM,CAAA;QAC1CH,UAAU;QACVI,QAAQ;QACRC,YAAY,CAAC,UAAU,EAAEF,MAAMG,OAAO,CAACC,OAAO,EAAE;QAChDC,SAAS;IACX,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { ReactElement } from 'react';
2
+ import { otlptracev1 } from '@perses-dev/core';
3
+ import { TracingGanttChartOptions } from '../gantt-chart-model';
4
+ import { AttributeLinks } from './DetailPane/Attributes';
5
+ export interface TracingGanttChartProps {
6
+ options: TracingGanttChartOptions;
7
+ attributeLinks?: AttributeLinks;
8
+ trace: otlptracev1.TracesData;
9
+ }
10
+ /**
11
+ * The core GanttChart panel for Perses.
12
+ *
13
+ * The UI/UX of this panel is based on Jaeger UI, licensed under Apache License, Version 2.0.
14
+ * https://github.com/jaegertracing/jaeger-ui
15
+ */
16
+ export declare function TracingGanttChart(props: TracingGanttChartProps): ReactElement;
17
+ //# sourceMappingURL=TracingGanttChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TracingGanttChart.d.ts","sourceRoot":"","sources":["../../../src/TracingGanttChart/TracingGanttChart.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAA6B,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAOhE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,wBAAwB,CAAC;IAClC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAoD7E"}