Git Product home page Git Product logo

at-stacked-chart's Introduction

Airtable Bar Chart Viewer

This example app shows how to intetgrate a charting library (Chart.Js) with Airtable blocks. The code shows:

The application lets a user view a simple bar chart or a stacked chart based on a "grouping" select input.

Code organization

The application relevant code lives in two directories:

/config: All globally defined store keys and constants. /frontend: The React code that runs our application interface.

See the app running

App updating chart as the user changes data

How to run this app (Theoretical)

First, ensure you have the Airtable CLI installed.

  1. Setup Create a new base with at least two columns of data with a many-to-one cardinality, i.e. one Pet Owner has many Pets.

    The data in this screenshot is as follows:

    N Person Pet type
    1 Alice Cat
    2 Bob Dog
    3 Alice Hamster
    4 Bob Hamster
    5 Alice Dog
  2. Get the code and install Dependencies
    Clone this repository to a location on your computer. Install dependencies from the root of your application with either npm install or yarn if you prefer.

  3. Get App ID and Block ID
    From your base, click "add new App", when provided the init script, copy the app id and block id. In the video below, this appears as the string value appd9dkdYZyub62Hy/blkWKm2JYQM2l769Z.

  4. Update Code reference
    In your code editor, update the config in .block/remote.json with the appropriate values.

  5. Run the block locally
    From the root of your new app, run block run. Note the provided server where your app is located. Typically https://localhost:9000. Note, you may need to set a Chrome configuration to allow accessing https of unverified or expired urls - localhost in our case.

  6. Provide running block endpoint to Airtable
    Return to the browser and provide the URL of the running block.

View the following gif for a visual walk-through.

Running a custom block in your base

at-stacked-chart's People

Contributors

martincreative avatar

Watchers

 avatar  avatar

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.