-
Notifications
You must be signed in to change notification settings - Fork 163
adopt the new classes for plot's big numbers #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8145753
adopt the new classes for plot's big numbers
Fil e611f92
fix padding and color, the hard way
Fil a26fdd0
Update examples/plot/docs/index.md
Fil 54eb832
Update examples/plot/docs/index.md
Fil 55cf5ad
quote attributes
Fil acd987c
link not muted, fix slag
Fil b30b82a
Update examples/plot/docs/index.md
Fil 8da625b
remove redundant client-side html generation
Fil 6537d9d
a bit of clean-up in the google-analytics example
Fil d335c5a
add a gap class
Fil 0b03f32
Merge branch 'main' into fil/plot-big
Fil d15e6eb
fix links
Fil 65fb83b
remove .gap
Fil edfacf1
fix indentation, close div
Fil 27e6c01
trend function
Fil bbd04c8
Merge branch 'main' into fil/plot-big
Fil 03920a6
Update examples/google-analytics/docs/index.md
Fil ad9164f
Update examples/google-analytics/docs/index.md
Fil 0d9c5bc
Update examples/google-analytics/docs/index.md
Fil 09d3c89
Update examples/google-analytics/docs/index.md
Fil 5f4f6c7
Update examples/plot/docs/index.md
Fil da25240
Update examples/plot/docs/index.md
Fil 7860c6b
Update examples/plot/docs/index.md
Fil 1706dc4
- trend as a (local) component
Fil f3b3f95
Merge branch 'main' into fil/plot-big
Fil 20ef431
small
Fil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ theme: dashboard | |
# Plot | ||
|
||
```js | ||
import {BigNumber} from "./components/bigNumber.js"; | ||
import {DailyPlot, today, start} from "./components/dailyPlot.js"; | ||
``` | ||
|
||
|
@@ -43,17 +42,26 @@ const burndown = issues | |
``` | ||
|
||
<div class="grid grid-cols-4" style="grid-auto-rows: 86px;"> | ||
<div class=card>${BigNumber(versions.at(-1).version, { | ||
title: "Current release", | ||
href: `https://github.com/observablehq/plot/releases/tag/v${versions.at(-1).version}`, | ||
trend: d3.utcDay.count(versions.at(-1).date, Date.now()), | ||
trendFormat: d => `${d === 0 ? "today" : d===1 ? "yesterday" : `${d} days ago`}`, | ||
trendColor: "#888", | ||
trendArrow: null | ||
})}</div> | ||
<div class=card>${BigNumber(stars.length, {title: "GitHub stars", trend: stars.filter((d) => d.starred_at >= lastWeek).length, trendFormat: "+", trendTitle: "Since last week"})}</div> | ||
<div class=card>${BigNumber(downloads[0].value, {title: "Daily npm downloads", trend: downloads[7].value ? (downloads[0].value - downloads[7].value) / downloads[7].value : undefined, trendTitle: "Compared to last week"})}</div> | ||
<div class=card>${BigNumber(d3.sum(downloads, (d) => d.value), {title: "Total npm downloads"})}</div> | ||
<div class="card"> | ||
<h2>Current release</h2> | ||
Fil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<span class="big">${versions.at(-1).version}</span> | ||
<a href="https://github.com/observablehq/plot/releases" class="muted"> | ||
${((days) => days === 0 ? "today" : days === 1 ? "yesterday" : `${days} days ago`)(d3.utcDay.count(versions.at(-1).date, Date.now()))}`} | ||
</a> | ||
</div> | ||
<div class="card"> | ||
<h2>GitHub stars</h2> | ||
${html`<span class="big">${d3.format(",")(stars.length)}`} | ||
${html`<span class="green">${d3.format("+")(d3.sum(stars, (d) => d.starred_at >= lastWeek))} ↗︎`} | ||
</div> | ||
<div class="card"> | ||
<h2>Daily npm downloads</h2> | ||
${html`<span class="big">${d3.format(",")(downloads[0].value)}`} | ||
${((trend) => html`<span class=${trend > 0 ? "green" : trend < 0 ? "red" : "muted"}>${d3.format("+.1%")(trend)} ${trend > 0 ? "↗︎" : trend < 0 ? "↘︎" :""}`)(downloads[7].value ? (downloads[0].value - downloads[7].value) / downloads[7].value : undefined)} | ||
</div> | ||
<div class="card"> | ||
<h2>Total npm downloads</h2> | ||
${html`<span class="big">${d3.format(",")(d3.sum(downloads, (d) => d.value))}`} | ||
</div> | ||
|
||
<div class="card grid grid-cols-1" style="grid-auto-rows: calc(260px + 2rem);"> | ||
|
@@ -99,11 +107,27 @@ const burndown = issues | |
)} | ||
</div> | ||
|
||
<style> | ||
.big {margin-right: 0.5rem;} | ||
Fil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</style> | ||
|
||
<div class="grid grid-cols-4" style="grid-auto-rows: 86px;"> | ||
<div class=card>${BigNumber(issues.filter((d) => !d.pull_request && d.state === "open").length, {title: "Open issues", href: "https://github.com/observablehq/plot/issues"})}</div> | ||
<div class=card>${BigNumber(issues.filter((d) => !d.pull_request && d.open >= lastMonth).length, {title: "Opened issues, 28d"})}</div> | ||
<div class=card>${BigNumber(issues.filter((d) => !d.pull_request && d.close >= lastMonth).length, {title: "Closed issues, 28d"})}</div> | ||
<div class=card>${BigNumber(issues.filter((d) => d.pull_request && d.state === "open" && !d.draft).length, {title: "Open PRs", href: "https://github.com/observablehq/plot/pulls?q=is%3Apr+is%3Aopen+draft%3Afalse"})}</div> | ||
<div class="card"> | ||
<h2>Open issues</h2> | ||
<span class="big">${d3.format(",")(d3.sum(issues, (d) => !d.pull_request && d.state === "open"))}</span> | ||
</div> | ||
<div class="card"> | ||
<h2>Opened issues, 28d</h2> | ||
<span class="big">${d3.format(",")(d3.sum(issues, (d) => !d.pull_request && d.open >= lastMonth))}</span> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m not a big fan of the |
||
</div> | ||
<div class="card"> | ||
<h2>Closed issues, 28d</h2> | ||
<span class="big">${d3.format(",")(d3.sum(issues, (d) => !d.pull_request && d.close >= lastMonth))}</span> | ||
</div> | ||
<div class="card"> | ||
<h2>Open PRs</h2> | ||
<a class="big" href="https://github.com/observablehq/plot/pulls?q=is%3Apr+is%3Aopen+draft%3Afalse"><span style="color: var(--theme-foreground)">${d3.format(",")(d3.sum(issues, (d) => d.pull_request && d.state === "open" && !d.draft))}</span></a> | ||
Fil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</div> | ||
</div> | ||
|
||
<div class="grid grid-cols-2" style="grid-auto-rows: 276px;"> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.