Skip to content
D
Documentation

Types — interfaces b–t

reference
9 min readUpdated

Interfaces B–T

Import these from @grafloria/renderer.

Interfaces

BooleanPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Boolean property definition

ts
interface BooleanPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'boolean'Editor type to use for this property
defaultValue?booleanDefault value if property is not set

Example

typescript
const prop: BooleanPropertyDefinition = {
  key: 'enabled',
  label: 'Enabled',
  editor: 'boolean',
  defaultValue: true
};

BoundingBox

Bounding box result.

ts
interface BoundingBox

Properties

NameTypeDefaultDescription
xnumber
ynumber
widthnumber
heightnumber

CanvasRendererConfig

Canvas Renderer Configuration

ts
interface CanvasRendererConfig

Properties

NameTypeDefaultDescription
enableHitDetection?booleanEnable hit detection canvas Default: true
hitCanvasScale?numberScale factor for hit detection canvas Higher values = more accurate but slower Default: 1.0

ColorPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Color picker property definition

ts
interface ColorPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'color'Editor type to use for this property
defaultValue?stringDefault value if property is not set

Example

typescript
const prop: ColorPropertyDefinition = {
  key: 'backgroundColor',
  label: 'Background Color',
  editor: 'color',
  defaultValue: '#FFFFFF'
};

ComplexPropertyCondition

Complex condition combining multiple simple conditions

ts
interface ComplexPropertyCondition

Properties

NameTypeDefaultDescription
and?PropertyCondition[]All conditions must be true (AND logic)
or?PropertyCondition[]At least one condition must be true (OR logic)

Example

AND condition

typescript
const condition: ComplexPropertyCondition = {
  and: [
    { property: 'enabled', operator: '==', value: true },
    { property: 'nodeCount', operator: '>', value: 10 }
  ]
};

Example

OR condition

typescript
const condition: ComplexPropertyCondition = {
  or: [
    { property: 'type', operator: '==', value: 'table' },
    { property: 'type', operator: '==', value: 'view' }
  ]
};

DatePropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Date picker property definition

ts
interface DatePropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'date'Editor type to use for this property
defaultValue?string | DateDefault value if property is not set
validation?{ required?: boolean; }Validation rules for this property

Example

typescript
const prop: DatePropertyDefinition = {
  key: 'birthDate',
  label: 'Birth Date',
  editor: 'date',
  validation: { required: true }
};

DateTimePropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

DateTime picker property definition

ts
interface DateTimePropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'datetime'Editor type to use for this property
defaultValue?string | DateDefault value if property is not set
validation?{ required?: boolean; }Validation rules for this property

Example

typescript
const prop: DateTimePropertyDefinition = {
  key: 'createdAt',
  label: 'Created At',
  editor: 'datetime',
  defaultValue: new Date().toISOString()
};

Effects

Effects theme (shadows, border radius, opacity)

ts
interface Effects

Properties

NameTypeDefaultDescription
shadow{ none: string; sm: string; md: string; lg: string; }Shadow definitions (CSS box-shadow values)
borderRadius{ none: number; sm: number; md: number; lg: number; full: number; }Border radius values (in pixels)
opacity{ disabled: number; ghost: number; translucent: number; }Opacity values (0-1)

FilePropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

File upload property definition

ts
interface FilePropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'file'Editor type to use for this property
accept?string
multiple?boolean

Example

typescript
const prop: FilePropertyDefinition = {
  key: 'avatar',
  label: 'Avatar Image',
  editor: 'file',
  accept: 'image/*',
  multiple: false
};

HighlightConnectedOptions

How highlightConnected draws the selected nodes' lines. Every field is optional.

ts
interface HighlightConnectedOptions

Properties

NameTypeDefaultDescription
depth?numberHow far the highlight follows the graph from the selected nodes. 1 (the default) marks only the lines that touch them; 2 also the lines one node further upstream and downstream; Infinity traces every path in and out.
stroke?stringThe colour of a highlighted line. Default: the theme's primary text colour.
strokeWidth?numberThe width of a highlighted line. Default 2.5 (a line is 2).
outgoing?'dashed' | 'solid'How a line going OUT of the selection is drawn. Default 'solid', like the lines coming in; 'dashed' adds a direction cue. (A line crossing a card is dashed either way.)
dimOpacity?numberOpacity of every other line while a node is selected. Default 0.4 — faded, still legible; 1 leaves them alone.

JsonPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

JSON editor property definition

ts
interface JsonPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'json'Editor type to use for this property
defaultValue?anyDefault value if property is not set

Example

typescript
const prop: JsonPropertyDefinition = {
  key: 'metadata',
  label: 'Metadata',
  editor: 'json',
  defaultValue: { version: '1.0' }
};

LinkStyleTheme

Link style from theme

ts
interface LinkStyleTheme

Properties

NameTypeDefaultDescription
strokestring
strokeWidthnumber
strokeDasharray?string
opacitynumber

MultiSelectPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Multi-select property definition with options

ts
interface MultiSelectPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'multiselect'Editor type to use for this property
optionsSelectOption[]
validation?{ required?: boolean; }Validation rules for this property

Example

typescript
const prop: MultiSelectPropertyDefinition = {
  key: 'tags',
  label: 'Tags',
  editor: 'multiselect',
  options: [
    { value: 'important', label: 'Important' },
    { value: 'urgent', label: 'Urgent' },
    { value: 'review', label: 'Needs Review' }
  ]
};

NodeStyleTheme

Node style from theme

ts
interface NodeStyleTheme

Properties

NameTypeDefaultDescription
fillstring
strokestring
strokeWidthnumber
borderRadiusnumber
shadowboolean
opacitynumber
selection?'both' | 'border' | 'ring'How a selected node shows it — 'both' (default), 'border' or 'ring'.

NumberPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Number property definition with number-specific validation

ts
interface NumberPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'number'Editor type to use for this property
validation?{ required?: boolean; min?: number; max?: number; step?: number; }Validation rules for this property

Example

typescript
const prop: NumberPropertyDefinition = {
  key: 'port',
  label: 'Port Number',
  editor: 'number',
  validation: {
    required: true,
    min: 1,
    max: 65535,
    step: 1
  }
};

NumberScale

A named numeric scale (see {@link Theme.numbers}). Values are unitless — they are consumed as SVG lengths (stroke-width), which accept plain numbers.

ts
interface NumberScale

Properties

NameTypeDefaultDescription
hairline?number
regular?number
emphasis?number
heavy?number

PerformanceMetrics

Performance metrics returned by renderer

ts
interface PerformanceMetrics

Properties

NameTypeDefaultDescription
mode'svg' | 'canvas'Renderer mode
nodeCountnumberNumber of nodes rendered
linkCountnumberNumber of links rendered
renderTimenumberLast render time in milliseconds
fpsnumberCurrent frames per second
memoryUsagenumberEstimated memory usage in bytes

PortThemeConfig

Port theme configuration

ts
interface PortThemeConfig

Properties

NameTypeDefaultDescription
sizenumber
strokeWidthnumber
colors{ input: string; output: string; bi: string; }

PropertyCondition

Simple condition for property visibility

ts
interface PropertyCondition

Properties

NameTypeDefaultDescription
propertystringKey of the property to check
operatorConditionOperatorComparison operator
valueanyValue to compare against

Example

Equality condition

typescript
const condition: PropertyCondition = {
  property: 'useCustomColor',
  operator: '==',
  value: true
};

Example

Comparison condition

typescript
const condition: PropertyCondition = {
  property: 'nodeCount',
  operator: '>',
  value: 100
};

Example

Contains condition

typescript
const condition: PropertyCondition = {
  property: 'tags',
  operator: 'contains',
  value: 'important'
};

PropertyDisplayOptions

Display options for property editors

ts
interface PropertyDisplayOptions

Properties

NameTypeDefaultDescription
variant?stringVariant of the editor (e.g., 'toggle' for boolean)
rows?numberNumber of rows for textarea/json editors
autoResize?booleanAuto-resize for textarea
showLabels?booleanShow labels on slider (min/max)

PropertyGroup

Property group for organizing related properties

Groups allow properties to be organized into collapsible sections in the UI. Each group has a name (used for referencing in property definitions) and a label (displayed to the user).

ts
interface PropertyGroup

Properties

NameTypeDefaultDescription
namestringUnique group identifier (used in PropertyDefinition.group)
labelstringDisplay label shown in UI
description?stringOptional description or help text
collapsed?booleanInitial collapse state (default: false/expanded)
order?numberDisplay order (groups with lower order appear first)
icon?stringOptional icon identifier

