From: Date: Mon, 3 Sep 2007 05:53:42 +0000 (-0400) Subject: Extended the COLORS array in graph controller so that elections with multiple X-Git-Url: https://projects.mako.cc/source/selectricity/commitdiff_plain/c5ca3aa0771719286fb9f1a468c28a83af52292b?hp=d2fadf2d1f345fab0956a05599b50a483d939c9a Extended the COLORS array in graph controller so that elections with multiple candidates won't have graphs with dangerously similar colors. After 10 candidates though, they're on their own. Also added captions to the pref_tables of the Schulze method to quickly explain how to read them. Feel free to edit/move them. I tried to make them quick, explanatory and look-alikes to the rest of the text, but definitely failed on the look-alike requirement. Please fix... --- diff --git a/app/controllers/graph_controller.rb b/app/controllers/graph_controller.rb index 413ebb0..f956c0b 100644 --- a/app/controllers/graph_controller.rb +++ b/app/controllers/graph_controller.rb @@ -2,7 +2,8 @@ require 'date' class GraphController < ApplicationController class GruffGraff - COLORS = ['#74CE00', '#005CD9', '#DC0D13', '#131313', '#990033'] + COLORS = ['#74CE00', '#005CD9', '#DC0D13', '#131313', '#A214A4', 'EFF80E', + '90E5E6', 'F58313', '437D3D', '0E026C'] BACKGROUND_COLORS = ['#74CE00', '#FFFFFF'] #for green and white background def initialize(options) diff --git a/app/views/quickvote/_pref_tables.rhtml b/app/views/quickvote/_pref_tables.rhtml index 3479167..588ec22 100644 --- a/app/views/quickvote/_pref_tables.rhtml +++ b/app/views/quickvote/_pref_tables.rhtml @@ -7,6 +7,9 @@ + <% candidates.each do |candidate| -%> @@ -34,6 +37,9 @@
Each number shows how many times the candidate on the left beat the +matching candidate on the top. The Schulze/Condorcet winner is on the top of the +left column.
+ <% candidates.each do |victor| %> diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 16b10bf..632a47f 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -267,12 +267,17 @@ li.moveable { } .preftable { + font-family: verdana,arial,helvetica,sans-serif; border-spacing: 0px; - border-width: 2px; - border-color: #999999; - border-style: solid; + border-width: 2px; + border-color: #999999; + border-style: solid; + caption-side: top; +} +.preftable caption { + font-family: verdana,arial,helvetica,sans-serif; + font-size: 0.9em; } - .preftable th { font-family: verdana,arial,helvetica,sans-serif; border-width: 2px; @@ -290,7 +295,6 @@ li.moveable { border-width: 1px; border-color: #999999; border-style: solid; - text-align: right; padding-right: 5px; padding-left: 5px; @@ -335,7 +339,6 @@ li.moveable { .voterbox#election td { border-color: #990d13;} - .rbmoreinfo hr { width: 100%; height: 10px;
A simplification of the above data. The winner is on the left; each cell +names the defeated candidate and the magnitude of the victory in parenthesis. +
<%=h @names[victor] %>