ExpressionValue

Renders a bound expression as its live value, which is what The slope is {{#f.slope}}. shows.

@internote/canvas-sdk/reactComponent
On this page
import { ExpressionValue } from '@internote/canvas-sdk/react';

Every live number on the page goes through formatLiveValue, so one in prose and one in a mark's label read alike, and an unpublished value reads as an em dash. An expression that is only a reference shows whatever was published there: {{#q.verdict}} reads correct, {{#q.answered}} reads yes or no. Anything with arithmetic in it is a number.

#Props

Also takes className. Any other prop is passed to the rendered element.

expressionRequired
The bound expression to show; null shows an em dash.
ChalkExpression | null
options
How the number is formatted, such as its significant figures.
LiveValueFormatOptions
variables
Values for an equation's variables, by name.
Record<string, number>

#Example

const expression = expressionItemOf(item);
if (expression) return <ExpressionValue key={i} expression={expression} />;

Declared in packages/canvas-sdk/src/content/expression-values.tsx:163.

Last updated