Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                    <div style="max-width:1100px; margin: auto;">                     <!-- Add this div to center the content -->
      <tableau-viz
        src="https://public.tableau.com/views/FleetwoodMacTheMembersandtheAlbums/FWM"
        device="default"
        hide-tabs
        toolbar="bottom"
      >
      </tableau-viz>
    </div>                                                            <!-- End of the div for centering the content -->
              
            
!

CSS

              
                
              
            
!

JS

              
                      import { TableauEventType } from 'https://public.tableau.com/javascripts/api/tableau.embedding.3.latest.js';
      (async () => {
        // Get the viz object from the HTML web component
        const viz = document.querySelector('tableau-viz, tableau-authoring-viz');

        // The value of the token variable is generated and available when this code executes in the playground.
        // You will have to generate this token. See CA documentation- https://sfdc.co/chGcg5.
        viz.token = window.token;

        // Wait for the viz to become interactive
        await new Promise((resolve, reject) => {
          // Add an event listener to verify the viz becomes interactive
          viz.addEventListener(TableauEventType.FirstInteractive, () => {
            console.log('Viz is interactive!');
            resolve();
          });

          viz.addEventListener(TableauEventType.VizLoadError, (error) => {
            const message = JSON.parse(error.detail.message);
            const errorMessage = JSON.parse(message.errorMessage);

            const displayMessage = `ca-error-${errorMessage.result.errors[0].code}`;
            reject(displayMessage);
          });
        });
      })();

              
            
!
999px

Console