Public
Edited
Jan 12
Insert cell
Insert cell
vegalite = require("vega-embed@6")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//weather = weather_all.filter(item => item.date.getMonth() < 3) // change to <= 12 to include all values
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vegalite({
width: 400,
height: 400,
data: {values: weather},
mark: "point", // options for marks bar/point/circle/square/tick/line/area/text
encoding: {
x: {field: "station", type: "nominal"},
// shape: {field: "station", type: "nominal" } // change to shape
}
})
Insert cell
Insert cell
vegalite({
width: 400,
height: 400,
data: {values: weather},
mark: "tick", // options for marks bar/point/circle/square/tick/line/area/text
encoding: {
x: {field: "temperature", type: "quantitative"}
}
})
Insert cell
Insert cell
Insert cell
Insert cell
vegalite({
width: 400,
height: 400,
data: {values: weather},
mark: "point", // options for marks bar/point/circle/square/tick/line/area/text
encoding: {
y: {field: "station", type: "nominal"}, // options for variables x/y/shape/color/size/text
shape: {field: "station", type: "nominal"},
color: {field: "station", type: "nominal"},
}
})
Insert cell
Insert cell
vegalite({
width: 400,
height: 400,
data: {values: weather},
mark: "tick", // options for marks bar/point/circle/square/tick/line/area
encoding: {
x: {field: "temperature", type: "quantitative"}, // options for variables x/y/shape/color/size/text
}
})
Insert cell
Insert cell
vegalite({
width: 400,
height: 400,
data: {values: weather},
mark: "point", // change to tick
encoding: {
x: {field: "station", type: "nominal"},
y: {field: "temperature", type: "quantitative"},
color: {field: "station", type: "nominal"}
}
})
Insert cell
Insert cell
vegalite({
width: 400,
height: 400,
data: {values: weather},
mark: "point",
encoding: {
x: {field: "temperature", type: "quantitative"}, // and ' scale: {zero: false} ' to each of the axis to see the effect
y: {field: "humidity", type: "quantitative"} // and ' scale: {zero: false} ' to each of the axis to see the effect
}
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vegalite({
"width": 400,
"height": 400,
"data": {
"url": "https://raw.githubusercontent.com/aurioldegbelo/hsb-dgp-datasets/refs/heads/main/old/weather-small.json"
},
"mark": "point",
"encoding": {
"x": {"field": "station", "type": "nominal"}
}
})

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more