Publishing

Publishing a web version of a Visualization is distinctly different from sharing it via a Google Doc in that the web publication is standalone and is no longer a Google Doc file type. Therefore, efforts to secure the Visualization to a limited audience of viewers must be accomplished through the usual methods of security used on a standard website. However, manipulating the visualization on the published web page cannot modify the Google Doc, making it more appropriate for wider audience viewing. Web versions of a visualization can be created using Spreadsheets, Fusion Tables, or from scratch, and can be hosted by Google, or any web hosting service.

Spreadsheets

To publish a Google Spreadsheet and subsequent visualization to a web page, select from the menu, File | Publish to the web....

Spreadsheets

From the Publish to the web window, if desired, configure the range of the Spreadsheet to be published. To create the live web version of the Spreadsheet, click on the Spreadsheets button. Once pressed, the website version of the Spreadsheet is available on the Web and can be reached by navigating a browser to the link given in the Get a link to the published data field. For a publication format other than a web page, click on the drop-down menu at the top of the Get a link to the published data. Alternative publication options available are as follows:

  • Web page
  • HTML to embed in a page
  • CSV (comma-separated values)
  • TXT (Plain Text)
  • PDF (Adobe PDF)
  • ATOM
  • RSS

The following screenshot is of the web page version of the Spreadsheet for 2010 Chicago Census data. Note the similarity in appearance to the Spreadsheet file itself. However, the web version cannot be edited by site visitors and maintains a fairly static appearance in comparison to the Google Spreadsheets application.

Spreadsheets

While data manipulation is not inherently available in the web version, limited mouse-over interactivity of the visualization is still available.

Fusion Tables

Publishing a web page from Fusion Tables is similar in process to publishing a web page from Spreadsheets. The primary difference is that each chart or component of the Fusion Table file is published individually. For example, a web page of table data is distinct from a chart web page, even when the two components are from the Fusion Tables document. To publish a component of a Fusion Table, select the component's tab and navigate to Tools | Publish… in the menu bar.

Fusion Tables

The Publish window will appear. Options for the method of publishing are displayed. The Send a link in email or IM produces a standalone, simple web page representation of the tab contents. Alternatively, the Paste HTML to embed in a website encapsulates the published component into an iFrame, allowing for easy addition as part of another page.

Fusion Tables

Web publication of a Google Doc is similar to sharing, but with distinct differences. Google provides additional information on the topic of sharing and web publishing for Google Docs in its support documentation.

Note

More information on Sharing versus Publish to Web Visibility is available at https://support.google.com/drive/bin/answer.py?hl=en&answer=183965.

Apps Script

Methods of standalone web publication for Apps Script files are also available. The publication process for both standalone and Spreadsheet-embedded App Scripts is mostly the same. The primary difference is that the Spreadsheet script may contain Spreadsheet-specific code, making it dependent on its respective Spreadsheet.

Publishing basics

The web publication of an Apps Script has two general steps. First, version management must be established before the Apps Script environment allows a script to be published. To initiate managed version control, click on File | Manage Versions… from the menu bar. In the Manage Versions window, enter a description of the version and click on Save New Version. The current script version will then be saved as a snapshot in time, and can be called on by other script projects. It can also be loaded as a particular instance of the published script.

Publishing basics

When at least one version is available, the Apps Script environment will allow a web instance to be published. From the menu bar, click on Publish | Deploy as web app… to deploy the script as a web page.

Publishing basics

Alternatively, selecting the cloud arrow button from the menu bar also accesses the Deploy as web app... window.

Publishing basics

In the Deploy as web app window click on the script version that is to be deployed. The versions available are the same versions as saved in the Manage Versions… window. Next, select the level of access for the new web application. The Execute this app as: option tells the application under which user permissions to run the application. This setting is important because allowing a user to run as script developer allows the user to perform the same actions for which the developer has rights. However, certain normal actions in an application may require elevated permissions, thus potentially prohibiting the functionality of the script.

Publishing basics

The Who has access to the app: setting is slightly more self-explanatory. This setting simply determines if web users can view the script application or if it is private to the developer.

Note

More information on Security and Google Apps Script is available at https://developers.google.com/apps-script/scripts_google_accounts.

Embedded in a Spreadsheet

