@@ -41,19 +41,6 @@ const chartData = {
41
41
] ,
42
42
} ;
43
43
44
- // const chartData = {
45
- // name: 'App', index: 1, val3: 50000, timeData: { actualDuration: 35000 }, children: [
46
- // { name: 'DisplayPanel', index: 2, timeData: { actualDuration: 35000 }, val3: 17010 },
47
- // { name: 'Button Panel', index: 3, timeData: { actualDuration: 35000 }, val3: 50000, children: [
48
- // { name: 'Button', timeData: { actualDuration: 35000 }, val3: 10000 },
49
- // { name: 'Button', timeData: { actualDuration: 35000 }, val3: 2047 },
50
- // ],
51
- // },
52
- // { name: 'MainSlider', timeData: { actualDuration: 35000 }, val3: 5176 },
53
- // ],
54
- // };
55
-
56
-
57
44
const PerfView = ( { width = 200 , height = 200 , chartData } ) => {
58
45
59
46
console . log ( "PerfView -> chartData" , chartData )
@@ -100,7 +87,7 @@ const PerfView = ({ width = 200, height = 200, chartData }) => {
100
87
. on ( 'click' , d => focus !== d && ( zoom ( d ) , d3 . event . stopPropagation ( ) ) ) ;
101
88
102
89
const label = svg . append ( 'g' )
103
- . style ( 'font' , '10px sans-serif' )
90
+ . style ( 'font' , '11px sans-serif' )
104
91
. attr ( 'pointer-events' , 'none' )
105
92
. attr ( 'text-anchor' , 'middle' )
106
93
. selectAll ( 'text' )
@@ -110,7 +97,7 @@ const PerfView = ({ width = 200, height = 200, chartData }) => {
110
97
. append ( 'text' )
111
98
. style ( 'fill-opacity' , d => ( d . parent === packedRoot ? 1 : 0 ) )
112
99
. style ( 'display' , d => ( d . parent === packedRoot ? 'inline' : 'none' ) )
113
- . text ( d => d . data . name ) ;
100
+ . text ( d => ` ${ d . data . name } : ${ Number . parseFloat ( d . data . actualDuration ) . toFixed ( 2 ) } ms` ) ;
114
101
115
102
console . log ( 'PerfView -> node' , node ) ;
116
103
zoomTo ( [ packedRoot . x , packedRoot . y , packedRoot . r * 2 ] ) ;
0 commit comments