Radar axes: one canonical order everywhere
The dashboard fingerprints sorted score dimensions alphabetically while the ticker page rendered them in API order, so the same ticker drew a differently-shaped polygon on each page. New shared helper radarAxesFromDimensions() pins the axis order to the backend's DIMENSIONS list (technical, sr_quality, sentiment, fundamental, momentum; unknown dimensions append alphabetically) and centralizes the label truncation. Used by the dashboard fingerprint strip, the ticker header radar, and ScoreCard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import { useActivation } from '../hooks/useActivation';
|
||||
import { topPickSymbol, qualifiesSetup } from '../lib/qualification';
|
||||
import type { FetchSelector } from '../api/ingestion';
|
||||
import { CandlestickChart } from '../components/charts/CandlestickChart';
|
||||
import { RadarChart } from '../components/charts/horizon';
|
||||
import { RadarChart, radarAxesFromDimensions } from '../components/charts/horizon';
|
||||
import { ScoreCard } from '../components/ui/ScoreCard';
|
||||
import { useTickerNames } from '../hooks/useTickers';
|
||||
import { SkeletonCard } from '../components/ui/Skeleton';
|
||||
@@ -373,14 +373,7 @@ export default function TickerDetailPage() {
|
||||
</Button>
|
||||
</div>
|
||||
{scores.data && scores.data.dimensions.length >= 3 && (
|
||||
<RadarChart
|
||||
axes={scores.data.dimensions.map((d) => ({
|
||||
label: d.dimension.length > 9 ? `${d.dimension.slice(0, 8)}.` : d.dimension,
|
||||
full: d.dimension,
|
||||
value: d.score,
|
||||
}))}
|
||||
size={112}
|
||||
/>
|
||||
<RadarChart axes={radarAxesFromDimensions(scores.data.dimensions)} size={112} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user