Extended the COLORS array in graph controller so that elections with multiple
author<jlsharps@mit.edu> <>
Mon, 3 Sep 2007 05:53:42 +0000 (01:53 -0400)
committer<jlsharps@mit.edu> <>
Mon, 3 Sep 2007 05:53:42 +0000 (01:53 -0400)
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...

app/controllers/graph_controller.rb
app/views/quickvote/_pref_tables.rhtml
public/stylesheets/main.css

index 413ebb0c10617d9e5ac38e2cc1a3ed0e74933008..f956c0bf665890e9962c549739fd1bbe28d99b4c 100644 (file)
@@ -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)
index 3479167d226296cc14a0864c47b1299d2efb452a..588ec22d8aa88e19883fc1cda0a08c06bb6edbcb 100644 (file)
@@ -7,6 +7,9 @@
 <!-- This table shows how many times each choice was ranked above the other, 
        with percentages-->
 <table class="preftable">
+<caption>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.</caption>
   <tr>
        <td></td>
        <% candidates.each do |candidate| -%>
@@ -34,6 +37,9 @@
 <br />
 <!-- This table generates a margin of victory -->
 <table class="preftable">
+<caption>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.
+</caption>
   <% candidates.each do |victor| %>
   <tr>
     <th><%=h @names[victor] %></th>
index 16b10bfef028ed463ab08fae6dd91802b60b66cf..632a47f886d0c488c9aa0dd4057a8bb33061efa9 100644 (file)
@@ -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;

Benjamin Mako Hill || Want to submit a patch?