Skip to content

Commit

Permalink
Merge pull request #2 from tokyo-metropolitan-gov/development
Browse files Browse the repository at this point in the history
sync origin
  • Loading branch information
soutaito authored Jan 22, 2021
2 parents 912cf8a + addd809 commit 6ae23f3
Show file tree
Hide file tree
Showing 15 changed files with 312 additions and 286 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: '10.23.1'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: '10.23.1'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ogp_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: '10.23.1'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/screenshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: '10.23.1'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
node-version: '10.23.1'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand Down
51 changes: 30 additions & 21 deletions components/DashedRectangleTimeBarChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -255,21 +255,22 @@ const options: ThisTypedComponentOptionsWithRecordProps<
}
},
displayOption() {
const self = this
const unit = this.unit
const scaledTicksYAxisMax = this.scaledTicksYAxisMax
const options: Chart.ChartOptions = {
tooltips: {
displayColors: false,
filter(tooltipItem) {
return tooltipItem.datasetIndex !== 1
},
callbacks: {
label(tooltipItem) {
label: (tooltipItem) => {
return `${parseInt(tooltipItem.value!).toLocaleString()} ${unit}`
},
title(tooltipItem, data) {
title: (tooltipItem, data) => {
const label = data.labels![tooltipItem[0].index!] as string
return self.$d(new Date(label), 'date')
return this.$d(new Date(label), 'date')
},
},
},
Expand Down Expand Up @@ -316,31 +317,34 @@ const options: ThisTypedComponentOptionsWithRecordProps<
time: {
unit: 'month',
displayFormats: {
month: 'MMM',
month: 'YYYY-MM',
},
},
},
],
yAxes: [
{
stacked: true,
position: 'left',
gridLines: {
display: true,
drawOnChartArea: true,
color: '#E5E5E5',
},
ticks: {
suggestedMin: 0,
maxTicksLimit: 8,
fontColor: '#808080', // #808080
suggestedMax: this.scaledTicksYAxisMax,
fontColor: '#808080',
suggestedMin: 0,
suggestedMax: scaledTicksYAxisMax,
},
},
],
},
}
if (this.$route.query.ogp === 'true') {
Object.assign(options, { animation: { duration: 0 } })
}
return options
},
displayDataHeader() {
Expand All @@ -356,12 +360,14 @@ const options: ThisTypedComponentOptionsWithRecordProps<
}
},
displayOptionHeader() {
const scaledTicksYAxisMax = this.scaledTicksYAxisMax
const options: Chart.ChartOptions = {
tooltips: { enabled: false },
maintainAspectRatio: false,
legend: {
display: false,
},
tooltips: { enabled: false },
scales: {
xAxes: [
{
Expand All @@ -373,9 +379,8 @@ const options: ThisTypedComponentOptionsWithRecordProps<
ticks: {
fontSize: 9,
maxTicksLimit: 20,
fontColor: 'transparent',
fontColor: 'transparent', // displayOption では '#808080'
maxRotation: 0,
minRotation: 0,
callback: (label: string) => {
return dayjs(label).format('D')
},
Expand All @@ -386,41 +391,45 @@ const options: ThisTypedComponentOptionsWithRecordProps<
stacked: true,
gridLines: {
drawOnChartArea: false,
drawTicks: false, // true -> false
drawTicks: false, // displayOption では true
drawBorder: false,
tickMarkLength: 10,
},
ticks: {
fontSize: 11,
fontColor: 'transparent', // #808080
padding: 13, // 3 + 10(tickMarkLength)
fontColor: 'transparent', // displayOption では '#808080'
padding: 13, // 3 + 10(tickMarkLength),displayOption では 3
fontStyle: 'bold',
},
type: 'time',
time: {
unit: 'month',
displayFormats: {
month: 'YYYY-MM',
},
},
},
],
yAxes: [
{
stacked: true,
position: 'left',
gridLines: {
display: true,
drawOnChartArea: false,
color: '#E5E5E5', // #E5E5E5
drawOnChartArea: false, // displayOption では true
color: '#E5E5E5',
},
ticks: {
suggestedMin: 0,
maxTicksLimit: 8,
fontColor: '#808080', // #808080
suggestedMax: this.scaledTicksYAxisMax,
fontColor: '#808080',
suggestedMin: 0,
suggestedMax: scaledTicksYAxisMax,
},
},
],
},
animation: { duration: 0 },
}
return options
},
scaledTicksYAxisMax() {
Expand Down
53 changes: 29 additions & 24 deletions components/FeverMixedChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,15 @@ const options: ThisTypedComponentOptionsWithRecordProps<
.reverse()
},
displayOption() {
const self = this
const unit = this.unit[1]
const getFormatter = this.getFormatter
const scaledTicksYAxisMax = this.scaledTicksYAxisMax
const options: Chart.ChartOptions = {
tooltips: {
displayColors: false,
callbacks: {
label: (tooltipItem) => {
const formatter = getFormatter(tooltipItem.datasetIndex!)
const formatter = this.getFormatter(tooltipItem.datasetIndex!)
const cases = formatter(parseFloat(tooltipItem.value!))
let label = `${
this.dataLabels[tooltipItem.datasetIndex!]
Expand All @@ -325,10 +325,10 @@ const options: ThisTypedComponentOptionsWithRecordProps<
}
return label
},
title(tooltipItem, data) {
title: (tooltipItem, data) => {
if (tooltipItem[0].datasetIndex! < 4) {
const label = data.labels![tooltipItem[0].index!] as string
return self.$d(new Date(label), 'date')
return this.$d(new Date(label), 'date')
}
return ''
},
Expand Down Expand Up @@ -377,32 +377,34 @@ const options: ThisTypedComponentOptionsWithRecordProps<
time: {
unit: 'month',
displayFormats: {
month: 'MMM',
month: 'YYYY-MM',
},
},
},
],
yAxes: [
{
stacked: true,
position: 'left',
gridLines: {
display: true,
drawOnChartArea: true,
color: '#E5E5E5', // #E5E5E5
color: '#E5E5E5',
},
ticks: {
suggestedMin: 0,
maxTicksLimit: 8,
fontColor: '#808080', // #808080
suggestedMax: this.scaledTicksYAxisMax,
fontColor: '#808080',
suggestedMin: 0,
suggestedMax: scaledTicksYAxisMax,
},
},
],
},
}
if (this.$route.query.ogp === 'true') {
Object.assign(options, { animation: { duration: 0 } })
}
return options
},
displayDataHeader() {
Expand Down Expand Up @@ -436,12 +438,14 @@ const options: ThisTypedComponentOptionsWithRecordProps<
}
},
displayOptionHeader() {
const scaledTicksYAxisMax = this.scaledTicksYAxisMax
const options: Chart.ChartOptions = {
tooltips: { enabled: false },
maintainAspectRatio: false,
legend: {
display: false,
},
tooltips: { enabled: false },
scales: {
xAxes: [
{
Expand All @@ -453,9 +457,8 @@ const options: ThisTypedComponentOptionsWithRecordProps<
ticks: {
fontSize: 9,
maxTicksLimit: 20,
fontColor: 'transparent',
fontColor: 'transparent', // displayOption では '#808080'
maxRotation: 0,
minRotation: 0,
callback: (label: string) => {
return dayjs(label).format('D')
},
Expand All @@ -466,43 +469,45 @@ const options: ThisTypedComponentOptionsWithRecordProps<
stacked: true,
gridLines: {
drawOnChartArea: false,
drawTicks: false, // true -> false
drawTicks: false, // displayOption では true
drawBorder: false,
tickMarkLength: 10,
},
ticks: {
fontSize: 11,
fontColor: 'transparent', // #808080
padding: 13, // 3 + 10(tickMarkLength)
fontColor: 'transparent', // displayOption では '#808080'
padding: 13, // 3 + 10(tickMarkLength),displayOption では 3
fontStyle: 'bold',
},
type: 'time',
time: {
unit: 'month',
displayFormats: {
month: 'YYYY-MM',
},
},
},
],
yAxes: [
{
type: 'linear',
position: 'left',
stacked: true,
gridLines: {
display: true,
drawOnChartArea: false,
color: '#E5E5E5', // #E5E5E5
drawOnChartArea: false, // displayOption では true
color: '#E5E5E5',
},
ticks: {
suggestedMin: 0,
maxTicksLimit: 8,
fontColor: '#808080', // #808080
suggestedMax: this.scaledTicksYAxisMax,
fontColor: '#808080',
suggestedMin: 0,
suggestedMax: scaledTicksYAxisMax,
},
},
],
},
animation: { duration: 0 },
}
return options
},
scaledTicksYAxisMax() {
Expand Down
Loading

0 comments on commit 6ae23f3

Please sign in to comment.