mirror of
https://github.com/olehomelchenko/olehomelchenko.com.git
synced 2025-12-21 21:22:22 +00:00
add some articles
This commit is contained in:
@@ -18,6 +18,10 @@
|
||||
<script src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script>
|
||||
{{ end }}
|
||||
<style>
|
||||
.vega-container {
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
}
|
||||
.vega-embed {
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 6px 20px rgba(0, 0, 0, 0.19);
|
||||
margin: 10px;
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
<!-- Create a unique ID for the div where the Vega-Lite visualization will be rendered -->
|
||||
<div class="vegaVis" id="{{ .Get "id" | default "vega-lite-vis" }}"></div>
|
||||
<div class="vega-container">
|
||||
<div class="vegaVis" id="{{ .Get "id" | default "vega-lite-vis" }}"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const spec = {{ .Inner | safeJS }};
|
||||
spec['width'] = {{ .Get "width" | default 700}};
|
||||
spec['height'] = {{ .Get "height" | default 300}};
|
||||
vegaEmbed('#{{ .Get "id" | default "vega-lite-vis" }}', spec, {"actions": false}).catch(console.error);
|
||||
(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>
|
||||
|
||||
Reference in New Issue
Block a user