parallel coordinates in protovis

779 views Asked by At

I came across this http://mbostock.github.com/protovis/ex/cars.html cars parallel coordinates sample:

enter image description here

It works well. We can apply filters along the parallel lines and the corresponding data(horizontal lines) are highlighted. But what I wanted to know is how can we select/identify the individual horizontal lines(data). Typically like what we do in javascipt like getElementById, I tried to debug it in firebug but I couldnt pick those lines. The code is posted below: This is the main html page:

    <html>
  <head>
    <title>Parallel Coordinates</title>
    <link type="text/css" rel="stylesheet" href="ex.css?3.2"/>
    <script type="text/javascript" src="../protovis-r3.2.js"></script>
    <script type="text/javascript" src="cars.js"></script>
    <style type="text/css">

#fig {
  width: 880px;
  height: 460px;
}

#title {
  position: absolute;
  top: 70px;
  left: 200px;
  padding: 10px;
  background: white;
}

large {
  font-size: medium;
}

    </style>
  </head>
  <body><div id="center"><div id="fig">
    <script type="text/javascript+protovis">

// The units and dimensions to visualize, in order.
var units = {
  cyl: {name: "cylinders", unit: ""},
  dsp: {name: "displacement", unit: " sq in"},
  lbs: {name: "weight", unit: " lbs"},
  hp: {name: "horsepower", unit: " hp"},
  acc: {name: "acceleration (0-60 mph)", unit: " sec"},
  mpg: {name: "mileage", unit: " mpg"},
  year: {name: "year", unit: ""}
}

var dims = pv.keys(units);

/* Sizing and scales. */
var w = 820,
    h = 420,
    fudge = 0.5,
    x = pv.Scale.ordinal(dims).splitFlush(0, w),
    y = pv.dict(dims, function(t) pv.Scale.linear(
        cars.filter(function(d) !isNaN(d[t])),
        function(d) Math.floor(d[t])-fudge,
        function(d) Math.ceil(d[t]) +fudge
        ).range(0, h)),
    c = pv.dict(dims, function(t) pv.Scale.linear(
        cars.filter(function(d) !isNaN(d[t])),
        function(d) Math.floor(d[t])-fudge,
        function(d) Math.ceil(d[t]) +fudge
        ).range("steelblue", "brown"));

/* Interaction state. */
var filter = pv.dict(dims, function(t) {
    return {min: y[t].domain()[0], max: y[t].domain()[1]};
  }), active = "mpg";

/* The root panel. */
var vis = new pv.Panel()
    .width(w)
    .height(h)
    .left(30)
    .right(30)
    .top(30)
    .bottom(20);

// The parallel coordinates display.
vis.add(pv.Panel)
    .data(cars)
    .visible(function(d) dims.every(function(t)
        (d[t] >= filter[t].min) && (d[t] <= filter[t].max)))
  .add(pv.Line)
    .data(dims)
    .left(function(t, d) x(t))
    .bottom(function(t, d) y[t](d[t]))
    .strokeStyle("#ddd")
    .lineWidth(1)
    .antialias(false);

// Rule per dimension.
rule = vis.add(pv.Rule)
    .data(dims)
    .left(x);

// Dimension label
rule.anchor("top").add(pv.Label)
    .top(-12)
    .font("bold 10px sans-serif")
    .text(function(d) units[d].name);

// The parallel coordinates display.
var change = vis.add(pv.Panel);

var line = change.add(pv.Panel)
    .data(cars)
    .visible(function(d) dims.every(function(t)
        (d[t] >= filter[t].min) && (d[t] <= filter[t].max)))
  .add(pv.Line)
    .data(dims)
    .left(function(t, d) x(t))
    .bottom(function(t, d) y[t](d[t]))
    .strokeStyle(function(t, d) c[active](d[active]))
    .lineWidth(1);

// Updater for slider and resizer.
function update(d) {
  var t = d.dim;
  filter[t].min = Math.max(y[t].domain()[0], y[t].invert(h - d.y - d.dy));
  filter[t].max = Math.min(y[t].domain()[1], y[t].invert(h - d.y));
  active = t;
  change.render();
  return false;
}

// Updater for slider and resizer.
function selectAll(d) {
  if (d.dy < 3) {
    var t = d.dim;
    filter[t].min = Math.max(y[t].domain()[0], y[t].invert(0));
    filter[t].max = Math.min(y[t].domain()[1], y[t].invert(h));
    d.y = 0; d.dy = h;
    active = t;
    change.render();
  }
  return false;
}

