Public
Edited
May 6, 2022
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
chosen_lib.filter(d => d.tag === '2.0' && d.is_toxic == 'Toxic')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// raw_data = FileAttachment("allLibs_to_plot@6.csv").csv({typed:true})
Insert cell
// cpython = FileAttachment("cpython_to_plot@7.csv").csv({typed:true})
Insert cell
chosen_lib = tidy(
cpython,
mutate({
is_toxic_new_score: d => +d.is_toxic_new_score,
// is_toxic: d => d.is_toxic === "True" ? "Toxic" : "Not Toxic",
is_toxic: d => d.is_toxic_new_score >= form2.tog_D ? "Toxic" : "Not Toxic",
cumlines_tag: d => +d.cumlines_tag,
abs_lines_changed: d => +d.abs_lines_changed,
insertions: d => +d.insertions,
deletions: d => +d.deletions,
tot_lines_tag: d => +d.tot_ines_tag,
pct_completion_tag: d=> +d.pct_completion_tag,
diff_by_release_s: d=>+d.diff_by_release_s,
diff_prev_row_tag_auth_sec: d=>+d.diff_prev_row_tag_auth_sec,
Day: d => parseTime(d.Day)
}
)
)
Insert cell
parseTime = d3.utcParse("%Y-%m-%d");
Insert cell
chosen_lib_long = tidy(chosen_lib,
select(['Day', 'yearMonth', 'insertions', 'deletions', 'abs_lines_changed']),
pivotLonger({
cols: ['insertions', 'deletions', 'abs_lines_changed'],
namesTo: 'contrib_type',
valuesTo: 'val',
}), filter(d => d.contrib_type !== 'abs_lines_changed'))
Insert cell
chosen_lib_long_toxic = tidy(chosen_lib,
select(['Day', 'is_toxic']),
pivotLonger({
cols: ['is_toxic'],
namesTo: 'type',
valuesTo: 'val',
}), filter(d => d.contrib_type !== 'abs_lines_changed'))
Insert cell
min_x = d3.min(chosen_lib.map(d => d.Day))
Insert cell
max_x = d3.max(chosen_lib.map(d => d.Day))
Insert cell
import {tidy, mutate, groupBy, filter, count, arrange, cumsum, mutateWithSummary,
sum, summarize, leftJoin, desc, sliceHead,distinct, pivotLonger, select,
n, max, mean, deviation, slice} from "@pbeshai/tidyjs"
Insert cell
import {Plot} from "@mkfreeman/plot-tooltip"
Insert cell
// Load the Temporal API using a Polyfill
Temporal = {
const TemporalLib = await require("@js-temporal/polyfill@0.3.0")
return TemporalLib.Temporal
}
Insert cell
import {brushFilterX} from "@observablehq/brush-filter-x"
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