Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Chart.js Node Ssr Example | 35 | 10 months ago | 9 | other | TypeScript | |||||
Chart.js server side rendering example. (pure JavaScript; no native modules) | ||||||||||
Phpchartjs | 19 | 4 years ago | 5 | January 11, 2020 | 6 | agpl-3.0 | PHP | |||
Multilevelpiechart.js | 17 | 2 | 8 years ago | January 07, 2015 | HTML | |||||
Extension chart for Chart.js for rendering nested or segmented pie charts. | ||||||||||
Headless Render | 10 | 6 years ago | JavaScript | |||||||
Captures the content of the canvas elements in a given url using Phantom.js and returns an array of buffer data. Can be used for rendering the output from front-end canvas drawing libraries (like p5.js, chart.js, etc.) on a node.js backend. | ||||||||||
Charting | 5 | 8 months ago | 4 | apache-2.0 | F# | |||||
Charts for web applications | ||||||||||
Charts Rendering | 5 | 2 years ago | 25 | October 21, 2021 | 1 | TypeScript | ||||
Server side charts rendering with Puppeteer. | ||||||||||
React Ssr | 1 | 3 years ago | JavaScript | |||||||
Server rendering with React and React Router 5 | ||||||||||
Cryptoviz | 1 | 6 years ago | JavaScript | |||||||
Capture the content of all the canvas elements in a given url and return an array of buffer data to be rendered into a file. Can be used for rendering the canvas drawings that created using front-end libraries (like chart.js, p5.js, etc.) on the backend.
Promise based. Uses Phantom.js and Casper.js for headless rendering and datauri for converting the given html to datauri format.
https
address. You could either point to a http
file or pass the library through clientScripts.const fs = require('fs');
const render = require('headless-render').render;
// assuming the content you want to render is being served to this url.
const url = 'http://127.0.0.1:8080/';
const sizeX = 500;
const sizeY = 500;
return render(url, sizeX, sizeY).then((data) => {
// the render function captures the content of all the canvas elements and returns an array,
// we are grabbing the first one.
return new Promise((resolve, reject) => {
fs.writeFile(`./image.png`, data[0], (err, response) => {
if (err) {
console.log(err);
reject(err);
} else {
resolve();
}
});
});
});
const fs = require('fs');
const datauri = require('headless-render').datauri;
const render = require('headless-render').render;
const Promise = require('bluebird');
const sizeX = 500;
const sizeY = 500;
const clientScripts = '';
const concurrency = 10;
const amount = 64;
// the given html file is converted into datauri and served as a url to Casper.js
// using the Bluebird promises library and renders the same url given amount of times.
// `concurrency` controls how many concurrent renders you would like to have.
// executing this script would render the p5.js code inside index.html 64 times by doing 10 renders at a time.
// the code inside index.html randomizes it's parameters every time it's called
datauri('./index.html').then((url) => {
Promise.map(createArrOfSize(amount), (item, index) => {
return render(url, sizeX, sizeY, clientScripts).then((data) => {
// the render function captures the content of all the canvas elements and returns an array,
// we are grabbing the first one.
return new Promise((resolve, reject) => {
fs.writeFile(`./image-${index}.png`, data[0], (err, response) => {
if (err) {
console.log(err);
reject(err);
} else {
resolve();
}
});
});
});
}, { concurrency: concurrency === undefined ? 0 : concurrency }).then(() => {
console.log('image rendering completed');
});
});
function createArrOfSize(size) {
const arr = [];
for (let i = 0; i<size; i++) {
arr.push(i);
}
return arr;
}
Image inspired by this sketch