/* Handle select and drag */
var handle = change.add(pv.Panel)
    .data(dims.map(function(dim) { return {y:0, dy:h, dim:dim}; }))
    .left(function(t) x(t.dim) - 30)
    .width(60)
    .fillStyle("rgba(0,0,0,.001)")
    .cursor("crosshair")
    .event("mousedown", pv.Behavior.select())
    .event("select", update)
    .event("selectend", selectAll)
  .add(pv.Bar)
    .left(25)
    .top(function(d) d.y)
    .width(10)
    .height(function(d) d.dy)
    .fillStyle(function(t) t.dim == active
        ? c[t.dim]((filter[t.dim].max + filter[t.dim].min) / 2)
        : "hsla(0,0,50%,.5)")
    .strokeStyle("white")
    .cursor("move")
    .event("mousedown", pv.Behavior.drag())
    .event("dragstart", update)
    .event("drag", update);

handle.anchor("bottom").add(pv.Label)
    .textBaseline("top")
    .text(function(d) filter[d.dim].min.toFixed(0) + units[d.dim].unit);

handle.anchor("top").add(pv.Label)
    .textBaseline("bottom")
    .text(function(d) filter[d.dim].max.toFixed(0) + units[d.dim].unit);

vis.render();

    </script>
  </div></div></body>
</html>

