mirror of
https://github.com/olehomelchenko/olehomelchenko.com.git
synced 2025-12-21 21:22:22 +00:00
17 lines
626 B
HTML
17 lines
626 B
HTML
<!-- Create a unique ID for the div where the Vega-Lite visualization will be rendered -->
|
|
<div class="vega-container">
|
|
<div class="vegaVis" id="{{ .Get "id" | default "vega-lite-vis" }}"></div>
|
|
</div>
|
|
|
|
<script>
|
|
(function() {
|
|
|
|
let spec = {{ .Inner | safeJS }};
|
|
let actions = {{ .Get "actions" | default false}};
|
|
spec['width'] = spec['width']? spec['width'] : {{ .Get "width" | default 700}};
|
|
spec['height'] = spec['height']? spec['height'] : {{ .Get "height" | default 300}};
|
|
vegaEmbed('#{{ .Get "id" | default "vega-lite-vis" }}', spec, {"actions": actions}).catch(console.error);
|
|
})();
|
|
|
|
</script>
|