Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/euripidean/final-project

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/euripidean/final-project

  • v0.0.0-20240508060436-38f9865c34a3
  • Source
  • Go
  • Socket score

Version published
Created
Source

final-project | Simple Data Visualization Utility

Go Report Card

Description

This package allows you to visualize data from a Google Sheets spreadsheet in a web browser. You can pass the ID of the Google Sheets spreadsheet as a flag at runtime, and the program will read the data from the spreadsheet, marshal it into a JSON object, and save it to a file. The program will then read the JSON object and display the data in an HTML bar chart using D3.js.

How to Install

  1. Clone the repository

  2. Run go build in the root directory

  3. Run the executable using go run main.go with the following flags:

    • -sid (optional): The ID of the Google Sheets spreadsheet you want to visualize. If you don't pass it as a flag, the default value will be the value of the SPREADSHEET_ID environment variable.
    • -f (optional): The name of the file where the JSON data will be saved (default: data.json). This will also be the name of the HTML file that will be served.
  4. Open a web browser and navigate to http://localhost:3030/<file>.html to see the visualizations

Environment Variables

`API_KEY` - Your Google Cloud Console API key, which must have the Google Sheets API enabled
`SPREADSHEET_ID` - The ID of the Google Sheets spreadsheet you want to visualize. This is optional, as you can pass it as a flag at runtime. However, if you don't pass it as a flag, the default value will be the value of this environment variable.
`READ_RANGE` - The range of the Google Sheets spreadsheet you want to read. I recommend using the range `Sheet1!A1:Z1000` to read the entire sheet.

How to Use

  1. Create a Google Cloud Console project and enable the Google Sheets API
  2. Create an API key and set it as the value of the API_KEY environment variable
  3. Create a Google Sheets spreadsheet and share it with the email address associated with the API key
  4. Run the executable with the following flags:
    • -sid (required): The ID of the Google Sheets spreadsheet you want to visualize
    • -file (optional): The name of the file where the JSON data will be saved (default: data.json). This will also be the name of the HTML file that will be served.
  5. Open a web browser and navigate to http://localhost:5500/<file>.html to see the visualizations

Screenshot of output HTML

Screenshot 2024-05-07 at 10 39 23 PM

Screenshot of Go Report (Github is caching at C grade)

Screenshot 2024-05-07 at 11 02 57 PM

FAQs

Package last updated on 08 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc