Skip to content

Commit 65e5db0

Browse files
authored
Merge pull request #31 from VisActor/release/1.2.4
[Auto release] release 1.2.4
2 parents 056e4b6 + 5ff73a3 commit 65e5db0

File tree

92 files changed

+10121
-719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+10121
-719
lines changed

.github/workflows/pre-release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
env:
5454
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
5555
NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
56+
NODE_OPTIONS: '--max_old_space_size=4096'
5657
run: node common/scripts/install-run-rush.js publish --publish --include-all --tag ${{ steps.semver_parser.outputs.pre_release_type }}
5758

5859
- name: Update shrinkwrap

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
env:
6161
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
6262
NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
63+
NODE_OPTIONS: '--max_old_space_size=4096'
6364
run: node common/scripts/install-run-rush.js publish --publish --include-all --tag latest
6465

6566
- name: Update shrinkwrap

.github/workflows/sync-main-to-develop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ jobs:
5757
title: '[Auto Sync] Sync the code from branch main to branch develop after release ${{ steps.package-version.outputs.current_version }}'
5858
base: develop
5959
head: sync/main-${{ steps.package-version.outputs.current_version }}
60-
reviewers: xile611
60+
reviewers: da730
6161
body: 'Sync the code from branch main to branch develop after release ${{ steps.package-version.outputs.current_version }}'

README.md

+37-7
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ const { fieldInfo, dataset } = await vmind.parseCSVDataWithLLM(csv, userInput);
136136
We want to show "the changes in sales rankings of various car brands". Call the generateChart method and pass the data and display content description directly to VMind:
137137

138138
```typescript
139-
const describe = 'show me the changes in sales rankings of various car brand';
139+
const userPrompt = 'show me the changes in sales rankings of various car brand';
140140
//Call the chart generation interface to get spec and chart animation duration
141-
const { spec, time } = await vmind.generateChart(userInput, fieldInfo, dataset);
141+
const { spec, time } = await vmind.generateChart(userPrompt, fieldInfo, dataset);
142142
```
143143

144144
In this way, we get the VChart spec of the corresponding dynamic chart. We can render the chart based on this spec:
@@ -161,19 +161,19 @@ Thanks to the capabilities of the large language model, users can describe more
161161
Users can specify different theme styles (currently only gpt chart generation supports this feature). For example, users can specify to generate a tech-style chart:
162162

163163
```typescript
164-
//describe can be in both Chinese and English
164+
//userPrompt can be in both Chinese and English
165165
//Specify to generate a tech-style chart
166-
const describe = 'show me the changes in sales rankings of various car brand,tech style';
167-
const { spec, time } = await vmind.generateChart(userInput, fieldInfo, dataset);
166+
const userPrompt = 'show me the changes in sales rankings of various car brand,tech style';
167+
const { spec, time } = await vmind.generateChart(userPrompt, fieldInfo, dataset);
168168
```
169169

170170
You can also specify the chart type, field mapping, etc. supported by VMind. For example:
171171

172172
```typescript
173173
//Specify to generate a line chart, with car manufacturers as the x-axis
174-
const describe =
174+
const userPrompt =
175175
'show me the changes in sales rankings of various car brands,tech style.Using a line chart, Manufacturer makes the x-axis';
176-
const { spec, time } = await(vmind.generateChart(csvData, describe));
176+
const { spec, time } = await vmind.generateChart(userPrompt, fieldInfo, dataset);
177177
```
178178

179179
#### Customizing LLM Request Method
@@ -196,6 +196,35 @@ temperature?: number;//recommended to set to 0
196196
Specify your LLM service url in url (default is https://api.openai.com/v1/chat/completions)
197197
In subsequent calls, VMind will use the parameters in params to request the LLM service url.
198198

199+
200+
201+
#### Data Aggregation
202+
📢 Note: The data aggregation function only supports GPT series models, more models will come soon.
203+
204+
When using the chart library to draw bar charts, line charts, etc., if the data is not aggregated, it will affect the visualization effect. At the same time, because no filtering and sorting of fields has been done, some visualization intentions cannot be met, for example: show me the top 10 departments with the most cost, show me the sales of various products in the north, etc.
205+
206+
VMind supports intelligent data aggregation since version 1.2.2. This function uses the data input by the user as a data table, uses a LLM to generate SQL queries according to the user's command, queries data from the data table, and uses GROUP BY and SQL aggregation methods to group, aggregate, sort, and filter data. Supported SQL statements include: SELECT, GROUP BY, WHERE, HAVING, ORDER BY, LIMIT. Supported aggregation methods are: MAX(), MIN(), SUM(), COUNT(), AVG(). Complex SQL operations such as subqueries, JOIN, and conditional statements are not supported.
207+
208+
209+
Use the `dataQuery` function of the VMind object to aggregate data. This method has three parameters:
210+
- userInput: user input. You can use the same input as generateChart
211+
- fieldInfo: Dataset field information. The same as generateChart, it can be obtained by parseCSVData, or built by the user.
212+
- dataset: Dataset. The same as generateChart, it can be obtained by parseCSVData, or built by the user.
213+
214+
215+
```typescript
216+
const { fieldInfo, dataset } = await vmind?.dataQuery(userInput, fieldInfo, dataset);
217+
```
218+
219+
220+
The fieldInfo and dataset returned by this method are the field information and dataset after data aggregation, which can be used for chart generation.
221+
By default, the `generateChart` function will perform a data aggregation using the same user input before generating the chart. You can disable data aggregation by passing in the fourth parameter:
222+
```typescript
223+
const userInput = 'show me the changes in sales rankings of various car brand';
224+
const { spec, time } = await vmind.generateChart(userInput, fieldInfo, dataset, false); //pass false as the forth parameter to disable data aggregation before generating a chart.
225+
```
226+
227+
199228
#### Dialog-based editing
200229

201230
Under development, stay tuned
@@ -213,3 +242,4 @@ Under development, stay tuned
213242
#### Pie chart
214243

215244
![Alt text](https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VChart-Video-3.gif)
245+

0 commit comments

Comments
 (0)