@@ -234,32 +234,33 @@ export default function radar_visualization(config) {
234234
235235 // draw quadrant labels
236236 for ( let i = 0 ; i < config . quadrants . length ; i ++ ) {
237- const smallerLabels = config . zoomed_quadrant || ! fullSize ;
237+ const smallerRadar = ! fullSize ;
238238 const isZoomed = i === config . zoomed_quadrant ;
239239 const factorX = quadrants [ i ] . factor_x ;
240240 const factorY = quadrants [ i ] . factor_y ;
241241 // magic numbers (found by experimentation)
242- const factorsForSmallerLabels = [
243- { x : factorX * 200 , y : factorY * 220 } ,
244- { x : factorX * 300 , y : factorY * 200 } ,
245- { x : factorX * 320 , y : factorY * 220 } ,
246- { x : factorX * 200 , y : factorY * 200 } ,
242+ const factorsForSmallerRadar = [
243+ { x : factorX * 210 , y : factorY * 220 } ,
244+ { x : factorX * 350 , y : factorY * 200 } ,
245+ { x : factorX * ( isZoomed ? 300 : 410 ) , y : factorY * 220 } ,
246+ { x : factorX * 220 , y : factorY * 200 } ,
247247 ] ;
248- const factorsForBiggerLabels = [
249- { x : factorX * 340 , y : factorY * 280 } ,
250- { x : factorX * 510 , y : factorY * 250 } ,
251- { x : factorX * 550 , y : factorY * 300 } ,
252- { x : factorX * 330 , y : factorY * 260 } ,
248+ const factorsForBiggerRadar = [
249+ { x : factorX * 290 , y : factorY * 280 } ,
250+ { x : factorX * 450 , y : factorY * 250 } ,
251+ { x : factorX * ( isZoomed ? 400 : 480 ) , y : factorY * ( isZoomed ? 270 : 300 ) } ,
252+ { x : factorX * 300 , y : factorY * 260 } ,
253253 ] ;
254254
255- const currentFactors = smallerLabels ? factorsForSmallerLabels : factorsForBiggerLabels ;
256- const { subtractX, subtractY } = getPxToSubtractQuadrantLabelText ( smallerLabels ) ;
255+ const currentFactors = smallerRadar ? factorsForSmallerRadar : factorsForBiggerRadar ;
256+ const { subtractX, subtractY } = getPxToSubtractQuadrantLabelText ( smallerRadar ) ;
257257
258258 const quadrantLabel = grid . append ( 'g' ) . attr ( 'id' , `quadrant-label-${ i } ` ) . style ( 'opacity' , 1 ) ;
259+
259260 quadrantLabel
260261 . append ( 'rect' )
261- . attr ( 'rx' , smallerLabels ? 12 : 20 )
262- . attr ( 'ry' , smallerLabels ? 12 : 20 )
262+ . attr ( 'rx' , isZoomed ? 7 : 15 )
263+ . attr ( 'ry' , isZoomed ? 7 : 15 )
263264 . attr ( 'x' , currentFactors [ i ] . x )
264265 . attr ( 'y' , currentFactors [ i ] . y )
265266 . style ( 'fill' , color . mineShaft )
@@ -272,7 +273,7 @@ export default function radar_visualization(config) {
272273 . attr ( 'text-anchor' , 'left' )
273274 . style ( 'fill' , config . active_quadrant === i || config . zoomed_quadrant === i ? color . mineShaft : color . scorpion )
274275 . style ( 'font-family' , 'Hellix' )
275- . style ( 'font-size' , `${ smallerLabels ? 8 : 14 } px` )
276+ . style ( 'font-size' , `${ isZoomed ? ( smallerRadar ? 5.5 : 6.5 ) : 13 } px` )
276277 . style ( 'font-weight' , 600 )
277278 . style ( 'letter-spacing' , '0.2em' ) ;
278279
@@ -294,8 +295,8 @@ export default function radar_visualization(config) {
294295 'y' ,
295296 config . zoomed_quadrant ? currentFactors [ i ] . y - bbox . height + addY : currentFactors [ i ] . y - bbox . height - 5
296297 )
297- . attr ( 'width' , smallerLabels ? bbox . width + 30 : bbox . width + 40 )
298- . attr ( 'height' , smallerLabels ? bbox . height + 12 : bbox . height + 18 ) ;
298+ . attr ( 'width' , bbox . width + 30 )
299+ . attr ( 'height' , isZoomed ? ( smallerRadar ? 14 : 16 ) : 32 ) ;
299300 }
300301 }
301302
0 commit comments