mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: Adjust health chart for large values (#6665)
This commit is contained in:
		
							parent
							
								
									7ca95295bc
								
							
						
					
					
						commit
						cf7507db98
					
				| @ -16,7 +16,13 @@ export const ProjectHealthChart: React.FC<ProgressComponentProps> = ({ | |||||||
|     health, |     health, | ||||||
| }) => { | }) => { | ||||||
|     const theme = useTheme(); |     const theme = useTheme(); | ||||||
|     const gap = active === 0 || stale === 0 ? 0 : 10; |     const gap = | ||||||
|  |         active === 0 || | ||||||
|  |         stale === 0 || | ||||||
|  |         active / stale > 30 || | ||||||
|  |         stale / active > 30 | ||||||
|  |             ? 0 | ||||||
|  |             : 10; | ||||||
|     const strokeWidth = 6; |     const strokeWidth = 6; | ||||||
|     const radius = 50 - strokeWidth / 2; |     const radius = 50 - strokeWidth / 2; | ||||||
|     const circumference = 2 * Math.PI * radius; |     const circumference = 2 * Math.PI * radius; | ||||||
| @ -27,7 +33,7 @@ export const ProjectHealthChart: React.FC<ProgressComponentProps> = ({ | |||||||
|         totalCount === 0 ? 100 : (active / totalCount) * 100; |         totalCount === 0 ? 100 : (active / totalCount) * 100; | ||||||
|     const stalePercentage = totalCount === 0 ? 0 : (stale / totalCount) * 100; |     const stalePercentage = totalCount === 0 ? 0 : (stale / totalCount) * 100; | ||||||
|     const potentiallyStalePercentage = |     const potentiallyStalePercentage = | ||||||
|         active === 0 ? 0 : (potentiallyStale / active) * 100; |         active === 0 ? 0 : (potentiallyStale / totalCount) * 100; | ||||||
| 
 | 
 | ||||||
|     const activeLength = Math.max( |     const activeLength = Math.max( | ||||||
|         (activePercentage / 100) * circumference - gap, |         (activePercentage / 100) * circumference - gap, | ||||||
| @ -37,8 +43,10 @@ export const ProjectHealthChart: React.FC<ProgressComponentProps> = ({ | |||||||
|         (stalePercentage / 100) * circumference - gap, |         (stalePercentage / 100) * circumference - gap, | ||||||
|         1, |         1, | ||||||
|     ); |     ); | ||||||
|     const potentiallyStaleLength = |     const potentiallyStaleLength = Math.max( | ||||||
|         (potentiallyStalePercentage / 100) * activeLength; |         (potentiallyStalePercentage / 100) * circumference - gap, | ||||||
|  |         1, | ||||||
|  |     ); | ||||||
| 
 | 
 | ||||||
|     const activeRotation = -90 + gapAngle / 2; |     const activeRotation = -90 + gapAngle / 2; | ||||||
|     const potentiallyStaleRotation = |     const potentiallyStaleRotation = | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user