Get started with jointjs CDN
MPL 2.0 licensed
JointJS is a library for building interactive diagrams and graphs in the browser.
Tags:- diagram
- flowchart
- graph
- visualization
Stable version
Copied!
How to start using jointjs CDN
// Include the JointJS library
const script = document.createElement('script');
script.src = 'https://cdn.cdnhub.io/jointjs/3.7.7/joint.min.js';
document.head.appendChild(script);
// Wait for the library to load before initializing the graph
script.onload = () => {
// Create a new paper with a given size
const paper = new joint.dia.Paper({
el: document.createElement('div'),
width: 800,
height: 600,
gridSize: 10,
model: new joint.dia.Graph(),
});
// Append the paper to the body
document.body.appendChild(paper.el);
// Create some cells
const source = new joint.shapes.rect({
position: { x: 100, y: 100 },
size: { width: 50, height: 50 },
attrs: {
label: { text: 'Source' },
rect: { fill: 'green' },
},
});
const target = new joint.shapes.rect({
position: { x: 200, y: 100 },
size: { width: 50, height: 50 },
attrs: {
label: { text: 'Target' },
rect: { fill: 'red' },
},
});
// Add the cells to the graph and the paper
paper.model.add(source, target);
paper.add(source, target);
// Create a connection between the source and target
const link = new joint.dia.Link({
source: { id: source.id },
target: { id: target.id },
});
// Add the link to the graph and the paper
paper.model.add(link);
paper.add(link);
// Refresh the paper to render the new elements
paper.refresh();
};
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
0.6.1
0.6.3
0.6.4
0.7.0
0.8.0
0.8.1
0.9.0
0.9.1
0.9.10
0.9.2
0.9.3
0.9.4
0.9.5
0.9.6
0.9.7
0.9.7-rappid.6
0.9.7-rappid.7
0.9.8
0.9.9
1.0.0
1.0.1
1.0.2
1.0.3
1.1.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.2.0
2.2.1
3.0.0
3.0.1
3.0.2
3.0.3
3.0.4
3.1.0
3.1.1
3.2.0
3.3.0
3.3.1
3.4.0
3.4.1
3.4.2
3.4.3
3.4.4
3.5.0
3.5.1
3.5.2
3.5.3
3.5.4
3.5.5
3.6.0
3.6.1
3.6.2
3.6.3
3.6.4
3.6.5
3.7.0
3.7.1
3.7.2
3.7.3
3.7.4
3.7.5
3.7.6
*** 3.7.7