Recall that designing an Apps Script that creates a visualization in a Spreadsheet requires programming specific to the Spreadsheet interface itself (see Chapter 4, Basic Charts). The result of this specification generally means an Apps Script attached to a Spreadsheet has a high chance of failing to translate into a standalone web page. Apps Scripts attached to a Spreadsheet are still fully functional and have the potential to stand alone as a web app, but any code referencing an interaction with the Spreadsheet must first be removed.

App Engine

There are various methods of launching applications on Google App Engine. Development of a visualization API application can be accomplished in just about any web development environment capable of handling HTML and JavaScript. The popular open source platform, Eclipse, can be used in its web development version with an added Google developer extension for seamless app deployment. Even simple text editors can be used to edit code when using the App Engine Launcher and Software Development Kit (SDK).

App Engine Launcher and SDK

The Google Development SDK provides the basic functionality needed to test and launch an application in App Engine. It is intended for use by developers fluent in Java, Python, or Google's own programming language, Go. A consequence of using the SDK method to publish API Visualizations is that there is some overhead programming required to create a Java, Python, or Go framework to serve HTTP pages. App Engine applications do however use the standard WAR structure for bundling web applications, making it possible to manually create an application folder structure.

In this method, testing and deploying the application is accomplished through the SDK command line or with the GoogleAppEngineLauncher tool.

App Engine Launcher and SDK

Eclipse plugin

If developing in an environment such as Eclipse, use the Google plugin for Eclipse. The plugin provides basic framework templates that are accessed as App Engine projects directly from Eclipse. Deployment of an App Engine application in Eclipse is as simple as with the Google plugin. After installing the plugin through the Eclipse add software method, create or deploy an App Engine application in Eclipse, and click on the Eclipse plugin icon in the menu bar. From the drop-down menu, select the appropriate action desired.

Eclipse plugin

For a new web project, the project initialization and configuration steps will look very similar to all other Eclipse project creation wizards.

Eclipse plugin

Note

For more information on Eclipse, Google App Engine, and the Google Go programming language, visit the links listed here.

Eclipse development environment at http://www.eclipse.org/.

Google plugin for Eclipse at https://developers.google.com/eclipse/.

App Engine Developer downloads—SDK, Launcher, and Plugins at https://developers.google.com/appengine/downloads.

Google programming language: Go at http://golang.org/.

Integrated Development Environments in the Cloud (IDEs)

Possibly the most intuitive method of App Engine development is to use a cloud-based online development environment for which application deployment to App Engine is integrated. This approach allows for template-based deployment of App Engine apps as well as faster testing and update processes. Cloud 9 IDE (Integrated Development Environment) and Codenvy IDE are two popular cloud-hosted development environments available at the time of this book's publication. The Codenvy IDE is used in the following visualization API application example, with discussion of basic functionality as applied to launching visualization API applications in App Engine.

The Codenvy development application is fairly straightforward in organization. The menu bar is the primary access to environment functions. The folder structure of the application is on the left-hand side of the screen, with the selected file's contents displayed for editing on the right. The lower window and tabs display code previews and the output of environment operations, such as building and launching an application.

Integrated Development Environments in the Cloud (IDEs)

To create or update applications from the Codenvy IDE application, click on PaaS | Google App Engine from the menu bar. Choose either Update Application or Create Application… respectively.

Integrated Development Environments in the Cloud (IDEs)

The Codenvy application will then guide the developer through the App Engine creating an application process or automatically updating an existing application on App Engine.

Integrated Development Environments in the Cloud (IDEs)

Much of the development and deployment process for App Engine is handled through the IDE. However, independent of the development environment, App Engine applications must be initially created in the App Engine console. As mentioned earlier, the creation of the Application ID is required when configuring an application to deploy from any of the deployment.

More APIs

In addition to the Visualization and Google Docs APIs, Google provides a selection of APIs for other Google services. While many of these APIs are available at no charge when consumed below a certain user threshold, heavier use requires a pay-for-what-you-use fee per API. To access additional APIs from Google, log in to the API Console. From the console, APIs can be turned on or off for a specific project.

More APIs

Publishing a Google Visualization as a web page allows for a variety of development and deployment options. These options are also diverse across developer experience levels and workflows, which makes visualizations easy to incorporate in existing websites or as standalone pages.

Note

Information on Codenvy IDE is available at https://codenvy.com/.

Information on Cloud 9 IDE is available at https://c9.io/.

Information on API Console is available at https://code.google.com/apis/console/.

Project hosting on Google Code is available at http://code.google.com/hosting/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset