you are viewing a single comment's thread.

view the rest of the comments →

[–]JasonCarswell 3 insightful - 3 fun3 insightful - 2 fun4 insightful - 3 fun -  (3 children)

I see.

I'd wager something already exists out there somewhere for you, perhaps with other maps, but if you can't find it and need to make original code, I'd implore you to make it open source because IMO this would actually make it all worth it. First, see if any of these might meet your needs: https://duckduckgo.com/?q=animated+map+maker

Instead of converting to an SVG, I'd just start with a more accurate original SVG source (ie. Wikimedia Commons). I figure the data should be easy enough to find or make, a simple table or array with the list of states, years, and values. Interfacing between the two is the trick. I suspect it'd be simple enough to script an equation in a compositing package (ie. AfterEffects, Premiere, Blender with shaders, etc.). This animated map stuff could be utilized for all sorts of things beyond just voting.

I thought of another thing that might be neat. I mentioned a timeline bar, across the bottom, that would advance as it played indicating the year. Since you're coding it to be interactive, it'd be neat to have that indicator draggable making playback speed moot.

A lot of work for what? If built with the idea of swapping out maps or data, then it might be worth it so your next projects will be much easier. Don't give up - if you don't do this who will?

[–][deleted] 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (0 children)

Thanks, man! I'll look into it some more later on. I'll definitely make it open source, but not on Github, because I don't trust them to not nuke me from orbit like they did with youtube-dl. (Gitlab, maybe?)

Wikimedia commons is good. I intend(ed) on using maps from there and then manipulating them with javascript.

I was thinking about having a slider, yes. There are really a whole bunch of controls, and those probably wouldn't be much of an issue after I get everything set up.

The only problem is I don't think javascript behaves correctly on static websites, so I'll need to move hosting providers first. I think gitlab will let me host my projects there, though I've never used it before. If so, I'll just link to it from my main website.

[–][deleted] 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (1 child)

I decided to just use a javascript map since I can modify it on a static website. The problem is that I couldn't find any that were copyright-free, so I had to use one with a watermark on it.

Another problem I've ran into is that I have to reload the map every time I make changes, so for about half a second the screen is blank. There's nothing I can do about that since it's not my code.

I also decided to make a dictionary of functions (if I used values it would be much larger) that change the color of every state and just copy-paste it with whatever changes are needed. It's not ideal, but it's the only solution I could think of.

I could just put in what was changed, but I realized doing that would be a big hassle because it has to work both ways round. If I copy-paste it I can just work backwards.

I've programmed in 2016-2020, and I don't know if I should go ahead and release it, and add more dates over time, or wait until the entire data-set is there. A lot of game developers have open betas, and this would kind of be like that.

Anyways, I'm going to bed, it's like 4AM. Tomorrow I might work on porting it to my website or adding more dates, whichever I end up choosing.

[–][deleted] 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (0 children)

Last minute decision: I'm probably going to rewrite the dictionary with values. I'll make it stand-alone so anyone can add it to their project without needing to decipher my spaghetti. This will be a huge roadblock, but I think it's the right way to go.

It'll also give me the opportunity to go through each state individually so it'll be more accurate. This means I'll be waiting until the entirely data-set has been converted to javascript before releasing it. I do intend on adding more after, but for now it's just going to be 1992-2020 (maybe 2021 if all the election data comes in before I'm done).