MCPcopy Index your code
hub / github.com/ObservedObserver/viz-gpt

github.com/ObservedObserver/viz-gpt @0.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.0.1 ↗ · + Follow
45 symbols 96 edges 25 files 0 documented · 0% updated 12mo ago0.0.1 · 2023-05-12★ 62410 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

VizGPT: Make contextual data visualization with Chat Interface

https://github.com/ObservedObserver/viz-gpt/assets/22167673/a09032d3-f3c8-4cdf-ac14-89df8754fd9f

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.

You can try it at Playground

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.

Features & Roadmap

  • [x] Natural language to data visualization vega-lite
  • [x] Use chat context to edit your visualization. Allow users to change the chart if it is not what they expected
  • [x] Explore the data step by step by chatting with visualizations.
  • [x] 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.

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.

Extension points exported contracts — how you extend this code

IField (Interface)
(no doc)
src/interface.ts
ReactVegaProps (Interface)
(no doc)
src/components/react-vega.tsx
IMessage (Interface)
(no doc)
src/services/llm.ts
RequestBody (Interface)
(no doc)
api/vizchat.ts
IRow (Interface)
(no doc)
src/interface.ts
ModalProps (Interface)
(no doc)
src/components/modal.tsx
IResponse (Interface)
(no doc)
src/services/llm.ts
IResponseData (Interface)
(no doc)
api/vizchat.ts

Core symbols most depended-on inside this repo

classNames
called by 3
src/components/selectMenu.tsx
matchQuote
called by 2
src/utils/index.ts
classNames
called by 1
src/components/dropdownContext.tsx
useNotification
called by 1
src/components/notify/useNotification.tsx
getNotificationIcon
called by 1
src/components/notify/index.tsx
getHeaderType
called by 1
src/components/datasetCreation/dataTable.tsx
getHeaderClassNames
called by 1
src/components/datasetCreation/dataTable.tsx
getSemanticColors
called by 1
src/components/datasetCreation/dataTable.tsx

Shape

Function 27
Interface 18

Languages

TypeScript100%

Modules by API surface

src/components/datasetCreation/dataTable.tsx5 symbols
src/utils/inferType.ts4 symbols
src/components/dropdownContext.tsx4 symbols
src/services/llm.ts3 symbols
src/interface.ts3 symbols
src/components/selectMenu.tsx3 symbols
src/components/notify/index.tsx3 symbols
src/utils/index.ts2 symbols
src/components/welcomePrompt.tsx2 symbols
src/components/vizChat.tsx2 symbols
src/components/react-vega.tsx2 symbols
src/components/modal.tsx2 symbols

For agents

$ claude mcp add viz-gpt \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact