Skip to content

Commit a0d1ed1

Browse files
committed
used appliance wattage example instead of distro popularity
1 parent d24dd74 commit a0d1ed1

File tree

1 file changed

+70
-22
lines changed

1 file changed

+70
-22
lines changed

example.html

Lines changed: 70 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,81 @@
3131
}
3232
document.getElementById("mappings").innerHTML = s;
3333

34-
// Distros
35-
var distros = [
36-
['Mint', 3065],
37-
['Ubuntu', 2170],
38-
['Fedora', 1693],
39-
['openSUSE', 1398],
40-
['Debian', 1365],
41-
['Arch', 1197],
42-
['CentOS', 980],
43-
['PCLinuxOS', 950],
44-
['Puppy', 876],
45-
['Mageia', 770]
34+
// Wattages
35+
var wattages = [
36+
["Clothes Dryer",5000],
37+
["Air Conditioner (36,000 BTU)",4500],
38+
["Water Heater (Quick Recovery)",4500],
39+
["Range (Oven)",2660],
40+
["Range (Self Cleaning Cycle)",2500],
41+
["Power Tools (Circular Saw)",1800],
42+
["Vacuum Cleaner",1560],
43+
["Air Conditioner (12,000 BTU)",1500],
44+
["Convection Oven",1500],
45+
["Curling Iron",1500],
46+
["Heater (Portable)",1500],
47+
["Jacuzzi (Maintain Temperature, 2 Person)",1500],
48+
["Microwave Oven",1500],
49+
["Toaster",1400],
50+
["Dishwasher (Dry Cycle)",1200],
51+
["Fry Pan",1200],
52+
["Waffle Iron",1200],
53+
["Coffee Maker (Auto Drip)",1165],
54+
["Hair Dryer (Hand Held)",1000],
55+
["Heater (Auto Engine, Winter)",1000],
56+
["Iron",1000],
57+
["Motor (1 HP)",1000],
58+
["Auto Engine Heater",600],
59+
["Washer",512],
60+
["Sump Pump (1/2 HP)",500],
61+
["Water Pump (1/2 HP)",460],
62+
["Dehumidifier (20 Pints, Summer)",450],
63+
["Refrigerator/Freezer (Frostfree,17.5cu.ft.)",450],
64+
["Freezer (Automatic Defrost 15 cu. ft.)",440],
65+
["Disposal",420],
66+
["Compactor",400],
67+
["Fan (Attic)",400],
68+
["Blender",385],
69+
["Waterbed Heater (Queen Size)",375],
70+
["Computer (With Monitor and Printer)",365],
71+
["Satellite Dish (Includes Receiver)",360],
72+
["Freezer (Manual Defrost, 15 cu. ft.)",350],
73+
["Garage Door Opener",350],
74+
["Heating System (Warm Air Fan)",312],
75+
["CD, Tape, Radio, Receiver System",250],
76+
["Heat Lamp",250],
77+
["Dishwasher (Wash Cycle)",200],
78+
["Television (Color, Solid State)",200],
79+
["Heat Tape (30ft., Winter)",180],
80+
["Humidifier (Winter)",177],
81+
["Electric Blanket",175],
82+
["Battery Charger (Car)",150],
83+
["Lighting (Outdoor Floor)",120],
84+
["Mixer, Hand",100],
85+
["Fan (Ceiling)",80],
86+
["Lighting (Incandescent)",75],
87+
["Radio",71],
88+
["Bug Zapper",40],
89+
["Lighting (Fluorescent)",40],
90+
["VCR/DVD",21],
91+
["Lighting (Compact Fluorescent)",18],
92+
["Clock",3]
4693
];
4794

4895
var heatmap = new Rainbow();
4996
heatmap.setSpectrum('black', 'blue', 'aqua', 'lime', 'yellow', 'red');
50-
heatmap.setNumberRange(0, 3065);
51-
var table = '<table><tr><th>Linux Distribution</th><th>Popularity (hits per day)</th></tr>';
52-
for (var i = 0; i < distros.length; i++) {
53-
var distroName = distros[i][0];
54-
var hits = distros[i][1];
55-
table += '<tr><td>' + distroName + '</td>';
56-
var hexColour = '#' + heatmap.colourAt(hits);
57-
table += '<td style="background-color:' + hexColour + '">' + hits + '</td></tr>';
97+
heatmap.setNumberRange(0, 5000);
98+
var table = '<table><tr><th>Appliance</th><th>Typical Wattage</th></tr>';
99+
for (var i = 0; i < wattages.length; i++) {
100+
var appliance = wattages[i][0];
101+
var watts = wattages[i][1];
102+
table += '<tr><td>' + appliance + '</td>';
103+
var hexColour = '#' + heatmap.colourAt(watts);
104+
table += '<td style="background-color:' + hexColour + '; color: #fff">' + watts + '</td></tr>';
58105
}
59106
table += '</table>';
60-
document.getElementById("distros").innerHTML = table;
107+
table += '<p>Source: <a href="http://www.cornhusker-power.com/householdappliances.asp">Operating Costs of Household Appliances</a></p>';
108+
document.getElementById("wattages").innerHTML = table;
61109

62110
// Canvas Drawing
63111
var RAINBOW_WIDTH = 60;
@@ -84,7 +132,7 @@
84132
<h2>Mappings</h2>
85133
<div id="mappings"></div>
86134
<h2>Data Visualization</h2>
87-
<div id="distros"></div>
135+
<div id="wattages"></div>
88136
<h2>Canvas Drawing</h2>
89137
<canvas id="MyRainbow" width="300" height="300">
90138
<p>Rainbow arc example. Your browser doesn't support canvas.</p>

0 commit comments

Comments
 (0)