@kylincloud/flamegraph 0.35.6

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 (267) hide show
  1. package/CHANGELOG.md +1211 -0
  2. package/LICENSE +202 -0
  3. package/README.md +251 -0
  4. package/dist/FlameGraph/FlameGraphComponent/CheckIcon.d.ts +2 -0
  5. package/dist/FlameGraph/FlameGraphComponent/CheckIcon.d.ts.map +1 -0
  6. package/dist/FlameGraph/FlameGraphComponent/ContextMenu.d.ts +17 -0
  7. package/dist/FlameGraph/FlameGraphComponent/ContextMenu.d.ts.map +1 -0
  8. package/dist/FlameGraph/FlameGraphComponent/ContextMenuHighlight.d.ts +14 -0
  9. package/dist/FlameGraph/FlameGraphComponent/ContextMenuHighlight.d.ts.map +1 -0
  10. package/dist/FlameGraph/FlameGraphComponent/DiffLegend.d.ts +9 -0
  11. package/dist/FlameGraph/FlameGraphComponent/DiffLegend.d.ts.map +1 -0
  12. package/dist/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.d.ts +8 -0
  13. package/dist/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.d.ts.map +1 -0
  14. package/dist/FlameGraph/FlameGraphComponent/Flamegraph.d.ts +96 -0
  15. package/dist/FlameGraph/FlameGraphComponent/Flamegraph.d.ts.map +1 -0
  16. package/dist/FlameGraph/FlameGraphComponent/Flamegraph_render.d.ts +27 -0
  17. package/dist/FlameGraph/FlameGraphComponent/Flamegraph_render.d.ts.map +1 -0
  18. package/dist/FlameGraph/FlameGraphComponent/GraphVizPane.d.ts +7 -0
  19. package/dist/FlameGraph/FlameGraphComponent/GraphVizPane.d.ts.map +1 -0
  20. package/dist/FlameGraph/FlameGraphComponent/Header.d.ts +12 -0
  21. package/dist/FlameGraph/FlameGraphComponent/Header.d.ts.map +1 -0
  22. package/dist/FlameGraph/FlameGraphComponent/Highlight.d.ts +18 -0
  23. package/dist/FlameGraph/FlameGraphComponent/Highlight.d.ts.map +1 -0
  24. package/dist/FlameGraph/FlameGraphComponent/LogoLink.d.ts +2 -0
  25. package/dist/FlameGraph/FlameGraphComponent/LogoLink.d.ts.map +1 -0
  26. package/dist/FlameGraph/FlameGraphComponent/color.d.ts +20 -0
  27. package/dist/FlameGraph/FlameGraphComponent/color.d.ts.map +1 -0
  28. package/dist/FlameGraph/FlameGraphComponent/colorPalette.d.ts +11 -0
  29. package/dist/FlameGraph/FlameGraphComponent/colorPalette.d.ts.map +1 -0
  30. package/dist/FlameGraph/FlameGraphComponent/constants.d.ts +6 -0
  31. package/dist/FlameGraph/FlameGraphComponent/constants.d.ts.map +1 -0
  32. package/dist/FlameGraph/FlameGraphComponent/index.d.ts +37 -0
  33. package/dist/FlameGraph/FlameGraphComponent/index.d.ts.map +1 -0
  34. package/dist/FlameGraph/FlameGraphComponent/murmur3.d.ts +2 -0
  35. package/dist/FlameGraph/FlameGraphComponent/murmur3.d.ts.map +1 -0
  36. package/dist/FlameGraph/FlameGraphComponent/testData.d.ts +53 -0
  37. package/dist/FlameGraph/FlameGraphComponent/testData.d.ts.map +1 -0
  38. package/dist/FlameGraph/FlameGraphComponent/utils.d.ts +6 -0
  39. package/dist/FlameGraph/FlameGraphComponent/utils.d.ts.map +1 -0
  40. package/dist/FlameGraph/FlameGraphComponent/viewTypes.d.ts +2 -0
  41. package/dist/FlameGraph/FlameGraphComponent/viewTypes.d.ts.map +1 -0
  42. package/dist/FlameGraph/FlameGraphRenderer.d.ts +86 -0
  43. package/dist/FlameGraph/FlameGraphRenderer.d.ts.map +1 -0
  44. package/dist/FlameGraph/decode.d.ts +27 -0
  45. package/dist/FlameGraph/decode.d.ts.map +1 -0
  46. package/dist/FlameGraph/normalize.d.ts +6 -0
  47. package/dist/FlameGraph/normalize.d.ts.map +1 -0
  48. package/dist/FlameGraph/uniqueness.d.ts +3 -0
  49. package/dist/FlameGraph/uniqueness.d.ts.map +1 -0
  50. package/dist/FlamegraphRenderer.d.ts +19 -0
  51. package/dist/FlamegraphRenderer.d.ts.map +1 -0
  52. package/dist/Icons.d.ts +9 -0
  53. package/dist/Icons.d.ts.map +1 -0
  54. package/dist/ProfilerTable.d.ts +21 -0
  55. package/dist/ProfilerTable.d.ts.map +1 -0
  56. package/dist/SharedQueryInput.d.ts +10 -0
  57. package/dist/SharedQueryInput.d.ts.map +1 -0
  58. package/dist/Toolbar.d.ts +31 -0
  59. package/dist/Toolbar.d.ts.map +1 -0
  60. package/dist/Tooltip/FlamegraphTooltip.d.ts +59 -0
  61. package/dist/Tooltip/FlamegraphTooltip.d.ts.map +1 -0
  62. package/dist/Tooltip/LeftClickIcon.d.ts +2 -0
  63. package/dist/Tooltip/LeftClickIcon.d.ts.map +1 -0
  64. package/dist/Tooltip/RightClickIcon.d.ts +2 -0
  65. package/dist/Tooltip/RightClickIcon.d.ts.map +1 -0
  66. package/dist/Tooltip/TableTooltip.d.ts +12 -0
  67. package/dist/Tooltip/TableTooltip.d.ts.map +1 -0
  68. package/dist/Tooltip/Tooltip.d.ts +29 -0
  69. package/dist/Tooltip/Tooltip.d.ts.map +1 -0
  70. package/dist/convert/convertJaegerTraceToProfile.d.ts +3 -0
  71. package/dist/convert/convertJaegerTraceToProfile.d.ts.map +1 -0
  72. package/dist/convert/diffTwoProfiles.d.ts +3 -0
  73. package/dist/convert/diffTwoProfiles.d.ts.map +1 -0
  74. package/dist/convert/flamebearersToTree.d.ts +11 -0
  75. package/dist/convert/flamebearersToTree.d.ts.map +1 -0
  76. package/dist/convert/sandwichViewProfiles.d.ts +14 -0
  77. package/dist/convert/sandwichViewProfiles.d.ts.map +1 -0
  78. package/dist/convert/subtract.d.ts +3 -0
  79. package/dist/convert/subtract.d.ts.map +1 -0
  80. package/dist/convert/testData.d.ts +50 -0
  81. package/dist/convert/testData.d.ts.map +1 -0
  82. package/dist/convert/toGraphviz.d.ts +3 -0
  83. package/dist/convert/toGraphviz.d.ts.map +1 -0
  84. package/dist/fitMode/fitMode.d.ts +42 -0
  85. package/dist/fitMode/fitMode.d.ts.map +1 -0
  86. package/dist/format/format.d.ts +42 -0
  87. package/dist/format/format.d.ts.map +1 -0
  88. package/dist/i18n.d.ts +55 -0
  89. package/dist/i18n.d.ts.map +1 -0
  90. package/dist/index.cjs.css +792 -0
  91. package/dist/index.cjs.js +5087 -0
  92. package/dist/index.d.ts +4 -0
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.esm.css +792 -0
  95. package/dist/index.esm.js +5079 -0
  96. package/dist/index.node.d.ts +9 -0
  97. package/dist/index.node.d.ts.map +1 -0
  98. package/dist/logo-v3-small-T5VXIMRR.svg +32 -0
  99. package/dist/models/decode.d.ts +3 -0
  100. package/dist/models/decode.d.ts.map +1 -0
  101. package/dist/models/flamebearer.d.ts +63 -0
  102. package/dist/models/flamebearer.d.ts.map +1 -0
  103. package/dist/models/groups.d.ts +37 -0
  104. package/dist/models/groups.d.ts.map +1 -0
  105. package/dist/models/index.d.ts +8 -0
  106. package/dist/models/index.d.ts.map +1 -0
  107. package/dist/models/profile.d.ts +152 -0
  108. package/dist/models/profile.d.ts.map +1 -0
  109. package/dist/models/spyName.d.ts +8 -0
  110. package/dist/models/spyName.d.ts.map +1 -0
  111. package/dist/models/trace.d.ts +357 -0
  112. package/dist/models/trace.d.ts.map +1 -0
  113. package/dist/models/units.d.ts +6 -0
  114. package/dist/models/units.d.ts.map +1 -0
  115. package/dist/search.d.ts +2 -0
  116. package/dist/search.d.ts.map +1 -0
  117. package/dist/shims/Box.d.ts +38 -0
  118. package/dist/shims/Box.d.ts.map +1 -0
  119. package/dist/shims/Button.d.ts +26 -0
  120. package/dist/shims/Button.d.ts.map +1 -0
  121. package/dist/shims/Dropdown.d.ts +30 -0
  122. package/dist/shims/Dropdown.d.ts.map +1 -0
  123. package/dist/shims/Input.d.ts +19 -0
  124. package/dist/shims/Input.d.ts.map +1 -0
  125. package/dist/shims/LoadingSpinner.d.ts +7 -0
  126. package/dist/shims/LoadingSpinner.d.ts.map +1 -0
  127. package/dist/shims/Menu.d.ts +4 -0
  128. package/dist/shims/Menu.d.ts.map +1 -0
  129. package/dist/shims/NoData.d.ts +2 -0
  130. package/dist/shims/NoData.d.ts.map +1 -0
  131. package/dist/shims/Table.d.ts +52 -0
  132. package/dist/shims/Table.d.ts.map +1 -0
  133. package/dist/shims/Tooltip.d.ts +9 -0
  134. package/dist/shims/Tooltip.d.ts.map +1 -0
  135. package/package.json +84 -0
  136. package/src/FlameGraph/FlameGraphComponent/CheckIcon.tsx +27 -0
  137. package/src/FlameGraph/FlameGraphComponent/ContextMenu.module.scss +10 -0
  138. package/src/FlameGraph/FlameGraphComponent/ContextMenu.spec.tsx +84 -0
  139. package/src/FlameGraph/FlameGraphComponent/ContextMenu.tsx +86 -0
  140. package/src/FlameGraph/FlameGraphComponent/ContextMenuHighlight.module.css +8 -0
  141. package/src/FlameGraph/FlameGraphComponent/ContextMenuHighlight.tsx +47 -0
  142. package/src/FlameGraph/FlameGraphComponent/DiffLegend.module.css +21 -0
  143. package/src/FlameGraph/FlameGraphComponent/DiffLegend.tsx +52 -0
  144. package/src/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.module.css +40 -0
  145. package/src/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.tsx +129 -0
  146. package/src/FlameGraph/FlameGraphComponent/Flamegraph.spec.ts +552 -0
  147. package/src/FlameGraph/FlameGraphComponent/Flamegraph.ts +446 -0
  148. package/src/FlameGraph/FlameGraphComponent/Flamegraph_render.spec.tsx +233 -0
  149. package/src/FlameGraph/FlameGraphComponent/Flamegraph_render.ts +478 -0
  150. package/src/FlameGraph/FlameGraphComponent/GraphVizPane.tsx +56 -0
  151. package/src/FlameGraph/FlameGraphComponent/GraphVizPanel.module.scss +55 -0
  152. package/src/FlameGraph/FlameGraphComponent/Header.module.css +27 -0
  153. package/src/FlameGraph/FlameGraphComponent/Header.tsx +71 -0
  154. package/src/FlameGraph/FlameGraphComponent/Highlight.module.css +7 -0
  155. package/src/FlameGraph/FlameGraphComponent/Highlight.spec.tsx +53 -0
  156. package/src/FlameGraph/FlameGraphComponent/Highlight.tsx +94 -0
  157. package/src/FlameGraph/FlameGraphComponent/LogoLink.module.scss +10 -0
  158. package/src/FlameGraph/FlameGraphComponent/LogoLink.tsx +101 -0
  159. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-collapses-small-blocks-into-one-1-snap.png +0 -0
  160. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-diff-mode-1-snap.png +0 -0
  161. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-highlighted-flamegraph-1-snap.png +0 -0
  162. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-normal-flamegraph-1-snap.png +0 -0
  163. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-selected-node-1-snap.png +0 -0
  164. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-also-zooms-1-snap.png +0 -0
  165. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-renders-a-focused-node-in-the-beginning-1-snap.png +0 -0
  166. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-renders-a-focused-node-when-node-is-not-in-the-beginning-1-snap.png +0 -0
  167. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-renders-a-focused-node-zoom-top-level-1-snap.png +0 -0
  168. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-complex-flamegraph-1-snap.png +0 -0
  169. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-double-diff-flamegraph-1-snap.png +0 -0
  170. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-highlighted-double-flamegraph-1-snap.png +0 -0
  171. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-highlighted-flamegraph-1-snap.png +0 -0
  172. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-simple-flamegraph-1-snap.png +0 -0
  173. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-simple-tree-1-snap.png +0 -0
  174. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-zoomed-flamegraph-1-snap.png +0 -0
  175. package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-zoomed-with-fit-mode-tail-1-snap.png +0 -0
  176. package/src/FlameGraph/FlameGraphComponent/canvas.module.css +6 -0
  177. package/src/FlameGraph/FlameGraphComponent/color.spec.ts +308 -0
  178. package/src/FlameGraph/FlameGraphComponent/color.ts +167 -0
  179. package/src/FlameGraph/FlameGraphComponent/colorPalette.ts +58 -0
  180. package/src/FlameGraph/FlameGraphComponent/constants.ts +5 -0
  181. package/src/FlameGraph/FlameGraphComponent/index.spec.tsx +291 -0
  182. package/src/FlameGraph/FlameGraphComponent/index.tsx +411 -0
  183. package/src/FlameGraph/FlameGraphComponent/murmur3.ts +97 -0
  184. package/src/FlameGraph/FlameGraphComponent/styles.module.scss +10 -0
  185. package/src/FlameGraph/FlameGraphComponent/testData.ts +427 -0
  186. package/src/FlameGraph/FlameGraphComponent/utils.ts +31 -0
  187. package/src/FlameGraph/FlameGraphComponent/viewTypes.ts +6 -0
  188. package/src/FlameGraph/FlameGraphRenderer.tsx +603 -0
  189. package/src/FlameGraph/FlamegraphRenderer.module.scss +93 -0
  190. package/src/FlameGraph/decode.ts +78 -0
  191. package/src/FlameGraph/normalize.spec.ts +76 -0
  192. package/src/FlameGraph/normalize.ts +60 -0
  193. package/src/FlameGraph/testData.json +423 -0
  194. package/src/FlameGraph/uniqueness.spec.ts +16 -0
  195. package/src/FlameGraph/uniqueness.ts +84 -0
  196. package/src/FlamegraphRenderer.tsx +61 -0
  197. package/src/Icons.tsx +74 -0
  198. package/src/ProfilerTable.tsx +527 -0
  199. package/src/SharedQueryInput.module.scss +82 -0
  200. package/src/SharedQueryInput.tsx +127 -0
  201. package/src/Toolbar.module.scss +117 -0
  202. package/src/Toolbar.spec.tsx +217 -0
  203. package/src/Toolbar.tsx +471 -0
  204. package/src/Tooltip/FlamegraphTooltip.spec.tsx +81 -0
  205. package/src/Tooltip/FlamegraphTooltip.tsx +257 -0
  206. package/src/Tooltip/LeftClickIcon.tsx +18 -0
  207. package/src/Tooltip/RightClickIcon.tsx +18 -0
  208. package/src/Tooltip/TableTooltip.spec.tsx +44 -0
  209. package/src/Tooltip/TableTooltip.tsx +145 -0
  210. package/src/Tooltip/Tooltip.module.scss +71 -0
  211. package/src/Tooltip/Tooltip.spec.tsx +395 -0
  212. package/src/Tooltip/Tooltip.tsx +336 -0
  213. package/src/__snapshots__/Toolbar.spec.tsx.snap +297 -0
  214. package/src/convert/convertJaegerTraceToProfile.ts +97 -0
  215. package/src/convert/diffTwoProfiles.ts +81 -0
  216. package/src/convert/flamebearersToTree.ts +78 -0
  217. package/src/convert/sandwichViewProfiles.spec.ts +65 -0
  218. package/src/convert/sandwichViewProfiles.ts +191 -0
  219. package/src/convert/subtract.ts +87 -0
  220. package/src/convert/testData.ts +145 -0
  221. package/src/convert/toGraphviz.ts +485 -0
  222. package/src/fitMode/fitMode.spec.ts +93 -0
  223. package/src/fitMode/fitMode.ts +122 -0
  224. package/src/format/format.spec.ts +291 -0
  225. package/src/format/format.ts +303 -0
  226. package/src/globals.d.ts +13 -0
  227. package/src/i18n.tsx +293 -0
  228. package/src/index.node.ts +19 -0
  229. package/src/index.spec.tsx +383 -0
  230. package/src/index.tsx +10 -0
  231. package/src/logo-v3-small.svg +32 -0
  232. package/src/models/decode.ts +45 -0
  233. package/src/models/flamebearer.ts +86 -0
  234. package/src/models/groups.ts +14 -0
  235. package/src/models/index.ts +7 -0
  236. package/src/models/profile.spec.ts +32 -0
  237. package/src/models/profile.ts +48 -0
  238. package/src/models/spyName.spec.ts +18 -0
  239. package/src/models/spyName.ts +32 -0
  240. package/src/models/trace.ts +45 -0
  241. package/src/models/units.spec.ts +21 -0
  242. package/src/models/units.ts +24 -0
  243. package/src/sass/_common.scss +206 -0
  244. package/src/sass/_css-variables.scss +201 -0
  245. package/src/sass/_mixins.scss +15 -0
  246. package/src/sass/_sanitize.scss +407 -0
  247. package/src/sass/_variables.scss +53 -0
  248. package/src/sass/flamegraph.scss +18 -0
  249. package/src/search.spec.ts +11 -0
  250. package/src/search.ts +4 -0
  251. package/src/shameful-any.d.ts +2 -0
  252. package/src/shims/Box.module.scss +57 -0
  253. package/src/shims/Box.tsx +105 -0
  254. package/src/shims/Button.module.scss +129 -0
  255. package/src/shims/Button.tsx +128 -0
  256. package/src/shims/Dropdown.module.scss +63 -0
  257. package/src/shims/Dropdown.tsx +96 -0
  258. package/src/shims/Input.module.scss +15 -0
  259. package/src/shims/Input.tsx +55 -0
  260. package/src/shims/LoadingSpinner.tsx +19 -0
  261. package/src/shims/Menu.tsx +9 -0
  262. package/src/shims/NoData.module.scss +6 -0
  263. package/src/shims/NoData.tsx +11 -0
  264. package/src/shims/Table.module.scss +82 -0
  265. package/src/shims/Table.spec.tsx +121 -0
  266. package/src/shims/Table.tsx +252 -0
  267. package/src/shims/Tooltip.tsx +51 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2020 Pyroscope
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,251 @@
1
+ # @kylincloud/flamegraph
2
+
3
+ 一个可复用的 **火焰图 / 差分火焰图 React 组件库**,基于 Pyroscope 的 flamegraph 思路进行了工程化封装,方便在任意前端应用中渲染 CPU / 内存等采样型 Profiling 数据。
4
+
5
+ > ⚠️ 说明
6
+ > 本仓库主要服务于麒麟内部项目(如性能观测 / 智算平台等),API 在 0.x 阶段可能会有不兼容调整,请结合代码实际导出使用。
7
+
8
+ ---
9
+
10
+ ## 1. 功能特性
11
+
12
+ - 🔥 支持 **单视图** 与 **Diff 差分视图**
13
+ - 📊 支持 **表格 / 火焰图 / 表格+火焰图 / Sandwich** 等多种布局
14
+ - 🧭 丰富交互:
15
+ - 鼠标悬停 Tooltip(展示占比、采样数、绝对值等)
16
+ - 点击放大 / 回退、滚轮缩放、拖拽平移
17
+ - 右键菜单(折叠、重置视图等,视实际实现为准)
18
+ - 🔍 函数名搜索 & 高亮
19
+ - 🎨 多种配色 / Diff 渐变色,适配普通与色弱模式
20
+ - 🧱 基于 **Flamebearer** 数据结构,兼容 Pyroscope / Grafana Pyroscope 的 profile 数据
21
+ - 🧩 以组件的方式独立封装,可作为「黑盒区域」嵌入任意业务页面
22
+
23
+ ---
24
+
25
+ ## 2. 安装
26
+
27
+ > 具体发布渠道请按你实际使用方式调整(npm / GitLab Registry / 本地 `link` 等)。
28
+
29
+ ```bash
30
+ # npm
31
+ npm install @kylincloud/flamegraph
32
+
33
+ # or pnpm
34
+ pnpm add @kylincloud/flamegraph
35
+
36
+ # or yarn
37
+ yarn add @kylincloud/flamegraph
38
+ ````
39
+
40
+ ---
41
+
42
+ ## 3. 快速上手(React 示例)
43
+
44
+ ### 3.1 引入样式与组件
45
+
46
+ ```tsx
47
+ import React from 'react'
48
+
49
+ // 必须:引入打包好的 CSS
50
+ import '@kylincloud/flamegraph/dist/index.css'
51
+
52
+ // 组件名称以实际导出为准,如果你改过导出,请相应调整
53
+ import { FlamegraphRenderer } from '@kylincloud/flamegraph'
54
+ // 或:import FlamegraphRenderer from '@kylincloud/flamegraph'
55
+ ```
56
+
57
+ ### 3.2 最小可用示例
58
+
59
+ ```tsx
60
+ // 仅为示意,类型 / 字段名请以 src 下实际定义为准
61
+ const simpleProfile = {
62
+ version: 1,
63
+ flamebearer: {
64
+ names: ['total', 'fnA', 'fnB'],
65
+ levels: [
66
+ // 单视图:每 4 个数表达一个矩形 [xOffset, width, self, total]
67
+ [0, 100, 0, 100], // root
68
+ // ...
69
+ ],
70
+ // 其他字段:numTicks, maxSelf, units, sampleRate 等
71
+ },
72
+ metadata: {
73
+ appName: 'demo',
74
+ spyName: 'cpu',
75
+ format: 'single', // 或 'double' / 'diff' 等
76
+ },
77
+ }
78
+
79
+ export default function App() {
80
+ return (
81
+ <div style={{ height: 600 }}>
82
+ <FlamegraphRenderer
83
+ profile={simpleProfile}
84
+ // 以下 props 为常见配置示意,实际以组件实现为准
85
+ // viewType="both" // 'flamegraph' | 'table' | 'both' | 'sandwich'
86
+ // type="single" // 'single' | 'diff'
87
+ // showToolbar={true}
88
+ // showCredit={false}
89
+ />
90
+ </div>
91
+ )
92
+ }
93
+ ```
94
+
95
+ > ✅ 建议:
96
+ >
97
+ > * 将容器高度固定(如 400–800px),避免页面滚动条与内部滚动冲突
98
+ > * 确保在 App 入口只引入一次 `@kylincloud/flamegraph/dist/index.css`
99
+
100
+ ---
101
+
102
+ ## 4. 数据格式说明(Flamebearer 简要约定)
103
+
104
+ 组件默认消费的数据结构与 Pyroscope 的 **Flamebearer** 格式保持兼容,整体上可理解为:
105
+
106
+ ```ts
107
+ type FlamebearerProfile = {
108
+ version: number
109
+ flamebearer: {
110
+ names: string[]
111
+ levels: number[][]
112
+ // 单视图每 4 个数一组,Diff 视图通常每组 7 个数
113
+ numTicks?: number
114
+ maxSelf?: number
115
+ sampleRate?: number
116
+ units?: 'samples' | 'bytes' | 'ns' | string
117
+ }
118
+ metadata?: {
119
+ appName?: string
120
+ spyName?: string
121
+ format?: 'single' | 'double' | 'triple' | 'diff' | string
122
+ // 还可以包含 from / until / query 等字段
123
+ [key: string]: any
124
+ }
125
+ }
126
+ ```
127
+
128
+ * `names`:所有符号(函数名)列表,`levels` 中通过索引引用
129
+ * `levels`:二维数组,每一行对应火焰图中的一层;
130
+
131
+ * **单视图**:每 4 个数字为一组
132
+ * **Diff 视图**:每组数字扩展为左/右/差值等信息(通常 7 个)
133
+ * `units` / `sampleRate`:用于 Tooltip 和表格中做单位换算、展示总时间等
134
+
135
+ 在麒麟内部项目中,你也可以在后端将自定义的树型数据转换为上述格式,再传递给组件。
136
+
137
+ ---
138
+
139
+ ## 5. Diff 差分火焰图
140
+
141
+ 如果 profile 为 Diff 格式(如比较「基线」与「当前」两段 profile),通常会:
142
+
143
+ * 在 `metadata.format` 中标注 diff 格式
144
+ * 在 `flamebearer.levels` 中扩展出左/右两个 profile 的宽度以及差分数值
145
+ * 在前端通过:
146
+
147
+ * 渐变色 / 红绿配色展示「变慢 / 变快」
148
+ * 表格中展示 `Baseline / Comparison / Diff` 三列
149
+ * Tooltip 中展示百分比、绝对值、样本数等
150
+
151
+ 具体字段与含义请以项目中实际的 `DiffProfile` / `DiffNode` 类型定义为准。
152
+
153
+ ---
154
+
155
+ ## 6. 样式与主题
156
+
157
+ * 本项目的核心样式文件为 `src/sass/flamegraph.scss`,构建后输出到 `dist/index.css`
158
+ * 支持通过 Sass 变量、CSS 变量覆盖部分样式:
159
+
160
+ * 字体大小、行高
161
+ * tooltip 外观
162
+ * 表格排版
163
+ * 如需与业务系统整体主题统一,可以:
164
+
165
+ * 在外层容器上控制背景色、边框、圆角
166
+ * 使用 CSS 变量对颜色进行二次覆盖
167
+
168
+ ---
169
+
170
+ ## 7. 开发与构建
171
+
172
+ ### 7.1 脚本
173
+
174
+ ```jsonc
175
+ {
176
+ "scripts": {
177
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && pnpm run copy-assets && pnpm run build-css",
178
+ "copy-assets": "rsync -av --include='*/' --include='*.css' --include='*.scss' --include='*.svg' --exclude='*' src/ dist/",
179
+ "build-css": "sass src/sass/flamegraph.scss dist/index.css",
180
+ "type-check": "tsc -p tsconfig.build.json --noEmit",
181
+ "lint": "eslint ./ --cache --fix"
182
+ }
183
+ }
184
+ ```
185
+
186
+ * **构建库**
187
+
188
+ ```bash
189
+ pnpm build
190
+ ```
191
+
192
+ 输出:
193
+
194
+ * `dist/index.js` —— 浏览器环境入口(`"browser"`)
195
+ * `dist/index.node.js` —— Node / SSR 环境入口(`"main"`)
196
+ * `dist/index.css` —— CSS 样式文件
197
+ * `dist/**/*.d.ts` —— 类型声明文件
198
+
199
+ * **类型检查**
200
+
201
+ ```bash
202
+ pnpm type-check
203
+ ```
204
+
205
+ * **代码规范检查**
206
+
207
+ ```bash
208
+ pnpm lint
209
+ ```
210
+
211
+ > ✅ 建议:
212
+ >
213
+ > * 使用 Node 18+(或与你当前前端工程保持一致的版本)
214
+ > * 在 CI 中至少执行 `pnpm build` 与 `pnpm type-check` 保证包的基本可用性
215
+
216
+ ---
217
+
218
+ ## 8. 与上游项目的关系
219
+
220
+ * 本项目在工程结构与数据格式上与 Pyroscope 的 flamegraph 组件保持高度兼容
221
+ * 主要差异点集中在:
222
+
223
+ * 包名与发布渠道:使用 `@kylincloud/flamegraph`
224
+ * 构建链路与样式组织适配麒麟内部前端工程
225
+ * 后续可能增加针对麒麟项目的定制功能(如与内部监控体系联动)
226
+
227
+ 如需回溯或对比实现细节,可以阅读源码中相关注释。
228
+
229
+ ---
230
+
231
+ ## 9. 贡献 & 开发约定
232
+
233
+ 欢迎在内部 / 开源仓库中提交:
234
+
235
+ * Bug 修复
236
+ * 性能优化(尤其是大规模 profile 渲染场景)
237
+ * 新的交互特性(搜索、折叠策略、视图联动等)
238
+ * 文档补充与示例
239
+
240
+ 建议遵循:
241
+
242
+ 1. 所有 PR 保持 TypeScript `type-check` 与 ESLint 通过
243
+ 2. 尽量避免破坏现有 API;如有必要,务必在 README 中标注
244
+ 3. 对关键交互(如 Diff 视图、搜索、高亮)补充最小可复现示例
245
+
246
+ ---
247
+
248
+ ## 10. 许可证
249
+
250
+ 本项目使用 **Apache-2.0** 许可证发布。
251
+ 如在外部开源,请确保保留上游版权与许可证声明,并补充 @kylincloud 的版权信息。
@@ -0,0 +1,2 @@
1
+ export default function CheckIcon(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=CheckIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckIcon.d.ts","sourceRoot":"","sources":["../../../src/FlameGraph/FlameGraphComponent/CheckIcon.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,SAAS,4CAuBhC"}
@@ -0,0 +1,17 @@
1
+ import '@szhsin/react-menu/dist/index.css';
2
+ import React from 'react';
3
+ type xyToMenuItems = (x: number, y: number) => JSX.Element[];
4
+ export interface ContextMenuProps {
5
+ canvasRef: React.RefObject<HTMLCanvasElement>;
6
+ /**
7
+ * The menu is built dynamically
8
+ * Based on the cell's contents
9
+ * only MenuItem and SubMenu should be supported
10
+ */
11
+ xyToMenuItems: xyToMenuItems;
12
+ onClose: () => void;
13
+ onOpen: (x: number, y: number) => void;
14
+ }
15
+ export default function ContextMenu(props: ContextMenuProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=ContextMenu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/FlameGraph/FlameGraphComponent/ContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,mCAAmC,CAAC;AAE3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,aAAa,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAE9C;;;;OAIG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA+D1D"}
@@ -0,0 +1,14 @@
1
+ import { Maybe } from 'true-myth';
2
+ export interface HighlightProps {
3
+ barHeight: number;
4
+ node: Maybe<{
5
+ top: number;
6
+ left: number;
7
+ width: number;
8
+ }>;
9
+ }
10
+ /**
11
+ * Highlight on the node that triggered the context menu
12
+ */
13
+ export default function ContextMenuHighlight(props: HighlightProps): import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=ContextMenuHighlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextMenuHighlight.d.ts","sourceRoot":"","sources":["../../../src/FlameGraph/FlameGraphComponent/ContextMenuHighlight.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,MAAM,WAAW,cAAc;IAE7B,SAAS,EAAE,MAAM,CAAC;IAElB,IAAI,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3D;AAOD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,cAAc,2CA2BjE"}
@@ -0,0 +1,9 @@
1
+ import { FlamegraphPalette } from './colorPalette';
2
+ export type sizeMode = 'small' | 'large';
3
+ interface DiffLegendProps {
4
+ palette: FlamegraphPalette;
5
+ showMode: sizeMode;
6
+ }
7
+ export default function DiffLegend(props: DiffLegendProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=DiffLegend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiffLegend.d.ts","sourceRoot":"","sources":["../../../src/FlameGraph/FlameGraphComponent/DiffLegend.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AACzC,UAAU,eAAe;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,2CAyBxD"}
@@ -0,0 +1,8 @@
1
+ import { FlamegraphPalette } from './colorPalette';
2
+ interface DiffLegendPaletteDropdownProps {
3
+ palette: FlamegraphPalette;
4
+ onChange: (p: FlamegraphPalette) => void;
5
+ }
6
+ export declare const DiffLegendPaletteDropdown: (props: DiffLegendPaletteDropdownProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default DiffLegendPaletteDropdown;
8
+ //# sourceMappingURL=DiffLegendPaletteDropdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiffLegendPaletteDropdown.d.ts","sourceRoot":"","sources":["../../../src/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAcxB,UAAU,8BAA8B;IACtC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,yBAAyB,UAC7B,8BAA8B,4CA+DtC,CAAC;AAqCF,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,96 @@
1
+ import { DeepReadonly } from 'ts-essentials';
2
+ import { Maybe } from 'true-myth';
3
+ import { Flamebearer } from '../../models';
4
+ import type { FlamegraphPalette } from './colorPalette';
5
+ export default class Flamegraph {
6
+ private readonly flamebearer;
7
+ private canvas;
8
+ /**
9
+ * What node to be 'focused'
10
+ * ie what node to start the tree
11
+ */
12
+ private focusedNode;
13
+ /**
14
+ * What level has been "selected"
15
+ * All nodes above will be dimmed out
16
+ */
17
+ private readonly fitMode;
18
+ /**
19
+ * The query used to match against the node name.
20
+ * For each node,
21
+ * if it matches it will be highlighted,
22
+ * otherwise it will be greyish.
23
+ */
24
+ private readonly highlightQuery;
25
+ private zoom;
26
+ private palette;
27
+ private ff;
28
+ constructor(flamebearer: Flamebearer, canvas: HTMLCanvasElement,
29
+ /**
30
+ * What node to be 'focused'
31
+ * ie what node to start the tree
32
+ */
33
+ focusedNode: Maybe<DeepReadonly<{
34
+ i: number;
35
+ j: number;
36
+ }>>,
37
+ /**
38
+ * What level has been "selected"
39
+ * All nodes above will be dimmed out
40
+ */
41
+ fitMode: 'HEAD' | 'TAIL',
42
+ /**
43
+ * The query used to match against the node name.
44
+ * For each node,
45
+ * if it matches it will be highlighted,
46
+ * otherwise it will be greyish.
47
+ */
48
+ highlightQuery: string, zoom: Maybe<DeepReadonly<{
49
+ i: number;
50
+ j: number;
51
+ }>>, palette: FlamegraphPalette);
52
+ render(): void;
53
+ private pxPerTick;
54
+ private tickToX;
55
+ private getRange;
56
+ private getCanvasWidth;
57
+ private isFocused;
58
+ private binarySearchLevel;
59
+ private xyToBarIndex;
60
+ private parseXY;
61
+ private xyToBarPosition;
62
+ private xyToBarData;
63
+ isWithinBounds: (x: number, y: number) => boolean;
64
+ xyToBar(x: number, y: number): Maybe<{
65
+ format: "single";
66
+ name: string;
67
+ self: number;
68
+ offset: number;
69
+ total: number;
70
+ barTotal?: undefined;
71
+ totalLeft?: undefined;
72
+ totalRight?: undefined;
73
+ totalDiff?: undefined;
74
+ x: number;
75
+ y: number;
76
+ width: number;
77
+ i: number;
78
+ j: number;
79
+ } | {
80
+ format: "double";
81
+ barTotal: number;
82
+ totalLeft: number;
83
+ totalRight: number;
84
+ totalDiff: number;
85
+ name: string;
86
+ self?: undefined;
87
+ offset?: undefined;
88
+ total?: undefined;
89
+ x: number;
90
+ y: number;
91
+ width: number;
92
+ i: number;
93
+ j: number;
94
+ }>;
95
+ }
96
+ //# sourceMappingURL=Flamegraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flamegraph.d.ts","sourceRoot":"","sources":["../../../src/FlameGraph/FlameGraphComponent/Flamegraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAEL,WAAW,EAIZ,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAYxD,MAAM,CAAC,OAAO,OAAO,UAAU;IAI3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,MAAM;IACd;;;OAGG;IACH,OAAO,CAAC,WAAW;IACnB;;;OAGG;IAEH,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,IAAI;IAEZ,OAAO,CAAC,OAAO;IAzBjB,OAAO,CAAC,EAAE,CAA8B;gBAGrB,WAAW,EAAE,WAAW,EACjC,MAAM,EAAE,iBAAiB;IACjC;;;OAGG;IACK,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClE;;;OAGG;IAEc,OAAO,EAAE,MAAM,GAAG,MAAM;IACzC;;;;;OAKG;IACc,cAAc,EAAE,MAAM,EAC/B,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,EAEnD,OAAO,EAAE,iBAAiB;IAsB7B,MAAM;IAkDb,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,OAAO,CAGb;IAEF,OAAO,CAAC,QAAQ;IA2FhB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,iBAAiB;IA0BzB,OAAO,CAAC,YAAY;IAmEpB,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,eAAe,CA4BrB;IAEF,OAAO,CAAC,WAAW,CAoCjB;IAEK,cAAc,MAAO,MAAM,KAAK,MAAM,aAe3C;IAMK,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcpC"}
@@ -0,0 +1,27 @@
1
+ import { Flamebearer } from '../../models';
2
+ import type { FlamegraphPalette } from './colorPalette';
3
+ import Flamegraph from './Flamegraph';
4
+ type CanvasRendererConfig = Flamebearer & {
5
+ canvas: HTMLCanvasElement;
6
+ focusedNode: ConstructorParameters<typeof Flamegraph>[2];
7
+ fitMode: ConstructorParameters<typeof Flamegraph>[3];
8
+ highlightQuery: ConstructorParameters<typeof Flamegraph>[4];
9
+ zoom: ConstructorParameters<typeof Flamegraph>[5];
10
+ /**
11
+ * Used when zooming, values between 0 and 1.
12
+ * For illustration, in a non zoomed state it has the value of 0
13
+ */
14
+ readonly rangeMin: number;
15
+ /**
16
+ * Used when zooming, values between 0 and 1.
17
+ * For illustration, in a non zoomed state it has the value of 1
18
+ */
19
+ readonly rangeMax: number;
20
+ tickToX: (i: number) => number;
21
+ pxPerTick: number;
22
+ palette: FlamegraphPalette;
23
+ maxSelf?: number;
24
+ };
25
+ export default function RenderCanvas(props: CanvasRendererConfig): void;
26
+ export {};
27
+ //# sourceMappingURL=Flamegraph_render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flamegraph_render.d.ts","sourceRoot":"","sources":["../../../src/FlameGraph/FlameGraphComponent/Flamegraph_render.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAY,WAAW,EAAW,MAAM,cAAc,CAAC;AAqB9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,KAAK,oBAAoB,GAAG,WAAW,GAAG;IACxC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,EAAE,qBAAqB,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,OAAO,EAAE,qBAAqB,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,cAAc,EAAE,qBAAqB,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,IAAI,EAAE,qBAAqB,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAElD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAE/B,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,oBAAoB,QAgP/D"}
@@ -0,0 +1,7 @@
1
+ import type { Flamebearer } from '../../models';
2
+ interface GraphVizPaneProps {
3
+ flamebearer: Flamebearer;
4
+ }
5
+ export declare function GraphVizPane({ flamebearer }: GraphVizPaneProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=GraphVizPane.d.ts.map