joto-svg

1.3.0 • Public • Published

joto-svg: generate SVGs for joto.rocks

Generate SVGs contains text, icons, charts for https://joto.rocks.

Installation

This module is meant to be used server-side, using NodeJS.

npm i joto-svg

Usage

The canvas size is 500×500.

const fs = require('fs');
const JotoSVG = require('joto-svg');
 
const joto = new JotoSVG();
 
const cityName = 'Paris, France';
joto.addString({
  x: 250 - cityName.length * 6,
  y: 40,
  size: 30,
  str: cityName,
  align: 'center',
});
 
const svg = joto.getSVG();
fs.writeFileSync('./joto.svg', svg, { encoding: 'utf8' });

Check test.js for a more complete example. You can especially use icons from Font Awesome. Check index.js to get details about usage.

You can use joto.html to see how your svg would render on the board.

Examples

Check examples/ folder.

Acknowledgment

Code in ./joto-text comes from Joto's webapp; I made some small changes so it works in a node environment, but all credits go to Joto.

Readme

Keywords

Package Sidebar

Install

npm i joto-svg

Weekly Downloads

22

Version

1.3.0

License

GPL-3.0

Unpacked Size

536 kB

Total Files

13

Last publish

Collaborators

  • ntag