book

Report

Authors

This report is prepared by

# What class has the highest ratio between of work to credit hours?[top]

Viz LAWS 6119 5.81 LAWS 6280 5.29 LAWS 6420 5.14 EMUS 1287 4.93 LAWS 6331 4.78 LAWS 7629 4.67 PMUS 4157 4.38 EMUS 1327 3.495 LAWS 7509 3.25 LAWS 7106 3.17 EMUS 1277 3 LAWS 7126 3 EMUS 1297 2.995 GEOL 2700 2.91 SLHS 6660 2.8 EMUS 1307 2.69 PMUS 4517 2.615 PMUS 2205 2.57 CHEN 3130 2.56375 CVEN 4414 2.513333333333333
<g transform="translate(0 0)">
    <rect         
         width="348.59999999999997"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        LAWS 6119
    </text>
	<text transform="translate(358.59999999999997 15)">
        5.81
    </text>
</g>
<g transform="translate(0 20)">
    <rect         
         width="317.4"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        LAWS 6280
    </text>
	<text transform="translate(327.4 15)">
        5.29
    </text>
</g>
<g transform="translate(0 40)">
    <rect         
         width="308.4"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        LAWS 6420
    </text>
	<text transform="translate(318.4 15)">
        5.14
    </text>
</g>
<g transform="translate(0 60)">
    <rect         
         width="295.79999999999995"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        EMUS 1287
    </text>
	<text transform="translate(305.79999999999995 15)">
        4.93
    </text>
</g>
<g transform="translate(0 80)">
    <rect         
         width="286.8"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        LAWS 6331
    </text>
	<text transform="translate(296.8 15)">
        4.78
    </text>
</g>
<g transform="translate(0 100)">
    <rect         
         width="280.2"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        LAWS 7629
    </text>
	<text transform="translate(290.2 15)">
        4.67
    </text>
</g>
<g transform="translate(0 120)">
    <rect         
         width="262.8"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        PMUS 4157
    </text>
	<text transform="translate(272.8 15)">
        4.38
    </text>
</g>
<g transform="translate(0 140)">
    <rect         
         width="209.70000000000002"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        EMUS 1327
    </text>
	<text transform="translate(219.70000000000002 15)">
        3.495
    </text>
</g>
<g transform="translate(0 160)">
    <rect         
         width="195"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        LAWS 7509
    </text>
	<text transform="translate(205 15)">
        3.25
    </text>
</g>
<g transform="translate(0 180)">
    <rect         
         width="190.2"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        LAWS 7106
    </text>
	<text transform="translate(200.2 15)">
        3.17
    </text>
</g>
<g transform="translate(0 200)">
    <rect         
         width="180"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        EMUS 1277
    </text>
	<text transform="translate(190 15)">
        3
    </text>
</g>
<g transform="translate(0 220)">
    <rect         
         width="180"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        LAWS 7126
    </text>
	<text transform="translate(190 15)">
        3
    </text>
</g>
<g transform="translate(0 240)">
    <rect         
         width="179.70000000000002"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        EMUS 1297
    </text>
	<text transform="translate(189.70000000000002 15)">
        2.995
    </text>
</g>
<g transform="translate(0 260)">
    <rect         
         width="174.60000000000002"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        GEOL 2700
    </text>
	<text transform="translate(184.60000000000002 15)">
        2.91
    </text>
</g>
<g transform="translate(0 280)">
    <rect         
         width="168"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        SLHS 6660
    </text>
	<text transform="translate(178 15)">
        2.8
    </text>
</g>
<g transform="translate(0 300)">
    <rect         
         width="161.4"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        EMUS 1307
    </text>
	<text transform="translate(171.4 15)">
        2.69
    </text>
</g>
<g transform="translate(0 320)">
    <rect         
         width="156.9"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        PMUS 4517
    </text>
	<text transform="translate(166.9 15)">
        2.615
    </text>
</g>
<g transform="translate(0 340)">
    <rect         
         width="154.2"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        PMUS 2205
    </text>
	<text transform="translate(164.2 15)">
        2.57
    </text>
</g>
<g transform="translate(0 360)">
    <rect         
         width="153.82500000000002"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        CHEN 3130
    </text>
	<text transform="translate(163.82500000000002 15)">
        2.56375
    </text>
</g>
<g transform="translate(0 380)">
    <rect         
         width="150.79999999999998"
         height="20"
         style="fill:red;
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        CVEN 4414
    </text>
	<text transform="translate(160.79999999999998 15)">
        2.513333333333333
    </text>
</g>
Solution: SVG Template
<g transform="translate(0 ${d.y})">
    <rect         
         width="${d.width}"
         height="20"
         style="fill:${d.color};
                stroke-width:3;
                stroke:rgb(0,0,0)" />
<text transform="translate(10 15)">
        ${d.label1}
    </text>
	<text transform="translate(${d.width2} 15)">
        ${d.label2}
    </text>
