
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
A thin JavaScript library for SVG element creation and manipulation.
npm install vecs
var vecs = require("vecs");
var svg = new vecs.SVGRoot(100, 100);
var circle = new vecs.SVGCircle(25);
svg.addAt(circle, 50, 50);
The base class for all vecs SVG classes. You shouldn't need to instantiate this class directly.
Returns the raw SVG DOM element.
Returns the tag name of the SVG element. It is guaranteed to be all lowercase.
Set the id attribute on the element to the given id parameter.
Set the coordinates of the element. This is just like setting the x and y attributes for most SVG elements, but handles special cases like <circle> and <path>.
Removes the element from its parent.
Returns an object containing the dimensions of the <svg> element's viewport. If the object is not an <svg> element, the viewport dimensions to which the element belongs to will be returned. The properties of the returned index are numbers named x, y, width, height.
The class for <svg> elements. The values for width and height parameters should be integers. Their units are pixels.
Create a new SVGRoot instance using the supplied <svg> element.
Add to the document.body element and use the given string as the id attribute.
Sets the viewBox attribute.
Sets the perserveAspectRatio attribute.
Add the given svgObj (which should inherit from SVGElement) to the root element. Use addAt() to add an object and position it at the same time.
Add the given svgObj (which should inherit from SVGElement) to the root element at the given coordinates.
Add the given svgObj (which should inherit from SVGElement) to the root element's definition list (<defs>). If id is supplied, it will set the id attribute on the svgObj.
Returns an SVGGroup object that is clipped to the bounds of the viewBox, creating it if it doesn't exist. This is useful for creating images that should not draw outside of their viewBox. Just add shapes to this group object instead of the root object.
Base class for all the elements that could be considered "shapes" (SVGRect, SVGPolygon, SVGPath, etc). Inherits from SVGElement. You should not need to directly call this class's constructor.
Sets the stroke color of the element to the given CSS color string.
Set the opacity of the stroke as a decimal where 0 is invisible and 1 is opaque.
Sets the stroke width to the given number.
Set thes the stroke-linecap attribute of the element. Valid type strings are butt, round, square, and inherit.
Sets the fill color of the element to the given CSS color string.
Set the opacity of the fill as a decimal where 0 is invisible and 1 is opaque.
Create a new <circle> element with the given radius.
Create a new <rect> element with the given width and height.
Creates a new <polygon> element.
Add a point to the polygon. Points are relative to the parent element.
Creates a new <path> element.
Set the beginning point in the path relative to the parent element.
Add a straight line from the previous point in the path, relative to that point.
Add a quadratic Bezier curve to the path. The control point and the end points are relative to the previous point in the path.
Add a raw SVG path command string to the path. Useful for ad-hoc data or pre-computed data like raw text paths.
Prevent the path from closing (and being filled with a fill color).
Create a new <g> element for grouping SVG elements. Inherits from SVGContainerElement.
Create a new <clipPath> element for defining a clipping path. Inherits from SVGContainerElement.
Base class for all elements that essentially act as containers for other SVG elements, such as SVGRoot, SVGGroup, SVGClipPath. It inherits from SVGElement. You should not need to directly call this class's constructor.
Add the given svgObj (which should inherit from SVGElement) to the group.
Add the given svgObj (which should inherit from SVGElement) to the group at the given coordinates.
Set the clip-path attribute of the element to the given id. This should be the id you've given an SVGClipPath element, which has been added as a definition to the SVGRoot element.
FAQs
A thin JavaScript library for SVG element creation and manipulation
The npm package vecs receives a total of 2 weekly downloads. As such, vecs popularity was classified as not popular.
We found that vecs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.