Skip to content
EliteChart

FloatingToolbar

Documentation


Documentation / @elitechart/core / FloatingToolbar

Defined in: ui/floating-toolbar.ts:93

Per-drawing floating toolbar. Renders above the selected drawing with color / line-style / lock / delete actions. Auto-flips below the drawing when it would clip at the top.

Example

code
const tb = new FloatingToolbar({ mount: chartContainer });
tb.showFor(binding, { x: 120, y: 80, width: 240, height: 60 });
// later:
tb.hide();
tb.destroy();

Constructors

Constructor

code
new FloatingToolbar(config): FloatingToolbar;

Defined in: ui/floating-toolbar.ts:110

Parameters

config

FloatingToolbarConfig

Returns

FloatingToolbar

Accessors

bbox

Get Signature

code
get bbox(): ToolbarBBox | null;

Defined in: ui/floating-toolbar.ts:232

Testing hook — access current bbox.

Returns

ToolbarBBox | null


element

Get Signature

code
get element(): HTMLElement;

Defined in: ui/floating-toolbar.ts:227

Testing hook — read the element for assertions.

Returns

HTMLElement


visible

Get Signature

code
get visible(): boolean;

Defined in: ui/floating-toolbar.ts:213

Whether the toolbar is currently showing.

Returns

boolean

Methods

destroy()

code
destroy(): void;

Defined in: ui/floating-toolbar.ts:218

Remove the toolbar DOM and break all listeners.

Returns

void


hide()

code
hide(): void;

Defined in: ui/floating-toolbar.ts:206

Hide the toolbar and clear the binding.

Returns

void


position()

code
position(bbox): void;

Defined in: ui/floating-toolbar.ts:190

Reposition without changing the binding (for drag/viewport updates).

Parameters

bbox

ToolbarBBox

Returns

void


showFor()

code
showFor(binding, bbox): void;

Defined in: ui/floating-toolbar.ts:181

Show the toolbar above bbox, using binding for actions.

Parameters

binding

FloatingToolbarBinding

bbox

ToolbarBBox

Returns

void