Public
Edited
May 3, 2023
Fork of donut
Insert cell
Insert cell
Insert cell
Insert cell

donutchart = DonutChart(coursenames, {
category: d => d.Category,
name: d => d.Name,
value: d => d.Number,
width,
height: 800,
names: category,
colors: d3.schemeSet3
//["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9", "#bc80bd", "#ccebc5", "#ffed6f"]
//https://observablehq.com/@d3/working-with-color
coursenames: (i) => i.coursenames.replaceAll(" ", "\n")
})
Insert cell
linkToSpreadsheet = "https://docs.google.com/spreadsheets/d/1HdATGSycXsz0DWcUAd8fLfAHEuInhrGgl835nR0brVQ/gviz/tq?tqx=out:csv&sheet=Sheet3"
Insert cell
coursenames = d3.csv(linkToSpreadsheet)
Insert cell
category = coursenames.map(d => d.Category)
Insert cell
import {Swatches as legend} from "@d3/color-legend"
Insert cell
import {Swatches} from "@d3/color-legend"
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