SVG Viewbox
Output Readme Download Replit Sel. & Copy Full

About

This repl includes a few JavaScript functions that allow you to move shapes from an SVG element.

To view this on TripleLog, click here.

HTML

The index.html is generated from other repls and includes SVG elements for the states of Georgia, South Carolina, and North Carolina.

The menu at the top allows you to edit the viewBox via direct input. Set the left, right, top , and bottom. Or move the blue bars to change the size. Click update to see the new viewBox.

JavaScript

The script.js allows you to edit the viewBox. Handling text input is relatively easy, but moving the bars to change the viewBox requires a bit more code.

You probably want to add more functionality, but this code could get you started to easily change the viewBox to fit your needs.