Skip to content

Commit 445745b

Browse files
authored
feat(app2): reenable graph (#4496)
2 parents a75b4df + da4ba04 commit 445745b

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

app2/src/lib/queries/statistics.svelte.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,17 @@ export const dailyTransfersQuery = (limit = 30) =>
3838
variables: { limit },
3939
refetchInterval: "60 seconds",
4040
writeData: data => {
41-
dailyTransfers.data = data.pipe(Option.map(d => d.v2_stats_transfers_daily_count))
41+
// Only show testnet 10 transfers
42+
dailyTransfers.data = data.pipe(
43+
Option.map(d => {
44+
const modifiedData = [...d.v2_stats_transfers_daily_count]
45+
const len = modifiedData.length
46+
for (let i = Math.max(0, len - 10); i < len; i++) {
47+
modifiedData[i] = { ...modifiedData[i], count: 0 }
48+
}
49+
return modifiedData
50+
})
51+
)
4252
},
4353
writeError: error => {
4454
dailyTransfers.error = error

app2/src/routes/explorer/+page.svelte

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,7 @@ onMount(() => {
6868
{/if}
6969
</div>
7070

71-
<Card divided>
72-
<A class="block p-4" href="/explorer/transfers" external={false}
73-
>View all transfers</A
74-
>
75-
<A class="block p-4" href="/explorer/packets" external={false}
76-
>View all packets</A
77-
>
78-
</Card>
79-
8071
<!-- Daily Transfers Chart -->
81-
<!--
8272
<Card class="h-80 relative" divided>
8373
<div class="p-4 gap-4 absolute top-0 left-0 border-b-0 w-full z-10">
8474
<div class="flex justify-between items-center">
@@ -98,5 +88,13 @@ onMount(() => {
9888
onHoverChange={(day) => hoveredDay = day}
9989
/>
10090
</Card>
101-
!-->
91+
92+
<Card divided>
93+
<A class="block p-4" href="/explorer/transfers" external={false}
94+
>View all transfers</A
95+
>
96+
<A class="block p-4" href="/explorer/packets" external={false}
97+
>View all packets</A
98+
>
99+
</Card>
102100
</Sections>

0 commit comments

Comments
 (0)