2 import { beforeUpdate, onMount } from 'svelte';
3 import {sex,nex,haks,fatal,hak,map} from "$lib/Y/Pic"
4 import Chart from 'chart.js/auto'; // Auto import for all chart types
19 const ctx = chartContainer.getContext('2d');
22 if (!hak(spam.N)) return
24 // elect an x axis label
25 let label_looking = 'now,time,x'
27 spam.N.map(q => sex(labelly,q,label_looking))
28 let label = haks(labelly)[0]
31 // put others on the y axis
33 spam.N.map(q => nex(datatic,q,label_looking))
37 'green','blue','red','beige','orange','brown','pink'
39 let datasets = map((k) => { return {
41 // data: geometryHistory.map(entry => entry.width),
42 borderColor: colours.shift()
44 myChart = new Chart(ctx, {
45 type: 'line', // Start with a line chart
48 // You can add customization options here if you like
51 console.log("Init'd Chart", datasets)
57 // Update chart when data changes!!!!!!!
59 $: if (vers, spam && myChart && hak(spam.N)) {
64 myChart.data.labels = spam.N.map(q => q[x])
68 myChart.data.datasets[i] ||= {}
69 myChart.data.datasets[i].data = spam.N.map(q => q[k])
73 console.log("Upd'd Chart")
75 spam.update = (a) => {
77 console.log("spamn update")
79 console.log("charted")
83 <canvas bind:this={chartContainer} style="position:relative;"></canvas>
87 border: 2em solid purple;