and the data is in cars.js which looks like:

    var cars = [
{name:"chevrolet chevelle malibu", mpg:18, cyl:8, dsp:307, hp:130, lbs:3504, acc:12, year:70, origin:1},
{name:"buick skylark 320", mpg:15, cyl:8, dsp:350, hp:165, lbs:3693, acc:11.5, year:70, origin:1},
{name:"plymouth satellite", mpg:18, cyl:8, dsp:318, hp:150, lbs:3436, acc:11, year:70, origin:1},
{name:"amc rebel sst", mpg:16, cyl:8, dsp:304, hp:150, lbs:3433, acc:12, year:70, origin:1},
{name:"ford torino", mpg:17, cyl:8, dsp:302, hp:140, lbs:3449, acc:10.5, year:70, origin:1},
{name:"ford galaxie 500", mpg:15, cyl:8, dsp:429, hp:198, lbs:4341, acc:10, year:70, origin:1},
{name:"chevrolet impala", mpg:14, cyl:8, dsp:454, hp:220, lbs:4354, acc:9, year:70, origin:1},
{name:"plymouth fury iii", mpg:14, cyl:8, dsp:440, hp:215, lbs:4312, acc:8.5, year:70, origin:1},
{name:"pontiac catalina", mpg:14, cyl:8, dsp:455, hp:225, lbs:4425, acc:10, year:70, origin:1},
{name:"amc ambassador dpl", mpg:15, cyl:8, dsp:390, hp:190, lbs:3850, acc:8.5, year:70, origin:1},
{name:"citroen ds-21 pallas", mpg:undefined, cyl:4, dsp:133, hp:115, lbs:3090, acc:17.5, year:70, origin:2},
{name:"chevrolet chevelle concours (sw)", mpg:undefined, cyl:8, dsp:350, hp:165, lbs:4142, acc:11.5, year:70, origin:1},
{name:"ford torino (sw)", mpg:undefined, cyl:8, dsp:351, hp:153, lbs:4034, acc:11, year:70, origin:1},
{name:"plymouth satellite (sw)", mpg:undefined, cyl:8, dsp:383, hp:175, lbs:4166, acc:10.5, year:70, origin:1},
{name:"amc rebel sst (sw)", mpg:undefined, cyl:8, dsp:360, hp:175, lbs:3850, acc:11, year:70, origin:1},
{name:"dodge challenger se", mpg:15, cyl:8, dsp:383, hp:170, lbs:3563, acc:10, year:70, origin:1},
{name:"plymouth 'cuda 340", mpg:14, cyl:8, dsp:340, hp:160, lbs:3609, acc:8, year:70, origin:1},
{name:"ford mustang boss 302", mpg:undefined, cyl:8, dsp:302, hp:140, lbs:3353, acc:8, year:70, origin:1},
{name:"chevrolet monte carlo", mpg:15, cyl:8, dsp:400, hp:150, lbs:3761, acc:9.5, year:70, origin:1},
{name:"buick estate wagon (sw)", mpg:14, cyl:8, dsp:455, hp:225, lbs:3086, acc:10, year:70, origin:1},
{name:"toyota corona mark ii", mpg:24, cyl:4, dsp:113, hp:95, lbs:2372, acc:15, year:70, origin:3},
{name:"plymouth duster", mpg:22, cyl:6, dsp:198, hp:95, lbs:2833, acc:15.5, year:70, origin:1},
{name:"amc hornet", mpg:18, cyl:6, dsp:199, hp:97, lbs:2774, acc:15.5, year:70, origin:1},
{name:"ford maverick", mpg:21, cyl:6, dsp:200, hp:85, lbs:2587, acc:16, year:70, origin:1},
{name:"datsun pl510", mpg:27, cyl:4, dsp:97, hp:88, lbs:2130, acc:14.5, year:70, origin:3},
{name:"volkswagen 1131 deluxe sedan", mpg:26, cyl:4, dsp:97, hp:46, lbs:1835, acc:20.5, year:70, origin:2},
{name:"peugeot 504", mpg:25, cyl:4, dsp:110, hp:87, lbs:2672, acc:17.5, year:70, origin:2},
{name:"audi 100 ls", mpg:24, cyl:4, dsp:107, hp:90, lbs:2430, acc:14.5, year:70, origin:2},
{name:"saab 99e", mpg:25, cyl:4, dsp:104, hp:95, lbs:2375, acc:17.5, year:70, origin:2},
{name:"bmw 2002", mpg:26, cyl:4, dsp:121, hp:113, lbs:2234, acc:12.5, year:70, origin:2},
{name:"amc gremlin", mpg:21, cyl:6, dsp:199, hp:90, lbs:2648, acc:15, year:70, origin:1},
{name:"ford f250", mpg:10, cyl:8, dsp:360, hp:215, lbs:4615, acc:14, year:70, origin:1},
{name:"chevy c20", mpg:10, cyl:8, dsp:307, hp:200, lbs:4376, acc:15, year:70, origin:1},
{name:"dodge d200", mpg:11, cyl:8, dsp:318, hp:210, lbs:4382, acc:13.5, year:70, origin:1},
{name:"hi 1200d", mpg:9, cyl:8, dsp:304, hp:193, lbs:4732, acc:18.5, year:70, origin:1},
{name:"datsun pl510", mpg:27, cyl:4, dsp:97, hp:88, lbs:2130, acc:14.5, year:71, origin:3},
{name:"chevrolet vega 2300", mpg:28, cyl:4, dsp:140, hp:90, lbs:2264, acc:15.5, year:71, origin:1},
{name:"toyota corona", mpg:25, cyl:4, dsp:113, hp:95, lbs:2228, acc:14, year:71, origin:3},
{name:"ford pinto", mpg:25, cyl:4, dsp:98, hp:undefined, lbs:2046, acc:19, year:71, origin:1},
{name:"volkswagen super beetle 117", mpg:undefined, cyl:4, dsp:97, hp:48, lbs:1978, acc:20, year:71, origin:2},
{name:"amc gremlin", mpg:19, cyl:6, dsp:232, hp:100, lbs:2634, acc:13, year:71, origin:1},
{name:"plymouth satellite custom", mpg:16, cyl:6, dsp:225, hp:105, lbs:3439, acc:15.5, year:71, origin:1},
{name:"chevrolet chevelle malibu", mpg:17, cyl:6, dsp:250, hp:100, lbs:3329, acc:15.5, year:71, origin:1},
{name:"ford torino 500", mpg:19, cyl:6, dsp:250, hp:88, lbs:3302, acc:15.5, year:71, origin:1},
{name:"amc matador", mpg:18, cyl:6, dsp:232, hp:100, lbs:3288, acc:15.5, year:71, origin:1},
{name:"chevrolet impala", mpg:14, cyl:8, dsp:350, hp:165, lbs:4209, acc:12, year:71, origin:1},
{name:"pontiac catalina brougham", mpg:14, cyl:8, dsp:400, hp:175, lbs:4464, acc:11.5, year:71, origin:1},
{name:"ford galaxie 500", mpg:14, cyl:8, dsp:351, hp:153, lbs:4154, acc:13.5, year:71, origin:1},
{name:"plymouth fury iii", mpg:14, cyl:8, dsp:318, hp:150, lbs:4096, acc:13, year:71, origin:1},
{name:"dodge monaco (sw)", mpg:12, cyl:8, dsp:383, hp:180, lbs:4955, acc:11.5, year:71, origin:1},
{name:"ford country squire (sw)", mpg:13, cyl:8, dsp:400, hp:170, lbs:4746, acc:12, year:71, origin:1},
{name:"pontiac safari (sw)", mpg:13, cyl:8, dsp:400, hp:175, lbs:5140, acc:12, year:71, origin:1},
{name:"amc hornet sportabout (sw)", mpg:18, cyl:6, dsp:258, hp:110, lbs:2962, acc:13.5, year:71, origin:1},
{name:"chevrolet vega (sw)", mpg:22, cyl:4, dsp:140, hp:72, lbs:2408, acc:19, year:71, origin:1},
{name:"pontiac firebird", mpg:19, cyl:6, dsp:250, hp:100, lbs:3282, acc:15, year:71, origin:1},
{name:"ford mustang", mpg:18, cyl:6, dsp:250, hp:88, lbs:3139, acc:14.5, year:71, origin:1},
{name:"mercury capri 2000", mpg:23, cyl:4, dsp:122, hp:86, lbs:2220, acc:14, year:71, origin:1},
{name:"opel 1900", mpg:28, cyl:4, dsp:116, hp:90, lbs:2123, acc:14, year:71, origin:2},
{name:"peugeot 304", mpg:30, cyl:4, dsp:79, hp:70, lbs:2074, acc:19.5, year:71, origin:2},
{name:"fiat 124b", mpg:30, cyl:4, dsp:88, hp:76, lbs:2065, acc:14.5, year:71, origin:2},
{name:"toyota corolla 1200", mpg:31, cyl:4, dsp:71, hp:65, lbs:1773, acc:19, year:71, origin:3},
{name:"datsun 1200", mpg:35, cyl:4, dsp:72, hp:69, lbs:1613, acc:18, year:71, origin:3},
{name:"volkswagen model 111", mpg:27, cyl:4, dsp:97, hp:60, lbs:1834, acc:19, year:71, origin:2},
{name:"plymouth cricket", mpg:26, cyl:4, dsp:91, hp:70, lbs:1955, acc:20.5, year:71, origin:1},
{name:"toyota corona hardtop", mpg:24, cyl:4, dsp:113, hp:95, lbs:2278, acc:15.5, year:72, origin:3},
{name:"dodge colt hardtop", mpg:25, cyl:4, dsp:97.5, hp:80, lbs:2126, acc:17, year:72, origin:1},
{name:"volkswagen type 3", mpg:23, cyl:4, dsp:97, hp:54, lbs:2254, acc:23.5, year:72, origin:2},
{name:"chevrolet vega", mpg:20, cyl:4, dsp:140, hp:90, lbs:2408, acc:19.5, year:72, origin:1},
{name:"ford pinto runabout", mpg:21, cyl:4, dsp:122, hp:86, lbs:2226, acc:16.5, year:72, origin:1},
{name:"chevrolet impala", mpg:13, cyl:8, dsp:350, hp:165, lbs:4274, acc:12, year:72, origin:1},
{name:"pontiac catalina", mpg:14, cyl:8, dsp:400, hp:175, lbs:4385, acc:12, year:72, origin:1},
{name:"plymouth fury iii", mpg:15, cyl:8, dsp:318, hp:150, lbs:4135, acc:13.5, year:72, origin:1},
{name:"ford galaxie 500", mpg:14, cyl:8, dsp:351, hp:153, lbs:4129, acc:13, year:72, origin:1},
{name:"amc ambassador sst", mpg:17, cyl:8, dsp:304, hp:150, lbs:3672, acc:11.5, year:72, origin:1},
{name:"mercury marquis", mpg:11, cyl:8, dsp:429, hp:208, lbs:4633, acc:11, year:72, origin:1},
{name:"buick lesabre custom", mpg:13, cyl:8, dsp:350, hp:155, lbs:4502, acc:13.5, year:72, origin:1},
{name:"oldsmobile delta 88 royale", mpg:12, cyl:8, dsp:350, hp:160, lbs:4456, acc:13.5, year:72, origin:1},
{name:"chrysler newport royal", mpg:13, cyl:8, dsp:400, hp:190, lbs:4422, acc:12.5, year:72, origin:1},
{name:"mazda rx2 coupe", mpg:19, cyl:3, dsp:70, hp:97, lbs:2330, acc:13.5, year:72, origin:3},
{name:"amc matador (sw)", mpg:15, cyl:8, dsp:304, hp:150, lbs:3892, acc:12.5, year:72, origin:1},
{name:"chevrolet chevelle concours (sw)", mpg:13, cyl:8, dsp:307, hp:130, lbs:4098, acc:14, year:72, origin:1},
{name:"ford gran torino (sw)", mpg:13, cyl:8, dsp:302, hp:140, lbs:4294, acc:16, year:72, origin:1},
{name:"plymouth satellite custom (sw)", mpg:14, cyl:8, dsp:318, hp:150, lbs:4077, acc:14, year:72, origin:1},
{name:"volvo 145e (sw)", mpg:18, cyl:4, dsp:121, hp:112, lbs:2933, acc:14.5, year:72, origin:2},
{name:"volkswagen 411 (sw)", mpg:22, cyl:4, dsp:121, hp:76, lbs:2511, acc:18, year:72, origin:2},
{name:"peugeot 504 (sw)", mpg:21, cyl:4, dsp:120, hp:87, lbs:2979, acc:19.5, year:72, origin:2},
{name:"renault 12 (sw)", mpg:26, cyl:4, dsp:96, hp:69, lbs:2189, acc:18, year:72, origin:2},
{name:"ford pinto (sw)", mpg:22, cyl:4, dsp:122, hp:86, lbs:2395, acc:16, year:72, origin:1},
{name:"datsun 510 (sw)", mpg:28, cyl:4, dsp:97, hp:92, lbs:2288, acc:17, year:72, origin:3},
{name:"toyouta corona mark ii (sw)", mpg:23, cyl:4, dsp:120, hp:97, lbs:2506, acc:14.5, year:72, origin:3},
{name:"dodge colt (sw)", mpg:28, cyl:4, dsp:98, hp:80, lbs:2164, acc:15, year:72, origin:1},
{name:"toyota corolla 1600 (sw)", mpg:27, cyl:4, dsp:97, hp:88, lbs:2100, acc:16.5, year:72, origin:3},
{name:"buick century 350", mpg:13, cyl:8, dsp:350, hp:175, lbs:4100, acc:13, year:73, origin:1},
{name:"amc matador", mpg:14, cyl:8, dsp:304, hp:150, lbs:3672, acc:11.5, year:73, origin:1},
{name:"chevrolet malibu", mpg:13, cyl:8, dsp:350, hp:145, lbs:3988, acc:13, year:73, origin:1},
{name:"ford gran torino", mpg:14, cyl:8, dsp:302, hp:137, lbs:4042, acc:14.5, year:73, origin:1},
{name:"dodge coronet custom", mpg:15, cyl:8, dsp:318, hp:150, lbs:3777, acc:12.5, year:73, origin:1},
{name:"mercury marquis brougham", mpg:12, cyl:8, dsp:429, hp:198, lbs:4952, acc:11.5, year:73, origin:1},
{name:"chevrolet caprice classic", mpg:13, cyl:8, dsp:400, hp:150, lbs:4464, acc:12, year:73, origin:1},
{name:"ford ltd", mpg:13, cyl:8, dsp:351, hp:158, lbs:4363, acc:13, year:73, origin:1},
{name:"plymouth fury gran sedan", mpg:14, cyl:8, dsp:318, hp:150, lbs:4237, acc:14.5, year:73, origin:1},
{name:"chrysler new yorker brougham", mpg:13, cyl:8, dsp:440, hp:215, lbs:4735, acc:11, year:73, origin:1},
{name:"buick electra 225 custom", mpg:12, cyl:8, dsp:455, hp:225, lbs:4951, acc:11, year:73, origin:1},
{name:"amc ambassador brougham", mpg:13, cyl:8, dsp:360, hp:175, lbs:3821, acc:11, year:73, origin:1},
{name:"plymouth valiant", mpg:18, cyl:6, dsp:225, hp:105, lbs:3121, acc:16.5, year:73, origin:1},
{name:"chevrolet nova custom", mpg:16, cyl:6, dsp:250, hp:100, lbs:3278, acc:18, year:73, origin:1},
{name:"amc hornet", mpg:18, cyl:6, dsp:232, hp:100, lbs:2945, acc:16, year:73, origin:1},
{name:"ford maverick", mpg:18, cyl:6, dsp:250, hp:88, lbs:3021, acc:16.5, year:73, origin:1},
{name:"plymouth duster", mpg:23, cyl:6, dsp:198, hp:95, lbs:2904, acc:16, year:73, origin:1},
{name:"volkswagen super beetle", mpg:26, cyl:4, dsp:97, hp:46, lbs:1950, acc:21, year:73, origin:2},
{name:"chevrolet impala", mpg:11, cyl:8, dsp:400, hp:150, lbs:4997, acc:14, year:73, origin:1},
{name:"ford country", mpg:12, cyl:8, dsp:400, hp:167, lbs:4906, acc:12.5, year:73, origin:1},
{name:"plymouth custom suburb", mpg:13, cyl:8, dsp:360, hp:170, lbs:4654, acc:13, year:73, origin:1},
{name:"oldsmobile vista cruiser", mpg:12, cyl:8, dsp:350, hp:180, lbs:4499, acc:12.5, year:73, origin:1},
{name:"amc gremlin", mpg:18, cyl:6, dsp:232, hp:100, lbs:2789, acc:15, year:73, origin:1},
{name:"toyota carina", mpg:20, cyl:4, dsp:97, hp:88, lbs:2279, acc:19, year:73, origin:3},
{name:"chevrolet vega", mpg:21, cyl:4, dsp:140, hp:72, lbs:2401, acc:19.5, year:73, origin:1},
{name:"datsun 610", mpg:22, cyl:4, dsp:108, hp:94, lbs:2379, acc:16.5, year:73, origin:3},
{name:"maxda rx3", mpg:18, cyl:3, dsp:70, hp:90, lbs:2124, acc:13.5, year:73, origin:3},
{name:"ford pinto", mpg:19, cyl:4, dsp:122, hp:85, lbs:2310, acc:18.5, year:73, origin:1},
{name:"mercury capri v6", mpg:21, cyl:6, dsp:155, hp:107, lbs:2472, acc:14, year:73, origin:1},
   {name:"toyota corona", mpg:31, cyl:4, dsp:76, hp:52, lbs:1649, acc:16.5, year:74, origin:3},
{name:"datsun 710", mpg:32, cyl:4, dsp:83, hp:61, lbs:2003, acc:19, year:74, origin:3},
{name:"dodge colt", mpg:28, cyl:4, dsp:90, hp:75, lbs:2125, acc:14.5, year:74, origin:1},
{name:"fiat 128", mpg:24, cyl:4, dsp:90, hp:75, lbs:2108, acc:15.5, year:74, origin:2},
{name:"fiat 124 tc", mpg:26, cyl:4, dsp:116, hp:75, lbs:2246, acc:14, year:74, origin:2},
{name:"honda civic", mpg:24, cyl:4, dsp:120, hp:97, lbs:2489, acc:15, year:74, origin:3},
{name:"subaru", mpg:26, cyl:4, dsp:108, hp:93, lbs:2391, acc:15.5, year:74, origin:3},
{name:"fiat x1.9", mpg:31, cyl:4, dsp:79, hp:67, lbs:2000, acc:16, year:74, origin:2},
{name:"plymouth valiant custom", mpg:19, cyl:6, dsp:225, hp:95, lbs:3264, acc:16, year:75, origin:1},
    {name:"buick skylark", mpg:20.5, cyl:6, dsp:231, hp:105, lbs:3425, acc:16.9, year:77, origin:1},
{name:"plymouth volare custom", mpg:19, cyl:6, dsp:225, hp:100, lbs:3630, acc:17.7, year:77, origin:1},
{name:"ford granada", mpg:18.5, cyl:6, dsp:250, hp:98, lbs:3525, acc:19, year:77, origin:1},
{name:"pontiac grand prix lj", mpg:16, cyl:8, dsp:400, hp:180, lbs:4220, acc:11.1, year:77, origin:1},
{name:"chevrolet monte carlo landau", mpg:15.5, cyl:8, dsp:350, hp:170, lbs:4165, acc:11.4, year:77, origin:1},
{name:"chrysler cordoba", mpg:15.5, cyl:8, dsp:400, hp:190, lbs:4325, acc:12.2, year:77, origin:1},
{name:"ford thunderbird", mpg:16, cyl:8, dsp:351, hp:149, lbs:4335, acc:14.5, year:77, origin:1},
{name:"volkswagen rabbit custom", mpg:29, cyl:4, dsp:97, hp:78, lbs:1940, acc:14.5, year:77, origin:2},
{name:"pontiac sunbird coupe", mpg:24.5, cyl:4, dsp:151, hp:88, lbs:2740, acc:16, year:77, origin:1},
{name:"toyota corolla liftback", mpg:26, cyl:4, dsp:97, hp:75, lbs:2265, acc:18.2, year:77, origin:3},
{name:"ford mustang ii 2+2", mpg:25.5, cyl:4, dsp:140, hp:89, lbs:2755, acc:15.8, year:77, origin:1},
{name:"chevrolet chevette", mpg:30.5, cyl:4, dsp:98, hp:63, lbs:2051, acc:17, year:77, origin:1},
{name:"dodge colt m/m", mpg:33.5, cyl:4, dsp:98, hp:83, lbs:2075, acc:15.9, year:77, origin:1},
{name:"subaru dl", mpg:30, cyl:4, dsp:97, hp:67, lbs:1985, acc:16.4, year:77, origin:3},
{name:"volkswagen dasher", mpg:30.5, cyl:4, dsp:97, hp:78, lbs:2190, acc:14.1, year:77, origin:2},
{name:"datsun 810", mpg:22, cyl:6, dsp:146, hp:97, lbs:2815, acc:14.5, year:77, origin:3},
{name:"bmw 320i", mpg:21.5, cyl:4, dsp:121, hp:110, lbs:2600, acc:12.8, year:77, origin:2},
{name:"mazda rx-4", mpg:21.5, cyl:3, dsp:80, hp:110, lbs:2720, acc:13.5, year:77, origin:3},
{name:"volkswagen rabbit custom diesel", mpg:43.1, cyl:4, dsp:90, hp:48, lbs:1985, acc:21.5, year:78, origin:2},
{name:"ford fiesta", mpg:36.1, cyl:4, dsp:98, hp:66, lbs:1800, acc:14.4, year:78, origin:1},
{name:"mazda glc deluxe", mpg:32.8, cyl:4, dsp:78, hp:52, lbs:1985, acc:19.4, year:78, origin:3},
{name:"datsun b210 gx", mpg:39.4, cyl:4, dsp:85, hp:70, lbs:2070, acc:18.6, year:78, origin:3},
{name:"honda civic cvcc", mpg:36.1, cyl:4, dsp:91, hp:60, lbs:1800, acc:16.4, year:78, origin:3},
{name:"oldsmobile cutlass salon brougham", mpg:19.9, cyl:8, dsp:260, hp:110, lbs:3365, acc:15.5, year:78, origin:1},
{name:"dodge diplomat", mpg:19.4, cyl:8, dsp:318, hp:140, lbs:3735, acc:13.2, year:78, origin:1},
{name:"mercury monarch ghia", mpg:20.2, cyl:8, dsp:302, hp:139, lbs:3570, acc:12.8, year:78, origin:1},
{name:"pontiac phoenix lj", mpg:19.2, cyl:6, dsp:231, hp:105, lbs:3535, acc:19.2, year:78, origin:1},
{name:"chevrolet malibu", mpg:20.5, cyl:6, dsp:200, hp:95, lbs:3155, acc:18.2, year:78, origin:1},
{name:"ford fairmont (auto)", mpg:20.2, cyl:6, dsp:200, hp:85, lbs:2965, acc:15.8, year:78, origin:1},
{name:"ford fairmont (man)", mpg:25.1, cyl:4, dsp:140, hp:88, lbs:2720, acc:15.4, year:78, origin:1},
{name:"plymouth volare", mpg:20.5, cyl:6, dsp:225, hp:100, lbs:3430, acc:17.2, year:78, origin:1},
{name:"amc concord", mpg:19.4, cyl:6, dsp:232, hp:90, lbs:3210, acc:17.2, year:78, origin:1},
{name:"buick century special", mpg:20.6, cyl:6, dsp:231, hp:105, lbs:3380, acc:15.8, year:78, origin:1},
{name:"mercury zephyr", mpg:20.8, cyl:6, dsp:200, hp:85, lbs:3070, acc:16.7, year:78, origin:1},
{name:"dodge aspen", mpg:18.6, cyl:6, dsp:225, hp:110, lbs:3620, acc:18.7, year:78, origin:1},
{name:"amc concord d/l", mpg:18.1, cyl:6, dsp:258, hp:120, lbs:3410, acc:15.1, year:78, origin:1},
{name:"chevrolet monte carlo landau", mpg:19.2, cyl:8, dsp:305, hp:145, lbs:3425, acc:13.2, year:78, origin:1},
{name:"buick regal sport coupe (turbo)", mpg:17.7, cyl:6, dsp:231, hp:165, lbs:3445, acc:13.4, year:78, origin:1},
{name:"ford futura", mpg:18.1, cyl:8, dsp:302, hp:139, lbs:3205, acc:11.2, year:78, origin:1},
{name:"dodge magnum xe", mpg:17.5, cyl:8, dsp:318, hp:140, lbs:4080, acc:13.7, year:78, origin:1},
{name:"chevrolet chevette", mpg:30, cyl:4, dsp:98, hp:68, lbs:2155, acc:16.5, year:78, origin:1},
{name:"toyota corona", mpg:27.5, cyl:4, dsp:134, hp:95, lbs:2560, acc:14.2, year:78, origin:3},
{name:"datsun 510", mpg:27.2, cyl:4, dsp:119, hp:97, lbs:2300, acc:14.7, year:78, origin:3},
{name:"dodge omni", mpg:30.9, cyl:4, dsp:105, hp:75, lbs:2230, acc:14.5, year:78, origin:1},
{name:"toyota celica gt liftback", mpg:21.1, cyl:4, dsp:134, hp:95, lbs:2515, acc:14.8, year:78, origin:3},
{name:"plymouth sapporo", mpg:23.2, cyl:4, dsp:156, hp:105, lbs:2745, acc:16.7, year:78, origin:1},
{name:"oldsmobile starfire sx", mpg:23.8, cyl:4, dsp:151, hp:85, lbs:2855, acc:17.6, year:78, origin:1},
{name:"datsun 200-sx", mpg:23.9, cyl:4, dsp:119, hp:97, lbs:2405, acc:14.9, year:78, origin:3},
{name:"audi 5000", mpg:20.3, cyl:5, dsp:131, hp:103, lbs:2830, acc:15.9, year:78, origin:2},
{name:"volvo 264gl", mpg:17, cyl:6, dsp:163, hp:125, lbs:3140, acc:13.6, year:78, origin:2},
{name:"saab 99gle", mpg:21.6, cyl:4, dsp:121, hp:115, lbs:2795, acc:15.7, year:78, origin:2},
{name:"peugeot 604sl", mpg:16.2, cyl:6, dsp:163, hp:133, lbs:3410, acc:15.8, year:78, origin:2},
{name:"chevrolet cavalier", mpg:28, cyl:4, dsp:112, hp:88, lbs:2605, acc:19.6, year:82, origin:1},
{name:"chevrolet cavalier wagon", mpg:27, cyl:4, dsp:112, hp:88, lbs:2640, acc:18.6, year:82, origin:1},
{name:"chevrolet cavalier 2-door", mpg:34, cyl:4, dsp:112, hp:88, lbs:2395, acc:18, year:82, origin:1},
{name:"pontiac j2000 se hatchback", mpg:31, cyl:4, dsp:112, hp:85, lbs:2575, acc:16.2, year:82, origin:1},
{name:"dodge aries se", mpg:29, cyl:4, dsp:135, hp:84, lbs:2525, acc:16, year:82, origin:1},
{name:"pontiac phoenix", mpg:27, cyl:4, dsp:151, hp:90, lbs:2735, acc:18, year:82, origin:1},
{name:"ford fairmont futura", mpg:24, cyl:4, dsp:140, hp:92, lbs:2865, acc:16.4, year:82, origin:1},
{name:"amc concord dl", mpg:23, cyl:4, dsp:151, hp:undefined, lbs:3035, acc:20.5, year:82, origin:1},
{name:"volkswagen rabbit l", mpg:36, cyl:4, dsp:105, hp:74, lbs:1980, acc:15.3, year:82, origin:2},
{name:"mazda glc custom l", mpg:37, cyl:4, dsp:91, hp:68, lbs:2025, acc:18.2, year:82, origin:3},
{name:"mazda glc custom", mpg:31, cyl:4, dsp:91, hp:68, lbs:1970, acc:17.6, year:82, origin:3},
{name:"plymouth horizon miser", mpg:38, cyl:4, dsp:105, hp:63, lbs:2125, acc:14.7, year:82, origin:1},
{name:"mercury lynx l", mpg:36, cyl:4, dsp:98, hp:70, lbs:2125, acc:17.3, year:82, origin:1},
{name:"nissan stanza xe", mpg:36, cyl:4, dsp:120, hp:88, lbs:2160, acc:14.5, year:82, origin:3},
{name:"honda accord", mpg:36, cyl:4, dsp:107, hp:75, lbs:2205, acc:14.5, year:82, origin:3},
{name:"toyota corolla", mpg:34, cyl:4, dsp:108, hp:70, lbs:2245, acc:16.9, year:82, origin:3},
{name:"honda civic", mpg:38, cyl:4, dsp:91, hp:67, lbs:1965, acc:15, year:82, origin:3},
{name:"honda civic (auto)", mpg:32, cyl:4, dsp:91, hp:67, lbs:1965, acc:15.7, year:82, origin:3},
{name:"datsun 310 gx", mpg:38, cyl:4, dsp:91, hp:67, lbs:1995, acc:16.2, year:82, origin:3},
{name:"buick century limited", mpg:25, cyl:6, dsp:181, hp:110, lbs:2945, acc:16.4, year:82, origin:1},
{name:"oldsmobile cutlass ciera (diesel)", mpg:38, cyl:6, dsp:262, hp:85, lbs:3015, acc:17, year:82, origin:1},
{name:"chrysler lebaron medallion", mpg:26, cyl:4, dsp:156, hp:92, lbs:2585, acc:14.5, year:82, origin:1},
{name:"ford granada l", mpg:22, cyl:6, dsp:232, hp:112, lbs:2835, acc:14.7, year:82, origin:1},
{name:"toyota celica gt", mpg:32, cyl:4, dsp:144, hp:96, lbs:2665, acc:13.9, year:82, origin:3},
{name:"dodge charger 2.2", mpg:36, cyl:4, dsp:135, hp:84, lbs:2370, acc:13, year:82, origin:1},
{name:"chevrolet camaro", mpg:27, cyl:4, dsp:151, hp:90, lbs:2950, acc:17.3, year:82, origin:1},
{name:"ford mustang gl", mpg:27, cyl:4, dsp:140, hp:86, lbs:2790, acc:15.6, year:82, origin:1},
{name:"vw pickup", mpg:44, cyl:4, dsp:97, hp:52, lbs:2130, acc:24.6, year:82, origin:2},
{name:"dodge rampage", mpg:32, cyl:4, dsp:135, hp:84, lbs:2295, acc:11.6, year:82, origin:1},
{name:"ford ranger", mpg:28, cyl:4, dsp:120, hp:79, lbs:2625, acc:18.6, year:82, origin:1},
{name:"chevy s-10", mpg:31, cyl:4, dsp:119, hp:82, lbs:2720, acc:19.4, year:82, origin:1}
];
0

There are 0 answers