summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-01-06 20:19:27 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-01-06 20:19:27 +0900
commit70805e00eb2b2b3af7d7460b374f270a7de627e7 (patch)
tree3b7f3a21dd70dd503b09eda43671e8b1d4d8478e /packages/frontend/src
parenttweak retention heatmap (diff)
downloadmisskey-70805e00eb2b2b3af7d7460b374f270a7de627e7.tar.gz
misskey-70805e00eb2b2b3af7d7460b374f270a7de627e7.tar.bz2
misskey-70805e00eb2b2b3af7d7460b374f270a7de627e7.zip
:art:
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/components/MkChartLegend.vue7
-rw-r--r--packages/frontend/src/pages/user/activity.heatmap.vue8
-rw-r--r--packages/frontend/src/pages/user/activity.pv.vue36
-rw-r--r--packages/frontend/src/pages/user/activity.vue18
4 files changed, 57 insertions, 12 deletions
diff --git a/packages/frontend/src/components/MkChartLegend.vue b/packages/frontend/src/components/MkChartLegend.vue
index 8d2a2be8e8..b950f2836e 100644
--- a/packages/frontend/src/components/MkChartLegend.vue
+++ b/packages/frontend/src/components/MkChartLegend.vue
@@ -72,4 +72,11 @@ defineExpose({
}
}
}
+
+@container (max-width: 500px) {
+ .root {
+ font-size: 90%;
+ gap: 6px;
+ }
+}
</style>
diff --git a/packages/frontend/src/pages/user/activity.heatmap.vue b/packages/frontend/src/pages/user/activity.heatmap.vue
index 7b4c92c020..202201afb5 100644
--- a/packages/frontend/src/pages/user/activity.heatmap.vue
+++ b/packages/frontend/src/pages/user/activity.heatmap.vue
@@ -1,7 +1,7 @@
<template>
<div ref="rootEl">
<MkLoading v-if="fetching"/>
- <div v-else>
+ <div v-else :class="$style.root" class="_panel">
<canvas ref="chartEl"></canvas>
</div>
</div>
@@ -205,3 +205,9 @@ onMounted(async () => {
renderChart();
});
</script>
+
+<style lang="scss" module>
+.root {
+ padding: 20px;
+}
+</style>
diff --git a/packages/frontend/src/pages/user/activity.pv.vue b/packages/frontend/src/pages/user/activity.pv.vue
index 1f355cbcb1..d74b641dac 100644
--- a/packages/frontend/src/pages/user/activity.pv.vue
+++ b/packages/frontend/src/pages/user/activity.pv.vue
@@ -64,6 +64,8 @@ async function renderChart() {
const colorUser = '#3498db';
const colorVisitor = '#2ecc71';
+ const colorUser2 = '#3498db88';
+ const colorVisitor2 = '#2ecc7188';
chartInstance = new Chart(chartEl, {
type: 'bar',
@@ -78,8 +80,9 @@ async function renderChart() {
borderRadius: 4,
backgroundColor: colorUser,
barPercentage: 0.7,
- categoryPercentage: 1,
+ categoryPercentage: 0.7,
fill: true,
+ stack: 'u',
}, {
parsing: false,
label: 'UPV (visitor)',
@@ -90,8 +93,35 @@ async function renderChart() {
borderRadius: 4,
backgroundColor: colorVisitor,
barPercentage: 0.7,
- categoryPercentage: 1,
+ categoryPercentage: 0.7,
fill: true,
+ stack: 'u',
+ }, {
+ parsing: false,
+ label: 'NPV (user)',
+ data: format(raw.pv.user).slice().reverse(),
+ pointRadius: 0,
+ borderWidth: 0,
+ borderJoinStyle: 'round',
+ borderRadius: 4,
+ backgroundColor: colorUser2,
+ barPercentage: 0.7,
+ categoryPercentage: 0.7,
+ fill: true,
+ stack: 'n',
+ }, {
+ parsing: false,
+ label: 'NPV (visitor)',
+ data: format(raw.pv.visitor).slice().reverse(),
+ pointRadius: 0,
+ borderWidth: 0,
+ borderJoinStyle: 'round',
+ borderRadius: 4,
+ backgroundColor: colorVisitor2,
+ barPercentage: 0.7,
+ categoryPercentage: 0.7,
+ fill: true,
+ stack: 'n',
}],
},
options: {
@@ -146,7 +176,7 @@ async function renderChart() {
plugins: {
title: {
display: true,
- text: 'Unique PV',
+ text: 'Unique/Natural PV',
padding: {
left: 0,
right: 0,
diff --git a/packages/frontend/src/pages/user/activity.vue b/packages/frontend/src/pages/user/activity.vue
index f9dce3a9e8..3def414674 100644
--- a/packages/frontend/src/pages/user/activity.vue
+++ b/packages/frontend/src/pages/user/activity.vue
@@ -1,13 +1,15 @@
<template>
<MkSpacer :content-max="700">
- <MkFolder class="item">
- <template #header>Heatmap</template>
- <XHeatmap :user="user" :src="'notes'"/>
- </MkFolder>
- <MkFolder class="item">
- <template #header>PV</template>
- <XPv :user="user"/>
- </MkFolder>
+ <div class="_gaps">
+ <MkFolder class="item">
+ <template #header>Heatmap</template>
+ <XHeatmap :user="user" :src="'notes'"/>
+ </MkFolder>
+ <MkFolder class="item">
+ <template #header>PV</template>
+ <XPv :user="user"/>
+ </MkFolder>
+ </div>
</MkSpacer>
</template>