visactor / vmind Goto Github PK
View Code? Open in Web Editor NEWNot only automatic, but also intelligent. An Intelligent data Visualization System, based on LLM.
Home Page: https://www.visactor.io/vmind
License: MIT License
Not only automatic, but also intelligent. An Intelligent data Visualization System, based on LLM.
Home Page: https://www.visactor.io/vmind
License: MIT License
can use alasql https://github.com/AlaSQL/alasql to execute sql query
use @visactor/chart-advisor as a fallback plan. develop the chart-advisor task node
also add unit test for data aggregation
thoughts: 选择日期字段作为 x 轴,ctr、gmv、检测_uv 作为 y 轴,因为没有颜色字段,所以 color 为空
x: date
y: ctr, gmv, detection_uv
color:
use fold in chart-advisor package to handle this situation.
there are 2 steps in skylark chart generation: chart type recommend and field map assign. If the second step fails, we cal also use the recommended chart type in the first step and use @visactor/chartadvisor to get the field map.
none
cells generated by LLM will only have one y field, but may use another measure fields as color. In this case, we can fold the data by these two fields and show them with 1 y-axis.
user need to generate a chart only according to fields in dataset. So we can offer a function to generate a spec without dataset, and user can add their own dataset after quering data.
user must specify dimension value in their prompt, such as "帮我展示north区域排名前三的商品销售额" because LLM doesn't know dimension values when generating sql. If we add domain of dimensions in fieldInfo, user can use "帮我展示北方排名前三的商品销售额"
[
{
"fieldName": "商品名称",
"type": "string",
"role": "dimension",
domain:['可乐', '雪碧', '芬达', '醒目']
},
{
"fieldName": "region",
"type": "string",
"role": "dimension",
domain:['north', 'south', 'west', 'east']
},
{
"fieldName": "销售额",
"type": "int",
"role": "measure"
}
]
to increase the accuracy of chart generation, use vector database to query exapmles according to user's input and fill the result in chart generation prompt. This can be done when VMind has collected enough chart generation examples.
queryExamples(userInput)
图表生成允许用户指定支持的图表类型列表
--data-raw '{"csvData":"filter_r,a_type_label,prr_tags,app_id,abtest_versions,r_reasons,r_tags,channel_id,region,uid,vid_int,timestamp,trace_id\r\n,,,1233,,,,112,US,7092296493822592046,,1708445808150,2024022016164529A8B0CD0A1AEBED59C1\r\n,,,1233,,,,57,US,7092296493822592046,,1708445389846,202402201609497136D67B0F97D0E072E4\r\n,,,1233,,,,81,US,7092296493822592046,,1708525298858,20240221142138A866F61C2102DE076789\r\n,,,1233,,,,112,US,7092296493822592046,,1708867031297,20240225131710A436704DA937A7C72C7E\r\n,,,1233,,,,112,US,7092296493822592046,,1708610066492,202402221354256D11E714CFF5812E5944\r\n,,,1233,,,,112,US,7092296493822592046,,1708867539587,20240225132539E1B41CFDC4CA6C7D6B23\r\n,,,1233,,,,112,US,7092296493822592046,,1708525412066,202402211423318BAA53BC0648780C1A50\r\n,,,1233,,,,112,US,7092296493822592046,,1708867378664,2024022513225849549B50310E70CCBCB0\r\n,,,1233,,,,112,US,7092296493822592046,,1708867413105,20240225132332AA2CFEF9F4DDAFC645F6\r\n,,,1233,,,,112,US,7092296493822592046,,1708867493206,20240225132452B1C06A032A58CDBE709D\r\n,,,1233,,,,81,US,7092296493822592046,,1708778690534,20240224124450B7DD2AF1F6456415B9D4\r\n,,,1233,,,,199,US,7092296493822592046,,1708446088298,20240220162127028C9A44474E820AD6D8\r\n,,,1233,,,,112,US,7092296493822592046,,1708525477107,202402211424363EB0AAE89450ADD82476\r\n,,,1233,,,,81,US,7092296493822592046,,1708866956971,20240225131556726A95F72884A245C786\r\n,,,1233,,,,81,US,7092296493822592046,,1708445383055,202402201609424EB937059B320908E945\r\n,,,1233,,,,81,US,7092296493822592046,,1708866955521,2024022513155557DCB3F6E16D834367BB\r\n,,,1233,,,,112,US,7092296493822592046,,1708866921143,20240225131520A834042EBFBFE69DEB8D\r\n,,,1233,,,,81,US,7092296493822592046,,1708445387314,20240220160947B7E58F06F01A600A1D89\r\n,,,1233,,,,57,US,7092296493822592046,,1708866705920,20240225131145BF96E65D2170CE9EDD74\r\n,,,1233,,,,81,US,7092296493822592046,,1708696269252,20240223135109AD8C4B063FF90E11DE4A\r\n,,,1233,,,,81,US,7092296493822592046,,1708525300274,202402211421406DA69D0D4B109907247B\r\n,,,1233,,,,112,US,7092296493822592046,,1708696316767,20240223135156C054F110E2DCEF2A17FF\r\n,,,1233,,,,57,US,7092296493822592046,,1708780057459,20240224130737AD1422BAA86115E48421\r\n,,,1233,,,,81,US,7092296493822592046,,1708778691908,2024022412445168962D3FED452616CBC8\r\n,,,1233,,,,112,US,7092296493822592046,,1708867293249,20240225132132E7A7B63D8806E7B2669C\r\n,,,1233,,,,57,US,7092296493822592046,,1708830915190,20240225031514DA8D786AF956F3B3151E\r\n,,,1233,,,,199,US,7092296493822592046,,1708867020337,20240225131700BA96658227C3263D9FFB\r\n,,,1233,,,,112,US,7092296493822592046,,1708610183381,202402221356226A7787CFFCB3B3114B59\r\n,,,1233,,,,112,US,7092296493822592046,,1708445377163,20240220160936953B3302117F81C114EC\r\n,,,1233,,,,112,US,7092296493822592046,,1708445576957,20240220161256D50449D1328057A6BD06\r\n,,,1233,,,,112,US,7092296493822592046,,1708829558775,20240225025237CBDEFBA79C617EBD9D1C\r\n,,,1233,,,,112,US,7092296493822592046,,1708445743592,20240220161542266C6CB4CBA382E968C2\r\n,,,1233,,,,112,US,7092296493822592046,,1708445805356,2024022016164529A8B0CD0A1AEBED59C1\r\n,,,1233,,,,112,US,7092296493822592046,,1708829643717,20240225025403D1FC6676586CB0905BA4\r\n,,,1233,,,,112,US,7092296493822592046,,1708867458566,20240225132418AA2CFEF9F4DDAFC64C08\r\n,,,1233,,,,57,US,7092296493822592046,,1708829561662,20240225025241AD1DEF6A5E605EB09A41\r\n,,,1233,,,,199,US,7092296493822592046,,1708446060872,2024022016210090140F31FA12220A7D07\r\n,,,1233,,,,57,US,7092296493822592046,,1708866924109,202402251315234A814EC71071DF0BD7BA\r\n,,,1233,,,,112,US,7092296493822592046,,1708696468585,2024022313542700D9ED5E8EF761717DB0\r\n,,,1233,,,,112,US,7092296493822592046,,1708696711378,202402231358302CEAD44D98039B2DD7F7\r\n,,,1233,,,,112,US,7092296493822592046,,1708696888515,202402231401289ACBCA53809D603CB427\r\n,,,1233,,,,112,US,7092296493822592046,,1708697684980,20240223141444F63C2904943A35394266\r\n,,,1233,,,,112,US,7092296493822592046,,1708696523386,2024022313552333351F9918D7AEFBC917\r\n,,,1233,,,,112,US,7092296493822592046,,1708778718828,20240224124518678C6C73CA659783014F\r\n,,,1233,,,,199,US,7092296493822592046,,1708867002606,202402251316421204BD6B6E8A1543DF6D\r\n,,,1233,,,,81,US,7092296493822592046,,1708610072970,20240222135432AAB3121782186419DC89\r\n,,,1233,,,,36,US,7092296493822592046,,1708615362521,20240222152241EF0B669DEEE0E496F96F\r\n,,,1233,,,,112,US,7092296493822592046,,1708778675358,2024022412443493EB0DEC9C052B74105B\r\n,,,1233,,,,81,US,7092296493822592046,,1708610087681,202402221354477146569C78F80D18EA96\r\n,,,1233,,,,112,US,7092296493822592046,,1708697729569,2024022314152925857C95174C5170FFE1\r\n,,,1233,,,,112,US,7092296493822592046,,1708830914020,20240225031512773AB90FAACEEAAB0EC3\r\n,,,1233,,,,57,US,7092296493822592046,,1708525297721,2024022114213712CCCD5815C1AD2EC79C\r\n,,,1233,,,,112,US,7092296493822592046,,1708696389687,2024022313530844B7446267116F43B927\r\n,,,1233,,,,112,US,7092296493822592046,,1708696778238,20240223135937AE668F844C9E674014AA\r\n,,,1233,,,,112,US,7092296493822592046,,1708778853424,202402241247320E708EB8477261C354EC\r\n,,,1233,,,,57,US,7092296493822592046,,1708612888542,202402221441278D67B0C690E5271CF702\r\n,,,1233,,,,112,US,7092296493822592046,,1708525497626,202402211424572C71AF81DF15F3D58A12\r\n,,,1233,,,,112,US,7092296493822592046,,1708696264074,202402231351039FE818735839B051969E\r\n,,,1233,,,,112,US,7092296493822592046,,1708696837646,202402231400365EC5C2DC236F465D4E58\r\n,,,1233,,,,112,US,7092296493822592046,,1708866686273,202402251311254A6702F97C70EFB028C9\r\n,,,1233,,,,81,US,7092296493822592046,,1708696270906,202402231351101A6B548FA0EF34105774\r\n,,,1233,,,,112,US,7092296493822592046,,1708612905678,202402221441452F5FE2073237C10F57E7\r\n,,,1233,,,,199,US,7092296493822592046,,1708446029499,20240220162029CC9A407970F27F0A4877\r\n,,,1233,,,,112,US,7092296493822592046,,1708867137922,20240225131856472BE356E5350FABC73D\r\n,,,1233,,,,112,US,7092296493822592046,,1708610245415,2024022213572577901A133CFB2CCC0B92\r\n,,,1233,,,,57,US,7092296493822592046,,1708696266988,20240223135106160FFA6ADCFEDF73CA64\r\n,,,1233,,,,112,US,7092296493822592046,,1708615460784,202402221524199564A8038AF9AA36444C\r\n,,,1233,,,,57,US,7092296493822592046,,1708778687975,20240224124447386C3BC31D8413A29048\r\n,,,1233,,,,81,US,7092296493822592046,,1708778691688,20240224124451E04E8393FD062E163F63\r\n,,,1233,,,,112,US,7092296493822592046,,1708780055058,2024022413073490F4C59A20694E5BAB87\r\n,,,1233,,,,112,US,7092296493822592046,,1708866728857,202402251312084C2A820F878915C26092\r\n,,,1233,,,,57,US,7092296493822592046,,1708610081294,202402221354413A683CB601C0DB53ED1C\r\n,,,1233,,,,112,US,7092296493822592046,,1708525451364,2024022114241123B931A468FC56D27B6C","prompt":"show me the distribution","model":"gpt-3.5-turbo"}'
1.2.3
null
帮我展示不同区域各商品销售额
商品名称,region,销售额
可乐,south,2350
可乐,east,1027
可乐,west,1027
可乐,north,1027
雪碧,south,215
雪碧,east,654
雪碧,west,159
雪碧,north,28
芬达,south,345
芬达,east,654
芬达,west,2100
芬达,north,1679
醒目,south,1476
醒目,east,830
醒目,west,532
醒目,north,498
const { fieldInfo, dataset } = await vmind.current.parseCSVData(csvData, describe);
const { spec, time } = await vmind.current.generateChart(
describe,
fieldInfo,
dataset,
);
{
"sql": "SELECT Product name
, region
, SUM(Sales
) AS total_sales FROM dataSource GROUP BY Product name
, region
",
"fieldInfo": [
{
"fieldName": "Product name",
"description": "Represents the name of the product."
},
{
"fieldName": "region",
"description": "Represents the region where the product is sold."
},
{
"fieldName": "total_sales",
"description": "An aggregated field representing the total sales amount of each product in each region. It is generated by summing up the sales values for each product in each region."
}
]
}
and the aggregated measure value is all 0
aggregate normally
- OS:
- Browser:
- Framework:
No response
response of LLM need to be patched. We can divide this prgress into pipelines to make it more clear and improve maintainability
1.1.0
null
userPrompt: 请推荐最佳的数据可视化展现方式
GPT 3.5 and skylark2 pro all throw an error.
generate chart normally
- OS:
- Browser:
- Framework:
No response
add chartType and cell in chart generation result
1.2.3
null
帮我展示north区域排名前三的商品销售额
商品名称,region,销售额
可乐,south,2350
可乐,east,1027
可乐,west,1027
可乐,north,1027
雪碧,south,215
雪碧,east,654
雪碧,west,159
雪碧,north,28
芬达,south,345
芬达,east,654
芬达,west,2100
芬达,north,1679
醒目,south,1476
醒目,east,830
醒目,west,532
醒目,north,498
[
{
"商品名称": "可乐",
"total_sales": 1027
},
{
"商品名称": "雪碧",
"total_sales": 28
},
{
"商品名称": "芬达",
"total_sales": 1679
}
]
dataset sort by total_sales
- OS:
- Browser:
- Framework:
No response
1.2.4
null
Key,BP,Count\nJIRA-27358,BP1.4.1,1\nJIRA-27356,BP1.4.1,1\nJIRA-27350,BP1.5.0,1\nJIRA-27349,BP1.4.1,1\nJIRA-27348,BP1.4.1,1\nJIRA-27347,BP1.4.1,1\nJIRA-27344,BP1.5.0,1\nJIRA-27343,BP1.4.1,1\nJIRA-27339,BP1.4.1,1\nJIRA-27338,BP1.4.1,1\nJIRA-27336,BP1.4.1,1\nJIRA-27335,BP1.4.1,1\nJIRA-27334,BP1.4.1,1\nJIRA-27333,BP1.5.0,1\nJIRA-27331,BP1.4.1,1\nJIRA-27330,BP1.4.1,1\nJIRA-27322,BP1.4.1,1\nJIRA-27321,BP1.4.1,1\nJIRA-27320,BP1.4.0,1\nJIRA-27319,BP1.4.0,1\nJIRA-27316,BP1.4.0,1\nJIRA-27315,BP1.4.1,1\nJIRA-27314,BP1.5.0,1\nJIRA-27311,BP1.4.1,1\nJIRA-27310,BP1.4.1,1\nJIRA-27309,BP1.4.1,1\nJIRA-27308,BP1.4.1,1\nJIRA-27307,BP1.4.1,1\nJIRA-27306,BP1.4.1,1\nJIRA-27305,BP1.4.1,1\nJIRA-27304,BP1.4.1,1\nJIRA-27303,BP1.4.1,1\nJIRA-27302,BP1.4.1,1\nJIRA-27301,BP1.4.1,1\nJIRA-27300,BP1.4.1,1\nJIRA-27299,BP1.4.1,1\nJIRA-27297,BP1.4.1,1\nJIRA-27296,BP1.4.1,1\nJIRA-27295,BP1.4.1,1\nJIRA-27294,BP1.4.1,1\nJIRA-27293,BP1.4.1,1\nJIRA-27292,BP1.4.1,1\nJIRA-27291,BP1.4.1,1\nJIRA-27290,BP1.5.0,1\nJIRA-27289,BP1.4.1,1\nJIRA-27281,BP1.4.1,1\nJIRA-27279,BP1.4.0,1\nJIRA-27278,BP1.4.1,1\nJIRA-27277,BP1.4.0,1\nJIRA-27276,BP1.4.0,1
按照bp分类统计count之和,绘制柱状堆叠图
使用聚合后的数据生成图表
- OS:
- Browser:
- Framework:
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.