-
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.
feat: expose resulting Vega View (#59)
Co-authored-by: Alex Cabrera <angel_cabrera@apple.com>
- Loading branch information
1 parent
58e524d
commit e933cf3
Showing
4 changed files
with
31 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
<script lang="ts"> | ||
import type { EmbedOptions, Mode } from "vega-embed"; | ||
import type { SignalListeners, VisualizationSpec } from "./types"; | ||
import type { SignalListeners, VisualizationSpec, View } from "./types"; | ||
import VegaEmbed from "./VegaEmbed.svelte"; | ||
export let view: View | undefined; | ||
export let spec: VisualizationSpec; | ||
export let options: EmbedOptions = {}; | ||
export let data: Record<string, unknown> = {}; | ||
export let signalListeners: SignalListeners = {}; | ||
const mode = "vega" as Mode; | ||
$: vegaOptions = { ...options, mode: mode }; | ||
</script> | ||
|
||
<VegaEmbed | ||
{spec} | ||
{data} | ||
{signalListeners} | ||
options={vegaOptions} | ||
bind:view | ||
on:onNewView | ||
on: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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
<script lang="ts"> | ||
import type { EmbedOptions, Mode } from "vega-embed"; | ||
import type { SignalListeners, VisualizationSpec } from "./types"; | ||
import type { SignalListeners, VisualizationSpec, View } from "./types"; | ||
import VegaEmbed from "./VegaEmbed.svelte"; | ||
export let view: View | undefined; | ||
export let spec: VisualizationSpec; | ||
export let options: EmbedOptions = {}; | ||
export let data: Record<string, unknown> = {}; | ||
export let signalListeners: SignalListeners = {}; | ||
const mode = "vega-lite" as Mode; | ||
$: vegaLiteOptions = { ...options, mode: mode }; | ||
</script> | ||
|
||
<VegaEmbed | ||
{spec} | ||
{data} | ||
{signalListeners} | ||
options={vegaLiteOptions} | ||
bind:view | ||
on:onNewView | ||
on:onError | ||
/> |