/TableauSample

Test project running Tableau in Blazor

Primary LanguageHTML

TableauSample

Test project running Tableau in Blazor, to help answer https://stackoverflow.com/questions/58519173/how-to-embed-tableau-into-asp-net-core-blazor

I used the basic sample at https://help.tableau.com/current/api/js_api/en-us/JavaScriptAPI/js_api_sample_basic_embed.htm and made the following changes to make it work in Blazor:

  • use a Blazor @ref to get an element reference
  • created tableauInterop.js in the wwwroot folder
  • add the Tableau library to _Host.cshtml and imported the tableauInterop as well
  • modified Index.razor to add a div and an OnAfterRenderAsync override to invoke the interop lib

Sample