diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-06-09 11:40:42 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-06-09 11:40:42 +0900 |
| commit | 42a4f92cfa6f0e62cab93f7b1e7805861ddaa967 (patch) | |
| tree | 01a484a6021959c2ccea2c0aebb8fec554e1c8f7 /src/client | |
| parent | :art: (diff) | |
| download | misskey-42a4f92cfa6f0e62cab93f7b1e7805861ddaa967.tar.gz misskey-42a4f92cfa6f0e62cab93f7b1e7805861ddaa967.tar.bz2 misskey-42a4f92cfa6f0e62cab93f7b1e7805861ddaa967.zip | |
Fix #1125
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/desktop/views/components/activity.calendar.vue | 6 | ||||
| -rw-r--r-- | src/client/app/desktop/views/components/activity.chart.vue | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/client/app/desktop/views/components/activity.calendar.vue b/src/client/app/desktop/views/components/activity.calendar.vue index e488571070..1a88d1a994 100644 --- a/src/client/app/desktop/views/components/activity.calendar.vue +++ b/src/client/app/desktop/views/components/activity.calendar.vue @@ -1,5 +1,5 @@ <template> -<svg viewBox="0 0 21 7" preserveAspectRatio="none"> +<svg viewBox="0 0 21 7"> <rect v-for="record in data" class="day" width="1" height="1" :x="record.x" :y="record.date.weekday" @@ -15,7 +15,7 @@ style="pointer-events: none;"/> <rect class="today" width="1" height="1" - :x="data[data.length - 1].x" :y="data[data.length - 1].date.weekday" + :x="data[0].x" :y="data[0].date.weekday" rx="1" ry="1" fill="none" stroke-width="0.1" @@ -33,7 +33,7 @@ export default Vue.extend({ const peak = Math.max.apply(null, this.data.map(d => d.total)); let x = 0; - this.data.reverse().forEach(d => { + this.data.slice().reverse().forEach(d => { d.x = x; d.date.weekday = (new Date(d.date.year, d.date.month - 1, d.date.day)).getDay(); diff --git a/src/client/app/desktop/views/components/activity.chart.vue b/src/client/app/desktop/views/components/activity.chart.vue index ff489d988b..202eabe90d 100644 --- a/src/client/app/desktop/views/components/activity.chart.vue +++ b/src/client/app/desktop/views/components/activity.chart.vue @@ -1,5 +1,5 @@ <template> -<svg :viewBox="`0 0 ${ viewBoxX } ${ viewBoxY }`" preserveAspectRatio="none" @mousedown.prevent="onMousedown"> +<svg :viewBox="`0 0 ${ viewBoxX } ${ viewBoxY }`" @mousedown.prevent="onMousedown"> <title>%i18n:@total%<br/>%i18n:@notes%<br/>%i18n:@replies%<br/>%i18n:@renotes%</title> <polyline :points="pointsNote" @@ -55,7 +55,6 @@ export default Vue.extend({ }; }, created() { - this.data.reverse(); this.data.forEach(d => d.total = d.notes + d.replies + d.renotes); this.render(); }, @@ -63,10 +62,11 @@ export default Vue.extend({ render() { const peak = Math.max.apply(null, this.data.map(d => d.total)); if (peak != 0) { - this.pointsNote = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.notes / peak)) * this.viewBoxY}`).join(' '); - this.pointsReply = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.replies / peak)) * this.viewBoxY}`).join(' '); - this.pointsRenote = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.renotes / peak)) * this.viewBoxY}`).join(' '); - this.pointsTotal = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.total / peak)) * this.viewBoxY}`).join(' '); + const data = this.data.slice().reverse(); + this.pointsNote = data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.notes / peak)) * this.viewBoxY}`).join(' '); + this.pointsReply = data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.replies / peak)) * this.viewBoxY}`).join(' '); + this.pointsRenote = data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.renotes / peak)) * this.viewBoxY}`).join(' '); + this.pointsTotal = data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.total / peak)) * this.viewBoxY}`).join(' '); } }, onMousedown(e) { |