Skip to main content
100%

Viz Function Concept

✓ Published3🌍 Public
CCurran Kelleher
Last edited Feb 6, 2024
Created on Jan 23, 2024
Forked from Margins

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.

AI-generated description

A refactoring that introduces the "viz function" as a way to encapsulate configurable logic for graphics and visualization.

MIT Licensed

Similar vizzes