Skip to main content
100%

181202_02_ Divide window

✓ Published1🌍 Public
LLudovicGouverneur
Last edited Dec 2, 2018
Created on Dec 2, 2018
Forked from 181202_01_Viewport

Two identically sized SVG viewports render grids of vertical and horizontal lines using D3’s data join with `selectAll`, `data`, and `enter`. Each grid’s line count is set by parameters, and the viewBox dimensions are derived from those counts rather than hardcoded. The example demonstrates how varying the SVG `width` and `height` attributes changes the display of the same coordinate system, while CSS classes style the lines separately from the geometry.

AI-generated description

Goals : - Divide a svg element in 4 sub svg elements

Elements to grasp :

The D3 Select module : understand how DOM elements can be created, selected, modified.

How View port works for french speakers.

This example is used to understand the SVG viewport and viewbox - Ludo;

Improvements since the start : - Style of lines are defined in CSS. - Number of Horizontal and Vertical are parameter - For automatic Display, number of lines and viewbox dimensions are now linked. - Viewbox dimensions is not hardcoded anymore

This is based in SVG Path Tutorial • Easy to Understand!, made by Roberto Matthews.

MIT Licensed

Similar vizzes