* feat(web-shell): support custom code block rendering * fix(web-shell): harden custom code block rendering * docs: add skill capability gating design * fix(web-shell): make chart skill host supplied * docs(web-shell): write chart skill in English * docs(web-shell): document full-data chart payload * docs(web-shell): use dataset-backed chart payload * feat(web-shell): add echarts full-data renderer * chore(web-shell): keep chart skill host supplied * fix(web-shell): show loading for streaming chart blocks * style(web-shell): polish echarts full-data renderer * fix(web-shell): harden custom code block language parsing * fix(web-shell): harden echarts full-data renderer * fix(web-shell): polish echarts renderer followups * fix(web-shell): reuse enhanced table for chart data * fix(web-shell): recover chart renderer after errors * fix(web-shell): harden chart option handling * fix(web-shell): harden chart data rendering * fix(web-shell): tighten chart renderer guardrails * fix(web-shell): update chart fallback title * fix(web-shell): polish chart renderer review fixes * feat(web-shell): support compact echarts full data blocks * docs(web-shell): add chart skill template * fix(web-shell): address chart review suggestions * fix(web-shell): preserve punctuation language aliases * fix(web-shell): address chart follow-up review * fix(web-shell): harden chart ref resolution * fix(web-shell): cover chart sanitizer follow-ups * fix(web-shell): address chart review follow-ups * fix(web-shell): address chart review leftovers * fix(web-shell): close chart review gaps * fix(web-shell): handle latest chart review
3.9 KiB
| name | description |
|---|---|
| qwencode-viz | Generate renderable chart outputs for clients that support the Qwen Code Web Shell echarts-fulldata renderer. Use only when the current Web Shell host has explicitly registered that renderer and the user asks for a chart, visualization, ECharts output, or Web Shell-rendered chart block. |
Qwen Code Visualization Skill
Use this skill to emit chart blocks that a Qwen Code Web Shell host can render.
This skill defines only the model output contract; it does not load or execute
the chart runtime. The host client must already have registered an
echarts-fulldata renderer.
Preconditions
Use this skill only when all of these conditions are true:
- The active host is Qwen Code Web Shell, or an equivalent Web Shell client.
- The host has registered an
echarts-fulldatafenced code block renderer. - The user wants a visual chart, not just a plain Markdown table or code block.
If any condition is not met, do not emit an echarts-fulldata block. Use normal
Markdown, tables, or prose instead.
Output Contract
Emit one fenced code block whose language tag is exactly echarts-fulldata.
The block body must be one valid JSON object that can be parsed directly with
JSON.parse. Do not emit JavaScript.
Preferred inline payload shape:
{
"version": 1,
"data": {
"kind": "inline",
"dimensions": ["day", "orders"],
"source": [
["Mon", 120],
["Tue", 200],
["Wed", 150],
["Thu", 80],
["Fri", 240]
]
},
"option": {
"title": { "text": "Weekly orders" },
"tooltip": { "trigger": "axis" },
"xAxis": { "type": "category" },
"yAxis": { "type": "value" },
"series": [{ "type": "bar", "encode": { "x": "day", "y": "orders" } }]
}
}
Legacy dataset-backed ECharts option JSON is also accepted when an envelope is not needed:
{
"title": { "text": "Weekly orders" },
"dataset": {
"dimensions": ["day", "orders"],
"source": [
{ "day": "Mon", "orders": 120 },
{ "day": "Tue", "orders": 200 }
]
},
"xAxis": { "type": "category" },
"yAxis": { "type": "value" },
"series": [{ "type": "bar", "encode": { "x": "day", "y": "orders" } }]
}
Safety Rules
- Output JSON data only, not JavaScript.
- Do not output
const option = ..., expressions, comments, trailing commas, functions, or callbacks. - Do not ask the host to use
eval,new Function, or script injection. - Do not reference the DOM, globals, network requests, randomness, timers,
document,window, or the filesystem. - Put chart data in the envelope
data.source, or indataset.sourcefor legacy option payloads. - Avoid duplicating the same data in
xAxis.data,legend.data, orseries.datawhendatasetplusencodecan express it. - If the data is too large, aggregate or sample it first, and explain that treatment outside the block.
Response Format
When a chart is appropriate, respond in this order:
- One short takeaway describing the main point shown by the chart.
- One
echarts-fulldatafenced code block containing the complete JSON payload. - Optional notes such as metric definitions, aggregation choices, or reading guidance.
Do not nest the chart block inside any other Markdown container.
Chart Guidance
- Trends: Prefer a line chart with time on the x-axis and the metric on the y-axis.
- Rankings: Prefer a bar chart sorted by the metric in descending order.
- Composition: Use a pie chart for a small number of categories; use a bar chart when there are many categories.
- Multi-metric comparisons: Prefer grouped bars or multiple lines, and avoid overcrowding the chart with too many series.
- Keep titles, axes, units, and legends clear.
When Unsure
If there is not enough data to draw a chart, or if renderer support is unclear,
explain the reason in normal Markdown first. Do not guess by emitting an
echarts-fulldata block.