Skip to content
PreviewSelect a card to trace its dependencies across boards.
1 in work 7 ready 8 blocked 4 done
<TeamMap team={SMALL_TEAM} />

TSX
import { useState } from "react";
import { WorkGraph } from "@arcadia/ui/charts";

function Usage() {
  const [selected, setSelected] = useState<string | null>(null);
  const [showDone, setShowDone] = useState(false);
  return (
    <WorkGraph
      nodes={team.nodes} edges={team.edges} groups={team.groups} selected={selected} onSelect={setSelected} onOpen={openCard}
      showDone={showDone} onShowDone={setShowDone} bench={selected && <Bench card={selected} />}
    />
  );
}

See what can move now and what depends on it.

Columns to the right of Now show successive dependencies.

Words

Reuse the graph's state and chain wording in other views.

Preview
  • In work
  • Ready
  • Blocked
  • Done

Waits on 13: 3 in work, 10 blocked. 1 needs you. Longest chain before it: 7 cards.

import {
  WorkGraphMark, workGraphChain, workGraphChainWords, workGraphStateWord,
} from "@arcadia/ui/charts";

function Words() {
  const chain = workGraphChain(STRESS_TEAM.nodes, STRESS_TEAM.edges, DEEP.id, STRESS_TEAM.groups);
  const byId = new Map(STRESS_TEAM.nodes.map((n) => [n.id, n]));
  return (
    <div {...sx("work-graph-words", page.words)}>
      <ul {...sx("work-graph-words-list", page.wordsList)}>
        {STATES.map((state) => (
          <li key={state} {...sx("work-graph-word", page.word)}>
            <WorkGraphMark state={state} />
            {workGraphStateWord(state)}
          </li>
        ))}
      </ul>
      <p {...sx("work-graph-words-sentence", page.sentence)}>{workGraphChainWords(DEEP, chain, byId)}</p>
    </div>
  );
}

Use workGraphStateWord for states and workGraphChainWords for dependencies.

Examples

Many boards

Six boards with 300 cards and chains seven steps deep.

Preview
29 in work 87 ready 144 blocked 40 done
<TeamMap team={STRESS_TEAM} height="tall" />

Ready cards without dependencies fold at the bottom of their board.

A card selected

The selected chain stands out without hiding the other cards.

Preview
29 in work 87 ready 144 blocked 40 done

Name the map read, part 2

ARC-400 on Global
  • Blocked

Waits on 13: 3 in work, 10 blocked. 1 needs you. Longest chain before it: 7 cards.

<TeamMap team={STRESS_TEAM} start={DEEP.id} height="tall" />

A goal's map

A goal shows only its chain, including completed work.

Preview
ARC-216 Move the team's views 13 of 36 done
6 in work 2 ready 19 blocked 13 done
<TeamMap team={STRESS_TEAM} startFocus={GOAL.id} height="short" />

Done shown

Completed cards appear to the left of Now.

Preview
1 in work 7 ready 8 blocked 4 done
<TeamMap team={SMALL_TEAM} startDone />

Urgent cards

Highlight urgent cards without hiding their dependencies.

Preview
29 in work 87 ready 144 blocked 40 done
import { useState } from "react";
import { Switch } from "@arcadia/ui";

function Filtered() {
  const [urgent, setUrgent] = useState(true);
  return (
    <div {...sx("work-graph-filtered", page.filtered)}>
      <Switch size="sm" label="Highlight urgent cards" checked={urgent} onCheckedChange={setUrgent} />
      <TeamMap team={STRESS_TEAM} lit={urgent ? URGENT : undefined} />
    </div>
  );
}

Narrow graph

At narrow widths, the graph becomes a ranked list.

Preview
1 in work 7 ready 8 blocked 4 done
<div {...sx("work-graph-phone", page.phone)}><TeamMap team={SMALL_TEAM} /></div>

Empty

Preview
1 in work 7 ready 8 blocked 4 done

No links yet

Add a dependency to draw the order between cards.

import { useMemo } from "react";
import { EmptyState } from "@arcadia/ui";
import { WorkGraph } from "@arcadia/ui/charts";

function Empty() {
  const quiet = useMemo(() => ({ ...SMALL_TEAM, edges: [], nodes: SMALL_TEAM.nodes.map(({ asks: _a, exception: _e, ...n }) => n) }), []);
  return (
    <div {...sx("work-graph-frame", page.frame, page.short)}>
      <WorkGraph
        nodes={quiet.nodes} edges={quiet.edges} groups={quiet.groups}
        empty={<EmptyState title="No links yet" description="Add a dependency to draw the order between cards." />}
      />
    </div>
  );
}

Loading

Show placeholders after 200ms and hold them for at least 400ms.

Preview
import { WorkGraph } from "@arcadia/ui/charts";

<div {...sx("work-graph-frame", page.frame, page.short)}><WorkGraph nodes={[]} edges={[]} groups={[]} loading /></div>

Use rootStyle to set the map, card and channel widths.

--work-graph-node
`calc(${Ref<FontSize>} * ${number})`
Default: calc(var(--font-size-headline) * 16)
--work-graph-channel
Ref<Space> | `calc(${Ref<Space>} * ${number})`
Default: var(--space-16)

The graph is one Tab stop. Arrow keys move between cards, and each card announces its state and dependencies.

Shapes distinguish states independently of colour. Connectors are decorative.

Tab
Moves to the map's one stop, then to the bench
UpDown
Move along a column, into the board above or below
Left
Moves to what the card waits on, along its longest chain
Right
Moves to what waits on the card
HomeEnd
Go to a column's first or last card
Enter
Selects a card, or opens the selected card when onOpen is set
Space
Selects or clears
Escape
Clears the selection

WorkGraph

nodesrequired
readonly WorkGraphNode[]
edgesrequired
readonly WorkGraphEdge[]
groupsrequired
readonly WorkGraphGroup[]
stubbed
ReadonlySet<string>
Default: NONE
counts
WorkGraphCounts
selected
string | null
Default: null
onSelect
(id: string | null) => void
onOpen
(id: string) => void
lit
ReadonlySet<string>
showDone
boolean
Default: false
onShowDone
(show: boolean) => void
focus
string | null
Default: null
onFocusLeave
() => void
onUnfold
(group: string) => void
more
boolean
Default: false
bench
ReactNode
empty
ReactNode
loading
boolean
Default: false
rootStyle
RootStyle<WorkGraphKnobs>

Rest props go to HTMLAttributes<HTMLDivElement>.

staterequired
"work" | "ready" | "blocked" | "done"
rootStyle
RootStyle
A component's typed override prop: Layout and its documented knobs, each the references it takes or another kit knob of its kind; anything else is a type error at the call site (STYLEX.md).