Public
Edited
Mar 20, 2023
Insert cell
Insert cell
Insert cell
import {Plot} from "@mkfreeman/plot-tooltip"
Insert cell
viewof table = Inputs.table(alphabet)
Insert cell
alphabet
Insert cell
Plot.plot({
marks: [
Plot.barY(alphabet, {x: "letter", y: "frequency", sort: {x: "y", reverse: true}}),
Plot.ruleY([0])
]
})
Insert cell
olympians
Insert cell
Plot.plot({
marks: [
Plot.barX(olympians, Plot.groupY({x: "count"}, {y: "nationality", sort: {y: "x", reverse: true, limit: 10}})),
Plot.ruleX([0])
]
})
Insert cell
Plot.plot({
marks: [
Plot.barX(olympians, {x: ()=>1, y: "nationality", sort: {y: "x", reverse: true, limit: 10},
title: "name"}),
Plot.ruleX([0])
]
})
Insert cell
Plot.plot({
marks: [
Plot.barX(olympians, Plot.groupY({x: "count",title:"count"},
{y: "nationality",
sort: {y: "x", reverse: true,
limit: 20
}
})),
Plot.ruleX([0])
]
}) //팝업 확인해야겠다!
Insert cell
Plot.plot({
marks: [
Plot.barX(olympians, Plot.groupY({x: "count",title:"count"},
{y: d=>d.sport,
sort: {y: "x", reverse: true,
limit: 20
}
})),
Plot.ruleX([0])
]
}) //팝업 확인해야겠다!
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(olympians, Plot.dodgeY({x: "weight",stroke:"steelblue",
opacity:.3,
// r:1
})),
],
x:{
label:"weight (kg) →"
},
width,
height: 100

})
Insert cell
viewof numBins = Inputs.range([1, 100], {label: "Number of bins", step: 1})
Insert cell
Plot.plot({
marks: [
Plot.rectY(olympians, Plot.binX({y: "count"}, {x: "weight", thresholds:numBins})),//thresholds:가로축의 임계값
Plot.ruleY([0])
]
})
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.barY(olympians, Plot.groupX({y: "count"}, {x: "nationality", fill:"sport", title:"sport",//"sport"별로 채우기
sort: {x: "y", reverse: true,
limit: 10
}})), //앞의 그래프랑 방향 바뀌며 세로형으로 셋팅
],
color: {
legend:true
},
width
})
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.barY(olympians, Plot.groupX({y: "count"}, {x: "nationality", fill:"sex", title:"sport",//"sport"별로 채우기
sort: {x: "y", reverse: true,
limit: 10
}})), //앞의 그래프랑 방향 바뀌며 세로형으로 셋팅
],
color: {
legend:true
},
width
})
Insert cell
import {islands} from "@observablehq/datavis-course-lesson-1-introduction"
Insert cell
import {DonutChart} from "@d3/donut-chart"
Insert cell
DonutChart(islands, {name:d=>d.name, value: d=>d.value, innerRadius: 0})
Insert cell
viewof stacking = Inputs.select(["baseline", "silhouette", "wiggle", "expand"], {label: "Stacking method"})
Insert cell
Plot.plot({
y: {
tickFormat: "s"
},
marks: [
Plot.areaY(industries, {x: "date",title: "industry",
offset:stacking === "baseline"? null:stacking,
y: "unemployed", fill: "industry"}),
Plot.ruleY([0])
]
})
Insert cell
Insert cell
viewof table1 = Inputs.table(aapl)
Insert cell
viewof k = Inputs.range([1, 20], {label: "Window size", step: 1, value:1})
Insert cell
viewof reducer = Inputs.select(["mean", "median","min","max","sum","ratio"], {label: "Reducer"})
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(aapl, Plot.windowY({x: "Date", y: "Close", reduce:reducer, k: k}))
]
})
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