1.3.0 • Published 4 years ago

joto-svg v1.3.0

Weekly downloads
18
License
GPL-3.0
Repository
github
Last release
4 years ago

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.

1.2.0

4 years ago

1.1.0

4 years ago

1.3.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago