Methods
anchor(x, y) → {Anchor}
Creates a new Anchor
Parameters:
Name | Type | Description |
---|---|---|
x |
number | |
y |
number |
Returns:
- Type
- Anchor
cast(value) → {Vector}
Parameters:
Name | Type | Description |
---|---|---|
value |
Vector | number |
Returns:
- Type
- Vector
columns()
- Source:
diameter(value) → {Size}
Parameters:
Name | Type | Description |
---|---|---|
value |
Vector | number |
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 |
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 |
Returns:
- Type
- Vector
Type Definitions
Action()
- Source:
Axis
Type:
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 |
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> |
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 |
ConnectionListener(piece, target)
Parameters:
Name | Type | Description |
---|---|---|
piece |
Piece | |
target |
Piece |
DragMode
Type:
- TryDisconnection | ForceDisconnection | ForceConnection
- Source:
Figure
Type:
- object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
shape |
Shape | ||
group |
Group | ||
label |
Label |
<optional> |
Figure
Type:
- Source:
Group
Type:
- Source:
ImageLike
Type:
- HTMLImageElement | HTMLCanvasElement | ImageMetadata
- 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
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
LabelMetadata
Type:
- object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
text |
string |
<optional> |
|
fontSize |
number |
<optional> |
|
x |
number |
<optional> |
|
y |
number |
<optional> |
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> |
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 |
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> |
Settings
Type:
- object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
pieceRadius |
Vector | number |
<optional> |
|
proximity |
number |
<optional> |
Size
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
radius |
Vector | |
diameter |
Vector |
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 |
TranslationListener(piece, dx, dy)
Parameters:
Name | Type | Description |
---|---|---|
piece |
Piece | |
dx |
number | |
dy |
number |
ValidationListener(puzzle)
Parameters:
Name | Type | Description |
---|---|---|
puzzle |
Puzzle |
- Source:
Validator
Type:
- Source:
Vector
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
x |
number | |
y |
number |
VectorAction(dx, dy)
Parameters:
Name | Type | Description |
---|---|---|
dx |
number | |
dy |
number |
- Source: