Initial migration to Svelte5 via full syntax compatability

- updated all dependencies
- removed svelte-chartjs wrapper from dependencies
- sveltestrap causes compilation warnings (once)
- Header.svelte uses new Svelte5 syntax as example
- fixed most initial compilation warnings except circular dependencies with TBD cause
This commit is contained in:
Christoph Kluge
2025-02-03 17:31:01 +01:00
parent 1e63cdbcda
commit 5681062f01
27 changed files with 561 additions and 471 deletions

View File

@@ -1,5 +1,5 @@
<!--
@component Pie Plot based on uPlot Pie
@component Pie Plot based on chart.js Pie
Properties:
- `size Number`: X and Y size of the plot, for square shape
@@ -31,33 +31,17 @@
]
</script>
<script>
import { Pie } from 'svelte-chartjs';
import {
Chart as ChartJS,
Title,
Tooltip,
Legend,
Filler,
ArcElement,
CategoryScale
} from 'chart.js';
ChartJS.register(
Title,
Tooltip,
Legend,
Filler,
ArcElement,
CategoryScale
);
import Chart from 'chart.js/auto'
import { onMount } from 'svelte';
export let canvasId
export let size
export let sliceLabel
export let quantities
export let entities
export let displayLegend = false
$: data = {
const data = {
labels: entities,
datasets: [
{
@@ -79,10 +63,22 @@
}
}
onMount(() => {
new Chart(
document.getElementById(canvasId),
{
type: 'pie',
data: data,
options: options
}
);
});
</script>
<!-- <div style="width: 500px;"><canvas id="dimensions"></canvas></div><br/> -->
<div class="chart-container" style="--container-width: {size}; --container-height: {size}">
<Pie {data} {options}/>
<canvas id={canvasId}></canvas>
</div>
<style>