Public
Edited
Feb 19, 2024
Insert cell
Insert cell
character_url = "https://pudding.cool/2017/03/film-dialogue/character_list5.csv"
Insert cell
Insert cell
character = aq.loadCSV(character_url)
Insert cell
Inputs.table(character)
Insert cell
Insert cell
Insert cell
Inputs.table(data)
Insert cell
Insert cell
Plot.plot({
height: 200,
marks: [Plot.dot(data,
{ x: "gRatio", opacity: 0.05, r:20
})]
}
)
Insert cell
Plot.plot({
height: 600,
marks: [Plot.dot(data, Plot.dodgeY(
{ x: "gRatio", fill: "gRatio", r:3, anchor: "top"
}))]
}
)
Insert cell
Insert cell
data2 = aq
.from(data)
.derive({gRatio2: (d) => aq.op.round(d.gRatio*100)/100})
.groupby ("gRatio2")
.derive({rRank: aq.op.rank()})
Insert cell
Inputs.table((data2), {width: 500})
Insert cell
Insert cell
Plot.plot({
height: 500,
width:width,
y: {reverse: true},
color: {
type: "diverging",
scheme: "BuRd", pivot: 0.5
},
marks: [Plot.dot(data2,
{ x: "gRatio2", fill: "gRatio2", y: "rRank"
})]
}
)
Insert cell
Plot.plot({ x: { domain: [0, 300], reverse: true, grid: true } })
Insert cell
Insert cell
Plot.plot({
title: "Filmy Dialogues are too Male",
width: width,
height: 500,
y: { reverse: true, axis: null },
//color: { scheme: "BuRd", type: "diverging", pivot: 0.5 },
color: { range: ["blue", "white", "red"], type: "diverging", pivot: 0.5 },
marks: [
Plot.dot(data2, { x: "gRatio2", fill: "gRatio2", y: "rRank" }),
Plot.tip(
data2,
Plot.pointer({
x: "gRatio2",
y: "rRank",
channels: { movie: "script_id" }
})
)
]
})

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