Published
Edited
Dec 31, 2021
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
wind_red=FileAttachment("星巴克@1.csv").csv()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {vl} from '@vega/vega-lite-api-v5'
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
csv=FileAttachment("星巴克@4.csv").csv()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof dateView_MEDV = vegaSync({
facts,
dims: d => {
return [d.calorie];
},
interactivity: "brush",
counts: true,
normalized: true,
spec: {
title: '卡路里值',
width: w,
background:"transparent",
layer: [
{
mark: "line",
data: {
name: "counts"
},

encoding: {
x: {
field: "key",
type: "quantitative",
title: "卡路里"
},
y: {
field: "value",
type: "quantitative",
title: "分布指数"
},
color: {
value: "#ccc"
}
}
},
{
mark: "bar",
data: {
name: "counts"
},

selection: {
brush: {
name: "brush",
type: "interval",
encodings: ['x']
}
},
encoding: {
x: {
field: "key",
type: "quantitative"
},
y: {
field: "filtered",
type: "quantitative"
},
color: {
condition: { selection: "brush", value: colorVega },
value: "#bbb"
}
}
}
]
},
// specifique observable
invalidation,
visibility
})
Insert cell
Insert cell
Insert cell
Insert cell
facts = createFacts(csv)
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
G2Plot = require("@antv/g2plot@1.0.1");
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