File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,6 +260,17 @@ useEffect(() => {
260260 const spiderChartDomain : [ number , number ] =
261261 activeMetric === 'cost' ? spiderValueDomain : [ 0 , 100 ] ;
262262
263+ const formatSpiderTick = useCallback (
264+ ( value : number ) => {
265+ if ( activeMetric === 'cost' ) {
266+ if ( ! Number . isFinite ( value ) ) return '$0.000000' ;
267+ return `$${ value . toFixed ( 6 ) } ` ;
268+ }
269+ return value . toFixed ( 0 ) ;
270+ } ,
271+ [ activeMetric ]
272+ ) ;
273+
263274 useEffect ( ( ) => {
264275 if ( activeBarAxis && ! currentAxes . includes ( activeBarAxis ) ) {
265276 setActiveBarAxis ( '' ) ;
@@ -730,7 +741,7 @@ useEffect(() => {
730741 </ text >
731742 ) }
732743 />
733- < PolarRadiusAxis domain = { spiderValueDomain } tickCount = { 5 } />
744+ < PolarRadiusAxis domain = { spiderValueDomain } tickCount = { 5 } tickFormatter = { formatSpiderTick } />
734745 { routerIds . map ( ( id , index ) => (
735746 < Radar
736747 key = { id }
Original file line number Diff line number Diff line change @@ -95,9 +95,10 @@ const DifficultyBarPanel: React.FC<DifficultyBarPanelProps> = ({
9595 position = "right"
9696 formatter = { ( value : number ) => {
9797 if ( metricKey === 'cost' ) {
98- return value . toFixed ( 5 ) ;
98+ const safeValue = Number . isFinite ( value ) ? value : 0 ;
99+ return `$${ safeValue . toFixed ( 5 ) } ` ;
99100 }
100- return value . toFixed ( 1 ) ;
101+ return Number . isFinite ( value ) ? value . toFixed ( 1 ) : '0.0' ;
101102 } }
102103 fill = "#0f172a"
103104 fontSize = { 12 }
You can’t perform that action at this time.
0 commit comments