The site has multiple objectives. One is to help people connect with the local Green Party. One is to get Green Party politicians elected. And one is to get non-green, progressive candidates elected. In particular we want to recommend ballot choices for every voter in the country.
This website is made of pages, some with maps, some with banner ads, and some with lists of candidates.
The lists of candidates are in general different and smaller than the maps of candidates. That is because humans are much better at processing 2 dimensional images, than they are at keeping long lists in their heads. Ideally lists should only be about 7 items long. Maps can have a lot more pins.
We have two presidential candidates. An unknown number of congressional candidates, govenenors, state legislators, mayors and city councilmen.
Presidential candidates are Howie and Angela. They are stored at the national map level.
Congressional candidates are those stored at the state level, marked national. They could also be stored at the local level.
Mayors or city councilmen can also be stored state-wide or locally.
Having said this, it turns out it is easy to calculate the appropriate list of candidates. The basic idea is as follows At the national level, we are showing presidential and congressional candidates. The entire tree has to be searched for Congressional Candidates. At the state level we are showing all Green candidats. The entire state branch has to be searched for Green Candidates. At the local level, we are showing recommended candidates to vote for. We grab the candidates from all parent categories, local included.
The national page lists presidential and congressional candidates. Congressional candidates can be stored at the state level, or if there is a local page, they can be stored at the local level. A local page can either be local party, or a location (city) object.
The state pages are designed to highlight Green Party candidates. They list presidential, and state candidates. Governors are stored at the state level. State legislatures can be stored at the state level, or in a local party, county or city object. If a Green Party candidate is stored locally, the state page has to reach into its child objects to extract all of the Green Party politicians. The software already does that.
The local pages are designed to recommend voting patterns. Local pages could be 3 levels deep. National->State-County, or 4 levels deep. National-State->City->Ward. A local page shows the politicians in the national object. That is the 2 presidential candidates. It shows the politicians listed at the state level. In a poorly managed state that would be all of the Green politicians. In a well managed state that would only be the governors, and senators. A local page then lists its candidates. If city and ward, it lists the city and the ward candidates.
The idea is that local pages should not list a candidate the person cannot vote for.
On the national map, all Green candidates are displayed. The presidential candidates are displayed in their home towns.
On the State Map, all of the state and local candidates are displayed, but not the presidential candidates. Optionally the presidential candidates can be listed in a banner. Meaning the Howie Banner should be inherited by all states. I can do that.
As we get closer to the election, we do expect to see local maps, with rides to the polls offered.
The banner ads are custom to each page. So the page owner makes the decision as to what is in the banner ad. What follows are just our recommendations.
On the national banner the presidential, vice presidential, and the congressional candidates are displayed. The congressional candidates have smaller photos in a line below the presidential candidates.
On the state banner, all the Green state candidates can be listed.
On the local banner, the few local candidates can be lists.
Recomputing all of these lists may be expensive, so the results will probably need to be cached. Certainly the anonymous site visitor gets a page cached in NGINX, but even the logged in user will need the lists cached in Python.
This whole logic is a bit complex. But I am running on an Object-Graph database, so doing computations on trees is quite easy. The key is to get the ideas right. The other HUGE issue is fail safety. The algorithms have to display something reaasonable when the data is off. In particular the forms support fields for local state and national office, but I suspect that few myself included, filled those out correctly. The fields were only added recently.
Built using the Forest Map Wiki