How to use dsh-visualize
Render interactive cards directly in DSH model conversations, displaying charts, simulators, comparison panels, and UI mockups as HTML snippets.
This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.
This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.
Quick start
dsh-visualize
— source: plugin_wiki.wiki_content
Install & verify
dsh plugin --profile web add github:Nagi-ovo/dsh-visualize
Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.
— source: plugins.install
FAQ
After installation the model still only replies with text, how to make the model call visualize?
The model needs to load the visualize skill within the session to generate fragments. If it doesn't trigger in a new session, restart dsh web once to register the skill; or directly say "use the visualize card to draw an XX" when asking.
Tool warning: fragment contains a document-skeleton tag, how to fix?
Don't write outer layer tags like <!doctype>, <html>, <head>, <body> in the fragment - the host card will provide the document skeleton, styles, and theme itself. Only write the body structure in the fragment.
Why don't fetch, XHR, WebSocket in the card respond?
Cards run in a sandboxed iframe from an opaque source, CSP prohibits connect-src for external connections, and can only load static resources (like Chart.js, D3) from whitelisted CDNs. When data needs to be fetched over the network, the model should write the data directly into the fragment.
Buttons in the card don't respond when clicked, how to pass them back to the conversation?
The current version doesn't yet support buttons inside the card sending follow-up messages to the main conversation. When the model needs to redraw, it can only call visualize again. Please directly tell the model about buttons like "Apply".
Use update or recreate for local modifications?
When modifications are within 20 lines, 5 places, and each reply is under 4 turns, use action: update for old_str→new_str replacement for better efficiency. For structural changes or larger revisions, recreating a card is more stable. Every update reloads the card, so control states like slider inputs will reset to initial values.
Why don't TUI and headless clients display it?
Interactive cards currently only render in the Web UI; TUI and headless clients will only see a confirmation text "Rendered ... (X bytes; workspace copy at ...)". The fragment file still exists - you need to open dsh web in a browser to see the card.
What's the maximum size of a single card?
The default single fragment limit is 1,000,000 bytes (~1 MB), which can be adjusted up or down via maxFragmentBytes in the dsh profile configuration. When exceeded, it will directly error and prompt to reduce lines or lower precision.
How to completely uninstall?
dsh plugin --profile web remove github:Nagi-ovo/dsh-visualize, then restart dsh web. Cards in already rendered sessions will revert to plain tool result text.
— source: plugin_wiki.faq_json
Compatibility
- DSH: >=0.1.0-rc.6
- Node: 未声明
— source: plugin_wiki.compatibility_json
Pitfalls
Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.
— source: general rule