@kylincloud/flamegraph 0.35.23 → 0.35.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/FlameGraph/FlameGraphComponent/Flamegraph.d.ts +7 -1
- package/dist/FlameGraph/FlameGraphComponent/Flamegraph.d.ts.map +1 -1
- package/dist/FlameGraph/FlameGraphComponent/FlamegraphBreadcrumb.d.ts +16 -0
- package/dist/FlameGraph/FlameGraphComponent/FlamegraphBreadcrumb.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/Flamegraph_render.d.ts +3 -0
- package/dist/FlameGraph/FlameGraphComponent/Flamegraph_render.d.ts.map +1 -1
- package/dist/FlameGraph/FlameGraphComponent/index.d.ts +13 -0
- package/dist/FlameGraph/FlameGraphComponent/index.d.ts.map +1 -1
- package/dist/FlameGraph/FlameGraphRenderer.d.ts +9 -1
- package/dist/FlameGraph/FlameGraphRenderer.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/format/format.d.ts +14 -0
- package/dist/format/format.d.ts.map +1 -1
- package/dist/i18n.d.ts +7 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +4 -4
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.esm.js +4 -4
- package/dist/index.node.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/FlameGraph/FlameGraphComponent/Flamegraph.ts +34 -8
- package/src/FlameGraph/FlameGraphComponent/FlamegraphBreadcrumb.module.scss +106 -0
- package/src/FlameGraph/FlameGraphComponent/FlamegraphBreadcrumb.tsx +98 -0
- package/src/FlameGraph/FlameGraphComponent/Flamegraph_render.ts +134 -85
- package/src/FlameGraph/FlameGraphComponent/canvas.module.css +9 -0
- package/src/FlameGraph/FlameGraphComponent/index.tsx +105 -21
- package/src/FlameGraph/FlameGraphRenderer.tsx +169 -21
- package/src/Tooltip/Tooltip.tsx +1 -75
- package/src/format/format.ts +98 -0
- package/src/i18n.tsx +27 -0
package/src/i18n.tsx
CHANGED
|
@@ -77,6 +77,11 @@ export type FlamegraphMessages = {
|
|
|
77
77
|
// 火焰图聚焦时的 collapsed 提示
|
|
78
78
|
collapsedLevelsSingular: string; // "total (1 level collapsed)"
|
|
79
79
|
collapsedLevelsPlural: string; // "total (n levels collapsed)"
|
|
80
|
+
|
|
81
|
+
// Breadcrumb
|
|
82
|
+
ofTotal: string;
|
|
83
|
+
clearFocus: string;
|
|
84
|
+
sampleCountFormat: Array<{ value: number; label: string }>;
|
|
80
85
|
};
|
|
81
86
|
|
|
82
87
|
const defaultTooltipUnitTitles: Record<Units, TooltipUnitMessages> = {
|
|
@@ -235,6 +240,17 @@ export const defaultMessages: FlamegraphMessages = {
|
|
|
235
240
|
// 火焰图聚焦时的 collapsed 提示
|
|
236
241
|
collapsedLevelsSingular: 'total (1 level collapsed)',
|
|
237
242
|
collapsedLevelsPlural: 'total ({n} levels collapsed)',
|
|
243
|
+
|
|
244
|
+
// Breadcrumb
|
|
245
|
+
ofTotal: 'of total',
|
|
246
|
+
clearFocus: 'Clear focus',
|
|
247
|
+
sampleCountFormat: [
|
|
248
|
+
{ value: 1e15, label: 'Quad' },
|
|
249
|
+
{ value: 1e12, label: 'Tri' },
|
|
250
|
+
{ value: 1e9, label: 'B' },
|
|
251
|
+
{ value: 1e6, label: 'M' },
|
|
252
|
+
{ value: 1e3, label: 'K' },
|
|
253
|
+
],
|
|
238
254
|
};
|
|
239
255
|
|
|
240
256
|
export const zhCNMessages: FlamegraphMessages = {
|
|
@@ -298,9 +314,20 @@ export const zhCNMessages: FlamegraphMessages = {
|
|
|
298
314
|
// 火焰图聚焦时的 collapsed 提示
|
|
299
315
|
collapsedLevelsSingular: '总计(已折叠 1 层)',
|
|
300
316
|
collapsedLevelsPlural: '总计(已折叠 {n} 层)',
|
|
317
|
+
|
|
318
|
+
// Breadcrumb
|
|
319
|
+
ofTotal: '占总量',
|
|
320
|
+
clearFocus: '清除聚焦',
|
|
321
|
+
sampleCountFormat: [
|
|
322
|
+
{ value: 1e12, label: '兆' },
|
|
323
|
+
{ value: 1e8, label: '亿' },
|
|
324
|
+
{ value: 1e4, label: '万' },
|
|
325
|
+
{ value: 1e3, label: '千' },
|
|
326
|
+
],
|
|
301
327
|
};
|
|
302
328
|
|
|
303
329
|
const I18nContext = createContext<FlamegraphMessages>(defaultMessages);
|
|
330
|
+
export const FlamegraphI18nContext = I18nContext;
|
|
304
331
|
|
|
305
332
|
export type FlamegraphI18nProviderProps = {
|
|
306
333
|
messages?: Partial<FlamegraphMessages>;
|