Skip to main content
Explore
Solutions
Bespoke Studio
Pricing
Quick Start
Demo
Log in
Send feedback
✕
Tell us what works and what could be better. We read every submission.
Send feedback
✕
Tell us what works and what could be better. We read every submission.
Home
•
Fork Viz
Fork Viz
Create your own copy of this visualization.
Forking from
Viz Function Concept
Title
*
Description
This example demonstrates the Viz Function concept, a refactoring that encapsulates configurable logic for graphics and visualization. The main script imports a `viz` function from `./viz` and calls it with parameters for dimensions and an inner rectangle fill color, rendering an SVG with a gray inner rectangle inside the container. The `viz` function uses D3’s `select` and `join` APIs to create and update the SVG rectangle, calculating its size based on provided margins. The code relies on the D3 library (version 7.8.5) and is structured as a reusable, parameterized visualization component.
Visibility
Public
Private (only you), Pro
Unlisted (anyone with link)
Private work requires Pro.
Upgrade
Cancel
Fork Viz