Type Table, then Shift-Enter. Ctrl-space for more options.
// Access the third element in the array:
nyc_water[2]
// Access Consumption (HCF) from the ninth element in the array:
nyc_water[8].Consumption()
// Access Location from the 100th element in the array:
// Use Array.map and an arrow array to return and array with the ratio of Current Charges to Consumption (HCF):
Plot.plot({
marks:[
Plot.dot(nyc_water,{
x:"Consumption (HCF)",
y:"Current Charges",
fill:"purple",
r:"Consumption (HCF)"
})
],
x:{domain:[0,5e4]}
})
// Create and customize a scatterplot of Consumption (HCF) and Current Charges from the nyc_water data:
//Option-shift-F to automatically format code
import{showMe}from"@observablehq/show-me"
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.