</g>
Solution: Javascript
var clean = _.filter(data, function(d){
	return d.Workload.Raw != ""
})
var result = _.groupBy(clean, function(d){
	var dept = d.Subject
	var num = d.Course
	var combine = dept +  " " + num	
	return combine
})
var classes = _.mapValues(result, function(d){
	var wk = _.pluck(d, 'Workload.Raw')
	var hr = _.sum(_.pluck(d, 'Hours'))/d.length
	return (_.sum(wk)/d.length)/ hr
})
classes = _.sortBy(_.pairs(classes), function(d){
	return d[1]
}).reverse()
classes = _.dropRightWhile(classes, function(d){
	return d[1] < 2.513
})

console.log(classes)

// TODO: modify the code below to produce a nice vertical bar charts

function computeX(d, i) {
    return 0
}

function computeHeight(d, i) {
    return 20
}

function computeWidth(d, i) {
    return d[1]*60
}

function computeY(d, i) {
    return i*20
}

function computeColor(d, i) {
    return 'red'
}
function computeLabel1(d,i){
	return d[0]
}
function computeLabel2(d,i){
	return d[1]
}
var viz = _.map(classes, function(d, i){
            return {
                x: computeX(d, i),
                y: computeY(d, i),
                height: computeHeight(d, i),
                width: computeWidth(d, i),
                color: computeColor(d, i),
				label1: computeLabel1(d,i),
				label2: computeLabel2(d,i),
				width2: (computeWidth(d,i)+10)
			}
         })
console.log(viz)

var result = _.map(viz, function(d){
         // invoke the compiled template function on each viz data
         return template({d: d})
     })
return result.join('\n')
Console
[["LAWS 6119",5.81],["LAWS 6280",5.29],["LAWS 6420",5.14],["EMUS 1287",4.93],["LAWS 6331",4.78],["LAWS 7629",4.67],["PMUS 4157",4.38],["EMUS 1327",3.495],["LAWS 7509",3.25],["LAWS 7106",3.17],["EMUS 1277",3],["LAWS 7126",3],["EMUS 1297",2.995],["GEOL 2700",2.91],["SLHS 6660",2.8],["EMUS 1307",2.69],["PMUS 4517",2.615],["PMUS 2205",2.57],["CHEN 3130",2.56375],["CVEN 4414",2.513333333333333]]
[{"x":0,"y":0,"height":20,"width":348.59999999999997,"color":"red","label1":"LAWS 6119","label2":5.81,"width2":358.59999999999997},{"x":0,"y":20,"height":20,"width":317.4,"color":"red","label1":"LAWS 6280","label2":5.29,"width2":327.4},{"x":0,"y":40,"height":20,"width":308.4,"color":"red","label1":"LAWS 6420","label2":5.14,"width2":318.4},{"x":0,"y":60,"height":20,"width":295.79999999999995,"color":"red","label1":"EMUS 1287","label2":4.93,"width2":305.79999999999995},{"x":0,"y":80,"height":20,"width":286.8,"color":"red","label1":"LAWS 6331","label2":4.78,"width2":296.8},{"x":0,"y":100,"height":20,"width":280.2,"color":"red","label1":"LAWS 7629","label2":4.67,"width2":290.2},{"x":0,"y":120,"height":20,"width":262.8,"color":"red","label1":"PMUS 4157","label2":4.38,"width2":272.8},{"x":0,"y":140,"height":20,"width":209.70000000000002,"color":"red","label1":"EMUS 1327","label2":3.495,"width2":219.70000000000002},{"x":0,"y":160,"height":20,"width":195,"color":"red","label1":"LAWS 7509","label2":3.25,"width2":205},{"x":0,"y":180,"height":20,"width":190.2,"color":"red","label1":"LAWS 7106","label2":3.17,"width2":200.2},{"x":0,"y":200,"height":20,"width":180,"color":"red","label1":"EMUS 1277","label2":3,"width2":190},{"x":0,"y":220,"height":20,"width":180,"color":"red","label1":"LAWS 7126","label2":3,"width2":190},{"x":0,"y":240,"height":20,"width":179.70000000000002,"color":"red","label1":"EMUS 1297","label2":2.995,"width2":189.70000000000002},{"x":0,"y":260,"height":20,"width":174.60000000000002,"color":"red","label1":"GEOL 2700","label2":2.91,"width2":184.60000000000002},{"x":0,"y":280,"height":20,"width":168,"color":"red","label1":"SLHS 6660","label2":2.8,"width2":178},{"x":0,"y":300,"height":20,"width":161.4,"color":"red","label1":"EMUS 1307","label2":2.69,"width2":171.4},{"x":0,"y":320,"height":20,"width":156.9,"color":"red","label1":"PMUS 4517","label2":2.615,"width2":166.9},{"x":0,"y":340,"height":20,"width":154.2,"color":"red","label1":"PMUS 2205","label2":2.57,"width2":164.2},{"x":0,"y":360,"height":20,"width":153.82500000000002,"color":"red","label1":"CHEN 3130","label2":2.56375,"width2":163.82500000000002},{"x":0,"y":380,"height":20,"width":150.79999999999998,"color":"red","label1":"CVEN 4414","label2":2.513333333333333,"width2":160.79999999999998}]

