Skip to content

Radial Tree chart

D3 chart

For all common D3 chart properties, refer to D3 chart API.

RadialTree

This chart has children Title component.

js
import { RadialTree } from 'intergalactic/d3-chart';

<RadialTree>
  <RadialTree.Radian>
    <RadialTree.Radian.Label />
    <RadialTree.Radian.Line />
    <RadialTree.Radian.Cap />
    <RadialTree.Radian.Icon />
  </RadialTree.Radian>
  <RadialTree.Title></RadialTree.Title>
</RadialTree>;

RadialTreeProps

NameTypeDescription
data[] List of radians. `{ label: string; key: string; capSize?: number; icon?: React.FC; color?: string; iconColor?: string; iconSize?: number; }`
angleOffsetnumber Angel (in rads) that rotates chart. 0 means that first radian is exactly on top vertical line.
durationnumber Duration of appear and update animation.
centralMarginnumber Gap between the chart center and radians start point.
labelMarginnumber Gap around text label.
colorstring Color of all radian's line, cap and label.
capSizenumber Size of the cap (filled circle on the end of the radian).
iconReact.FC Icon, that displayed in the cap of the active radian (usage example `icon: UserM`).
iconColorstring Color of icon.
iconSizenumber Size of icon.
textSizenumber Text size in radians' labels. 1.5x is used as default text size of center text.
activeKeystring | null Used to define the active radian in controlled way. Active radian is highlighted with inreased cap size.
onActiveKeyChange(activeKey: string | null) => void
defaultActiveKeystring | null Default value for `activeKey` property.
transparentboolean Enables element transparency

Released under the MIT License.

Released under the MIT License.