-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Active accounts chart 2 #1006
base: develop
Are you sure you want to change the base?
Changes from 17 commits
ec23aff
c906af0
d654587
252a6a1
8e8c4e8
f090211
2f7d5fd
7505603
8303254
80af1a5
af29581
84e12d6
79ce379
7dd94b7
4dc39ff
d669ec9
47ffeab
5087faa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<template> | ||
<app-panel> | ||
<template #title> | ||
ACTIVE ACCOUNTS | ||
<hint-tooltip> | ||
{{ chartsHints.accountsChart }} | ||
</hint-tooltip> | ||
</template> | ||
<template #end> | ||
<chart-controls | ||
v-model="selectedRange" | ||
class="u-hidden-mobile"/> | ||
</template> | ||
|
||
<line-chart | ||
:data="accountsStatistics" | ||
:interval="selectedRange.interval"/> | ||
|
||
<chart-controls | ||
v-model="selectedRange" | ||
class="accounts-chart-panel__controls u-hidden-desktop"/> | ||
</app-panel> | ||
</template> | ||
|
||
<script setup> | ||
import { storeToRefs } from 'pinia' | ||
import { chartsHints } from '@/utils/hints/chartsHints' | ||
import { useChartsStore } from '@/stores/charts' | ||
|
||
const chartsStore = useChartsStore() | ||
const { accountsStatistics } = storeToRefs(chartsStore) | ||
const { fetchAccountsStatistics } = chartsStore | ||
|
||
const selectedRange = ref(CHART_INTERVALS_PRESETS_OPTIONS[4]) | ||
|
||
await useAsyncData(async() => { | ||
await loadHashrateStatistics() | ||
return true | ||
}) | ||
|
||
if (process.client) { | ||
watch([selectedRange], async() => { | ||
await loadHashrateStatistics() | ||
}) | ||
} | ||
|
||
async function loadHashrateStatistics() { | ||
await fetchAccountsStatistics( | ||
selectedRange.value.interval, | ||
selectedRange.value.limit, | ||
selectedRange.value.customInterval) | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.accounts-chart-pane__controls { | ||
margin-top: var(--space-4); | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<template> | ||
<div class="accounts-statistics"> | ||
<app-panel class="accounts-statistics__panel"> | ||
<h5>TOTAL ACCOUNTS</h5> | ||
<div class="accounts-statistics__value"> | ||
{{ formatNumber(totalAccountsCount) }} | ||
</div> | ||
</app-panel> | ||
<app-panel class="accounts-statistics__panel"> | ||
<h5>ACTIVE ACCOUNTS (LAST 24H)</h5> | ||
<div class="accounts-statistics__value"> | ||
{{ formatNumber(activeAccountsCount) }} | ||
<trend-chip | ||
v-if="activeAccountsDelta" | ||
:delta="activeAccountsDelta"/> | ||
</div> | ||
</app-panel> | ||
</div> | ||
</template> | ||
<script setup> | ||
import { storeToRefs } from 'pinia' | ||
import { useTopAccountsStore } from '@/stores/topAccounts' | ||
import { formatNumber } from '@/utils/format' | ||
|
||
const { fetchTopAccounts } = useTopAccountsStore() | ||
|
||
const { totalAccountsCount, activeAccountsCount, activeAccountsDelta } = storeToRefs(useTopAccountsStore()) | ||
|
||
if (process.client) { | ||
await fetchTopAccounts() | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.accounts-statistics { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--space-2); | ||
width: 100%; | ||
margin-bottom: var(--space-2); | ||
|
||
@media (--desktop) { | ||
flex-direction: row; | ||
} | ||
|
||
&__panel { | ||
padding: var(--space-4); | ||
width: 100%; | ||
|
||
@media (--desktop) { | ||
width: 50%; | ||
} | ||
} | ||
|
||
&__value { | ||
display: inline-flex; | ||
justify-content: space-between; | ||
width: 100%; | ||
font-size: 36px; | ||
font-family: var(--font-monospaced); | ||
font-weight: 400; | ||
margin-top: var(--space-3); | ||
} | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,17 @@ | |
<price-label :price="totalTokenSupply"/> | ||
</td> | ||
</tr> | ||
<tr class="ae-coin-panel__row"> | ||
<th class="ae-coin-panel__table-header"> | ||
<hint-tooltip> | ||
{{ aeCoinHints.activeAccounts }} | ||
</hint-tooltip> | ||
Latest Active Accounts | ||
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. Instead of displaying "Latest Active Accounts" in the Ae coin page I would suggest to add:
A stats panel in the /accounts page, like it's done for /transactions, as it's more related to accounts rather than the native coin itself and seems more consistent to me? 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. Yea, sure good suggestion. I can extend i. 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.
This was a direct requirement before tho, it think from Nikola. So I will keep it + extend it. 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. Done |
||
</th> | ||
<td> | ||
{{ activeAccounts }} | ||
</td> | ||
</tr> | ||
<tr class="ae-coin-panel__row"> | ||
<th class="ae-coin-panel__table-header"> | ||
<hint-tooltip> | ||
|
@@ -87,6 +98,10 @@ defineProps({ | |
type: Number, | ||
required: true, | ||
}, | ||
activeAccounts: { | ||
type: Number, | ||
required: true, | ||
}, | ||
}) | ||
|
||
</script> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup not related