Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
JavaScript canvas libraries draw and update two-dimensional graphics in the browser through the HTML canvas element or SVG. Many of them keep each shape as an object that code can move, transform, or listen to for events. These libraries draw the diagrams, whiteboards, design editors, and games that run in web apps.
Popularity
Rough.js has the most monthly downloads in this comparison, at 97.6M.
export function applyNodeProps(instance, props, oldProps = EMPTY_PROPS) {
// don't use zIndex in react-konva if (!zIndexWarningShowed && 'zIndex' in props) {
console.warn(Z_INDEX_WARNING);
zIndexWarningShowed = true;
}
// check correct draggable usage if (!dragWarningShowed && props.draggable) {
var hasPosition = props.x !== undefined || props.y !== undefined;
var hasEvents = props.onDragEnd || props.onDragMove;
if (hasPosition && !hasEvents) {
console.warn(DRAGGABLE_WARNING);
dragWarningShowed = true;
}
}
var updatedProps = {};
var hasUpdates = false;
// check old props // we need to unset properties that are not in new props // and remove all events for (var key in oldProps) {
if (propsToSkip[key]) {
continue;
}
var isEvent = key.slice(0, 2) === 'on';
var propChanged = oldProps[key] !== props[key];
// if that is a changed event, we need to remove it if (isEvent && propChanged) {
var eventName = key.substr(2).toLowerCase();
if (eventName.substr(0, 7) === 'content') {
eventName =
'content' +
eventName.substr(7, 1).toUpperCase() +
eventName.substr(8);
}
// Remove by namespace because react-konva binds at most one listener // for each event in that namespace. instance.off(eventName + EVENTS_NAMESPACE);
}
var toRemove = !props.hasOwnProperty(key);
if (!isEvent && toRemove) {
updatedProps[key] = undefined;
hasUpdates = true;
}
}
var strictUpdate = useStrictMode || props._useStrictMode;
const newEvents = {};
for (var key in props) {
if (propsToSkip[key]) {
continue;
}
var isEvent = key.slice(0, 2) === 'on';
var toAdd = oldProps[key] !== props[key];
if (isEvent && toAdd) {
var eventName = key.substr(2).toLowerCase();
if (eventName.substr(0, 7) === 'content') {
eventName =
'content' +
eventName.substr(7, 1).toUpperCase() +
eventName.substr(8);
}
// check that event is not undefined if (props[key]) {
newEvents[eventName] = props[key];
}
}
if (
!isEvent &&
(props[key] !== oldProps[key] ||
(strictUpdate && props[key] !== instance.getAttr(key)))
) {
hasUpdates = true;
updatedProps[key] = props[key];
}
}
if (hasUpdates) {
instance.setAttrs(updatedProps);
updatePicture(instance);
}
// subscribe to events AFTER we set attrs // we need it to fix https://github.com/konvajs/react-konva/issues/471 // settings attrs may add events. Like "draggable: true" will add "mousedown" listener for (var eventName in newEvents) {
// first clear any existing listeners, it is required for strict mode instance.off(eventName + EVENTS_NAMESPACE);
// then attach new one instance.on(eventName + EVENTS_NAMESPACE, newEvents[eventName]);
}
}
PixiJS
Builds rendered scenes from sprites, graphics, text, and assets, with SVG texture or geometry loading.
Downloads / mo
7.1M
Stars
48.8K
Last release
8.23.0
License
MIT
Strengths
Loads SVG textures or geometry.Choose sprite textures or editable Graphics geometry for SVG artwork.
Exports rendered content as PNG.Download a scene or object as a PNG image.
Limitations
Changing text rebuilds its texture.Use BitmapText for text that changes every frame.
SVG textures lose vector scalability.Use Graphics geometry when SVG artwork must scale cleanly.
public toWorld<P extends PointData = Point>(x: number | PointData, y?: number): P
{
if (arguments.length === 2)
{
return this.toLocal<P>(new Point(x as number, y));
}
return this.toLocal<P>(x as PointData);
}
Fabric.js
Adds interactive objects, transform controls, editable text, and scene serialization to a canvas.
Downloads / mo
5.2M
Stars
31.6K
Last release
7.4.0
License
MIT
Strengths
Provides ready-made object controls.Move, scale, rotate, skew, and group objects with built-in interactions.
Edits text directly on canvas.IText enters an editing state for interactive text input.
Limitations
Custom fields need export registration.Register application-specific properties before including them in serialized objects.
function draw() {
background(0);
if (i < values.length) {
for (let j = 0; j < values.length - i - 1; j++) {
let a = values[j];
let b = values[j + 1];
if (a > b) {
swap(values, j, j + 1);
}
}
} else {
console.log('finished');
noLoop();
}
i++;
for (let i = 0; i < values.length; i++) {
stroke(255);
line(i, height, i, height - values[i]);
}
}
FAQ
Konva and Fabric.js keep each shape as an object with its own events and transforms, the model behind editors and whiteboards. PixiJS renders sprite and graphics scenes, and Paper.js works with editable vector paths.
Rough.js draws lines, curves, arcs, polygons, circles, and ellipses in a hand-drawn, sketchy style on canvas or SVG. It has the most monthly downloads of these libraries, at 97.6M.
Fabric.js ships built-in controls to move, scale, rotate, and skew objects, and its IText edits text directly on the canvas. Konva gives each shape its own events and drag behavior, and text editing goes through a DOM input.
Konva does not support direct Konva.Text editing and recommends native DOM inputs.Fabric IText has a native editing state.
Images and event handlers must be manually restored after loading.
For coding agents
Found your canvas library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.