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


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.


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


The CSS is inline and some may not be needed.


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.


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