@@ -173,6 +173,9 @@ const devGraphStyles = {
173
173
circleStyle : {
174
174
fill : "black" ,
175
175
} ,
176
+ svg : {
177
+ height : "30px" ,
178
+ }
176
179
} ;
177
180
178
181
function nearestRoundUp ( number ) {
@@ -275,17 +278,24 @@ const renderBackgroundLines = () => {
275
278
function calculateTierHeight ( currentTierCount , previousTierCount , style ) {
276
279
const previousY = calculateYPoint ( previousTierCount , yMax ) ;
277
280
const currentY = calculateYPoint ( currentTierCount , yMax ) ;
278
-
281
+
279
282
// Calculate the height of the tier relative to y-axis lines
280
283
const height = previousY - currentY ;
281
284
285
+ // meaning that tier is too high so skip render
286
+ if ( ! height ) {
287
+ return null ;
288
+ }
289
+
282
290
// Calculate the y-position of the tier based on y-axis lines
283
291
const yPosition = Math . min ( previousY - height , yInnerMaxHeight - 5 ) ;
284
-
292
+
285
293
// if too small, barely render
286
294
if ( yInnerMaxHeight - ySingleUnit < yPosition ) {
287
295
return < rect x = "50" y = { previousY + 1 } style = { style } height = { 1 } > </ rect > ;
288
296
}
297
+
298
+
289
299
return < rect x = "50" y = { yPosition } style = { style } height = { Math . max ( height , 29 ) } > </ rect > ;
290
300
}
291
301
@@ -353,23 +363,23 @@ return (
353
363
</ div >
354
364
< div style = { devGraphStyles . row } >
355
365
< div style = { devGraphStyles . column2 } >
356
- < svg >
366
+ < svg style = { devGraphStyles . svg } >
357
367
< g >
358
368
< rect x = "0" y = "0" style = { devGraphStyles . freeTierSquare } > </ rect >
359
369
< text x = "35" y = "20" style = { devGraphStyles . textStyle6 } > Free Tier</ text >
360
370
</ g >
361
371
</ svg >
362
372
</ div >
363
373
< div style = { devGraphStyles . column2 } >
364
- < svg >
374
+ < svg style = { devGraphStyles . svg } >
365
375
< g >
366
376
< rect x = "0" y = "0" style = { devGraphStyles . tierOneSquare } > </ rect >
367
377
< text x = "35" y = "20" style = { devGraphStyles . textStyle6 } > Tier 1</ text >
368
378
</ g >
369
379
</ svg >
370
380
</ div >
371
381
< div style = { devGraphStyles . column2 } >
372
- < svg >
382
+ < svg style = { devGraphStyles . svg } >
373
383
< g >
374
384
< rect x = "0" y = "0" style = { devGraphStyles . tiertwoSquare } > </ rect >
375
385
< text x = "35" y = "20" style = { devGraphStyles . textStyle6 } > Tier 2</ text >
0 commit comments