fix(client): タイミングによっては tag-cloud でエラーが発生するのを修正

This commit is contained in:
syuilo 2022-07-20 20:00:35 +09:00
parent e83dd90e07
commit 716cb23acb

View File

@ -25,23 +25,25 @@ let tagsEl = $ref<HTMLElement | null>(null);
let width = $ref(300); let width = $ref(300);
watch($$(available), () => { watch($$(available), () => {
window.TagCanvas.Start(idForCanvas, idForTags, { try {
textColour: '#ffffff', window.TagCanvas.Start(idForCanvas, idForTags, {
outlineColour: tinycolor(computedStyle.getPropertyValue('--accent')).toHexString(), textColour: '#ffffff',
outlineRadius: 10, outlineColour: tinycolor(computedStyle.getPropertyValue('--accent')).toHexString(),
initial: [-0.030, -0.010], outlineRadius: 10,
frontSelect: true, initial: [-0.030, -0.010],
imageRadius: 8, frontSelect: true,
//dragControl: true, imageRadius: 8,
dragThreshold: 3, //dragControl: true,
wheelZoom: false, dragThreshold: 3,
reverse: true, wheelZoom: false,
depth: 0.5, reverse: true,
maxSpeed: 0.2, depth: 0.5,
minSpeed: 0.003, maxSpeed: 0.2,
stretchX: 0.8, minSpeed: 0.003,
stretchY: 0.8, stretchX: 0.8,
}); stretchY: 0.8,
});
} catch (e) {}
}); });
onMounted(() => { onMounted(() => {
@ -58,7 +60,7 @@ onMounted(() => {
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
window.TagCanvas.Delete(idForCanvas); if (window.TagCanvas) window.TagCanvas.Delete(idForCanvas);
}); });
defineExpose({ defineExpose({