Giter Club home page Giter Club logo

griddy's Introduction

Griddy

An example of using the Sheets API to power a grid-based text visualisation

Example

Overview

Griddy provides Google Trends Screensaver-esque visualisation of words and phrases, powered by the Sheets API. Perfect for that wallmounted screen in the office!

You can try this out at griddysheets.firebaseapp.com

Once authorized, select a Google Sheet to load data from. Words will be taken from the first column of each and every sheet in the Sheets file.

In this solution, Sheets is used as a convenient aggregation point: Different processes or accounts can populate different sheets within the same file, and all be visualized. Easily accessible via the API, and from Apps Script, including from Google Ads, it therefore allows easy visualisation of reporting data, such as search queries, keywords, or trends obtained from other APIs.

Example

Deployment

  1. Create a new Google Cloud project

  2. Enable the following APIs

    • Sheets API
    • Drive API
    • Picker API
  3. Within the new Cloud project, create new credentials, under APIs & Services:

    • Click on OAuth consent screen
      • Add Application name, support email.
      • Add https://www.googleapis.com/auth/drive.file to Scopes for Google APIs
      • Add any domains you are hosting on to Authorized domains, for example if using Firebase hosting: https://projectname.firebaseapp.com
      • Click Save.
    • Click Create credentials and create a new API key.
    • From the same dropdown, create also a new OAuth client ID.
      • Add http://localhost:8080 as a Authorized JavaScript origins and Authorized redirect URIs.
      • Add also any hosts where you plan to deploy this application, again for example if using Firebase hosting: https://projectname.firebaseapp.com
  4. In order to build the solution, set the following environment variables:

    • GRIDDY_CLIENT_ID - The OAuth client ID from the above step.
    • GRIDDY_API_KEY - The API key from the above step.
    • (optional) GRIDDY_GA_ID - A Google Analytics ID if you wish to use GA.

    This can most easily be done in a script, e.g. creds.sh which is already included in the .gitignore

    export GRIDDY_CLIENT_ID=xxxxxxxx.apps.googleusercontent.com
    export GRIDDY_API_KEY=Axxxxxxxxxxxxxxxxxxxxxxxx
    export GRIDDY_GA_ID=UA-xxxxxxxxxxx-1

    Then running: source creds.sh

  5. To build, the run:

    npm install
    npm run build

    The application will be built to the dist/ folder.

  6. Alternatively, to run locally execute:

    ./node_modules/.bin/webpack-dev-server
    

Ads example: Search query report

The following samples demonstrate populating the Sheet for visualisation using Google Ads Scripts.

Errors in the console

Some errors may appear in the console:

  • Failed to execute 'postMessage' on 'DOMWindow'... and Invalid 'X-Frame-Options' header encountered ... : These are long-standing issues with the Picker API and do not affect the functionality of the application.

  • GET https://lh3.googleusercontent.com/d/.... returns 403 error: The application uses the drive.file scope, which limits access to only files that have been opened by the application. These 403 errors result from the Picker trying to show thumbnails in the dialog for other documents which have not been opened by the application, therefore no access is granted.

griddy's People

Contributors

dependabot[bot] avatar garanj avatar

Stargazers

 avatar

griddy's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.