hccccc01333/dsh-report-html1

dsh-report-html

从 Markdown、表格和图表数据生成自包含交互式 HTML 报告的 DSH 工具插件。

AI 分析

为 Agent 注册 HTML 报告生成和自动数据分析工具。适合需要让 AI 直接输出可视化交互式分析报告和图表的用户。

套件
dsh-report-html
版本
0.7.0
最近更新
2026年8月13日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hccccc01333/dsh-report-html

Usage

The plugin registers one tool: report_html. Give the model a Markdown report or structured analysis data and ask it to write an HTML report; the tool renders the content and writes the file.

It also registers report_analysis for automatic analysis: pass rows of JSON data and the tool infers column types, computes statistics, detects trends, aggregates categories, picks charts and KPIs, and returns a conversational insights summary. Pass path to also write the full interactive HTML report; omit it to get the analysis without touching the filesystem.

Analyze these rows and write a report to D:\reports\sales-analysis.html:
[{"month": "2026-01", "channel": "Online", "revenue": 120000}, ...]
Write an HTML report to D:\reports\sales.html titled "2026 Sales"
with a summary section, a monthly table, and a bar chart of revenue.

The tool accepts:

ParameterTypeDescription
pathstring (required)Absolute path of the HTML file to write.
titlestring (required)Report title shown in the header and browser tab.
subtitlestringOptional one-line subtitle.
themelight | darkColor theme; defaults to light.
tocbooleanRender a table-of-contents nav from section, table, and chart titles.
kpisarray{ label, value, delta?, direction? } KPI cards above the body.
sectionsarray{ heading, markdown } content sections.
tablesarray{ title?, columns, rows } sortable tables.
chartsarray{ type, title?, ... } SVG charts (see below).

Markdown support: ATX headings, paragraphs, fenced code blocks, pipe tables, unordered/ordered lists, blockquotes, horizontal rules, bold, italic, strikethrough, inline code, http(s)/mailto links, and a small LaTeX-like math subset ($...$ inline, $$...$$ blocks: \frac, \sqrt, Greek letters, operators, ^/_ super/subscripts). Raw HTML is escaped, so report content cannot inject scripts.

Chart types:

TypeExtra fieldsRendering
barstacked?: trueGrouped or stacked bars.
lineMulti-series lines with points.
areastacked?: truePlain or stacked filled areas.
scatterpoints: { x, y, label?, series? }[]Numeric x/y scatter, colored by series.
heatmapcolumns: string[], data: number[][]Row×column matrix with a blue scale.
pieDonut using the first dataset.
mapmapData: { name, value }[]China province choropleth; accepts short names like 广东.
flowflow: { nodes, edges }Ranked-column flowchart with arrowheads and edge labels.
funnelConversion funnel with stage and overall rates.
gaugegauge: { value, min?, max?, label? }Single-value semicircle gauge.

Viewer interactions: table headers are click-to-sort, legend items toggle a series on and off, every table has a filter box, charts show a floating tooltip on hover and an Expand button for fullscreen viewing, and the header buttons switch between light and dark themes, open the viewer settings panel, or print/save the report as PDF. The settings panel lets the reader choose theme (auto/light/dark), font size, layout density, and whether the table of contents and KPI cards are visible; choices persist in localStorage. Bar, line, and area charts include a segmented control so the reader can switch the chart type at runtime. Any chart can declare drilldown: { columns, rows }; clicking a data point toggles that detail table below the chart. Everything is embedded in the single HTML file.

China map boundaries are projected from Aliyun DataV administrative areas (100000_full); islets south of 16°N render as a bottom-right inset.

The tool returns { path, bytes, kpis, sections, tables, charts, warnings }; rows or series whose length does not match the declared columns/labels are aligned and reported in warnings.

See examples/sample-report.html for a generated demo report. Regenerate it with node scripts/generate-sample.mjs.