- Source:
- konva.js
Classes
- Animation
- Arc
- Arrow
- BaseLayer
- Canvas
- Circle
- Collection
- Container
- Context
- Ellipse
- FastLayer
- Group
- Image
- Label
- Layer
- Line
- Node
- Path
- Rect
- RegularPolygon
- Ring
- Shape
- Sprite
- Stage
- Star
- Tag
- Text
- TextPath
- Transform
- Transformer
- Tween
- Wedge
Namespaces
Members
-
<static> angleDeg
-
Use degree values for angle properties. You may set this property to false if you want to use radiant values.
- Default Value:
-
- true
- Source:
- konva.js
Properties:
Name Type Description angleDeg
Example
node.rotation(45); // 45 degrees Konva.angleDeg = false; node.rotation(Math.PI / 2); // PI/2 radian
-
<static> captureTouchEventsEnabled
-
Should we capture touch events and bind them to the touchstart target? That is how it works on DOM elements.
The case: we touchstart on div1, then touchmove out of that element into another element div2.
DOM will continue trigger touchmove events on div1 (not div2). Because events are "captured" into initial target.
By default Konva do not do that and will trigger touchmove on another element, while pointer is moving.- Default Value:
-
- false
- Source:
- konva.js
Properties:
Name Type Description captureTouchEventsEnabled
Example
Konva.captureTouchEventsEnabled = true;
-
<static> dragButtons
-
Configure what mouse buttons can be used for drag and drop.
Default value is [0] - only left mouse button.- Default Value:
-
- true
- Source:
- konva.js
Properties:
Name Type Description dragButtons
Example
// enable left and right mouse buttons Konva.dragButtons = [0, 2];
-
<static> dragDistance
-
Drag distance property. If you start to drag a node you may want to wait until pointer is moved to some distance from start point,
only then start dragging. Default is 3px.- Default Value:
-
- 0
- Source:
- konva.js
Properties:
Name Type Description dragDistance
Example
Konva.dragDistance = 10;
-
<static> hitOnDragEnabled
-
Should we enable hit detection while dragging? For performance reasons, by default it is false.
But on some rare cases you want to see hit graph and check intersections. Just set it to true.- Default Value:
-
- false
- Source:
- konva.js
Properties:
Name Type Description hitOnDragEnabled
Example
Konva.hitOnDragEnabled = true;
-
<static> pixelRatio
-
Global pixel ratio configuration. KonvaJS automatically detect pixel ratio of current device.
But you may override such property, if you want to use your value.- Default Value:
-
- undefined
- Source:
- konva.js
Properties:
Name Type Description pixelRatio
Example
Konva.pixelRatio = 1;
-
<static> showWarnings
-
Show different warnings about errors or wrong API usage
- Default Value:
-
- true
- Source:
- konva.js
Properties:
Name Type Description showWarnings
Example
Konva.showWarnings = false;
Methods
-
<static> isDragging()
-
returns whether or not drag and drop is currently active
- Source:
- konva.js
-
<static> isDragReady()
-
returns whether or not a drag and drop operation is ready, but may
not necessarily have started- Source:
- konva.js