Public
Edited
Nov 1, 2021
Insert cell
Insert cell
Insert cell
Insert cell
data
Insert cell
Inputs.table(data)
Insert cell
Insert cell
Insert cell
zoneData = aq.loadCSV(url)
Insert cell
Inputs.table(zoneData)
Insert cell
Insert cell
dataAttach = FileAttachment("Coding Sheets & Observable - HTML.csv").csv()
Insert cell
Insert cell
aq = require("arquero")
Insert cell
indiaData = aq.from(data).filter((d) => d["country"] === "India")
Insert cell
Inputs.table(indiaData)
Insert cell
Insert cell
vegaEmbed = require("vega-embed")
Insert cell
themeConfig = ({
width: 800,
legend: {
orient: "bottom-left",
gradientDirection: "horizontal",
symbolDirection: "horizontal"
}
})
Insert cell
Insert cell
Visual Representation
- Mark: Point
- Structure: Rectangular
- Encoding:
- PositionX -> Scale (Domain [ Min(0) to Max(10,682) ] -> Linear -> Extent [0 pixel - 800 pixel])
- Color -> Scale (Domain [ Min(0) to Max(10,682) ] -> LinearGradient -> Extent [Light Blue --- Dark Blue])
Insert cell
vegaEmbed({
width: 800,
data: { values: indiaData },
mark: "point",
encoding: {
x: { field: "altitude", type: "quantitative" },
opacity: { value: 0.3 }
},
config: { legend: { orient: "bottom-left" } }
})
Insert cell
vegaEmbed({
width: 800,
data: { values: indiaData },
mark: "point",
encoding: {
x: { field: "altitude", type: "quantitative" },
color: {
field: "altitude",
type: "quantitative",
legend: { orient: "top-left", offset: 40 }
}
}
})
Insert cell
Insert cell
vegaEmbed({
width: 800,
data: { values: indiaData },
mark: "point",
encoding: {
x: { field: "altitude", type: "quantitative", scale: { type: "symlog" } },
color: { field: "altitude", type: "quantitative" }
},
config: { legend: { orient: "top-left", offset: 40 } }
})
Insert cell
Insert cell
vegaEmbed({
width: 800,
data: { values: indiaData },
mark: "point",
encoding: {
x: { field: "altitude", type: "quantitative", scale: { type: "symlog" } },
color: {
field: "altitude",
type: "quantitative",
bin: true,
legend: { orient: "top-left", offset: 40, direction: "horizontal" }
}
}
})
Insert cell
vegaEmbed(
{
data: { values: indiaData },
mark: "circle",
encoding: {
x: { field: "altitude", type: "quantitative", scale: { type: "symlog" } },
color: {
field: "altitude",
type: "quantitative",
scale: { type: "quantile" },
legend: {
type: "quantile",
orient: "top-left",
offset: 60,
direction: "horizontal"
}
}
}
},
themeConfig
)
Insert cell
vegaEmbed({
width: 800,
data: { values: indiaData },
mark: "circle",
encoding: {
x: { field: "altitude", type: "quantitative", scale: { type: "symlog" } },
size: {
field: "altitude",
type: "quantitative",
scale: { type: "sqrt" },
legend: {
type: "quantile",
orient: "top-left",
offset: 40,
direction: "horizontal"
}
}
}
})
Insert cell
Insert cell
vegaEmbed(
{
width: 400,
height: 400,
projection: { type: "mercator" },
data: { values: indiaData },
mark: "circle",
encoding: {
latitude: { field: "lat", type: "quantitative" },
longitude: { field: "lon", type: "quantitative" },
size: { field: "altitude", type: "quantitative" }
}
},
themeConfig
)
Insert cell
Insert cell
vegaEmbed(
{
width: 400,
height: 400,
data: { values: indiaData },
transform: [{ filter: "datum.altitude > 3000" }],
mark: { type: "arc", padAngle: "0.1" },
encoding: {
radius: { field: "altitude", type: "quantitative" },
theta: { field: "city", type: "nominal", sort: "-radius" }
}
},
themeConfig
)
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