# What college has the highest enrollment?[top]

Viz AS: 119563 BU: 17523 EB: 3198 EN: 27047 GR: 1177 JR: 2982 LW: 5166 MB: 7034 XX: 559 undefined: 384 AP: 1400
<rect x="0"
      y="0"
      height="20"
      width="597.815"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="605.815" y="17">
    AS: 119563
</text>
<rect x="0"
      y="35"
      height="20"
      width="87.615"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="95.615" y="52">
    BU: 17523
</text>
<rect x="0"
      y="70"
      height="20"
      width="15.99"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="23.990000000000002" y="87">
    EB: 3198
</text>
<rect x="0"
      y="105"
      height="20"
      width="135.235"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="143.235" y="122">
    EN: 27047
</text>
<rect x="0"
      y="140"
      height="20"
      width="5.885"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="13.885" y="157">
    GR: 1177
</text>
<rect x="0"
      y="175"
      height="20"
      width="14.91"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="22.91" y="192">
    JR: 2982
</text>
<rect x="0"
      y="210"
      height="20"
      width="25.83"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="33.83" y="227">
    LW: 5166
</text>
<rect x="0"
      y="245"
      height="20"
      width="35.17"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="43.17" y="262">
    MB: 7034
</text>
<rect x="0"
      y="280"
      height="20"
      width="2.795"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="10.795" y="297">
    XX: 559
</text>
<rect x="0"
      y="315"
      height="20"
      width="1.92"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="9.92" y="332">
    undefined: 384
</text>
<rect x="0"
      y="350"
      height="20"
      width="7"
      style="fill:teal;
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="15" y="367">
    AP: 1400
</text>
Solution: SVG Template
<rect x="${d.x}"
      y="${d.y}"
      height="${d.height}"
      width="${d.width}"
      style="fill:${d.color};
             stroke-width:1;
             stroke:rgb(0,0,0)" />
<text x="${d.width + 8}" y="${d.y + 17}">
    ${d.label}: ${d.count}
</text>
Solution: Javascript
var groups = _.groupBy(data, function(d){
    return d['CrsPBAColl']
})

var count = _.mapValues(groups, function(g) {
    return _.sum(_.pluck(g, 'N.ENROLL'))
})

var keys = _.keys(count)

var final = _.map(keys, function(key) {
    return {"name": key, "enroll": count[key]}
})

console.log(final)

/* SVG Functions */
function computeX(d, i) {
    return 0
}

function computeHeight(d, i) {
    return 20
}

function computeWidth(d, i) {
    return d.enroll / 200
}

function computeY(d, i) {
    return 35 * i
}

function computeColor(d, i) {
    return 'teal'
}

function computeLabel(d, i) {
    return d.name
}

function computeLabel2(d, i) {
    return d.enroll
}

var viz = _.map(final, function(d, i){
    return {
        x: computeX(d, i),
        y: computeY(d, i),
        height: computeHeight(d, i),
        width: computeWidth(d, i),
        color: computeColor(d, i),
        label: computeLabel(d, i),
        count: computeLabel2(d, i)
    }
 })
console.log(viz)

var result = _.map(viz, function(d){
         // invoke the compiled template function on each viz data
         return template({d: d})
     })
return result.join('\n')
Console
[{"name":"AS","enroll":119563},{"name":"BU","enroll":17523},{"name":"EB","enroll":3198},{"name":"EN","enroll":27047},{"name":"GR","enroll":1177},{"name":"JR","enroll":2982},{"name":"LW","enroll":5166},{"name":"MB","enroll":7034},{"name":"XX","enroll":559},{"name":"undefined","enroll":384},{"name":"AP","enroll":1400}]
[{"x":0,"y":0,"height":20,"width":597.815,"color":"teal","label":"AS","count":119563},{"x":0,"y":35,"height":20,"width":87.615,"color":"teal","label":"BU","count":17523},{"x":0,"y":70,"height":20,"width":15.99,"color":"teal","label":"EB","count":3198},{"x":0,"y":105,"height":20,"width":135.235,"color":"teal","label":"EN","count":27047},{"x":0,"y":140,"height":20,"width":5.885,"color":"teal","label":"GR","count":1177},{"x":0,"y":175,"height":20,"width":14.91,"color":"teal","label":"JR","count":2982},{"x":0,"y":210,"height":20,"width":25.83,"color":"teal","label":"LW","count":5166},{"x":0,"y":245,"height":20,"width":35.17,"color":"teal","label":"MB","count":7034},{"x":0,"y":280,"height":20,"width":2.795,"color":"teal","label":"XX","count":559},{"x":0,"y":315,"height":20,"width":1.92,"color":"teal","label":"undefined","count":384},{"x":0,"y":350,"height":20,"width":7,"color":"teal","label":"AP","count":1400}]