# VisTalk
**Repository Path**: mirrors_microsoft/VisTalk
## Basic Information
- **Project Name**: VisTalk
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-10-24
- **Last Updated**: 2023-08-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
Vis Talk: A JavaScript toolkit for Natural Language-based Visualization Authoring
====
[](https://www.npmjs.com/package/@vis-talk/vega-builder)
[](https://doi.org/10.1109/TVCG.2022.3209357)
[](https://arxiv.org/abs/2208.10947)
**Vis Talk** is a JavaScript library for developers create visualization using natural language.
## Try it out
You can try the [Playground Web App](https://microsoft.github.io/VisTalk/) or fork example [Observable Notebook](https://observablehq.com/@zhitao/vistalk)
#### Playground Demo:

## For Developers
### Installing
Install using yarn:
```shell
$ yarn add @vis-talk/vega-builder
```
or install using npm:
```shell
$ npm install @vis-talk/vega-builder
```
## Build a simple react sample app
```
$ npx create-react-app my-vis-app --template typescript
$ cd my-vis-app
$ npm install @vis-talk/vega-builder react-vega
```
Modify _src/App.tsx_ to:
```tsx
import React from 'react';
import { createBuilder } from "@vis-talk/vega-builder";
import { VegaLite } from "react-vega";
function App() {
const table = [
{ Brand: "BrandA", Category: "SUV", Sales: 40 },
{ Brand: "BrandB", Category: "SUV", Sales: 20 },
{ Brand: "BrandC", Category: "SUV", Sales: 30 },
{ Brand: "BrandD", Category: "SUV", Sales: 10 },
{ Brand: "BrandA", Category: "Midsize", Sales: 40 },
{ Brand: "BrandB", Category: "Midsize", Sales: 10 },
{ Brand: "BrandC", Category: "Midsize", Sales: 20 },
{ Brand: "BrandD", Category: "Midsize", Sales: 5 },
];
const builder = createBuilder(table);
builder.setInput([
"total sales by brand",
"highlight midsize in orange",
"add line in 60 in red",
"add rect from 12 to 37 in green"]);
const spec = builder.build({ name: "table" });
return (
);
}
export default App;
```
start the app:
```shell
$ npm start
```
## API Reference
### createBuilder(dataSource)
Create a new vega visual builder by load your data table.
```ts
function createBuilder(dataSource: DataSource): VegaBuilder;
// data source is array of object, with optional column name list.
export interface DataSource extends Array