Moses14159/dsh-visualizer ↗★ 6
dsh-visualizer
DSH 外部插件:模型在对话流中流式生成 SVG/HTML Widget(```svg/```html 围栏逐 token 渲染于沙箱 iframe)与结构化图表(visualize 工具的 ChartSpec -> echarts)。复用已有 assistant/chunk + tool/result 事件,不改 DSH 源码。 适合需要AI实时生成并直观展示SVG、HTML沙箱或ECharts图表的用户。
같은 패키지 이름의 다른 저장소
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Moses14159/dsh-visualizerUsage
After installing, just tell the model in the conversation:
- Say "draw a chart with visualize" → the model calls
visualizewith aspec; - Say "write an SVG badge / HTML widget" → the model streams ```svg / ```html fences directly in the reply, and you see it render frame by frame as it generates;
- The model can also pass a
widgetparameter tovisualizeto deliver a complete widget (validated, persisted, and replayable on the host).
Tool payloads
visualize takes exactly one of:
// Structured chart
{ "spec": {
"kind": "bar", // bar | line | area | pie | scatter
"title": "Shenzhen · 7-day temperature",
"xAxis": ["Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri"],
"yName": "°C",
"series": [{ "name": "Max", "data": [32, 32, 30, 31, 29, 31, 32] }]
} }
// SVG / HTML widget
{ "widget": { "kind": "svg", "code": "…", "title": "Card title" } }
Streaming fence
```svg
…rendered token by token…
```