Skip to main content

Tools of Geometry and SVG. Some features - Parse SVG path to objects - Morph SVG path - Conventional 2D geometry - intersections between a segment and a Bezier curve - Lerp a Bezier curve

This package works with Node.js, Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Bun
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
94%
Published
a year ago (3.1.6)

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Main Coverage Status License: MIT

okageo

Tools of Geometry and SVG.

demo(wip)

https://miyanokomiya.github.io/okageo/

usage

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))

commnad

# install dependencies
$ yarn install

# lint
$ yarn lint

# test
$ yarn test [--watch]

# build
$ yarn build

# serve demo at localhost:1234
$ yarn demo

publish

Create new release on Github.

Add Package

deno add jsr:@miyanokomiya/okageo

Import symbol

import * as okageo from "@miyanokomiya/okageo";

---- OR ----

Import directly with a jsr specifier

import * as okageo from "jsr:@miyanokomiya/okageo";

Add Package

npx jsr add @miyanokomiya/okageo

Import symbol

import * as okageo from "@miyanokomiya/okageo";

Add Package

yarn dlx jsr add @miyanokomiya/okageo

Import symbol

import * as okageo from "@miyanokomiya/okageo";

Add Package

pnpm dlx jsr add @miyanokomiya/okageo

Import symbol

import * as okageo from "@miyanokomiya/okageo";

Add Package

bunx jsr add @miyanokomiya/okageo

Import symbol

import * as okageo from "@miyanokomiya/okageo";