d3-snap
v1.0.3
Published
Captures d3.js visualizations in the server.
Downloads
9
Maintainers
Readme
d3-snap
d3-snapDon't limit yourself just to the browser. Visualize your data also on the server.
Supported Versions:
Features
- Capture D3.js visualizations on the server.
- Easy integration with existing D3.js projects.
🚀 Quick Installation
Download Dependencies
Download the d3-snap package from npm:
npm i d3-snap🙌 Hello World Example
Here's a simple example of how to use d3-snap:
- Create a file named
main.mjsin yoursrcfolder. - Add the following code to
main.mjs:
import { D3Snap } from "d3-snap";
const node = new D3Snap({
container: "<section><svg></svg></section>",
selector: "svg",
});
const svg = node.createSVG(50, 50);
svg
.append("text")
.text("Hello, D3!")
.attr("x", 10)
.attr("y", 20);
console.log("Svg message: ", node.svgToString());📚 Documentation
✍ Do you want to learn more?
- Learn more about D3.js.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Technologies used
License
Released under MIT by @MetalbolicX.
