rspace-online/backlog/tasks/task-146 - Sankey-Power-Ove...

1.6 KiB

id title status assignee created_date labels dependencies references priority
TASK-146 Sankey Power Overlay — dual-bar node sizing To Do
2026-04-16 18:56
rnetwork
governance
power-indices
TASK-144
modules/rnetwork/components/folk-trust-sankey.ts
src/encryptid/power-indices.ts
medium

Description

Add power index overlay to folk-trust-sankey.ts right-column nodes.

What

Right-column delegate nodes currently show rank badge + received weight %. Add a second bar showing Banzhaf power %, creating a visual comparison: raw weight vs actual coalitional power.

Primitive

  • Fetch power indices once on authority change: GET /rnetwork/api/power-indices?space={space}&authority={authority}
  • Build Map<did, { banzhaf, shapleyShubik }> lookup
  • Right-column nodes get dual horizontal bars:
    • Top bar (gray): raw received weight %
    • Bottom bar (authority color): Banzhaf power %
  • Nodes where power >> weight glow red (disproportionate influence)

Implementation

  • folk-trust-sankey.ts: Add powerMap field, fetch in loadData()
  • Modify renderRightNodes() to draw second bar below weight bar
  • Add CSS for .power-bar with transition animation
  • ~60 lines, one fetch, zero new files

Acceptance Criteria

  • #1 Dual bars on right-column nodes: weight % and Banzhaf %
  • #2 Red glow on nodes where Banzhaf > 1.5x weight share
  • #3 Bars animate on authority tab switch
  • #4 Toggle to show/hide power overlay