SVG fundamentals
✓ Published1🌍 Public
This example demonstrates the foundational use of SVG by creating an empty drawing surface and placing a single small rectangle on it. The code creates SVG elements programmatically using the `document.createElementNS` API with the SVG namespace, setting the canvas dimensions to 960 by 500 pixels. A rectangle is then added at coordinates (100, 100) with a width and height of 10 pixels each. This bare-minimum approach, using plain JavaScript without any libraries, illustrates how to construct vector graphics from scratch for later data visualization.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed