Skip to content

Commit

Permalink
titles and percentages
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickwoodhead committed Oct 22, 2024
1 parent 9f3ff6b commit 060cd43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/histogram.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as Plot from "npm:@observablehq/plot";

export function Histogram(events, { width, thresholds }) {
export function Histogram(events, { width, title, thresholds }) {
return Plot.plot({
y: {grid: true},
y: {grid: true },
x: { percent: true },
title,
width,
marks: [
Plot.rectY(events, Plot.binX({
Expand Down
4 changes: 2 additions & 2 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ const end = view(Inputs.date({label: "End", value: getDateXDaysAgo(1) }));

<div class="grid grid-cols-2" style="grid-auto-rows: 500px;">
<div class="card">${
resize((width) => Histogram(SparkMinerRates, { width, thresholds: 10 }))
resize((width) => Histogram(SparkMinerRates, { width, title: "Retrieval Success Rate Buckets", thresholds: 10 }))
}</div>
<div class="card">${
resize((width) => Histogram(nonZeroSparkMinerRates, { width, thresholds: 10 }))
resize((width) => Histogram(nonZeroSparkMinerRates, { width, title: "Non-zero Miners: Retrieval Success Rate Buckets", thresholds: 10 }))
}</div>
</div>

Expand Down

0 comments on commit 060cd43

Please sign in to comment.