tiny-svg
A minimal toolbelt for builing fast SVG-based applications
Last updated 2 years ago by barmac .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install tiny-svg 
SYNC missed versions from official npm registry.

tiny-svg

CI

tiny-svg is a minimal toolbelt for creating clean SVG applications.

Features

  • no wrapping magic, using native DOM elements instead
  • modular, just use what you need
  • 2kB minified + gzipped
  • innerSVG support
  • simplified attribute handling
  • geometry helpers

Checkout provided utilities.

Usage

import {
  appendTo,
  classes,
  create,
  innerSVG
} from 'tiny-svg';

var container = document.createElement('div');
var element = appendTo(create('svg'), container);

var g = appendTo(create('g'), element);

// add classes, SVG style!
classes(g).add('foo');

var text = `
  <g class="foo bar">
    <rect x="0" y="0" width="0" height="0" rx="50" ry="50"/>
  </g>
`;

// set innerSVG
innerSVG(g, text);

Your favourite module bundler should apply tree-shaking to only include the components your application requires. If you're using CommonJS modules give common-shake a try.

Related

  • min-dom - minimal DOM utility toolbelt
  • min-dash - minimal lodash inspired utility toolbelt

License

MIT

Current Tags

  • 3.0.0                                ...           latest (2 years ago)

19 Versions

  • 3.0.0                                ...           2 years ago
  • 2.2.4                                ...           2 years ago
  • 2.2.3                                ...           3 years ago
  • 2.2.2                                ...           5 years ago
  • 2.2.1                                ...           6 years ago
  • 2.2.0                                ...           6 years ago
  • 2.1.2                                ...           7 years ago
  • 2.1.1                                ...           7 years ago
  • 2.1.0                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.1.3                                ...           7 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
  • 0.0.1                                ...           10 years ago
Downloads
Today 0
This Week 0
This Month 19
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (15)

Copyright 2013 - present © cnpmjs.org | Home |