Global

Methods

anchor(x, y) → {Anchor}

Creates a new Anchor
Parameters:
Name Type Description
x number
y number
Source:
Returns:
Type
Anchor

cast(value) → {Vector}

Parameters:
Name Type Description
value Vector | number
Source:
Returns:
Type
Vector

columns()

Source:

diameter(value) → {Size}

Parameters:
Name Type Description
value Vector | number
Source:
Returns:
Type
Size

grid()

Source:

line()

Source:

noise(maxDistance) → {Shuffler}

Parameters:
Name Type Description
maxDistance Vector
Source:
Returns:
Type
Shuffler

noop()

Source:

padder(padding, width, height) → {Shuffler}

Parameters:
Name Type Description
padding number
width number
height number
Source:
Returns:
Type
Shuffler

radius(value) → {Size}

Parameters:
Name Type Description
value Vector | number
Source:
Returns:
Type
Size

random(maxX, maxY) → {Shuffler}

Parameters:
Name Type Description
maxX number
maxY number
Source:
Returns:
Type
Shuffler

vector(x, y) → {Vector}

Parameters:
Name Type Description
x number
y number
Source:
Returns:
Type
Vector

Type Definitions

Action()

Source:

Axis

Type:
Source:

CanvasConnectionListener(piece, figure, targetPiece, targetFigure)

Parameters:
Name Type Description
piece Piece the connecting piece
figure Figure the visual representation of the connecting piece
targetPiece Piece the target connected piece
targetFigure Figure the visual representation of the target connected
Source:

CanvasMetadata

Type:
  • object
Properties:
Name Type Attributes Description
id string <optional>
targetPosition Vector <optional>
currentPosition Vector <optional>
color string <optional>
fixed boolean <optional>
strokeColor string <optional>
image ImageLike <optional>
label LabelMetadata <optional>
Source:

CanvasTranslationListener(piece, figure, dx, dy)

Parameters:
Name Type Description
piece Piece the translated piece
figure Figure the visual representation of the translated piece
dx number the horizontal displacement
dy number the vertical displacement
Source:

ConnectionListener(piece, target)

Parameters:
Name Type Description
piece Piece
target Piece
Source:

DragMode

Type:
  • TryDisconnection | ForceDisconnection | ForceConnection
Source:

Figure

Type:
  • object
Properties:
Name Type Attributes Description
shape Shape
group Group
label Label <optional>
Source:

Figure

Type:
Source:

Group

Type:
Source:

ImageLike

Type:
Source:

ImageMetadata

Type:
  • object
Properties:
Name Type Attributes Description
content HTMLImageElement | HTMLCanvasElement
offset Vector <optional>
scale number <optional>
Source:

Insert

A connection element of a piece
Type:
  • Tab | Slot | None
Source:

InsertsGenerator(index) → {Insert}

A function for generating Inserts sequentially
Parameters:
Name Type Description
index number the position of the element to be generated in the sequence
Source:
Returns:
Type
Insert

Label

Type:
  • object
Source:

LabelMetadata

Type:
  • object
Properties:
Name Type Attributes Description
text string <optional>
fontSize number <optional>
x number <optional>
y number <optional>
Source:

Mapper(value) → {B}

Parameters:
Name Type Description
value A
Source:
Returns:
Type
B

Orthogonal

Type:
  • Object
Properties:
Name Type Description
up A
down A
left A
right A
Source:

Outline

Type:
  • Squared | Rounded
Source:

PieceCondition(puzzle) → {boolean}

Parameters:
Name Type Description
puzzle Piece
Source:
Returns:
Type
boolean

PieceConfig

Type:
  • Object
Properties:
Name Type Attributes Description
centralAnchor Vector <optional>
size Size <optional>
metadata any <optional>
Source:

PieceDump

A piece primitive representation that can be easily stringified, exchanged and persisted
Type:
  • object
Properties:
Name Type Attributes Description
centralAnchor Vector
size Size <optional>
metadata any
connections Orthogonal.<object> <optional>
structure string
Source:

PuzzleCondition(puzzle) → {boolean}

Parameters:
Name Type Description
puzzle Puzzle
Source:
Returns:
Type
boolean

PuzzleDump

A puzzle primitive representation that can be easily stringified, exchanged and persisted
Type:
  • object
Properties:
Name Type Description
pieceRadius Vector
proximity number
pieces Array.<PieceDump>
Source:

Settings

Type:
  • object
Properties:
Name Type Attributes Description
pieceRadius Vector | number <optional>
proximity number <optional>
Source:

Size

Type:
  • Object
Properties:
Name Type Description
radius Vector
diameter Vector
Source:

SpatialMetadata

Type:
  • object
Properties:
Name Type Attributes Description
targetPosition Vector <optional>
currentPosition Vector <optional>
Source:

Structure

Type:
  • object
Properties:
Name Type Attributes Description
up Insert <optional>
left Insert <optional>
down Insert <optional>
right Insert <optional>
Source:

Template

Type:
  • object
Properties:
Name Type Attributes Description
structure StructureLike
size Size <optional>
metadata CanvasMetadata
Source:

TranslationListener(piece, dx, dy)

Parameters:
Name Type Description
piece Piece
dx number
dy number
Source:

ValidationListener(puzzle)

Parameters:
Name Type Description
puzzle Puzzle
Source:

Validator

Type:
Source:

Vector

Type:
  • object
Properties:
Name Type Description
x number
y number
Source:

VectorAction(dx, dy)

Parameters:
Name Type Description
dx number
dy number
Source: