-
Notifications
You must be signed in to change notification settings - Fork 261
Added samples for Dashboard Layout and Set Click Through #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seanmakesgames
merged 2 commits into
dev
from
ahsiao/add-dashboard-layout-and-clickthrough-samples
Oct 1, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest manifest-version="0.1" xmlns="http://www.tableau.com/xml/extension_manifest"> | ||
| <dashboard-extension id="com.tableau.extensions.samples.dashboardlayout" extension-version="0.1.0"> | ||
| <default-locale>en_US</default-locale> | ||
| <name resource-id="name"/> | ||
| <description>Dashboard Layout Sample</description> | ||
| <author name="tableau" email="github@tableau.com" organization="tableau" website="https://www.tableau.com"/> | ||
| <min-api-version>1.7</min-api-version> | ||
| <source-location> | ||
| <url>http://localhost:8765/Samples-Typescript/DashboardLayout/dashboardLayout.html</url> | ||
| </source-location> | ||
| <icon>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH4QgLDTYEcBRoeAAABp9JREFUeNrlm01sHEUWx//vVbs79gThjAd2iflIAkEcEARfEciBSYLEbbV8SJaDEpIAMQgkViuirA8IskKcdiEJX3G0C5d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K/V/BwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wOC0xMVQxMzo1NDowNC0wNDowMMrC9wEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDgtMTFUMTM6NTQ6MDQtMDQ6MDC7n0+9AAAAAElFTkSuQmCC</icon> | ||
| </dashboard-extension> | ||
| <resources> | ||
| <resource id="name"> | ||
| <text locale="en_US">Dashboard Layout Sample</text> | ||
| </resource> | ||
| </resources> | ||
| </manifest> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <title>Dashboard Layout Sample</title> | ||
| <!-- jQuery --> | ||
| <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | ||
|
|
||
| <!-- Bootstrap --> | ||
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
|
|
||
| <!-- Extensions Library (this will be hosted on a CDN eventually) --> | ||
| <script src="../../lib/tableau.extensions.1.latest.js"></script> | ||
|
|
||
| <!-- Our extension's code --> | ||
| <script src="../../dist/dashboardLayout.js"></script> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <h1>Dashboard Layout Sample</h1> | ||
| <button id="dashboard-event-btn" class="btn btn-primary" disabled="true">Add Dashboard Event</button> | ||
| <hr> | ||
| <h3>Dashboard Changes</h3> | ||
| <div id="dashboard-layout-change-list" class="container"> | ||
| </div> | ||
| </div> | ||
| </body> | ||
| </html> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| import { DashboardLayoutChange, DashboardLayoutChangedEvent, DashboardObject, TableauEvent } from '@tableau/extensions-api-types'; | ||
|
|
||
| // Wrap everything in an anonymous function to avoid polluting the global namespace | ||
| (async () => { | ||
| class DashboardLayout { | ||
| public dashboardObjects: DashboardObject[]; | ||
| private self: DashboardLayout; | ||
|
|
||
| // Avoid globals. | ||
| constructor(private _$: JQueryStatic) {} | ||
|
|
||
| /** | ||
| * Initializes the extension | ||
| */ | ||
| public async initialize() { | ||
| console.log('Waiting for DOM ready'); | ||
| await this._$.ready; | ||
| console.log('Initializing extension API'); | ||
| await tableau.extensions.initializeAsync(); | ||
|
|
||
| const dashboard = tableau.extensions.dashboardContent.dashboard; | ||
| this.dashboardObjects = dashboard.objects; | ||
| console.log(this.dashboardObjects); | ||
|
|
||
| // enabling dashboard event button | ||
| this._$('#dashboard-event-btn').prop('disabled', false); | ||
| this._$('#dashboard-event-btn').click(this.onEventButtonClick.bind(this)); | ||
| } | ||
|
|
||
| // When changes are made to the dashboard we get all the details for each of the | ||
| // dashboard objects that were changed and compare it with their previous values. | ||
| // The dashboardLayoutChangeDetails property is a map of dashboard obj3ct ids to | ||
| // an array of dashboard layout changes. | ||
| // Dashboard layout change events are invoked when dashboard objects are resized, | ||
| // repositioned, added, and more. See DashboardLayoutChange in the API documentation | ||
| // for all possible actions. | ||
| // Extension reloads when worksheets are added / removed. | ||
| private onDashboardLayoutChange(event: TableauEvent) { | ||
| console.log(event); | ||
| const dashboardEvent = event as DashboardLayoutChangedEvent; | ||
| const dashboardEventDetails = dashboardEvent.dashboardLayoutChangeDetails; | ||
| const dashboard = tableau.extensions.dashboardContent.dashboard; | ||
|
|
||
| // updating dashboard objects and storing the previous dashboard objects for referrence. | ||
| const oldDashboardObjects = this.dashboardObjects; | ||
| this.dashboardObjects = dashboard.objects; | ||
|
|
||
| // An empty dashboard layout change event may be invoked when loading an extension from the manifest. | ||
| // In this case we ignore it and return. | ||
| if (dashboardEventDetails === undefined || dashboardEventDetails.size === 0) { | ||
| return; | ||
| } | ||
|
|
||
| // Emptying previous content from the UI's change list. | ||
| this._$('#dashboard-layout-change-list').empty(); | ||
|
|
||
| // Updating UI's change list to display information on the current dashboard event. | ||
| dashboardEventDetails.forEach((changesMade: DashboardLayoutChange[], dashboardObjectId: number) => { | ||
| // getting dashboard object from its id | ||
| const dashboardObject = dashboard.getDashboardObjectById(dashboardObjectId); | ||
|
|
||
| // building a div for the changes made to this dashboard object. | ||
| const changesDiv = this._$('<div>'); | ||
|
|
||
| // checking if this dashboard object was added as part of the event. | ||
| if (changesMade.includes(tableau.DashboardLayoutChange.Added)) { | ||
| const toAppend = this._$('<h6/>'); | ||
| toAppend.text(`Dashboard Object ${dashboardObjectId} added: "${dashboardObject.name}"`); | ||
| changesDiv.append(toAppend); | ||
| this._$('#dashboard-layout-change-list').append(changesDiv); | ||
| return; | ||
| } | ||
|
|
||
| // getting old dashboard object before event to compare it with the current one. | ||
| const oldDashboardObject = oldDashboardObjects.find(o => o.id === dashboardObjectId); | ||
|
|
||
| // checking if this dashboard object was removed as part of the event. | ||
| if (changesMade.includes(tableau.DashboardLayoutChange.Removed)) { | ||
| const toAppend = this._$('<h6/>'); | ||
| toAppend.text(`Dashboard Object ${dashboardObjectId} removed: "${oldDashboardObject.name}"`); | ||
| changesDiv.append(toAppend); | ||
| this._$('#dashboard-layout-change-list').append(changesDiv); | ||
| return; | ||
| } | ||
|
|
||
| // the following dashboard changes are not mutually exclusive, so we list them together. | ||
| const h6 = this._$('<h6/>'); | ||
| h6.text(`Dashboard Object ${dashboardObjectId}: "${dashboardObject.name}"`); | ||
| changesDiv.append(h6); | ||
| const ul = this._$('<ul/>'); | ||
|
|
||
| // checking if the dashboard object had changes to its floating state. | ||
| if (changesMade.includes(tableau.DashboardLayoutChange.IsFloatingChanged)) { | ||
| const li = this._$('<li/>'); | ||
| li.text(`Floating is now ${dashboardObject.isFloating}, was ${oldDashboardObject.isFloating}`); | ||
| ul.append(li); | ||
| } | ||
|
|
||
| // checking if the dashbaord object had changes to its visibility. | ||
alicemhsiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (changesMade.includes(tableau.DashboardLayoutChange.IsVisibleChanged)) { | ||
| const li = this._$('<li/>'); | ||
| li.text(`Visibility is now ${dashboardObject.isVisible}, was ${oldDashboardObject.isVisible}`); | ||
| ul.append(li); | ||
| } | ||
|
|
||
| // checking if the dashboard object was repositioned. | ||
alicemhsiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (changesMade.includes(tableau.DashboardLayoutChange.PositionChanged)) { | ||
| const li = this._$('<li/>'); | ||
| const newPos = dashboardObject.position; | ||
| const oldPos = oldDashboardObject.position; | ||
| li.text(`Position is now (${newPos.x},${newPos.y}), was (${oldPos.x},${oldPos.y})`); | ||
| ul.append(li); | ||
| } | ||
|
|
||
| // checking if the dashboard object was resized. | ||
alicemhsiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (changesMade.includes(tableau.DashboardLayoutChange.SizeChanged)) { | ||
| const li = this._$('<li/>'); | ||
| const newSize = dashboardObject.size; | ||
| const oldSize = oldDashboardObject.size; | ||
| li.text(`Size is now ${newSize.width}x${newSize.height}, was ${oldSize.width}x${oldSize.height}`); | ||
| ul.append(li); | ||
| } | ||
|
|
||
| // checking if the dashboard object was renamed. | ||
alicemhsiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (changesMade.includes(tableau.DashboardLayoutChange.NameChanged)) { | ||
| const li = this._$('<li/>'); | ||
| li.text(`Name is now "${dashboardObject.name}", was "${oldDashboardObject.name}"`); | ||
| ul.append(li); | ||
| } | ||
|
|
||
| changesDiv.append(ul); | ||
| this._$('#dashboard-layout-change-list').append(changesDiv); | ||
| }); | ||
| } | ||
|
|
||
| // This function adds a dashboard event if there is not one already, and removes it if there is. | ||
| private onEventButtonClick() { | ||
| const dashboard = tableau.extensions.dashboardContent.dashboard; | ||
| if ($('#dashboard-event-btn').text() === 'Add Dashboard Event') { | ||
| dashboard.addEventListener(tableau.TableauEventType.DashboardLayoutChanged, | ||
| (event) => this.onDashboardLayoutChange(event)); | ||
| $('#dashboard-event-btn').text('Remove Dashboard Event'); | ||
| } else { | ||
| dashboard.removeEventListener(tableau.TableauEventType.DashboardLayoutChanged, | ||
| (event) => this.onDashboardLayoutChange(event)); | ||
| $('#dashboard-layout-change-list').empty(); | ||
| $('#dashboard-event-btn').text('Add Dashboard Event'); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| console.log('Initializing DashboardLayout extension.'); | ||
| await new DashboardLayout($).initialize(); | ||
| })(); | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest manifest-version="0.1" xmlns="http://www.tableau.com/xml/extension_manifest"> | ||
| <dashboard-extension id="com.tableau.extension.demo.local" extension-version="0.1.0"> | ||
| <default-locale>en_US</default-locale> | ||
| <name resource-id="name"/> | ||
| <description>ClickThrough Sample</description> | ||
| <author name="tableau" email="github@tableau.com" organization="tableau" website="https://www.tableau.com"/> | ||
| <min-api-version>1.7</min-api-version> | ||
| <source-location> | ||
| <url>http://localhost:8765/Samples/DashboardLayout/clickThrough.html</url> | ||
| </source-location> | ||
| <icon>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH4QgLDTYEcBRoeAAABp9JREFUeNrlm01sHEUWx//vVbs79gThjAd2iflIAkEcEARfEciBSYLEbbV8SJaDEpIAMQgkViuirA8IskKcdiEJX3G0C5dNpAVxQLIyiYw4YYIQBw4RBoMg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cmVhdGUAMjAxNy0wOC0xMVQxMzo1NDowNC0wNDowMMrC9wEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDgtMTFUMTM6NTQ6MDQtMDQ6MDC7n0+9AAAAAElFTkSuQmCC</icon> | ||
| </dashboard-extension> | ||
| <resources> | ||
| <resource id="name"> | ||
| <text locale="en_US">ClickThrough Sample</text> | ||
| </resource> | ||
| </resources> | ||
| </manifest> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest manifest-version="0.1" xmlns="http://www.tableau.com/xml/extension_manifest"> | ||
| <dashboard-extension id="com.tableau.extensions.samples.dashboardlayout" extension-version="0.1.0"> | ||
| <default-locale>en_US</default-locale> | ||
| <name resource-id="name"/> | ||
| <description>Dashboard Layout Sample</description> | ||
| <author name="tableau" email="github@tableau.com" organization="tableau" website="https://www.tableau.com"/> | ||
| <min-api-version>1.7</min-api-version> | ||
| <source-location> | ||
| <url>http://localhost:8765/Samples/DashboardLayout/dashboardLayout.html</url> | ||
| </source-location> | ||
| <icon>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH4QgLDTYEcBRoeAAABp9JREFUeNrlm01sHEUWx//vVbs79gThjAd2iflIAkEcEARfEciBSYLEbbV8SJaDEpIAMQgkViuirA8IskKcdiEJX3G0C5dNpAVxQLIyiYw4YYIQBw4RBoMgBBIbCRtnOsx0vbcHd9sTZ3r8ge2p2bQ0B/+7unp+1dX/eX71ivL5TgAwAAQAxR/rsiYidvv2btq6ddcqVRwE8JCqgoigqgAA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6MDQtMDQ6MDC7n0+9AAAAAElFTkSuQmCC</icon> | ||
| </dashboard-extension> | ||
| <resources> | ||
| <resource id="name"> | ||
| <text locale="en_US">Dashboard Layout Sample</text> | ||
| </resource> | ||
| </resources> | ||
| </manifest> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>ClickThrough Sample</title> | ||
|
|
||
| <!-- jQuery --> | ||
| <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | ||
|
|
||
| <!-- Bootstrap --> | ||
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
|
|
||
| <script src="../../lib/tableau.extensions.1.latest.js"></script> | ||
|
|
||
| <!-- Our extension's code --> | ||
| <script src="./clickThrough.js"></script> | ||
| </head> | ||
| <body style="background-color: transparent;"> | ||
| <div class="container"> | ||
| <div> | ||
| <h1>Set Click Through (reload to disable)</h1> | ||
| <button id="enable-click-through" class="btn btn-primary">Enable</button> | ||
| </div> | ||
| </body> | ||
| </html> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| 'use strict'; | ||
|
|
||
| // Wrap everything in an anonymous function to avoid polluting the global namespace | ||
| (function () { | ||
| $(document).ready(function () { | ||
| tableau.extensions.initializeAsync().then(function () { | ||
| $('#enable-click-through').click(() => { | ||
| tableau.extensions.setClickThroughAsync(true).then(() => { | ||
| console.log('click through enabled! (reload to disable)'); | ||
| }, (err) => { | ||
| console.log(err); | ||
| }); | ||
| }); | ||
| }, function (err) { | ||
| // Something went wrong in initialization. | ||
| console.log('Error while Initializing: ' + err.toString()); | ||
| }); | ||
| }); | ||
| })(); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.