VB Project Planning

<quadrant-grid>

Generic 2x2 quadrant grid primitive backing SWOT, stakeholder maps, and any custom 2x2 visualization.

Overview

The <quadrant-grid> component renders a configurable 2x2 grid with axis labels, low/high markers, and four titled quadrants. Children are placed by either data-quadrant (explicit bucket) or data-x / data-y (normalized coordinates that compute to the matching quadrant and pin the child as a labelled dot). Optional drag-and-drop via the draggable attribute composes <drag-surface>.

This is the primitive that backs SWOT, stakeholder-map, and other 2x2 patterns — it replaces three previously-proposed standalone components with one configurable element plus recipes.

Cartesian convention

Quadrant indices follow Cartesian numbering. q1 is top-right, q2 top-left, q3 bottom-left, q4 bottom-right:

Use data-quadrant="0".."3" on children to bucket them, or set data-x / data-y in [0..1] and the component computes the quadrant.

Attributes

AttributeValuesDefaultDescription
x-labelstring—X-axis label
y-labelstring—Y-axis label
x-lowstring—X-axis low-end marker (default: "Low")
x-highstring—X-axis high-end marker (default: "High")
y-lowstring—Y-axis low-end marker (default: "Low")
y-highstring—Y-axis high-end marker (default: "High")
q1-labelstring—Top-right quadrant title
q2-labelstring—Top-left quadrant title
q3-labelstring—Bottom-left quadrant title
q4-labelstring—Bottom-right quadrant title
draggableboolean—Enable drag-and-drop between quadrants (composes one <drag-surface> per quadrant)

Child attributes

AttributeOnValuesDescription
data-quadrant*numberExplicit quadrant index 0..3 (Cartesian Q1..Q4)
data-x*numberNormalized x coordinate 0..1; quadrant is computed from coords; removed when the child is dragged to another quadrant
data-y*numberNormalized y coordinate 0..1; quadrant is computed from coords; removed when the child is dragged to another quadrant
data-id*stringStable identifier emitted in move events

SWOT recipe

SWOT analysis is just a quadrant-grid with appropriate axis labels and quadrant titles. No new component required.

Stakeholder Map recipe

Power × Interest grid with labelled dots positioned at exact coordinates via data-x / data-y.

Drag-and-drop

Add the draggable attribute to enable moving children between quadrants. Each quadrant becomes a <drag-surface>; the component listens for cross-surface transfers and emits quadrant-grid:move.

A drop has no position, so a coordinate-pinned child (data-x / data-y) that is dragged to another quadrant loses its coordinates: data-x and data-y are removed and it joins that quadrant's stack like any other card. Overlapping-pin clusters are recomputed after every move. The event detail carries no coordinates.

Events

EventDetailDescription
quadrant-grid:move{ item, itemId, from, to }Fired when a draggable child moves between quadrants (from / to are indices 0..3). A coordinate-pinned child dropped in another quadrant loses its data-x / data-y and joins that quadrant's stack
quadrant-grid:upgraded—Fired (in a microtask) each time the grid connects and upgrades

Progressive Enhancement

The component layers cleanly:

  1. HTML. Static fallback content (a <dl> of quadrant titles or children with data-quadrant) remains visible without JS or CSS.
  2. CSS. The :not(:defined) selector keeps the host visible pre-upgrade; once defined, the grid layout applies.
  3. JS. Adds axis labels, computes quadrants for data-x / data-y children, wires drag-and-drop when requested, and fires quadrant-grid:move.

Accessibility

  • The grid is a <section role="region"> labelled from the axis labels (e.g. "Helpfulness × Origin quadrant grid").
  • Each quadrant is its own <section> with an aria-label from its q*-label. Quadrants are in the DOM in visual reading order — top-left (Q2), top-right (Q1), bottom-left (Q3), bottom-right (Q4) — so screen-reader and tab order match the layout.
  • In read-only mode each quadrant's children are a list (<ul> / <li>).
  • When coordinate pins overlap, each pin in the cluster becomes focusable (tabindex="0", role="group" unless it already has a role) so keyboard users can fan the cluster out.
  • Axis and scale labels are aria-hidden; the region label carries the axis names.
  • With draggable, a polite live region announces moves using the item's text and the quadrant label (e.g. "Moved Add 2FA to Big Bets").
  • Each <drag-surface> is exposed as a list of its cards (role="list" / "listitem", kept in step as cards are added and moved). If any card is an element that may not be a list item, such as <article>, that surface is exposed as a labelled role="group" instead and the cards keep their own role. The drag-surface's own move announcements are moved to a hidden status region just after the list, since a list may only contain list items.

Related

  • <impact-effort> — Specialized 2x2 with hardcoded Quick Wins / Big Bets / Fill-Ins / Money Pit labels and stable public API. Keeps its own surface; quadrant-grid covers other 2x2 use cases.
  • <empathy-map> — UX research 2x2 with persona context and emotion tagging. Domain-specific.
  • <drag-surface> — DnD primitive composed when draggable is set.
↑