fixes formatting and lints

This commit is contained in:
2024-12-27 11:05:47 -05:00
parent 147d1abaf8
commit 12f27bad69
11 changed files with 281 additions and 210 deletions

View File

@@ -140,8 +140,7 @@ const lines = computed(() => {
:timestamp="tick"
:utc="props.utc"
:show_millis="duration < 1000"
>
</TimeText>
></TimeText>
</template>
</g>
<slot></slot>

View File

@@ -5,8 +5,8 @@ const props = defineProps<{
x: number;
y: number;
timestamp: number;
utc?: boolean
show_millis?: boolean
utc?: boolean;
show_millis?: boolean;
}>();
// This function is slow
@@ -61,18 +61,12 @@ function getDateString(date: Date) {
const timetext = computed(() => {
return getDateString(new Date(props.timestamp));
});
</script>
<template>
<text
:x="props.x"
:y="props.y"
>
<text :x="props.x" :y="props.y">
{{ timetext }}
</text>
</template>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>

View File

@@ -1,6 +1,5 @@
<script setup lang="ts">
import { computed, ref, useTemplateRef, watch, watchPostEffect } from 'vue';
import { useNow } from '@/composables/ticker';
import { computed, ref, useTemplateRef, watch } from 'vue';
const props = defineProps<{
x: number;
@@ -19,12 +18,15 @@ const value_text = computed(() => {
const label_width = ref(0);
watch([value_text, labelRef], ([_, label]) => {
label_width.value = label?.getBBox().width || 0;
}, {
flush: 'post',
});
watch(
[value_text, labelRef],
([, label]) => {
label_width.value = label?.getBBox().width || 0;
},
{
flush: 'post',
},
);
</script>
<template>
@@ -34,11 +36,7 @@ watch([value_text, labelRef], ([_, label]) => {
:width="label_width + background_offset * 2"
:height="16 + background_offset * 2"
></rect>
<text
ref="label-ref"
:x="x"
:y="y"
>
<text ref="label-ref" :x="x" :y="y">
{{ value_text }}
</text>
</template>
@@ -59,4 +57,4 @@ text {
fill: var(--indexed-color);
dominant-baseline: middle;
}
</style>
</style>