Commit bcb7dc47 by Danyel Fisher

demo tweaks based on dom's updates

parent 304b05d5
npm-debug.log
node_modules/**
\ No newline at end of file
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<script src="node_modules/vega-lite/build/vega-lite.js"></script> <script src="node_modules/vega-lite/build/vega-lite.js"></script>
<script src="node_modules/vega-embed/vega-embed.js"></script>--> <script src="node_modules/vega-embed/vega-embed.js"></script>-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega/3.0.5/vega.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/vega/3.0.7/vega.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega-lite/2.0.0-rc3/vega-lite.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/vega-lite/2.0.0-rc5/vega-lite.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega-embed/3.0.0-beta.20/vega-embed.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/vega-embed/3.0.0-rc6/vega-embed.js"></script>
</head> </head>
<body> <body>
<div id="header"> <div id="header">
......
...@@ -47,10 +47,8 @@ function load(name) { ...@@ -47,10 +47,8 @@ function load(name) {
} }
} }
vega.embed('#view', './spec/' + name, {renderer: renderType}).then(function(res) { vegaEmbed('#view', './spec/' + name, {renderer: renderType}).then(function(res) {
view = res.view; view = res.view;
current = name; current = name;
}).catch(function(err) { }).catch( console.error );
console.error(err);
});
} }
{ {
"dependencies": { "dependencies": {
"vega": "^3.0.5", "vega": "^3.0.7",
"vega-embed": "^3.0.0-beta.20", "vega-embed": "^3.0.0-rc6",
"vega-lite": "2" "vega-lite": "^2.0.0-rc5"
}, },
"scripts": { "scripts": {
"start": "python -m SimpleHTTPServer 8005", "start": "python -m SimpleHTTPServer 8005",
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"brush": { "brush": {
"type": "interval", "type": "interval",
"encodings": ["y"], "encodings": ["y"],
"resolve": "intersect_others" "resolve": "intersect"
} }
}, },
"encoding": { "encoding": {
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
"type": "ordinal", "type": "ordinal",
"sort": { "sort": {
"op": "min", "op": "min",
"field": "Population_ages_15_64_of_total", "field": { "repeat":"column"},
"order": "descending" "order": "descending"
} }
}, },
"x": { "x": {
"field": "Population_ages_15_64_of_total", "field": { "repeat": "column"},
"type": "quantitative" "type": "quantitative"
}, },
"color": { "color": {
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
"selection": { "selection": {
"brush": { "brush": {
"type": "interval", "type": "interval",
"resolve": "intersect_others" "resolve": "intersect"
} }
}, },
"encoding": { "encoding": {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"mark": "bar", "mark": "bar",
"encoding": { "encoding": {
"x": {"bin": true, "field": "curb-weight", "type": "quantitative", "axis": {"title": "Curb Weight"}}, "x": {"bin": true, "field": "curb-weight", "type": "quantitative", "axis": {"title": "Curb Weight"}},
"y": { "aggregate": "count", "field": "*", "type": "quantitative", "stack": "none"}, "y": { "aggregate": "count", "type": "quantitative", "stack": null},
"column": {"field": "body-style", "type": "nominal", "header": {"title": "Body Style"}} "column": {"field": "body-style", "type": "nominal", "header": {"title": "Body Style"}}
} }
} }
\ No newline at end of file
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
"data": { "url": "data/cars.csv" }, "data": { "url": "data/cars.csv" },
"mark": "bar", "mark": "bar",
"encoding": { "encoding": {
"column": {"field": "body-style", "type": "nominal", "axis": {"title": "Body Style"}}, "column": {"field": "body-style", "type": "nominal", "header": {"title": "Body Style"}},
"x": {"field": "city-mpg", "type": "quantitative", "bin": true, "title": "City MPG"}, "x": {"field": "city-mpg", "type": "quantitative", "bin": true, "axis":{"title": "City MPG"}},
"y": {"field": "*", "type": "quantitative", "aggregate": "count"} "y": {"type": "quantitative", "aggregate": "count"}
} }
} }
\ No newline at end of file
{ {
"$schema": "https://vega.github.io/schema/vega-lite/v2.json", "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"config": {"background":"#ffffff"},
"data": { "url": "data/cars.csv" }, "data": { "url": "data/cars.csv" },
"mark": "rect", "mark": "rect",
"encoding": { "encoding": {
"x": {"field": "make", "type": "nominal", "axis": {"title": "Make"}}, "x": {"field": "make", "type": "nominal", "axis": {"title": "Make"}},
"y": {"field": "body-style", "type": "nominal", "axis": {"title": "Body Style"}}, "y": {"field": "body-style", "type": "nominal", "axis": {"title": "Body Style"}},
"color": {"aggregate": "count", "field": "*", "type": "quantitative"} "color": {"aggregate": "count", "type": "quantitative"}
}, },
"config": { "config": {
"background":"#ffffff",
"range": { "range": {
"heatmap": { "heatmap": {
"scheme": "greenblue" "scheme": "greenblue"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"encoding": { "encoding": {
"y": {"field": "curb-weight", "bin": true, "type": "quantitative", "axis": {"title": "Curb Weight"}}, "y": {"field": "curb-weight", "bin": true, "type": "quantitative", "axis": {"title": "Curb Weight"}},
"x": {"field": "city-mpg", "bin": true, "type": "quantitative", "axis": {"title": "City MPG"}}, "x": {"field": "city-mpg", "bin": true, "type": "quantitative", "axis": {"title": "City MPG"}},
"color": {"aggregate": "count", "field": "*", "type": "quantitative"} "color": {"aggregate": "count", "type": "quantitative"}
}, },
"config": { "config": {
"range": { "range": {
......
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
"field": "Date received", "field": "Date received",
"type": "temporal", "type": "temporal",
"timeUnit":"yearmonth"}, "timeUnit":"yearmonth"},
"color": {"field": "*", "aggregate": "count", "type": "quantitative"} "color": {"aggregate": "count", "type": "quantitative"}
} }
} }
{ {
"$schema": "https://vega.github.io/schema/vega-lite/v2.json", "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"config": {"background":"#ffffff"}, "config": {"background":"#ffffff"},
"width": 600,
"data": {"url": "data/complaints.csv", "format": {"type": "csv"}}, "data": {"url": "data/complaints.csv", "format": {"type": "csv"}},
"mark": "line", "mark": "line",
"encoding": { "encoding": {
"x": {"timeUnit": "yearmonth", "field": "Date received", "type": "temporal"}, "x": {"timeUnit": "yearmonth", "field": "Date received", "type": "temporal"},
"y": {"field": "*", "aggregate": "count", "type": "quantitative"} "y": {"aggregate": "count", "type": "quantitative"}
} }
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"timeUnit": "yearmonth", "field": "Date received", "type": "temporal", "timeUnit": "yearmonth", "field": "Date received", "type": "temporal",
"axis": {"title": "Date Received"} "axis": {"title": "Date Received"}
}, },
"y": {"field": "*", "aggregate": "count", "type": "quantitative"}, "y": { "aggregate": "count", "type": "quantitative"},
"color": {"field": "Product", "type": "nominal"} "color": {"field": "Product", "type": "nominal"}
} }
} }
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
"calculate": "indexof(datum['Company response to consumer'], 'relief') >= 0" "calculate": "indexof(datum['Company response to consumer'], 'relief') >= 0"
}], }],
"encoding": { "encoding": {
"column": {"field": "Product", "type": "nominal", "axis": {"labels": false}}, "column": {"field": "Product", "type": "nominal", "header": {"title": ""}},
"y": {"aggregate": "count", "field": "*", "type": "quantitative"}, "y": {"aggregate": "count", "type": "quantitative"},
"x": {"field": "relief", "type": "nominal"}, "x": {"field": "relief", "type": "nominal"},
"color": {"field": "Product", "type": "nominal"} "color": {"field": "Product", "type": "nominal"}
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
}], }],
"encoding": { "encoding": {
"column": {"field": "relief", "type": "nominal" }, "column": {"field": "relief", "type": "nominal" },
"y": {"aggregate": "count", "field": "*", "type": "quantitative"}, "y": {"aggregate": "count", "type": "quantitative"},
"x": {"field": "Product", "type": "nominal", "axis": {"labels": false}}, "x": {"field": "Product", "type": "nominal", "axis": {"labels": false}},
"color": {"field": "Product", "type": "nominal"} "color": {"field": "Product", "type": "nominal"}
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
}], }],
"encoding": { "encoding": {
"y": {"field": "Product", "type": "nominal"}, "y": {"field": "Product", "type": "nominal"},
"x": {"aggregate": "count", "field": "*", "type": "quantitative"}, "x": {"aggregate": "count", "type": "quantitative"},
"color": {"field": "relief", "type": "nominal"} "color": {"field": "relief", "type": "nominal"}
} }
} }
...@@ -17,6 +17,6 @@ ...@@ -17,6 +17,6 @@
"order": "descending" "order": "descending"
} }
}, },
"y": {"field": "*", "type": "quantitative", "aggregate": "count"} "y": { "type": "quantitative", "aggregate": "count"}
} }
} }
\ No newline at end of file
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
"mark": "bar", "mark": "bar",
"encoding": { "encoding": {
"x": {"field": "city-mpg", "type": "quantitative", "bin": true, "axis": {"title": "City MPG"}}, "x": {"field": "city-mpg", "type": "quantitative", "bin": true, "axis": {"title": "City MPG"}},
"y": {"field": "*", "type": "quantitative", "aggregate": "count"} "y": { "type": "quantitative", "aggregate": "count"}
} }
} }
\ No newline at end of file
{ {
"$schema": "https://vega.github.io/schema/vega-lite/v2.json", "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"config": {"background":"#ffffff"}, "config": {"background":"#ffffff"},
"width": 600,
"height": 100,
"data": {"url": "data/complaints.csv", "format": {"type": "csv"}}, "data": {"url": "data/complaints.csv", "format": {"type": "csv"}},
"mark": "line", "mark": "line",
"encoding": { "encoding": {
...@@ -8,7 +10,7 @@ ...@@ -8,7 +10,7 @@
"timeUnit": "yearmonth", "field": "Date received", "type": "temporal", "timeUnit": "yearmonth", "field": "Date received", "type": "temporal",
"axis": {"title": "Date Received"} "axis": {"title": "Date Received"}
}, },
"y": {"field": "*", "aggregate": "count", "type": "quantitative"}, "y": { "aggregate": "count", "type": "quantitative"},
"row": {"field": "Product", "type": "nominal"} "row": {"field": "Product", "type": "nominal"}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment