show dom elements in value explorer

This commit is contained in:
Dmitry Vasilev
2023-07-17 05:21:05 +03:00
parent 7102e532f2
commit 190e05d21d
4 changed files with 104 additions and 38 deletions

View File

@@ -0,0 +1,16 @@
import _ from 'https://unpkg.com/lodash-es'
const url = 'https://api.github.com/search/repositories?q=stars:%3E1&sort=stars'
const resp = await fetch(url)
const repos = await resp.json()
const langs = _(repos.items)
.map(r => r.language)
.filter(l => l != null)
.countBy()
.toPairs()
.map(([language, count]) => ({language, count}))
import {barY} from "https://cdn.jsdelivr.net/npm/@observablehq/plot@0.6/+esm";
barY(langs, {x: "language", y: "count", sort: {x: "y", reverse: true}, fill: 'purple'})
.plot()