Skip to main content
Public

Share visualization

Loading preview…

Viz Function Concept

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Viz Function Concept

7
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.

Comments

Sign in to join the discussion.

MIT Licensed