Skip to content

Commit

Permalink
Merge pull request #1168 from tokyo-metropolitan-gov/staging
Browse files Browse the repository at this point in the history
Release 2020/03/11 ver. 1.1.0
  • Loading branch information
halsk authored Mar 11, 2020
2 parents 6617371 + ad13141 commit 7d42ad0
Show file tree
Hide file tree
Showing 51 changed files with 6,600 additions and 1,050 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Tokyo Covid-19 response site contributors
| [dafujii](https://twitter.com/dafujii_k) ([@dafujii](https://github.com/dafujii)) | Kaizen |
| [7iva](https://twitter.com/_7iva) ([@7iva](https://github.com/7iva)) | Translations |
| Jun Shindo ([@jay-es](https://github.com/jay-es)) | Frontend |
| [mkfsn](https://twitter.com/mkfsn) ([@mkfsn](https://github.com/mkfsn)) | Coding, i18n |
| [Thien Le Vinh](https://github.com/omygodvt95) | Translation |
| -add your name here!- | -what did you do?- |

Expand Down
8 changes: 8 additions & 0 deletions assets/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ img {
height: auto;
vertical-align: bottom;
}

.clearfix {
&:after {
content: "";
display: block;
clear: both;
}
}
13 changes: 12 additions & 1 deletion assets/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,20 @@ $z-index-map: (

// ===================
// card
@mixin card-container {
@mixin card-container($withDivider: false) {
background-color: $white;
box-shadow: $shadow;
border: 0.5px solid $gray-4 !important;
border-radius: 4px;
@if ($withDivider) {
&::before {
content: '';
position: absolute;
left: 50%;
top: 0;
width: 1px;
height: 100%;
background-color: $gray-4;
}
}
}
166 changes: 166 additions & 0 deletions components/AgencyBarChart.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<template>
<data-view :title="title" :title-id="titleId" :date="date" :url="url">
<bar
:chart-id="chartId"
:chart-data="displayData"
:options="displayOption"
:height="240"
/>
</data-view>
</template>

<i18n>
{
"ja": {
"第一庁舎計": "第一庁舎計",
"第二庁舎計": "第二庁舎計",
"議事堂計": "議事堂計",
"人": "人",
"期間: {duration}": "期間: {duration}"
},
"en": {
"第一庁舎計": "TMG No. 1 Building",
"第二庁舎計": "TMG No. 2 Building",
"議事堂計": "Assembly Building",
"期間: {duration}": "Period: {duration}"
},
"zh-cn": {
"第一庁舎計": "第一本厅大厦来访人数",
"第二庁舎計": "第二本厅大厦来访人数",
"議事堂計": "都议会议事堂来发人数",
"人": "persons",
"期間: {duration}": "期间: {duration}"
},
"zh-tw": {
"第一庁舎計": "第一本廳來訪人數",
"第二庁舎計": "第二本廳來訪人數",
"議事堂計": "議事堂來訪人數",
"人": "人",
"期間: {duration}": "期間: {duration}"
},
"ko": {
"第一庁舎計": "제1청사 방문자 수",
"第二庁舎計": "제2청사 방문자 수",
"議事堂計": "도쿄도의회 의사당 방문자 수",
"人": "인",
"期間: {duration}": "기간: {duration}"
},
"ja-basic": {
"第一庁舎計": "第一庁舎(だいいちちょうしゃ)に 来(き)た 人(ひと)の 合計(ごうけい)",
"第二庁舎計": "第二庁舎(だいにちょうしゃ)に 来(き)た 人(ひと)の 合計(ごうけい)",
"議事堂計": "議事堂(ぎじどう)に 来(き)た人(ひと)の 合計(ごうけい)",
"人": "にん",
"期間: {duration}": "きかん: {duration}"
}
}
</i18n>

<script>
import agencyData from '@/data/agency.json'
import DataView from '@/components/DataView.vue'
export default {
components: { DataView },
props: {
title: {
type: String,
required: false,
default: ''
},
titleId: {
type: String,
required: false,
default: ''
},
chartId: {
type: String,
required: false,
default: 'agency-bar-chart'
},
unit: {
type: String,
required: false,
default: ''
},
url: {
type: String,
required: false,
default: ''
}
},
data() {
return {
chartData: agencyData,
date: agencyData.date
}
},
computed: {
displayData() {
const colors = ['#008b41', '#63c765', '#a6e29f']
return {
labels: this.chartData.labels,
datasets: this.chartData.datasets.map((d, i) => {
return {
label: d.label,
data: d.data,
backgroundColor: colors[i]
}
})
}
},
displayOption() {
const self = this
return {
tooltips: {
displayColors: false,
callbacks: {
title(tooltipItem) {
const dateString = tooltipItem[0].label
return self.$t('期間: {duration}', {
duration: dateString
})
},
label(tooltipItem, data) {
const index = tooltipItem.datasetIndex
const title = self.$t(data.datasets[index].label)
const num = tooltipItem.value
const unit = self.$t(self.unit)
return `${title}: ${num}${unit}`
}
}
},
scales: {
xAxes: [
{
stacked: true,
gridLines: {
display: false
},
ticks: {
fontSize: 9,
fontColor: '#808080'
}
}
],
yAxes: [
{
stacked: true,
gridLines: {
display: true
},
ticks: {
fontSize: 9,
fontColor: '#808080',
maxTicksLimit: 10,
callback(label) {
return `${label}${self.unit}`
}
}
}
]
}
}
}
}
}
</script>
532 changes: 352 additions & 180 deletions components/ConfirmedCasesTable.vue

Large diffs are not rendered by default.

37 changes: 35 additions & 2 deletions components/DataSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,47 @@
@change="$emit('input', $event)"
>
<v-btn v-ripple="false" value="transition" class="DataSelector-Button">
日別
{{ $t('日別') }}
</v-btn>
<v-btn v-ripple="false" value="cumulative" class="DataSelector-Button">
累計
{{ $t('累計') }}
</v-btn>
</v-btn-toggle>
</template>

<i18n>
{
"ja": {
"日別": "日別",
"累計": "累計"
},
"en": {
"日別": "daily",
"累計": "total"
},
"zh-cn": {
"日別": "每日",
"累計": "累计"
},
"zh-tw": {
"日別": "每日",
"累計": "累計"
},
"ko": {
"日別": "날짜별",
"累計": "총 집계"
},
"pt-BR": {
"日別": "diário",
"累計": "total"
},
"ja-basic": {
"日別": "いちにちごと",
"累計": "ぜんぶで"
}
}
</i18n>

<style lang="scss">
.DataSelector {
margin-top: 2px;
Expand Down
25 changes: 24 additions & 1 deletion components/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class="cardTable"
/>
<div class="note">
※退院には、死亡退院を含む
{{ $t('※退院には、死亡退院を含む') }}
</div>
<template v-slot:infoPanel>
<data-view-basic-info-panel
Expand All @@ -26,6 +26,29 @@
</data-view>
</template>

<i18n>
{
"ja": {
"※退院には、死亡退院を含む": "※退院には、死亡退院を含む"
},
"en": {
"※退院には、死亡退院を含む": "* The number of discharge include discharge due to death"
},
"zh-cn": {
"※退院には、死亡退院を含む": "※ 出院数包含因死亡出院"
},
"zh-tw": {
"※退院には、死亡退院を含む": "※ 出院包含因死亡出院"
},
"ko": {
"※退院には、死亡退院を含む": "※퇴원은 사망으로 인해 퇴원한것을 포함합니다"
},
"ja-basic": {
"※退院には、死亡退院を含む": ""
}
}
</i18n>

<style lang="scss">
.cardTable {
&.v-data-table {
Expand Down
33 changes: 31 additions & 2 deletions components/DataView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
<slot />
</div>
<v-footer class="DataView-Footer">
<time :datetime="date">{{ date }} 更新</time>
<time :datetime="date">{{ $t('{date} 更新', { date }) }}</time>
<a
v-if="url"
class="OpenDataLink"
:href="url"
target="_blank"
rel="noopener"
>
オープンデータへのリンク
{{ $t('オープンデータへのリンク') }}
<v-icon class="ExternalLinkIcon" size="15">
mdi-open-in-new
</v-icon>
Expand All @@ -43,6 +43,35 @@
</v-card>
</template>

<i18n>
{
"ja": {
"{date} 更新": "{date} 更新",
"オープンデータへのリンク": "オープンデータへのリンク"
},
"en": {
"{date} 更新": "Last update: {date}",
"オープンデータへのリンク": "Link to Open Data"
},
"zh-cn": {
"{date} 更新": "{date} 更新",
"オープンデータへのリンク": "公开数据的链接"
},
"zh-tw": {
"{date} 更新": "{date} 更新",
"オープンデータへのリンク": "開放資料連結"
},
"ko": {
"{date} 更新": "{date} 갱신",
"オープンデータへのリンク": "공공데이터에의 링크"
},
"ja-basic": {
"{date} 更新": "{date} に あたらしく しました",
"オープンデータへのリンク": "オープンデータ という ページを みたいとき"
}
}
</i18n>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import { convertDatetimeToISO8601Format } from '@/utils/formatDate'
Expand Down
Loading

0 comments on commit 7d42ad0

Please sign in to comment.