API index

Everything @umriss-ui/calculation exports, with its signature. A component's props stand on its own page.

Components

Calculation

Calculation – Lets a reader follow and redo a figure (also called a KPI tree or calculation tree): each line a quantity with its operator, derived lines folded until opened beneath themselves. Reach for it where a number on the screen gets questioned: a cost, an availability, an invoice total.

Used on Scenarios, Installation, Calculation, Tree, Chain, Rows from data, Given, Metrics, What can go wrong and Worked examples.

Chain

Chain – A sheet read top to bottom (a running calculation): each line worked into the value before it, and interims naming the value where they stand. Reach for it for invoices, budgets and cost sheets.

Used on Calculation, Chain, Rows from data, Given, Metrics, What can go wrong and Worked examples.

Difference

The first operand minus every other: a − b − c.

const Difference: (props: OperatorProps) => null;

Used on Scenarios, Installation, Calculation, Tree, Rows from data and Worked examples.

DividedBy

Divides the named value before it by its operand.

const DividedBy: (props: ChainOperandProps) => null;

Used on Chain, Metrics and Worked examples.

Given

Given – The numbers a calculation starts from (inputs, leaves): where they came from, when they were true, and whether they are still fresh.

Used on Scenarios, Installation, Calculation, Tree, Chain, Rows from data, Given, Metrics, What can go wrong and Worked examples.

Interim

Names the value of a chain where it stands.

const Interim: (props: QuantityProps) => null;

Used on Calculation, Chain, Rows from data, Given, Metrics, What can go wrong and Worked examples.

Minus

Takes its operand from the value before it.

const Minus: (props: ChainOperandProps) => null;

Used on Calculation, Chain, Rows from data, Given and Metrics.

Plus

Adds its operand to the value before it.

const Plus: (props: ChainOperandProps) => null;

Used on Calculation, Chain, Rows from data, Metrics, What can go wrong and Worked examples.

Product

The product of two or more operands.

const Product: (props: OperatorProps) => null;

Used on Scenarios, Calculation, Tree, Chain, Rows from data, Given, Metrics, What can go wrong and Worked examples.

Quotient

Exactly two operands: the first divided by the second.

const Quotient: (props: OperatorProps) => null;

Used on Scenarios, Installation, Calculation, Tree, Chain, Given, Metrics, What can go wrong and Worked examples.

Ref

Tree – A quantity defined elsewhere in the calculation, standing as an operand.

Used on Scenarios, Installation, Calculation, Tree, Chain, Rows from data, Given and Worked examples.

Sum

The sum of its operands, however many: rows from data, one or none included. The sum of none is zero, and its line says it has no entries.

const Sum: (props: OperatorProps) => null;

Used on Scenarios, Calculation, Tree, Chain, Rows from data, Metrics, What can go wrong and Worked examples.

Times

Multiplies the named value before it by its operand.

const Times: (props: ChainOperandProps) => null;

Used on Calculation, Chain and Metrics.

Types

CalculationProps

Its table stands on Calculation.

ChainOperandProps

Its table stands on Chain.

ChainProps

Its table stands on Chain.

GivenProps

Its table stands on Given.

Metric

Its table stands on Metrics.

Used on Rows from data and Metrics.

MetricValues

A given's numbers where the calculation has metrics: one per metric id, null where the number is absent.

type MetricValues = Readonly<Record<string, number | null>>;

OperatorProps

Its table stands on Tree.

QuantityProps

Its table stands on Chain.

RefProps

Its table stands on Tree.

Every page of @umriss-ui/calculation

Getting started

Writing a calculation

In practice

API index