-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change syntax to svelte 5 (#972)
* refactor: change syntax to svelte 5 * remove compiler optins * depend on svelte 5 and add explicit sveltekit dependencies (#973) * update optional props * chore: update deps * components are no longer classes --------- Co-authored-by: Dominik Moritz <domoritz@gmail.com>
- Loading branch information
Showing
14 changed files
with
265 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import { mount } from 'svelte'; | ||
import './app.css'; | ||
import App from './App.svelte'; | ||
|
||
const app = new App({ | ||
target: document.getElementById('app') | ||
}); | ||
const app = mount(App, { target: document.getElementById('app') }); | ||
|
||
export default app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
<script lang="ts"> | ||
import type { EmbedOptions, Mode } from 'vega-embed'; | ||
import type { SignalListeners, VisualizationSpec, View } from './types'; | ||
import type { SignalListeners, View, VisualizationSpec } from './types'; | ||
import VegaEmbed from './VegaEmbed.svelte'; | ||
export let spec: VisualizationSpec; | ||
export let options: EmbedOptions = {}; | ||
export let data: Record<string, unknown> = {}; | ||
export let signalListeners: SignalListeners = {}; | ||
export let view: View | undefined = undefined; | ||
let { | ||
spec, | ||
options, | ||
data, | ||
signalListeners, | ||
view = $bindable(), | ||
onNewView, | ||
onError | ||
}: { | ||
spec: VisualizationSpec; | ||
options?: EmbedOptions; | ||
data: Record<string, unknown>; | ||
signalListeners?: SignalListeners; | ||
view: View | undefined; | ||
onNewView?: (view: View) => void; | ||
onError?: (error: Error) => void; | ||
} = $props(); | ||
const mode = 'vega' as Mode; | ||
$: vegaOptions = { ...options, mode: mode }; | ||
const vegaOptions = $derived({ ...options, mode: 'vega' as Mode }); | ||
</script> | ||
|
||
<VegaEmbed | ||
{spec} | ||
{data} | ||
{signalListeners} | ||
options={vegaOptions} | ||
bind:view | ||
on:onNewView | ||
on:onError | ||
/> | ||
<VegaEmbed {spec} {data} {signalListeners} options={vegaOptions} bind:view {onNewView} {onError} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.