Last active
February 24, 2024 23:21
-
-
Save hobelinm/de089f99c3543e2a16f8f24fee4d958e to your computer and use it in GitHub Desktop.
Hugo shortcode to embed Tableau Vizzes
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
{{/* Featured on: */}} | |
{{/* https://brewingcats.com/posts/projects/software/tableauparser/ */}} | |
{{/* https://brewingcats.com/es/posts/projects/software/tableauparser/ */}} | |
{{/* tableau "viz_id" "view_pre" "view_id" "view_name" */}} | |
<div class='tableauPlaceholder' id='{{.Get 0 }}' style='position: relative'> | |
<noscript> | |
<a href='#'> | |
<img alt=' ' | |
src='https://public.tableau.com/static/images/{{.Get 1 }}/{{.Get 2 }}/{{.Get 3 }}/1_rss.png' | |
style='border: none' /> | |
</a> | |
</noscript> | |
<object class='tableauViz' style='display:none;'> | |
<param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> | |
<param name='embed_code_version' value='3' /> | |
<param name='site_root' value='' /> | |
<param name='name' value='{{.Get 2 }}/{{.Get 3 }}' /> | |
<param name='tabs' value='no' /> | |
<param name='toolbar' value='yes' /> | |
<param name='static_image' | |
value='https://public.tableau.com/static/images/{{.Get 1 }}/{{.Get 2 }}/{{.Get 3 }}/1.png' /> | |
<param name='animate_transition' value='yes' /> | |
<param name='display_static_image' value='yes' /> | |
<param name='display_spinner' value='yes' /> | |
<param name='display_overlay' value='yes' /> | |
<param name='display_count' value='yes' /> | |
<param name='language' value='en' /> | |
</object> | |
</div> | |
<script type='text/javascript'> | |
var divElement = document.getElementById('{{.Get 0 }}'); | |
var vizElement = divElement.getElementsByTagName('object')[0]; | |
vizElement.style.width='1024px';vizElement.style.height='795px'; | |
var scriptElement = document.createElement('script'); | |
scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js'; | |
vizElement.parentNode.insertBefore(scriptElement, vizElement); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment