Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Create a responsive SVG that resizes to the container.
var base = require("d3-base");
var b = base("#container", {
height: 400
});
var b = base("#container", {
aspect: 0.5
});
You must pass base
a selector representing the parent element in width the SVG will be created. You can optionally pass an object as a second argument representing options. These are:
property | description |
---|---|
width | The initial width of the SVG. Defaults to width of parent |
height | The initial height of the SVG. Defaults to the aspect ratio. |
aspect | The aspect ratio of the SVG. Defaults to 0.618, approximately the golden ratio |
resize | Info about how the SVG should scale. Current options are:
|
onResize | callback function to fire whenever the SVG resizes. This function will receive three arguments: the (new) width, height, and scale, which is (current width) / (original width) |
var base = require("d3-base");
var b = base("#container", {
onResize: function(w, h, s) {
console.log("Scale is " + s);
}
});
FAQs
Responsive SVGs using D3.
The npm package d3-base receives a total of 1 weekly downloads. As such, d3-base popularity was classified as not popular.
We found that d3-base 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.