Code Monkey home page Code Monkey logo

viz-gpt's Introduction

VizGPT: Make contextual data visualization with Chat Interface

viz-gpt.mp4

Use GPT to generate visualization from datasets with natural language. You can edit the visualization in the context step by step to make it more precise without retyping the complex query. VizGPT turns your text queries and chat into data visualization or charts.

You can try it at Playground or vizGPT on Kanaries kanaries-vizgpt

Why VizGPT

There exist lots of great visualization products in the world, such as Tableau, pygwalker. The traditional drag-and-drop visualization tool is hard to use for people unfamiliar with configs and viz/data transformations. For example, making a tableau heatmap requires bin transformations to both axes and then dragging the measure to color. It is hard for people unfamiliar with data visualization to make a heatmap.

Some text2viz tools accept natural language to generate the visualization. However, they are not flexible enough to allow users to edit the visualization. For example, if the user wants to change the color of the heatmap, they have to retype the whole sentence.

With VizGPT, you can build visualizations step by step with a chat interface. You can edit/adjust visualizations in the context. It allows you to explore the data first without figuring out how to build complex visualization initially, especially when unfamiliar with the data.

Besides, VizGPT focus on text based visual exploration. It allows users to discover new insights from visualization and ask new questions based on the insights they just find.

Features & Roadmap

  • Natural language to data visualization vega-lite
  • Use chat context to edit your visualization. Allow users to change the chart if it is not what they expected
  • Explore the data step by step by chatting with visualizations.
  • Upload your own dataset (CSV) to make visulizations.
  • Save the visualizations and chat history.
  • Allow user to use visualization editor (like graphic-walker or vega-editor) to edit the visualization and show the edit to GPT to make better visualization as the user prefers.

vizGPT is now good at drawing data visualizations, not data transformations/preparation/computation. You can use other tools like Kanaries/RATH to prepare the data first and then use vizGPT to draw the visualization.

vizGPT + RAG

I also build a RAG version of vizGPT, which can be accessed at vizgpt.ai, it contains RAG special for vega/vega-lite and SQL.

Chat to Viz Example

vizapt-1 vizapt-2 vizapt-3

Xnapper-2023-05-10-00 28 07

Xnapper-2023-05-10-01 05 15

Add custom CSV file

Click `upload CSV button to add your own data. You can view or edit your data's metas at data view. The metas are inferred automatically by default. You can edit it anytime you want to make the visualization more precise.

data view

Local Development

step 1

Create a .env file at the root of the project with the following contents:

BASE_URL=<Azure OpenAI BaseURL>
DEPLOYMENT_NAME=<Deployment Name>
AZURE_OPENAI_KEY=<Your key>

step 2

Install dependencies:

yarn install

step 3

Then run vercel dev or npm run dev to start the server at port 3000.

viz-gpt's People

Contributors

jojocys avatar louis-sanna-eki avatar observedobserver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

viz-gpt's Issues

Get early access to a formal cloud version

I am building a much powerful version of vizGPT, with more features to support real-world data analytics. If you are interested to get early access, you can now become a early adopter by sponsoring this project.

Which you will get:

  • 50% recurring discount for Pro plans of cloud version of vizGPT as long as you are using the product.
  • Early access to the cloud version of vizGPT and all insider features.

Click here to become an early adopter

Integration in third party application

Hi, thanks for sharing this wonderful tool. i'm planning to integrate it in my own web application based on Python: is there something (like api) that i can do to integrate viz-gpt in my app?

Cannot find module /app/vercel when trying to dockerize this project

I want to run this great project in a docker container.
The following is my dockerfile

FROM node:20.2
COPY viz-gpt /app
WORKDIR /app
ENV PATH /root/.yarn/bin:$PATH
RUN curl -o- -L https://yarnpkg.com/install.sh | bash && \
    yarn install

# Start the service
CMD ["vercel", "dev"]

And I got the following error when I start this docker image.

2023-05-26 15:53:03 node:internal/modules/cjs/loader:1073
2023-05-26 15:53:03   throw err;
2023-05-26 15:53:03   ^
2023-05-26 15:53:03 
2023-05-26 15:53:03 Error: Cannot find module '/app/vercel'
2023-05-26 15:53:03     at Module._resolveFilename (node:internal/modules/cjs/loader:1070:15)
2023-05-26 15:53:03     at Module._load (node:internal/modules/cjs/loader:923:27)
2023-05-26 15:53:03     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
2023-05-26 15:53:03     at node:internal/main/run_main_module:23:47 {
2023-05-26 15:53:03   code: 'MODULE_NOT_FOUND',
2023-05-26 15:53:03   requireStack: []
2023-05-26 15:53:03 }
2023-05-26 15:53:03 
2023-05-26 15:53:03 Node.js v20.2.0

My first try is using npm run dev instead of vercel dev. But I got Unexpected end of JSON input like this link

So I head back to vercel dev.

ChatGPT let me add yarn add vercel after yarn install. But it doesn't work.

feat: support other LLMs

Using VizGPT sends data to Microsoft/OpenAI & uses proprietary GPT model.
The possibility to use other LLMs instead would be nice. Free/open source and local & fine-tuned models could open up other usecases and be a huge improvement.

RAG for vega-lite visualization

For the online production version of vizgpt at vizgpt, there are some extra works of RAG for vega-lite and SQL.

These part of code is not open sourced yet due to some coupling of supabase architecture. If you are a researcher interested in this domain, welcome to contact me for more details.

Should we add support for configuring proxy access?

You can use HttpsProxyAgent to access the proxy in vizchat.ts. PROXY_URL can be configured in the .env file as shown below:

PROXY_URL=
import {HttpsProxyAgent} from "https-proxy-agent";
const proxy_url = process.env.PROXY_URL;
const agent= new HttpsProxyAgent(proxy_url)
...
const response = await fetch(url, {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${process.env.OPENAI_KEY}`,
        },
        agent,
        body: JSON.stringify({
            model: "gpt-3.5-turbo",
            messages: messages,
            temperature: TEMPERATURE,
            n: 1,
        }),
    });

unexpected end of JSON input

First of all, this project looks amazing! Thanks for all the good work.

However, I have this error when trying to visualise an example chart. When I pull up the console, I see this:
POST http://localhost:5173/api/vizchat 404 (Not Found)
Perhaps I have to run vizchat as a server in a separate instance?

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.