Skip to main content
Public

Share visualization

Loading preview…

variation Pascal's Triangle

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

variation Pascal's Triangle

0
MMTR
Last edited May 1, 2021
Created on May 1, 2021
Forked from Pascal's Triangle

This visualization presents a variation of Pascal's Triangle, where each row is a sequence of circles colored green or red based on whether the value is divisible by the row index. The triangle is built procedurally, generating 22 rows using a custom `nextRow` function that computes each row's sum-based values. Rendered as SVG via D3 v6, the code uses `d3.select` and `d3.append` to create a single SVG, with each row as a `<g>` element translated vertically and each circle horizontally. The fill color is determined by `j%i`, showing the modulo pattern across the structure.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed