Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

Commit c3aaa5e

Browse files
committed
Make chart description look better/responsive on mobile
1 parent 0cd531d commit c3aaa5e

File tree

2 files changed

+51
-57
lines changed

2 files changed

+51
-57
lines changed

src/index.md

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,6 @@ const percentiles = Object.entries(SparkMinerRsrSummaries).flatMap(
184184
185185
<div class="divider"></div>
186186
187-
<div class="grid grid-cols-2">
188-
<div>
189-
<h4>Spark Retrieval Result Codes</h4>
190-
<body>This section shows the Spark Retrieval Result Codes breakdown.</body>
191-
</div>
192-
<div>
193-
<h4>Spark Time To First Byte (TTFB)</h4>
194-
<body>The section shows the median of all median TTFB values from all retrieval tasks.</body>
195-
</div>
196-
</div>
197-
198187
```js
199188
// prettier-ignore
200189
const mapping = {
@@ -259,45 +248,53 @@ const tidy = clone(SparkRetrievalResultCodes).flatMap(({ day, rates }) => {
259248
})
260249
```
261250
262-
<div class="grid grid-cols-2" style="grid-auto-rows: 500px;">
263-
<div class="card">
264-
${Plot.plot({
265-
x: {label: null, type: "band", ticks: "week" },
266-
y: {
267-
percent: true
268-
},
269-
color: {
270-
scheme: "Accent",
271-
legend: "swatches",
272-
width: 2000,
273-
label: "Codes"
274-
},
275-
marks: [
276-
Plot.rectY(tidy, {
277-
x: "day",
278-
y: "rate",
279-
fill: "code",
280-
offset: "normalize",
281-
sort: {color: null, x: "-y" },
282-
interval: 'day'
283-
})
284-
]
285-
})}
286-
</div>
287-
<div class="card">
251+
<div class="grid grid-cols-2">
252+
<div>
253+
<h4>Spark Retrieval Result Codes</h4>
254+
<body>This section shows the Spark Retrieval Result Codes breakdown.</body>
255+
<div class="card">
288256
${Plot.plot({
289-
title: 'Time to First Byte (ms)',
290-
// TODO: Change tick to month once we have more data
291-
x: { type: 'utc', ticks: 'day' },
292-
y: { grid: true, zero: true},
293-
marks: [
294-
Plot.lineY(SparkRetrievalTimes, {
295-
x: 'day',
296-
y: 'ttfb_ms',
297-
stroke: "#FFBD3F",
298-
})
299-
]
300-
})}
257+
x: {label: null, type: "band", ticks: "week" },
258+
y: {
259+
percent: true
260+
},
261+
color: {
262+
scheme: "Accent",
263+
legend: "swatches",
264+
width: 2000,
265+
label: "Codes"
266+
},
267+
marks: [
268+
Plot.rectY(tidy, {
269+
x: "day",
270+
y: "rate",
271+
fill: "code",
272+
offset: "normalize",
273+
sort: {color: null, x: "-y" },
274+
interval: 'day'
275+
})
276+
]
277+
})}
278+
</div>
279+
</div>
280+
<div>
281+
<h4>Spark Time To First Byte (TTFB)</h4>
282+
<body>The section shows the median of all median TTFB values from all retrieval tasks.</body>
283+
<div class="card">
284+
${Plot.plot({
285+
title: 'Time to First Byte (ms)',
286+
// TODO: Change tick to month once we have more data
287+
x: { type: 'utc', ticks: 'day' },
288+
y: { grid: true, zero: true},
289+
marks: [
290+
Plot.lineY(SparkRetrievalTimes, {
291+
x: 'day',
292+
y: 'ttfb_ms',
293+
stroke: "#FFBD3F",
294+
})
295+
]
296+
})}
297+
</div>
301298
</div>
302299
</div>
303300

src/provider/[provider].md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,14 @@ const end = view(Inputs.date({ label: 'End', value: getDateXDaysAgo(1) }))
3232
<div>
3333
<h4>Storage Provider Spark RSR Summary</h4>
3434
<body>This section shows the storage provider Spark Retrieval Success Rate Score summary.</body>
35+
<div class="card">${
36+
resize((width) => LineGraph(rsrData, {width, title: "Retrieval Success Rate", start, end }))
37+
}</div>
3538
</div>
3639
<div>
3740
<h4>Storage Provider Spark Time To First Byte (TTFB)</h4>
3841
<body>The section shows the median of all TTFB values for successful retrieval checks of this storage provider.</body>
39-
</div>
40-
</div>
41-
42-
<div class="grid grid-cols-2" style="grid-auto-rows: 500px;">
43-
<div class="card">${
44-
resize((width) => LineGraph(rsrData, {width, title: "Retrieval Success Rate", start, end }))
45-
}</div>
46-
<div class="card">
42+
<div class="card">
4743
${Plot.plot({
4844
title: 'Time to First Byte (ms)',
4945
// TODO: Change tick to month once we have more data
@@ -57,6 +53,7 @@ const end = view(Inputs.date({ label: 'End', value: getDateXDaysAgo(1) }))
5753
})
5854
]
5955
})}
56+
</div>
6057
</div>
6158
</div>
6259

0 commit comments

Comments
 (0)