From 4e4c559db6964cbf17fcadf38d55fc79c995ca42 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 22 Oct 2021 05:36:48 +0900 Subject: Migrate to Chart.js v3 (#7896) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip * wip * wip * wip * wip * wip * wip * 定期的にresync * Update overview.vue * wip * wip --- src/client/scripts/hpml/lib.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client/scripts/hpml') diff --git a/src/client/scripts/hpml/lib.ts b/src/client/scripts/hpml/lib.ts index 150a04732f..200faf820b 100644 --- a/src/client/scripts/hpml/lib.ts +++ b/src/client/scripts/hpml/lib.ts @@ -1,11 +1,11 @@ import * as tinycolor from 'tinycolor2'; -import Chart from 'chart.js'; import { Hpml } from './evaluator'; import { values, utils } from '@syuilo/aiscript'; import { Fn, HpmlScope } from '.'; import { Expr } from './expr'; import * as seedrandom from 'seedrandom'; +/* // https://stackoverflow.com/questions/38493564/chart-area-background-color-chartjs Chart.pluginService.register({ beforeDraw: (chart, easing) => { @@ -18,6 +18,7 @@ Chart.pluginService.register({ } } }); +*/ export function initAiLib(hpml: Hpml) { return { @@ -49,11 +50,12 @@ export function initAiLib(hpml: Hpml) { ])); }), 'MkPages:chart': values.FN_NATIVE(([id, opts]) => { + /* TODO utils.assertString(id); utils.assertObject(opts); const canvas = hpml.canvases[id.value]; const color = getComputedStyle(document.documentElement).getPropertyValue('--accent'); - Chart.defaults.global.defaultFontColor = '#555'; + Chart.defaults.color = '#555'; const chart = new Chart(canvas, { type: opts.value.get('type').value, data: { @@ -122,6 +124,7 @@ export function initAiLib(hpml: Hpml) { }) } }); + */ }) }; } -- cgit v1.2.3-freya From 6171f27f8ddfda71c4101a5802a097b8832e2c42 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 23 Oct 2021 01:04:29 +0900 Subject: :art: --- src/client/components/queue-chart.vue | 14 ++++++++++++-- src/client/scripts/hpml/lib.ts | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/client/scripts/hpml') diff --git a/src/client/components/queue-chart.vue b/src/client/components/queue-chart.vue index 5962708804..59c9723f89 100644 --- a/src/client/components/queue-chart.vue +++ b/src/client/components/queue-chart.vue @@ -121,10 +121,20 @@ export default defineComponent({ }, scales: { x: { - + grid: { + display: false, + color: gridColor, + borderColor: 'rgb(0, 0, 0, 0)', + }, + ticks: { + display: false, + }, }, y: { - + grid: { + color: gridColor, + borderColor: 'rgb(0, 0, 0, 0)', + }, }, }, interaction: { diff --git a/src/client/scripts/hpml/lib.ts b/src/client/scripts/hpml/lib.ts index 200faf820b..2a1ac73a40 100644 --- a/src/client/scripts/hpml/lib.ts +++ b/src/client/scripts/hpml/lib.ts @@ -5,7 +5,7 @@ import { Fn, HpmlScope } from '.'; import { Expr } from './expr'; import * as seedrandom from 'seedrandom'; -/* +/* TODO: https://www.chartjs.org/docs/latest/configuration/canvas-background.html#color // https://stackoverflow.com/questions/38493564/chart-area-background-color-chartjs Chart.pluginService.register({ beforeDraw: (chart, easing) => { -- cgit v1.2.3-freya