Skip to content

Generate svg with TypeScript or JavaScript. Helper library for easy and type-safe handling of svg (creating, manipulating and animating)

License

Notifications You must be signed in to change notification settings

tobiaskraus/svg-gen

Repository files navigation

svg-gen

THIS LIBRARY IS NOT EVEN IN ALPHA VERSION YET - DON'T USE IT NOW!

A library to create, manipulate and animate svg via TypeScript (recommended) or JavaScript.

  • zero dependencies
  • type safe (written in TypeScript for TypeScript)
  • let's you generate nice visual patterns
  • is NOT recomended to use already - wait until it's stable!

Install

npm install svg-gen

Documentation

--Doesn't exist yet--

Is generated with typedoc and published in /docs. But it's not yet available online (no URL).

Getting Started

import { TrianglesGrid, SvgRenderer, TrianglesGridPattern } from 'svg-gen';

// create something to render (here: TrianglesGrid)
const trianglesGrid = new TrianglesGrid({
    rows: 6,
    cols: 4,
    trianglesPattern: TrianglesGridPattern.DoubleOffset,
});

// set up the renderer and render the grid
const svgRenderer = new SvgRenderer({});
svgRenderer.render(trianglesGrid);

Result

rendered svg

Features

  • Different Grids:
    • TrianglesGrid (Patterns: RegularGrid, VGrid , DoubleOffset)
    • PointsGrid
  • Renderer (same methods -> easy to change):
    • SvgRenderer
    • CanvasRenderer --Doesn't exist yet--
  • Flexible styling
    • (all inline stylings from this library are optional. So you can create with simple CSS all stylings you want)
  • Animations --Doesn't exist yet--
  • Easy creation of own geometries / svgs --Doesn't exist yet--

Contribution

Contributing Doku: CONTRIBUTING.md

About

Generate svg with TypeScript or JavaScript. Helper library for easy and type-safe handling of svg (creating, manipulating and animating)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published