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 @@
<script src="node_modules/vega-lite/build/vega-lite.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-lite/2.0.0-rc3/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/3.0.7/vega.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-rc6/vega-embed.js"></script>
</head>
<body>
<div id="header">
......
......@@ -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;
current = name;
}).catch(function(err) {
console.error(err);
});
}).catch( console.error );
}
{
"dependencies": {
"vega": "^3.0.5",
"vega-embed": "^3.0.0-beta.20",
"vega-lite": "2"
"vega": "^3.0.7",
"vega-embed": "^3.0.0-rc6",
"vega-lite": "^2.0.0-rc5"
},
"scripts": {
"start": "python -m SimpleHTTPServer 8005",
......
......@@ -14,7 +14,7 @@
"brush": {
"type": "interval",
"encodings": ["y"],
"resolve": "intersect_others"
"resolve": "intersect"
}
},
"encoding": {
......@@ -23,12 +23,12 @@
"type": "ordinal",
"sort": {
"op": "min",
"field": "Population_ages_15_64_of_total",
"field": { "repeat":"column"},
"order": "descending"
}
},
"x": {
"field": "Population_ages_15_64_of_total",
"field": { "repeat": "column"},
"type": "quantitative"
},
"color": {
......@@ -45,7 +45,7 @@
"selection": {
"brush": {
"type": "interval",
"resolve": "intersect_others"
"resolve": "intersect"
}
},
"encoding": {
......
......@@ -5,7 +5,7 @@
"mark": "bar",
"encoding": {
"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"}}
}
}
\ No newline at end of file
......@@ -4,8 +4,8 @@
"data": { "url": "data/cars.csv" },
"mark": "bar",
"encoding": {
"column": {"field": "body-style", "type": "nominal", "axis": {"title": "Body Style"}},
"x": {"field": "city-mpg", "type": "quantitative", "bin": true, "title": "City MPG"},
"y": {"field": "*", "type": "quantitative", "aggregate": "count"}
"column": {"field": "body-style", "type": "nominal", "header": {"title": "Body Style"}},
"x": {"field": "city-mpg", "type": "quantitative", "bin": true, "axis":{"title": "City MPG"}},
"y": {"type": "quantitative", "aggregate": "count"}
}
}
\ No newline at end of file
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"config": {"background":"#ffffff"},
"data": { "url": "data/cars.csv" },
"mark": "rect",
"encoding": {
"x": {"field": "make", "type": "nominal", "axis": {"title": "Make"}},
"y": {"field": "body-style", "type": "nominal", "axis": {"title": "Body Style"}},
"color": {"aggregate": "count", "field": "*", "type": "quantitative"}
"color": {"aggregate": "count", "type": "quantitative"}
},
"config": {
"background":"#ffffff",
"range": {
"heatmap": {
"scheme": "greenblue"
......
......@@ -6,7 +6,7 @@
"encoding": {
"y": {"field": "curb-weight", "bin": true, "type": "quantitative", "axis": {"title": "Curb Weight"}},
"x": {"field": "city-mpg", "bin": true, "type": "quantitative", "axis": {"title": "City MPG"}},
"color": {"aggregate": "count", "field": "*", "type": "quantitative"}
"color": {"aggregate": "count", "type": "quantitative"}
},
"config": {
"range": {
......
......@@ -16,6 +16,6 @@
"field": "Date received",
"type": "temporal",
"timeUnit":"yearmonth"},
"color": {"field": "*", "aggregate": "count", "type": "quantitative"}
"color": {"aggregate": "count", "type": "quantitative"}
}
}
{
"$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"}},
"mark": "line",
"encoding": {
"x": {"timeUnit": "yearmonth", "field": "Date received", "type": "temporal"},
"y": {"field": "*", "aggregate": "count", "type": "quantitative"}
"y": {"aggregate": "count", "type": "quantitative"}
}
}
......@@ -8,7 +8,7 @@
"timeUnit": "yearmonth", "field": "Date received", "type": "temporal",
"axis": {"title": "Date Received"}
},
"y": {"field": "*", "aggregate": "count", "type": "quantitative"},
"y": { "aggregate": "count", "type": "quantitative"},
"color": {"field": "Product", "type": "nominal"}
}
}
......@@ -8,8 +8,8 @@
"calculate": "indexof(datum['Company response to consumer'], 'relief') >= 0"
}],
"encoding": {
"column": {"field": "Product", "type": "nominal", "axis": {"labels": false}},
"y": {"aggregate": "count", "field": "*", "type": "quantitative"},
"column": {"field": "Product", "type": "nominal", "header": {"title": ""}},
"y": {"aggregate": "count", "type": "quantitative"},
"x": {"field": "relief", "type": "nominal"},
"color": {"field": "Product", "type": "nominal"}
}
......
......@@ -9,7 +9,7 @@
}],
"encoding": {
"column": {"field": "relief", "type": "nominal" },
"y": {"aggregate": "count", "field": "*", "type": "quantitative"},
"y": {"aggregate": "count", "type": "quantitative"},
"x": {"field": "Product", "type": "nominal", "axis": {"labels": false}},
"color": {"field": "Product", "type": "nominal"}
}
......
......@@ -9,7 +9,7 @@
}],
"encoding": {
"y": {"field": "Product", "type": "nominal"},
"x": {"aggregate": "count", "field": "*", "type": "quantitative"},
"x": {"aggregate": "count", "type": "quantitative"},
"color": {"field": "relief", "type": "nominal"}
}
}
......@@ -17,6 +17,6 @@
"order": "descending"
}
},
"y": {"field": "*", "type": "quantitative", "aggregate": "count"}
"y": { "type": "quantitative", "aggregate": "count"}
}
}
\ No newline at end of file
......@@ -5,6 +5,6 @@
"mark": "bar",
"encoding": {
"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",
"config": {"background":"#ffffff"},
"width": 600,
"height": 100,
"data": {"url": "data/complaints.csv", "format": {"type": "csv"}},
"mark": "line",
"encoding": {
......@@ -8,7 +10,7 @@
"timeUnit": "yearmonth", "field": "Date received", "type": "temporal",
"axis": {"title": "Date Received"}
},
"y": {"field": "*", "aggregate": "count", "type": "quantitative"},
"y": { "aggregate": "count", "type": "quantitative"},
"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