Example

Basic group

typescript
const group: PropertyGroup = {
  name: 'appearance',
  label: 'Appearance'
};

Example

Group with all options

typescript
const group: PropertyGroup = {
  name: 'advanced',
  label: 'Advanced Settings',
  description: 'Advanced configuration options',
  collapsed: true,
  order: 10,
  icon: 'settings'
};

Rectangle

Rectangle defined by position and size Used for viewport queries and rendering bounds

ts
interface Rectangle

Properties

NameTypeDefaultDescription
xnumber
ynumber
widthnumber
heightnumber

RendererCapabilities

Renderer capability flags for runtime feature detection.

ts
interface RendererCapabilities

Properties

NameTypeDefaultDescription
supportsHitTestbooleanCan perform hit testing (element at coordinate)
supportsBatchingbooleanCan batch multiple render operations
supportsExportbooleanCan export as image/SVG
supportsMeasurementbooleanCan measure text/elements accurately
supportsForeignObjectbooleanCan render foreignObject (HTML inside SVG)
supportsFiltersbooleanCan apply filters/effects
supportsOffscreenbooleanCan render to an offscreen buffer

SelectOption

Select option for dropdown editors

ts
interface SelectOption

Properties

NameTypeDefaultDescription
valueanyThe value of the option
labelstringDisplay label for the option
disabled?booleanWhether this option is disabled

SelectPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Select (dropdown) property definition with options

ts
interface SelectPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'select'Editor type to use for this property
optionsSelectOption[]
validation?{ required?: boolean; }Validation rules for this property

Example

typescript
const prop: SelectPropertyDefinition = {
  key: 'nodeType',
  label: 'Node Type',
  editor: 'select',
  options: [
    { value: 'table', label: 'Table' },
    { value: 'view', label: 'View' },
    { value: 'procedure', label: 'Stored Procedure', disabled: true }
  ],
  validation: { required: true }
};

SemanticPalette

The host's semantic colour vocabulary (see {@link Theme.categories}). Open-ended: the built-in themes ship the names below, and callers add theirs.

ts
interface SemanticPalette

Properties

NameTypeDefaultDescription
critical?stringBlocking / fatal — the strongest attention colour.
warning?stringNon-blocking problem.
success?stringHealthy / passing.
info?stringNeutral information.
neutral?stringDe-emphasised / inactive.
accent?stringThe host's brand accent.

SliderPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Slider (range) property definition

ts
interface SliderPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'slider'Editor type to use for this property
minnumber
maxnumber
step?number
defaultValue?numberDefault value if property is not set

Example

typescript
const prop: SliderPropertyDefinition = {
  key: 'opacity',
  label: 'Opacity',
  editor: 'slider',
  min: 0,
  max: 100,
  step: 1,
  defaultValue: 100
};

Spacing

Spacing theme (in pixels)

ts
interface Spacing

Properties

NameTypeDefaultDescription
xsnumber
smnumber
mdnumber
lgnumber
xlnumber

StringPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

String property definition with string-specific validation

ts
interface StringPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'string'Editor type to use for this property
validation?{ required?: boolean; minLength?: number; maxLength?: number; pattern?: string; // Regex pattern }Validation rules for this property

Example

typescript
const prop: StringPropertyDefinition = {
  key: 'tableName',
  label: 'Table Name',
  editor: 'string',
  validation: {
    required: true,
    minLength: 3,
    maxLength: 50,
    pattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
  }
};

TextAreaPropertyDefinition

Also has every member of PropertyDefinition, listed on its own entry.

Textarea (multi-line text) property definition

ts
interface TextAreaPropertyDefinition extends PropertyDefinition

Properties

NameTypeDefaultDescription
editor'textarea'Editor type to use for this property
validation?{ required?: boolean; minLength?: number; maxLength?: number; }Validation rules for this property

Example

typescript
const prop: TextAreaPropertyDefinition = {
  key: 'description',
  label: 'Description',
  editor: 'textarea',
  validation: {
    maxLength: 500
  }
};

TextMetrics

Text measurement result.

ts
interface TextMetrics

Properties

NameTypeDefaultDescription
widthnumber
heightnumber
baselinenumber

Was this page helpful?

Types — interfaces b–t — Grafloria