Published
Edited
Nov 30, 2020
Fork of books
Insert cell
md`# books-2`
Insert cell
import {vl} from '@vega/vega-lite-api'
Insert cell
viewof wifi = {
const brush =
vl.selectInterval()
//.bind("scales");
let wi = vl.markLine()
.select(brush)
.encode(
vl.color().fieldO("PubYear"), //.title("Год публикации").scale({range: ["#FF4500" , "#4169E1"]}),
vl.x().fieldN("AgeLimit"),//.title("").axis({labelAngle: 0}),
vl.y().count().title(false),
vl.tooltip().fieldQ("NominationYear"),
)

;
let fi = vl.markBar()
.select(brush)
.transform({filter: brush})
.title("Публикация кинги")
.width(500)
.encode(
//vl.color().fieldN("PubYear").title("Год публикации").scale({range: ["#FF4500" , "#4169E1"]}),
vl.x().fieldN("AgeLimit").title("").axis({labelAngle: 0}),
vl.y().count().title(false),
vl.tooltip().fieldQ("NominationYear"),
)
;
return vl.hconcat(wi, fi)
.data(wi_fi)
.transform({fold: ["AgeLimit" , "NominationYear"] , as: ["Возраст" , "Год"]})
.render({renderer: "svg"})
;
}

Insert cell
locale = {
return {
"decimal": ",",
"thousands": " ",
"grouping": [3],
"currency": ["Р", ""],
"dateTime": "%a %b %e %X %Y",
"date": "%d.%m.%Y",
"time": "%H:%M:%S",
"periods": ["AM", "PM"],
"days": ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
"shortDays": ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
"months": ["Январь", "Февраль", "Март", "Апрель", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
"shortMonths": ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"]
};
}
Insert cell
embed = require("vega-embed@4")
Insert cell
wi_fi = {
return await FileAttachment("books.csv")
.csv()
}
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