← All posts

How to visualize Google BigQuery on GraphXR

Nikko Sacramento · · 2 min read

How to visualize Google BigQuery on GraphXR

BigQuery is a powerful tool available on the Google Cloud Platform (GCP) for storing and querying SQL data on the cloud. We have created a simple pipeline to connect your GCP account to GraphXR to use BigQuery. To access this pipeline download this Grove Notebook here and drag-and-drop it into the Grove extension on the projects panel.

To connect to your GCP account you will need to turn on the BigQuery API and input three things into the Grove notebook: the desired project ID, service account credentials connected to your GCP project, and an API key.

  • First, click the project button at the top of the window to select a project you want to work on (or create a new one). Once the project is selected, you need to turn on the BigQuery API. Go to the GCP console and under APIs and Services select the API Library tab. Search for “BigQuery” and turn on the “BigQuery API”.
  • To find the Project ID, go to the GCP console and then to the GCP Dashboard. At the top of the page you will see a project dropdown where you can choose which project you want to work with. When you have selected the desired project, the project ID should show in the Project Info portion of the page. Enter this project ID in the “Project ID” text field on the Grove notebook.
  • To create an API key, go to the APIs & Services tab of the GCP console, then to the Credentials tab. Click on Create Credentials at the top of the page and choose API key. Now copy the API key generated into the “API Key” text field of the Grove notebook.
  • Next you will need a service account for this project if you have not already set one up. To do this, go to the IAM & Admin tab on the GCP console, then select Service Accounts. Click on the Create Service Account button and give it the desired access role. Once created, click on the service account and go to the Keys tab. Click Add Key and select Create New Key to create and download a new key in JSON format. Upload this file into the “Service Account File” input field on the Grove notebook.
  • Once all of this information is filled in, you will have the option to view the datasets and tables of the project you logged in with or any of Google’s publicly available projects. When a valid query is submitted into the “SQL Query” text field, an actionable “Import Data” button will push queried data into the graph space under the “Category Name” defined.

Keep in mind that storing and querying data on GCP costs money while using this pipeline. It is important to not expose your API key and Service Account Credentials as this can lead to unexpected billing on your account. For mitigating the costs billed to your GCP project, check out this guide.

Resources

Guides used on how to use the Big Query API with ObservableHQ/Grove: https://observablehq.com/@endpointservices/cache-bigquery

https://observablehq.com/@tomlarkworthy/gapi

More about Google BigQuery:

https://cloud.google.com/billing/docs/how-to/notify

https://cloud.google.com/bigquery/docs/api-performance

BigqueryData VisualizationSqlBig DataData Integration