Tools of Geometry and SVG.
https://miyanokomiya.github.io/okageo/
yarn add okageo
import * as okageo from 'okageo'
// parse SVG to polygons
const pathInfoList = okageo.parseSvgGraphicsStr(svgString)
// move and resize
const canvas = document.getElementById('canvas')
const inRectList = okageo.fitRect(pathInfoList, 0, 0, canvas.width, canvas.height)
// draw
const ctx = canvas.getContext('2d')
inRectList.forEach((info) => okageo.draw(ctx, info))
# install dependencies
$ yarn install
# lint
$ yarn lint
# test
$ yarn test [--watch]
# build
$ yarn build
# serve demo at localhost:1234
$ yarn demo
Bump version written in package.json
and jsr.json
.
Create new release on Github.