Skip to main content
Create new
Introduction
Reactivity
Props
Logic
Events
Bindings
Lifecycle
Stores
Motion
Transitions
Animations
Easing
SVG
Actions
Classes
Component composition
Context API
Special elements
Module context
Debugging
7GUIs
Miscellaneous
App.svelte
Chart.svelte
Header.svelte
dataPaths.js
loadData.js
store.js
<script>
import { store } from './store.js'
import loadData from './loadData.js'
import Header from './Header.svelte'
import Chart from './Chart.svelte'

let data
$: updateData()
async function getData(){
let data = await loadData()
return data[0]
}
async function updateData() {
data = await getData()
}
let search = "";

function searchFor(search) {
return data.filter(item => {
return Object.values(item).some(value => {
if (typeof value === "number") {
value = String(value);
}
if (typeof value === "object") {
value = formatDate(value);
}

return value.toLowerCase().includes(search.toLowerCase());
});
});
}

$: filtered = search ? searchFor(search) : data;
loading Svelte compiler...
/* Select a component to see its compiled code */
result = svelte.compile(source, {
generate: ,
});
/* Select a component to see its compiled code */