Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #112 from y-chan/development
Browse files Browse the repository at this point in the history
add "年代別陽性患者数", "クラスター別陽性患者数" and fix json data
  • Loading branch information
ohyama authored Mar 18, 2020
2 parents dcf4edd + 8e9c9fd commit c3a0445
Show file tree
Hide file tree
Showing 9 changed files with 207 additions and 181 deletions.
17 changes: 16 additions & 1 deletion components/DataTable.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<data-view :title="title" :title-id="titleId" :date="date" :url="url">
<template v-slot:button>
<span />
<p class="Table-Desc">
{{ desc }}
</p>
</template>
<v-data-table
:headers="chartData.headers"
Expand Down Expand Up @@ -102,7 +104,20 @@ export default {
type: String,
required: false,
default: ''
},
desc: {
type: String,
required: false,
default: ''
}
}
}
</script>

<style lang="scss" scoped>
.Table-Desc {
margin: 10px 0;
font-size: 12px;
color: $gray-3;
}
</style>
38 changes: 30 additions & 8 deletions components/TimeBarChart.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<data-view :title="title" :title-id="titleId" :date="date" :url="url">
<template v-slot:button>
<template v-if="showButton === true" v-slot:button>
<data-selector v-model="dataKind" />
</template>
<bar
Expand Down Expand Up @@ -63,6 +63,11 @@ export default {
type: String,
required: false,
default: ''
},
showButton: {
type: Boolean,
required: false,
default: true
}
},
data() {
Expand All @@ -84,8 +89,12 @@ export default {
displayInfo() {
if (this.dataKind === 'transition') {
return {
lText: `${this.chartData.slice(-1)[0].transition.toLocaleString()}`,
sText: `実績値(前日比:${this.displayTransitionRatio} ${this.unit}`,
lText: this.showButton
? `${this.chartData.slice(-1)[0].transition.toLocaleString()}`
: this.chartData[this.chartData.length - 1].cumulative.toLocaleString(),
sText: this.showButton
? `実績値(前日比:${this.displayTransitionRatio} ${this.unit}`
: ``,
unit: this.unit
}
}
Expand Down Expand Up @@ -135,6 +144,7 @@ export default {
},
displayOption() {
const unit = this.unit
const showButton = this.showButton
return {
tooltips: {
displayColors: false,
Expand All @@ -145,10 +155,14 @@ export default {
return labelText
},
title(tooltipItem, data) {
return data.labels[tooltipItem[0].index].replace(
/(\w+)\/(\w+)/,
'$1月$2日'
)
if (showButton) {
return data.labels[tooltipItem[0].index].replace(
/(\w+)\/(\w+)/,
'$1月$2日'
)
} else {
return data.labels[tooltipItem[0].index]
}
}
}
},
Expand All @@ -172,7 +186,7 @@ export default {
maxRotation: 0,
minRotation: 0,
callback: label => {
return label.split('/')[1]
return this.showButton ? label.split('/')[1] : label
}
}
},
Expand Down Expand Up @@ -252,3 +266,11 @@ export default {
}
}
</script>

<style lang="scss" scoped>
.Graph-Desc {
margin: 10px 0;
font-size: 12px;
color: $gray-3;
}
</style>
68 changes: 51 additions & 17 deletions data/clusters.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
"宝塚第一病院": 0,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"海外渡航者": 0,
"ライブ関係": 0,
"不明": 1
},
{
"日付": "2020-03-02T09:00:00+09:00",
"日付": "2020-03-02T00:00:00+09:00",
"認定こども園": 0,
"北播磨医療センター": 0,
"グリーンアルス": 0,
"宝塚第一病院": 0,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"海外渡航者": 0,
"ライブ関係": 0,
"不明": 0
},
{
Expand All @@ -28,16 +32,20 @@
"宝塚第一病院": 0,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"不明": 2
"海外渡航者": 0,
"ライブ関係": 1,
"不明": 1
},
{
"日付": "2020-03-04T09:00:00+09:00",
"日付": "2020-03-04T00:00:00+09:00",
"認定こども園": 0,
"北播磨医療センター": 0,
"グリーンアルス": 0,
"宝塚第一病院": 0,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"海外渡航者": 0,
"ライブ関係": 0,
"不明": 0
},
{
Expand All @@ -48,7 +56,9 @@
"宝塚第一病院": 0,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"不明": 1
"海外渡航者": 0,
"ライブ関係": 1,
"不明": 0
},
{
"日付": "2020-03-06T00:00:00+09:00",
Expand All @@ -58,7 +68,9 @@
"宝塚第一病院": 0,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"不明": 4
"海外渡航者": 0,
"ライブ関係": 4,
"不明": 0
},
{
"日付": "2020-03-07T00:00:00+09:00",
Expand All @@ -68,7 +80,9 @@
"宝塚第一病院": 0,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"不明": 1
"海外渡航者": 0,
"ライブ関係": 1,
"不明": 0
},
{
"日付": "2020-03-08T00:00:00+09:00",
Expand All @@ -78,6 +92,8 @@
"宝塚第一病院": 0,
"仁恵病院": 1,
"介護保険通所事業所": 0,
"海外渡航者": 0,
"ライブ関係": 0,
"不明": 0
},
{
Expand All @@ -88,7 +104,9 @@
"宝塚第一病院": 0,
"仁恵病院": 1,
"介護保険通所事業所": 0,
"不明": 2
"海外渡航者": 0,
"ライブ関係": 2,
"不明": 0
},
{
"日付": "2020-03-10T00:00:00+09:00",
Expand All @@ -98,16 +116,20 @@
"宝塚第一病院": 0,
"仁恵病院": 2,
"介護保険通所事業所": 0,
"不明": 3
"海外渡航者": 1,
"ライブ関係": 1,
"不明": 1
},
{
"日付": "2020-03-11T00:00:00+09:00",
"認定こども園": 5,
"北播磨医療センター": 1,
"グリーンアルス": 4,
"宝塚第一病院": 0,
"宝塚第一病院": 1,
"仁恵病院": 2,
"介護保険通所事業所": 0,
"海外渡航者": 0,
"ライブ関係": 0,
"不明": 0
},
{
Expand All @@ -118,6 +140,8 @@
"宝塚第一病院": 0,
"仁恵病院": 4,
"介護保険通所事業所": 0,
"海外渡航者": 0,
"ライブ関係": 0,
"不明": 2
},
{
Expand All @@ -127,8 +151,10 @@
"グリーンアルス": 2,
"宝塚第一病院": 0,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"不明": 7
"介護保険通所事業所": 2,
"海外渡航者": 0,
"ライブ関係": 2,
"不明": 3
},
{
"日付": "2020-03-14T00:00:00+09:00",
Expand All @@ -138,7 +164,9 @@
"宝塚第一病院": 1,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"不明": 2
"海外渡航者": 2,
"ライブ関係": 0,
"不明": 0
},
{
"日付": "2020-03-15T00:00:00+09:00",
Expand All @@ -147,8 +175,10 @@
"グリーンアルス": 5,
"宝塚第一病院": 4,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"不明": 2
"介護保険通所事業所": 1,
"海外渡航者": 1,
"ライブ関係": 1,
"不明": 0
},
{
"日付": "2020-03-16T00:00:00+09:00",
Expand All @@ -158,7 +188,9 @@
"宝塚第一病院": 1,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"不明": 2
"海外渡航者": 1,
"ライブ関係": 0,
"不明": 1
},
{
"日付": "2020-03-17T00:00:00+09:00",
Expand All @@ -167,8 +199,10 @@
"グリーンアルス": 1,
"宝塚第一病院": 0,
"仁恵病院": 0,
"介護保険通所事業所": 0,
"不明": 3
"介護保険通所事業所": 2,
"海外渡航者": 0,
"ライブ関係": 0,
"不明": 1
}
],
"last_update": "2020/03/18 00:00"
Expand Down
Loading

0 comments on commit c3a0445

Please sign in to comment.