JS Electoral Maps
Output Readme Download Replit Sel. & Copy Full

About

This repl creates interactive maps with HTML, JS, CSS, and SVG. Drag left or right on a state to change the color.

To view this on TripleLog, click here.

HTML

The index.html is regenerated every time the server creates a new map (not really a good idea for most scenarios).

CSS

The CSS is inline and some may not be needed.

JavaScript

The index.js file serves two files. One to set some options like colors and then it posts the form data to create the interactive map.

The template is an extension/modification of the CSS maps so it may not be exactly ideal.

The mapSlider.js file performs the logic of updating the data/visuals when a state is dragged left/right.

SVG

The map is SVG and other maps could be used with some adjustments to the server.