Skip to content

@fabwcie/free-drawing / constants

constants ​

Variables ​

arrowheadChoices ​

const arrowheadChoices: IconChoice<Arrowhead>[]

Defined in: packages/free-drawing/src/constants.ts:484

Heads of the ends of arrows: buttons of options panels (icons of end heads, mirrored for start heads)


arrowTypeChoices ​

const arrowTypeChoices: IconChoice<ArrowType>[]

Defined in: packages/free-drawing/src/constants.ts:477

Paths of arrows: buttons of options panels


clickTolerance ​

const clickTolerance: 3 = 3

Defined in: packages/free-drawing/src/constants.ts:143

Pointer move on screen (px, whatever the zoom) under which a press is a click: selection, nothing drawn by shape tools


crosshairCursor ​

const crosshairCursor: "url(\"data:image/svg+xml,<svg height='32' width='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'><defs><filter id='shadow' y='-40%' x='-40%' width='180px' height='180%' color-interpolation-filters='sRGB'><feDropShadow dx='1' dy='1' stdDeviation='1.2' flood-opacity='.5'/></filter></defs><g fill='none' transform='rotate(0 16 16)' filter='url(%23shadow)'><path d='m25 16h-6.01v-6h-2.98v6h-6.01v3h6.01v6h2.98v-6h6.01z' fill='white'/><path d='m23.9902 17.0103h-6v-6.01h-.98v6.01h-6v.98h6v6.01h.98v-6.01h6z' fill='%23231f1f'/></g></svg>\") 16 16, crosshair"

Defined in: packages/free-drawing/src/constants.ts:148

Crosshair cursor of drawing tools (brush, line, eraser)


dataAttributes ​

const dataAttributes: object

Defined in: packages/free-drawing/src/constants.ts:421

Attributes of option buttons of overlays holding the value they set: button of current value found by it

Type Declaration

arrowhead

arrowhead: string = 'data-arrowhead'

Head of an end of arrows: none, arrow, triangle, dot or bar

arrowType

arrowType: string = 'data-arrow-type'

Path of arrows: straight, curved or elbow

edges

edges: string = 'data-edges'

Corners of rectangles: sharp or round

fillColor

fillColor: string = 'data-fill-color'

Background color

fontSize

fontSize: string = 'data-font-size'

Font size of texts (px)

fontStyle

fontStyle: string = 'data-font-style'

Font style of texts: bold or italic

order

order: string = 'data-order'

Stacking order move of selected shapes (ShapeOrder)

strokeColor

strokeColor: string = 'data-stroke-color'

Stroke color

strokeStyle

strokeStyle: string = 'data-stroke-style'

Stroke style: solid, dashed or dotted

strokeWidth

strokeWidth: string = 'data-stroke-width'

Stroke width (px)

textAlign

textAlign: string = 'data-text-align'

Alignment of texts: left, center or right

textDecoration

textDecoration: string = 'data-text-decoration'

Decoration of texts: underline or line-through


defaultOptions ​

const defaultOptions: DrawerOptions

Defined in: packages/free-drawing/src/constants.ts:74

Default options of a drawer, merged with options given to new Drawer($el, options) (see DrawerOptions)


deprecatedEvents ​

const deprecatedEvents: Record<string, string>

Defined in: packages/free-drawing/src/constants.ts:407

Event names of previous versions (deprecated), listened and triggered as current ones


drawerEvents ​

const drawerEvents: object

Defined in: packages/free-drawing/src/constants.ts:371

Events of drawer (drawer.on(event, callback)) and of its components, named <subject>.<action> (change for the drawing)

Type Declaration

change

readonly change: "change" = 'change'

Drawing changed (shapes, background...), with drawer

collaborationChange

readonly collaborationChange: "collaboration.change" = 'collaboration.change'

Collaboration started or stopped, users or rights changed

dropdownHide

readonly dropdownHide: "dropdown.hide" = 'dropdown.hide'

Dropdown menu hidden (event of dropdown)

languageChange

readonly languageChange: "language.change" = 'language.change'

Language of interface changed, with language

libraryChange

readonly libraryChange: "library.change" = 'library.change'

