2 Replies Latest reply on Jun 21, 2019 6:08 PM by John Hegele

    React/ JS API Viz Issue

    Ben  Hazzard

      Hello,

       

      I'm trying to implement a dashboard from Tableau public into my project, but I'm having an issue calling the Viz constructor.

      Page Component:

      Screen Shot 2018-12-29 at 5.24.48 PM.png

      Viz Component:

      Screen Shot 2018-12-29 at 5.24.32 PM.png

       

      Error:

      Screen Shot 2018-12-29 at 5.26.02 PM.png

       

      I have also included a .d.ts file in the tableau-api directory to declare both of the files.

       

      Thanks!

        • 1. Re: React/ JS API Viz Issue
          patrick.byrne.0

          Hello Ben,

           

          Thanks for posting in the Tableau Community. I have not been able to find any information on the error that is returned.

           

          I might consider also trying to post on the Tableau GitHub page regarding the error if you are able to reproduce it with a sample.

           

          Issues · tableau/js-api-samples · GitHub

           

          My comment will also bring this post back to the top of the feed. Hope this helps!

           

          Cheers,

          Byrne, Patrick

          Community Manager

          Tableau Software

          • 2. Re: React/ JS API Viz Issue
            John Hegele

            Hey Ben,

             

            I hope that you got this sorted out since I'm about 6 months late to this questions. But I stumbled across this searching for something else so wanted to chime in.

             

            I'm pretty sure that the issue you're hitting here is that the way you're instantiating the Viz class is invalid. You are using:

             

            var viz = new tableau.Viz(url)

             

            The constructor for the Viz class requires three arguments: domNode, url, and options (see API Reference - Tableau ) and you are only passing one. You need to provide a value DOM node where the viz will be rendered, the URL of the viz itself, and any options you want to apply to the viz.

             

            John

            1 of 1 people found this helpful