npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

svg-util

v1.8.0

Published

The helper utils for SVG

Downloads

248

Readme

SVG util

npm Greenkeeper badge Build Status downloads license

The helper utils(filter, clip etc...) for Programming SVG.

Classes

  • SvgDefs Class: to manage all reused elements in defs of an invisibale SVG.
  • SvgDef Abstract Class: The reused element abstract class.
    • LinearGradient Class: the reused linear gradient to fill.
      • stops(IGradientColor): defines the ramp of colors to use on a gradient
        • offset: defined the offset of a given gradient stop. 0.0-1.0 or 0%-100%
        • stop-color: The color attribute indicates what color to use at that gradient stop.
        • stop-opacity: defines the opacity of a given gradient stop.
    • GlossGlassFilter Class: the gloss glass filter.
      • color(string): defaults to #bbbbbb
      • specular(number): defaults to 12
    • GrayscaleFilter Class: the reused grayscale filter.
    • LighterFilter Class: the reused lighter filter(in feComposite).
    • BrightnessFilter Class: adjust brightness filter.
      • slope(number): >1 improve brightness; <1 reduce brightness: color*slope
    • DropshadowFilter Class: the reused drop shadow filter. NOTE: You should wrapper it to a group if you wanna apply multi-filters on one svg element.
      • id(string): optional to reuse the dropshadow filter.
        • note: the same id will share the same dropshadow filter.
      • dx(number), dy(number): the offset of the drop shadow.
    • RoundedRectClip Class: the reused rounded rect clip.
      • id(string): optional to reuse the rounded rect clip.
      • width(number), height(number): the 0-1 float number for width/height aspect ratio.
        • the aspect ratio keep 6 decimal places.
      • rx(number): the 0-1 float number to rounded corner radius for x.
      • ry(number): optional, the 0-1 float number to rounded corner radius for y(ry = rx if no settings).
      • note: the same id and the same width/height ratio will share the same rounded rect clip.
    • PathClip Class: the reused path clip.
      • id(string): optional to reuse the path clip.
      • path(string): defines a path to be drawn. see d attribute
        • note: the clipPathUnits is 'objectBoundingBox'.

utils

  • domjson: used to convert the svg dom to json and reverse.
  • svg-path: convert svg shape to the path string.