Interface DrawingControllerOptions

interface DrawingControllerOptions {
    clipboard?: null | ClipboardPort;
    clipboardFallbackToMemory?: boolean;
    defaultStyle?: DrawingStyle;
    gestures?: DrawingGestureOptions;
    historyLimit?: number;
    inputAnchors?: boolean;
    magnet?: boolean | MagnetMode;
    pasteOffsetBars?: number;
    pasteOffsetPixels?: number;
    stayInDrawingMode?: boolean;
}

Properties

clipboard?: null | ClipboardPort

Where copy and paste move text. Defaults to navigator.clipboard; pass a port to route through a host's own transfer, or null to stay in the process-local clipboard entirely.

clipboardFallbackToMemory?: boolean

Whether a refused or failing clipboard write still lands in the in-process clipboard. Defaults to true, which is what makes copy and paste work between two charts on a page where the browser has denied clipboard permission.

Pass false for a host that would rather a failed copy be a failed copy: with it off, cut leaves the drawing alone when the write does not land, so a shape is never destroyed for a transfer that did not happen.

defaultStyle?: DrawingStyle

Style merged under every tool's own defaults.

The pointer gestures a held modifier key starts, each on unless set to false here, for a host whose own chart gestures already use that key. setOptions merges it flag by flag.

historyLimit?: number

Undo depth. Default 50.

inputAnchors?: boolean

Draw the anchor of every study input that declares one (a price input with a timeKey and anchor: true): a handle at the point the pair names that drags both as one settings change and one step of this undo history. Default true; false draws none, and the inputs are still edited in settings and picked with Chart.beginPick('point'). Read when the controller is built: setOptions does not change it.

magnet?: boolean | MagnetMode

Snap new anchors to the O/H/L/C of the bar under the cursor. 'strong' always takes the nearest of the four; 'weak' only when one sits within a few pixels of the pointer, so a click on open space stays where it was made. true means 'strong' and false means 'off', which is what the boolean meant before the modes existed. Default 'off'. While a tool is armed the layer paints a ring where the next click will land.

pasteOffsetBars?: number

How far a pasted or duplicated copy lands from its original, in bars along time and in screen pixels down the price axis. A copy that lands exactly on top of the original reads as nothing having happened. Defaults: 2 bars, 16 px.

pasteOffsetPixels?: number
stayInDrawingMode?: boolean

Stay in the active tool after finishing a drawing. Default false.