Published unlisted
Edited
Jan 8, 2020
1 star
Insert cell
Insert cell
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 400,
height: 400,
mark: 'point',
encoding: {
x: {field: 'Flavanoids', type: 'quantitative'},
y: {field: 'Nonflavanoid_phenols', type: 'quantitative'}
}
})
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 400,
mark: 'point',
encoding: {
y: {field: 'Alcohol', type: 'nominal'},
x: {field: 'Nonflavanoid_phenols', type: 'quantitative'}
}
})
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 400,
mark: 'point',
encoding: {
size: {field: 'Alcohol', type: 'nominal'},
x: {field: 'Nonflavanoid_phenols', type: 'quantitative'}
}
})
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 400,
height: 400,
mark: 'point',
encoding: {
x: {bin: true, field: 'Flavanoids', type: 'quantitative'},
y: {field: 'Nonflavanoid_phenols', type: 'quantitative'}
}
})
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 200,
height: 250,
mark: 'bar',
encoding: {
x: {bin: true, field: 'Flavanoids', type: 'quantitative'},
y: {aggregate: 'count', type: 'quantitative'}
}
})
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 400,
height: 400,
mark: 'point',
encoding: {
x: {field: 'Flavanoids', type: 'quantitative'},
y: {field: 'Nonflavanoid_phenols', type: 'quantitative'},
color: {field: 'Alcohol', type: 'nominal'}
}
})
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 400,
mark: 'rect',
encoding: {
x: {bin: true, field: 'Flavanoids', type: 'quantitative'},
y: {field: 'Alcohol', type: 'nominal'},
color: {aggregate: 'mean', field: 'Nonflavanoid_phenols', type: 'quantitative'},
}
})
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 200,
height: 200,
mark: 'point',
encoding: {
x: {field: 'Flavanoids', type: 'quantitative'},
y: {field: 'Nonflavanoid_phenols', type: 'quantitative'},
column: {field: 'Alcohol', type: 'nominal'}
}
})
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 200,
mark: 'circle',
encoding: {
x: {field: 'Flavanoids', type: 'quantitative'},
color: {field: 'Nonflavanoid_phenols', type: 'quantitative'},
row: {field: 'Alcohol', type: 'nominal'}
}
})
Insert cell
Insert cell
vegalite({
data: {values: wine_data},
width: 100,
height: 100,
mark: 'circle',
encoding: {
column: {bin: true, field: 'Flavanoids', type: 'quantitative'},
x: {field: 'Nonflavanoid_phenols', type: 'quantitative'},
y: {field: 'Ash', type: 'quantitative'},
size: {field: 'Magnesium', type: 'quantitative'},
color: {field: 'Alcohol', type: 'nominal'}
}
})
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
wine_data = FileAttachment('wine.json').json()
Insert cell
Insert cell
d3 = require('d3@5')
Insert cell
vegalite = require("@observablehq/vega-lite@0.2")
Insert cell
import {slider} from "@jashkenas/inputs"
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