Items of the library added, removed, renamed or imported (see drawer.library), with the items

optionsChange

readonly optionsChange: "options.change" = 'options.change'

Drawing options changed (setters, overlays...), with changed options

pluginChange

readonly pluginChange: "plugin.change" = 'plugin.change'

Plugin disabled or enabled again (forceDisabled), with the plugin

preferencesChange

readonly preferencesChange: "preferences.change" = 'preferences.change'

Interface settings changed (theme, language, grid, snapping), with preferences: once for several ones

readOnlyChange

readonly readOnlyChange: "readonly.change" = 'readonly.change'

Read only mode changed, with read only state

replayChange

readonly replayChange: "replay.change" = 'replay.change'

Replay of the drawing started, stopped or showing another shape (see drawer.replay), with the index of the shape

selectionChange

readonly selectionChange: "selection.change" = 'selection.change'

Selected shapes changed, with selected shapes

slideshowChange

readonly slideshowChange: "slideshow.change" = 'slideshow.change'

Slideshow started, stopped or showing another slide (see drawer.slideshow), with the index of the slide shown

themeChange

readonly themeChange: "theme.change" = 'theme.change'

Light or dark theme shown, with dark state

toastHide

readonly toastHide: "toast.hide" = 'toast.hide'

Toast hidden (event of toast)

unsavedChange

readonly unsavedChange: "unsaved.change" = 'unsaved.change'

Drawing has changes not saved yet (without auto save) or is saved, with unsaved state


edgesShapes ​

const edgesShapes: string[]

Defined in: packages/free-drawing/src/constants.ts:320

Shapes with corners, sharp or round (see edges option)


extraTools ​

const extraTools: Record<string, string>

Defined in: packages/free-drawing/src/constants.ts:60

Tools of previous versions in plugins of @fabwcie/free-drawing-extra-tools, by name: told when asked without them


fillShapes ​

const fillShapes: string[]

Defined in: packages/free-drawing/src/constants.ts:315

Shapes with a background color (fill), other shapes fill is their color (brush line, text) or none


grabbingCursor ​

const grabbingCursor: "url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='-1 -1 18 18'><defs><filter id='s' x='-30%' y='-30%' width='160%' height='160%'><feDropShadow dx='.4' dy='.6' stdDeviation='.5' flood-opacity='.45'/></filter></defs><g filter='url(%23s)' fill='white' stroke='black' stroke-width='1' stroke-linejoin='round'><rect x='4.5' y='5' width='2.3' height='4' rx='1.15'/><rect x='6.8' y='5' width='2.3' height='4' rx='1.15'/><rect x='9.1' y='5' width='2.3' height='4' rx='1.15'/><rect x='11.4' y='5' width='2.3' height='4' rx='1.15'/><path d='M4.5 7.5H13.7V10.2c0 2.6-1.7 4.3-4.3 4.3H8.6c-2 0-3.1-.9-4-2.3L3 9.7c-.4-.7-.2-1.5.5-1.8c.6-.3 1.2-.1 1.6.4l.6.8V7.5z'/></g></svg>\") 12 12, grabbing"

Defined in: packages/free-drawing/src/constants.ts:158

Closed hand cursor of pan tool, while the view is dragged


grabCursor ​

const grabCursor: "url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='-1 -1 18 18'><defs><filter id='s' x='-30%' y='-30%' width='160%' height='160%'><feDropShadow dx='.4' dy='.6' stdDeviation='.5' flood-opacity='.45'/></filter></defs><g filter='url(%23s)'><path fill='white' d='M13.5 2.4c-.4-.4-1-.5-1.5-.3c0-.3-.1-.6-.4-.9c-.2-.2-.6-.4-1.1-.4c-.3 0-.5.1-.7.1c0-.2-.1-.3-.2-.5c-.5-.6-1.5-.6-2 0c-.2.2-.4.4-.4.6C7 1 6.8.9 6.6.9c-.5 0-.8.2-1.1.5C5 1.9 5 2.7 5 2.7v3.8c-.3-.3-.8-.8-1.5-.8c-.2 0-.5.1-.7.2c-.4.2-.6.5-.7.9c-.3 1 .6 2.4.6 2.5c.1.1 1.2 2.7 2.2 3.8C5.9 14.3 7 15 9.8 15c2.9 0 4.2-1.6 4.2-5.1V4.4c0-.1.1-1.3-.5-2'/><path fill='black' d='M13.5 2.4c-.4-.4-1-.5-1.5-.3c0-.3-.1-.6-.4-.9c-.2-.2-.6-.4-1.1-.4c-.3 0-.5.1-.7.1c0-.2-.1-.3-.2-.5c-.5-.6-1.5-.6-2 0c-.2.2-.4.4-.4.6C7 1 6.8.9 6.6.9c-.5 0-.8.2-1.1.5C5 1.9 5 2.7 5 2.7v3.8c-.3-.3-.8-.8-1.5-.8c-.2 0-.5.1-.7.2c-.4.2-.6.5-.7.9c-.3 1 .6 2.4.6 2.5c.1.1 1.2 2.7 2.2 3.8C5.9 14.3 7 15 9.8 15c2.9 0 4.2-1.6 4.2-5.1V4.4c0-.1.1-1.3-.5-2M8 2c0-.3-.1-1 .5-1c.5 0 .5.5.5 1v4c0 .3.2.5.5.5s.5-.2.5-.5V2.2s0-.4.5-.4c.6 0 .5.9.5.9V6c0 .3.2.5.5.5s.5-.2.5-.5V3.6c0-.1 0-.6.5-.6s.5 1 .5 1v5.9c0 3.4-1.3 4.1-3.2 4.1c-2.4 0-3.3-.5-4.1-1.6c-.9-1-2.1-3.6-2.1-3.7c-.3-.3-.7-1.2-.6-1.6c0-.1.1-.2.2-.3c.1 0 .2-.1.2-.1c.4 0 .8.5.9.7l.6.9c.1.2.4.3.6.2c.4 0 .5-.2.5-.4V2.9c0-.4 0-1 .5-1c.4 0 .5.3.5.8V6c0 .3.2.5.5.5S8 6.3 8 6z'/></g></svg>\") 12 12, grab"

Defined in: packages/free-drawing/src/constants.ts:153

Hand cursors of pan tool, white with black outline (system ones are hardly visible on white canvas)


gridSize ​

const gridSize: 40 = 40

Defined in: packages/free-drawing/src/constants.ts:163

Grid cell size, used for drawing and snapping


gridStyles ​

const gridStyles: Choice<GridStyle>[]

Defined in: packages/free-drawing/src/constants.ts:172

Styles of the grid (preferences dialog, command palette)


historyLimit ​

const historyLimit: 100 = 100

Defined in: packages/free-drawing/src/constants.ts:182

Max undo / redo states kept


pathShapeData ​

const pathShapeData: Record<string, string>

Defined in: packages/free-drawing/src/constants.ts:273

Paths of path shapes in a box of width and height 1 (see scalePath), by shape name: tools of the toolbar, shapes of other apps opened


pathShapes ​

const pathShapes: string[]

Defined in: packages/free-drawing/src/constants.ts:256

Closed shapes drawn by path (see PathShapeWidget)


recognitionMinSize ​

const recognitionMinSize: 32 = 32

Defined in: packages/free-drawing/src/constants.ts:326

Diagonal of a brush stroke recognized as a shape, at least, on screen in px (smaller ones, as letters, are kept)


recognizedTools ​

const recognizedTools: Record<RecognizedKind, WidgetName>

Defined in: packages/free-drawing/src/constants.ts:329

Tools drawing the shapes recognized in brush strokes


shapeAlignments ​

const shapeAlignments: IconChoice<ShapeAlignment>[]

Defined in: packages/free-drawing/src/constants.ts:461

Alignments of the selection on a side or the center of its box: buttons of options panels, commands of the palette


shapeDistributions ​

const shapeDistributions: IconChoice<Direction>[]

Defined in: packages/free-drawing/src/constants.ts:471

Same space between selected shapes along an axis (3 at least): buttons of options panels, commands of the palette


