= require('d3')
d3 = await d3.json(
contributors "https://api.github.com/repos/" + repo + "/stats/contributors"
)= contributors.map(contributor => {
commits const author = contributor.author;
return {
name: author.login,
title: author.login,
group: author.type,
value: contributor.total
} })
Q_D_Intrctv_ObservableJS
Observable JS
This Quarto document is made interactive using Observable JS. Interactive documents allow readers to modify parameters and see the results immediately. Learn more about OJS interactive documents at https://quarto.org/docs/interactive/ojs/.
Bubble Chart
This example uses a D3 bubble chart imported from Observable HQ to analyze commits to GitHub repositories.
Select a repository to analyze the commits of:
Fetch the commits for the specified repo
using the GitHub API:
Note that the repo
variable is bound dynamically from the radio input defined above. If you change the input the contributors query will be automatically re-executed.
View the commits sorted by most to least:
.table(commits, { sort: "value", reverse: true }) Inputs
Visualize using a D3 bubble chart imported from Observable HQ:
import { chart } with { commits as data }
from "@d3/d3-bubble-chart"
chart