Get started with scatterjs CDN
MIT licensed
Scatter.js is a lightweight library for creating interactive, data-driven scatter plots.
Tags:- scatter
- blockchain
Stable version
Copied!
How to start using scatterjs CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with scatterjs CDN - cdnhub.io</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100vh; }
</style>
</head>
<body>
<script src="https://cdn.cdnhub.io/scatterjs/scatterjs-core@2.7.18/scatterjs-core.min.js"></script>
<script>
async function main() {
const scatter = new p5(sketch => {
scatter.setup = function() {
this.createCanvas(window.innerWidth, window.innerHeight);
ScatterJS.setCanvas(this.canvas);
ScatterJS.setSize(this.width, this.height);
};
scatter.draw = function() {
this.background(255);
ScatterJS.update();
ScatterJS.draw();
};
}, 'canvas');
await ScatterJS.load();
const data = [
{ x: 1, y: 1, size: 10, color: 0x0000ff },
{ x: 2, y: 2, size: 5, color: 0x00ff00 },
{ x: 3, y: 3, size: 15, color: 0xff0000 },
];
const swarm = new ScatterJS.Swarm();
swarm.add(data);
swarm.start();
scatter.runWithNewSketch();
}
main();
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
@scatterjs
@scatterjs/core@2.7.54
@scatterjs/eosjs2@1.5.36
@scatterjs/eosjs@1.5.37
@scatterjs/fio@1.5.37
@scatterjs/lynx@1.6.47
@scatterjs/tron@1.3.36
@scatterjs/web3@1.5.40
scatterjs-core@2.7.10
scatterjs-core@2.7.11
scatterjs-core@2.7.12
scatterjs-core@2.7.13
scatterjs-core@2.7.14
scatterjs-core@2.7.15
scatterjs-core@2.7.16
scatterjs-core@2.7.17
*** scatterjs-core@2.7.18
scatterjs-core@2.7.2
scatterjs-core@2.7.3
scatterjs-core@2.7.4
scatterjs-core@2.7.5
scatterjs-core@2.7.6
scatterjs-core@2.7.7
scatterjs-core@2.7.8
scatterjs-core@2.7.9
scatterjs-plugin-eosjs@1.5.1
scatterjs-plugin-lynx@1.5.1
scatterjs-plugin-lynx@1.5.2
scatterjs-plugin-lynx@1.5.3
scatterjs-plugin-lynx@1.6.0
scatterjs-plugin-lynx@1.6.1
scatterjs-plugin-lynx@1.6.2
scatterjs-plugin-lynx@1.6.3
scatterjs-plugin-lynx@1.6.4
scatterjs-plugin-lynx@1.6.5
scatterjs-plugin-lynx@1.6.6
scatterjs-plugin-web3@1.2.0
scatterjs-plugin-web3@1.3.0
scatterjs-plugin-web3@1.3.1
scatterjs-plugin-web3@1.3.2
scatterjs-plugin-web3@1.4.0
scatterjs-plugin-web3@1.5.0
scatterjs-plugin-web3@1.5.1
scatterjs-plugin-web3@1.5.4