Menu

Building a Deterministic Multi-Axis Personality Scoring Engine and SVG Radar Chart in TypeScript
📰

Building a Deterministic Multi-Axis Personality Scoring Engine and SVG Radar Chart in TypeScript

DEV Community: frontend·Jimmy fa·6 days ago
#cSHccjLH
#devtofrontend#devto#dev#axis#totals
Long article (337 words) — no AI summary yet.
Reading 0:00
15s threshold

When building interactive multi-dimensional assessments in the browser, keeping scoring deterministic, transparent, and zero-latency matters more than throwing an LLM at every response.

Weighted Vector Scoring in TypeScript

Instead of opaque server-side black boxes, each scenario prompt can map cleanly to a fixed 7-axis weight vector:

export type Axis = 'pride' | 'greed' | 'lust' | 'envy' | 'gluttony' | 'wrath' | 'sloth' ;

export interface AnswerWeight { weights : Partial < Record < Axis , number >> ; }

export function scoreResponses ( answers : AnswerWeight [ ] ) : Record < Axis , number > { const totals : Record < Axis , number > = { pride : 0 , greed : 0 , lust : 0 , envy : 0 , gluttony : 0 , wrath : 0 , sloth : 0 , } ; for ( const ans of answers ) { for ( const [ axis , val ] of Object . entries ( ans . weights ) ) { totals [ axis as Axis ] += val ?? 0 ; } } const maxVal = Math . max ( 1 , . . . Object . values ( totals ) ) ; for ( const k of Object .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.