Data Visualization
从文本生成美观的词云,支持自定义字体、颜色和大小
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/word-cloud-generator' \
-H 'Content-Type: application/json' \
-d '{"textData":"Enter your text here...\n\nor paste common words separated by spaces:\ncloud data analysis machine learning artificial intelligence programming development software technology innovation research science algorithm model training neural network deep learning big data visualization business strategy marketing design user experience interface web mobile application database server cloud computing cybersecurity network security digital transformation","chartTitle":"输入图表标题...","fontFamily":"Arial","colorScheme":"default","backgroundColor":"#ffffff","maxWords":"50","minFontSize":"12","maxFontSize":"60","spiralType":"archimedean","rotationAngles":"any","padding":"5","chartWidth":"800","chartHeight":"400","showBorder":false}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/word-cloud-generator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| textData | textarea | 是 | 用于词频分析的文本。更长的文本能生成更好的词云 |
| chartTitle | text | 否 | 显示在词云上方的标题 |
| fontFamily | select | 否 | — |
| colorScheme | select | 否 | — |
| backgroundColor | color | 否 | 词云的背景颜色 |
| maxWords | number | 否 | 云中显示的最大词数 |
| minFontSize | number | 否 | 低频词的最小字体大小(像素) |
| maxFontSize | number | 否 | 高频词的最大字体大小(像素) |
| spiralType | select | 否 | — |
| rotationAngles | select | 否 | — |
| padding | number | 否 | 词之间的最小间距(像素) |
| chartWidth | number | 否 | 词云的像素宽度 |
| chartHeight | number | 否 | 词云的像素高度 |
| showBorder | checkbox | 否 | 在词云周围显示边框 |
HTML 结果
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-word-cloud-generator": {
"name": "word-cloud-generator",
"description": "从文本生成美观的词云,支持自定义字体、颜色和大小",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=word-cloud-generator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "word-cloud-generator",
"arguments": {
"textData": "Enter your text here...\n\nor paste common words separated by spaces:\ncloud data analysis machine learning artificial intelligence programming development software technology innovation research science algorithm model training neural network deep learning big data visualization business strategy marketing design user experience interface web mobile application database server cloud computing cybersecurity network security digital transformation",
"chartTitle": "输入图表标题...",
"fontFamily": "Arial",
"colorScheme": "default",
"backgroundColor": "#ffffff",
"maxWords": "50",
"minFontSize": "12",
"maxFontSize": "60",
"spiralType": "archimedean",
"rotationAngles": "any",
"padding": "5",
"chartWidth": "800",
"chartHeight": "400",
"showBorder": false
}
}
}有问题或反馈?请联系 [email protected]