Information about the app/website js-draw is running within. This is shown at the beginning of the about dialog.
Optional
description?: string(Optional) A brief description of the app
Optional
version?: string(Optional) The app version
Provides a set of icons for the editor.
See, for example, the @js-draw/material-icons
package.
Configures the default InsertImageWidget control.
Optional
Beta
showA custom callback to show an image picker. If given, this should return
a list of File
s representing the images selected by the picker.
If not given, the default file picker shown by a file input is shown.
-- API may change between minor releases.
Overrides for keyboard shortcuts. For example,
{
'some.shortcut.id': [ KeyBinding.keyboardShortcutFromString('ctrl+a') ],
'another.shortcut.id': [ ]
}
where shortcut IDs map to lists of associated keybindings.
Uses a default English localization if a translation is not given.
Maximum zoom fraction (e.g. 2 → 200% zoom). Defaults to .
Minimum zoom fraction (e.g. 0.5 → 50% zoom). Defaults to .
Additional messages to show in the "about" dialog.
Configures the default PenTool tools.
Example:
import { Editor, makePolylineBuilder } from 'js-draw'; const editor = new Editor(document.body, { pens: { additionalPenTypes: [{ name: 'Polyline (For debugging)', id: 'custom-polyline', factory: makePolylineBuilder, // The pen doesn't create fixed shapes (e.g. squares, rectangles, etc) // and so should go under the "pens" section. isShapeBuilder: false, }], }, }); editor.addToolbar();
Optional
additionalAdditional pen types that can be selected in a toolbar.
Optional
filterShould return true
if a pen type should be shown in the toolbar.
Defaults to RenderingMode.CanvasRenderer
Configures the default TextTool control and text tool.
Optional
fonts?: string[]Fonts to show in the text UI.
true
if touchpad/mousewheel scrolling should scroll the editor instead of the document.
This does not include pinch-zoom events.
Defaults to true.
Provides settings to an instance of an editor. See the Editor Editor.constructor.
Example