Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@redsift/d3-rs-svg
Advanced tools
d3-rs-svg
is a component for creating a SVG 1.1 root element that is compatable with the D3 margin convention. This component is dependent on D3 v4 (Alpha).
UMD from //static.redsift.io/reusable/d3-rs-svg/latest/d3-rs-svg.umd-es2015.min.js
<script src="//static.redsift.io/reusable/d3-rs-svg/latest/d3-rs-svg.umd-es2015.min.js"></script>
<script>
var svg = d3_rs_svg.html();
...
</script>
import * as svg from "@redsift/d3-rs-svg";
let eml = svg.html();
...
If using rollup.js for a browser target, ensure d3-rs-svg
is part of the global map.
var svg = require("@redsift/d3-rs-svg");
var eml = svg.html();
...
By convention, the SVG element is meant to be hosted in a HTML node, hence svg.html()
Name | Description | Transition |
---|---|---|
width,height | SVG viewport size, px | Y |
scale | SVG scaling factor, floating point | Y |
margin | margin convention, Object or integer px | Y |
classed | SVG custom class | N |
style | SVG CSS embed | N |
background | Rect background color | Y |
title | N | |
role | https://www.w3.org/TR/wai-aria/roles#img | N |
Parameters that support transition can be animated and chained.
d3.select('#elm')
.call(svg) // draw the SVG at default (1x) scale
.transition().duration(1000)
.call(svg.scale(2.0)) // scale the SVG by 2x
.transition().duration(333)
.call(svg.scale(1.0)) // bounce back after 333ms
Note, this form of chaining does not work for parameters that do not support transition. Use the on('end', ...
event for them.
var el = d3.select('#elm')
.call(svg.style('rect{fill: yellow;}'));
el.select(svg.self()).select(svg.child())
.append('rect') // add a rect to the SVG we can paint with CSS
.attr('width', svg.childWidth())
.attr('height', svg.childHeight());
el.transition().delay(1000).duration(0).on('end', function() {
el.transition().duration(1000).delay(500)
.call(svg.scale(2.0).style('rect{fill: green;}')); // this green is applied after 1s of delay but 500ms before the scale changes
});
This module implements some of the features described here.
FAQs
Creates a SVG element using D3v4.
The npm package @redsift/d3-rs-svg receives a total of 503 weekly downloads. As such, @redsift/d3-rs-svg popularity was classified as not popular.
We found that @redsift/d3-rs-svg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 23 open source maintainers 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.