@@ -16,10 +16,10 @@ import { WaterfallEntryTiming } from "../../typing/waterfall";
16
16
function makeBlock ( rectData : RectData , className : string ) {
17
17
const blockHeight = rectData . height - 1 ;
18
18
const rect = svg . newRect ( {
19
- " height" : blockHeight ,
20
- " width" : misc . roundNumber ( rectData . width / rectData . unit ) + "%" ,
21
- "x" : misc . roundNumber ( rectData . x / rectData . unit ) + "%" ,
22
- "y" : rectData . y ,
19
+ height : blockHeight ,
20
+ width : misc . roundNumber ( rectData . width / rectData . unit ) + "%" ,
21
+ x : misc . roundNumber ( rectData . x / rectData . unit ) + "%" ,
22
+ y : rectData . y ,
23
23
} , className ) ;
24
24
if ( rectData . label ) {
25
25
rect . appendChild ( svg . newTitle ( rectData . label ) ) ; // Add tile to wedge path
@@ -40,16 +40,16 @@ function makeBlock(rectData: RectData, className: string) {
40
40
*/
41
41
function segmentToRectData ( segment : WaterfallEntryTiming , rectData : RectData ) : RectData {
42
42
return {
43
- " cssClass" : timingTypeToCssClass ( segment . type ) ,
44
- " height" : ( rectData . height - 6 ) ,
45
- " hideOverlay" : rectData . hideOverlay ,
46
- " label" : segment . type + " (" + Math . round ( segment . start ) + "ms - "
43
+ cssClass : timingTypeToCssClass ( segment . type ) ,
44
+ height : ( rectData . height - 6 ) ,
45
+ hideOverlay : rectData . hideOverlay ,
46
+ label : segment . type + " (" + Math . round ( segment . start ) + "ms - "
47
47
+ Math . round ( segment . end ) + "ms | total: " + Math . round ( segment . total ) + "ms)" ,
48
- " showOverlay" : rectData . showOverlay ,
49
- " unit" : rectData . unit ,
50
- " width" : segment . total ,
51
- "x" : segment . start || 0.001 ,
52
- "y" : rectData . y ,
48
+ showOverlay : rectData . showOverlay ,
49
+ unit : rectData . unit ,
50
+ width : segment . total ,
51
+ x : segment . start || 0.001 ,
52
+ y : rectData . y ,
53
53
} as RectData ;
54
54
}
55
55
@@ -73,7 +73,7 @@ function createTimingLabel(rectData: RectData, timeTotal: number, firstX: number
73
73
74
74
if ( percStart + ( roughTxtWidth / minWidth * 100 ) > 100 ) {
75
75
percStart = firstX / rectData . unit - spacingPerc ;
76
- txtEl = svg . newTextEl ( totalLabel , { x : `${ misc . roundNumber ( percStart ) } %` , y } , { " textAnchor" : "end" } ) ;
76
+ txtEl = svg . newTextEl ( totalLabel , { x : `${ misc . roundNumber ( percStart ) } %` , y } , { textAnchor : "end" } ) ;
77
77
}
78
78
79
79
return txtEl ;
@@ -152,14 +152,14 @@ export function createRequestLabelFull(x: number, y: number, name: string, heigh
152
152
clipPath : `url(#titleFullClipPath)` ,
153
153
} ) ;
154
154
labelHolder . appendChild ( svg . newRect ( {
155
- " height" : height - 4 ,
156
- "rx" : 5 ,
157
- "ry" : 5 ,
155
+ height : height - 4 ,
156
+ rx : 5 ,
157
+ ry : 5 ,
158
158
// for initial load performance use 500px as base width
159
159
// it's updated one by one on hover
160
- " width" : 500 ,
161
- "x" : x - 3 ,
162
- "y" : y + 3 ,
160
+ width : 500 ,
161
+ x : x - 3 ,
162
+ y : y + 3 ,
163
163
} , "label-full-bg" ) ) ;
164
164
labelHolder . appendChild ( blockLabel ) ;
165
165
return labelHolder ;
@@ -243,24 +243,24 @@ export function appendRequestLabels(rowFixed: SVGGElement, requestNumberLabel: S
243
243
export function createBgStripe ( y : number , height : number , isEven : boolean ) : SVGRectElement {
244
244
const className = isEven ? "even" : "odd" ;
245
245
return svg . newRect ( {
246
- "height" : height ,
247
- " width" : "100%" , // make up for the spacing
248
- "x" : 0 ,
249
- "y" : y ,
246
+ height,
247
+ width : "100%" , // make up for the spacing
248
+ x : 0 ,
249
+ y,
250
250
} , className ) ;
251
251
}
252
252
253
253
export function createNameRowBg ( y : number , rowHeight : number ) : SVGGElement {
254
254
const rowFixed = svg . newG ( "row row-fixed" ) ;
255
255
256
256
rowFixed . appendChild ( svg . newRect ( {
257
- " height" : rowHeight ,
258
- " width" : "100%" ,
259
- "x" : "0" ,
260
- "y" : y ,
257
+ height : rowHeight ,
258
+ width : "100%" ,
259
+ x : "0" ,
260
+ y,
261
261
} , "" ,
262
262
{
263
- " opacity" : 0 ,
263
+ opacity : 0 ,
264
264
} ) ) ;
265
265
266
266
return rowFixed ;
@@ -270,13 +270,13 @@ export function createRowBg(y: number, rowHeight: number): SVGGElement {
270
270
const rowFixed = svg . newG ( "row row-flex" ) ;
271
271
272
272
rowFixed . appendChild ( svg . newRect ( {
273
- " height" : rowHeight ,
274
- " width" : "100%" ,
275
- "x" : "0" ,
276
- "y" : y ,
273
+ height : rowHeight ,
274
+ width : "100%" ,
275
+ x : "0" ,
276
+ y,
277
277
} , "" ,
278
278
{
279
- " opacity" : 0 ,
279
+ opacity : 0 ,
280
280
} ) ) ;
281
281
282
282
return rowFixed ;
0 commit comments