Published
Edited
Nov 4, 2020
Insert cell
md`# lesson 6.2`
Insert cell
viewof dia = embed(vega_gold)
Insert cell
vega_gold = {
let obj = {
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"title" : {
"fontSize" : 24,
"anchor" : "start",
"text" : "Gold Prices over time"
},
"width" : 800,
"height" : 600
}
//data
obj.data = {
"values" : gold_fixed
};
obj.mark = "line"
obj.encoding = {
"color": {"value": "#761944"},
"x": {"field": "date", "type": "temporal" , "title" : "Year"},
"y": {"field": "price",
"type": "quantitative" ,
"title" : "Price, $" ,
"axis" : {
"format" : "f",
"tickCount": 5
}
}
}

return obj;
}
Insert cell
Insert cell
embed = require("vega-embed@6")
Insert cell
import {gold_fixed} from "@glebtr/vega-start"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more