Published unlisted
Edited
Feb 7, 2022
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tennis_data = await FileAttachment('tennis.json').json()
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
plot = {
let svg = d3.create('svg')
.attr('width', plot_width+margins.left+margins.right)
.attr('height', plot_height+margins.bottom+margins.top)

let g = svg.append('g')
.attr('transform', `translate(${margins.left},${margins.top})`)

return svg.node()
}
Insert cell
viewof plot_view = drawdom(plot,3)
Insert cell
plot_view
Insert cell
Insert cell
plot_width = width-(margins.left+margins.right)
Insert cell
plot_height = 450
Insert cell
margins = ({left:60,right:10,top:50,bottom:50})
Insert cell
Insert cell
round_domain = ['1st Round', '2nd Round', '3rd Round', '4th Round', 'Quarterfinals', 'Semifinals', 'The Final']
Insert cell
set_domain = [1,2,3]
Insert cell
set_outcome_domain = d3.range(-6,7)
Insert cell
match_result_domain = ['win','lose']
Insert cell
Insert cell
Insert cell
Insert cell
import {drawdom} from '91007ee9d5fd152b'
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