Skip to content

Towers

View as Markdown

<Towers /> takes the API response and draws every tower in it: one section per risk, the risk’s towers side by side, and a key underneath.

import { Towers } from '@vinsa/towers';
import '@vinsa/towers/styles.css';
<Towers data={response} />;

Property portfolio

Tower (Property)
Retention 70%
Property quota share
XOL Treaty - Per Event (Property)
Retention
Retention 70%
Cat XL 1, 10M xs 10M per eventCat XL 2, 30M xs 20M per eventCat XL 3, 50M xs 50M per event
XOL Treaty - Per Risk (Property)
Retention
Risk XL 1, 4M xs 1M per riskRisk XL 2, 5M xs 5M per risk
XOL Treaty - Aggregate (Property)
Retention
Retention 65%
Aggregate XL, 20M xs 40M xs 5M aggregate
XOL Treaty - Per Event (Whole account)
Retention
Whole-account clash XL, 15M xs 10M per event
kept by the cedant signed firm orderWidth is share of the risk, height is amount.

Casualty portfolio

Tower (Casualty)
Retention 50%
Retention 12.5%
Casualty quota shareCasualty XL 1, 3M xs 2M per claimCasualty XL 2, 5M xs 5M per claim
XOL Treaty - Per Event (Whole account)
Retention
Whole-account clash XL, 15M xs 10M per event
kept by the cedant signedWidth is share of the risk, height is amount.

When the response has more than one risk, each gets a heading: the insured’s name, or failing that the policy reference or risk id.

Prop Type Default
data TowersResponse required The API response, unchanged.
riskId string every risk Draw only this risk.
selectedKey string | null own state The highlighted layer. Pass it to control selection yourself.
onSelect (key, risk) => void Called when a layer is clicked. key is null when the selection is cleared.
loss number | null null Draws a loss of this amount up every tower.
scale 'amount' | 'even' 'amount' Heights to scale, or every band the same height.
height number 420 Plot height of each tower, in pixels.
legend boolean true Show the key under each risk, including an Other reinsurers entry when that block is present.
className string Added to the outer element.

Pass riskId to draw a single risk, for a page with a risk picker of its own.

<Towers data={response} riskId="R-1001" />

Clicking a layer highlights it and dims the rest. Clicking it again, or the empty plot, clears the selection.

Left alone, the component remembers the selection itself. To react to it, pass onSelect. The key is the layer’s layerRef, or its layerName when it has no reference.

<Towers
data={response}
onSelect={(key, risk) => {
if (key) openLayerPanel(risk.riskId, key);
}}
/>

To own the selection, for example to keep it in the URL, pass selectedKey as well:

const [selected, setSelected] = useState<string | null>(null);
<Towers data={response} riskId={riskId} selectedKey={selected} onSelect={setSelected} />;

A controlled selectedKey applies to every risk on show, so pair it with riskId.

scale="amount" draws heights in proportion to amounts, which is truthful but can squash a small layer under a large one. scale="even" gives every band the same height so each layer is readable.

Tower
Retention 20%
Retention 20%
Second excess, 5M xs 5M per claim
kept by the cedant signed firm orderWidth is share of the risk, height is amount.

loss washes the tower up to that amount and flags the level. See Test a loss.