shapeLabels ​

const shapeLabels: Record<string, TranslationKey>

Defined in: packages/free-drawing/src/constants.ts:341

Type names of drawing shapes (layers panel), keys of their translation


shapeName ​

const shapeName: object

Defined in: packages/free-drawing/src/constants.ts:197

Konva names of drawer nodes: type of drawing shapes (shape.hasName(shapeName.text)) and nodes of the interface

Type Declaration

arrow

arrow: string = 'drawer-arrow'

Arrow, its ends can be linked to shapes

background

background: string = 'drawer-background'

Background rectangle (background layer)

blockArrow

blockArrow: string = 'drawer-block-arrow'

Block arrow path (pointing right)

bubble

bubble: string = 'drawer-bubble'

Speech bubble path

checkbox

checkbox: string = 'drawer-checkbox'

Check box path (square and check mark)

cloud

cloud: string = 'drawer-cloud'

Cloud path

diamond

diamond: string = 'drawer-diamond'

Diamond path

ellipse

ellipse: string = 'drawer-ellipse'

Ellipse (circle tool)

frame

frame: string = 'drawer-frame'

Frame holding shapes (see Frame)

gridLine

gridLine: string = 'drawer-grid-line'

Shape drawing the grid (grid layer)

group

group: string = 'drawer-group'

Group of shapes

guideLine

guideLine: string = 'drawer-guide-line'

Snapping guide (selection layer)

heart

heart: string = 'drawer-heart'

Heart path

hexagon

hexagon: string = 'drawer-hexagon'

Hexagon path

highlighter

highlighter: string = 'drawer-highlighter'

Freehand stroke of highlighter

image

image: string = 'drawer-image'

Image, its file in the files of the drawing (fileId attribute, see drawer.files)

line

line: string = 'drawer-line'

Freehand stroke of brush

note

note: string = 'drawer-note'

Sticky note: a rectangle (also named rect) of a light color holding a text, with a shadow (see utils/note)

pathShape

pathShape: string = 'drawer-path-shape'

Path shape of a plugin (PathShapeWidget naming its shapes with a name of its own, next to this one): behavior of the path shapes of the library (background, stroke style, text, arrows on its outline, hit inside)

rect

rect: string = 'drawer-rect'

Rectangle (square tool)

selection

selection: string = 'drawer-selection'

Selection rectangle of selection tool (selection layer)

star

star: string = 'drawer-star'

Star of 5 points path

straightLine

straightLine: string = 'drawer-straight-line'

Straight line of line tool

text

text: string = 'drawer-text'

Text

triangle

triangle: string = 'drawer-triangle'

Triangle path


shapeOrders ​

const shapeOrders: ShortcutChoice<ShapeOrder>[]

Defined in: packages/free-drawing/src/constants.ts:451

Stacking orders of the selection, from bottom to top: buttons of options panels, commands of the palette


shapeStacks ​

const shapeStacks: IconChoice<Direction>[]

Defined in: packages/free-drawing/src/constants.ts:493

Selected shapes one after the other along an axis: buttons of options panels, commands of the palette


strokeStyleShapes ​

const strokeStyleShapes: string[]

Defined in: packages/free-drawing/src/constants.ts:304

Shapes drawn with an outline, which can be dashed (brush line is a filled outline)


viewMargin ​

const viewMargin: 64 = 64

Defined in: packages/free-drawing/src/constants.ts:323

Space kept around an area the view moves to (text found, shape reached with the keyboard), on screen in px


wheelActions ​

const wheelActions: Choice<WheelAction>[]

Defined in: packages/free-drawing/src/constants.ts:166

Actions of the mouse wheel (preferences dialog, command palette)


widgetNames ​

const widgetNames: WidgetName[]

Defined in: packages/free-drawing/src/constants.ts:41

Widgets of toolbar, default order


zoomLimits ​

const zoomLimits: object

Defined in: packages/free-drawing/src/constants.ts:187

Zoom levels allowed (scale of stage, 1 is 100%)

Type Declaration

max

max: number = 30

Largest zoom level (3000%)

min

min: number = 0.1

Smallest zoom level (10%)