Package com.tnsai.tools.visualization
Class VisualizationTools
java.lang.Object
com.tnsai.tools.visualization.VisualizationTools
Function-shape visualization tools — pure-JDK ASCII chart + table renderer
+ infographic template catalog. Replaces the legacy
AutoChartTool,
DataTableTool, and InfographicTool. The legacy tools each
exposed 5+ formats / operations behind one dispatched tool; this migration
focuses on the most-useful subset:
| Method | Purpose | Idempotent |
|---|---|---|
chartAscii(java.util.Map<java.lang.String, java.lang.Number>, java.lang.String) | ASCII bar chart from a label→value map | true |
tableFormat(java.util.List<java.util.Map<java.lang.String, java.lang.Object>>, java.lang.String) | Markdown / CSV / ASCII table from a list of row maps | true |
infographicTemplates() | List built-in infographic templates | true |
Pure-JDK / deterministic / no auth / no network. Vega-Lite + Mermaid
rendering can be added later via DiagramTools.mermaid_render for
non-ASCII output.
- Since:
- 0.5.7 (Phase 2 batch 24 — built-in tool migration to function shape, see #188)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordTemplate metadata record. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
VisualizationTools
public VisualizationTools()
-
-
Method Details
-
chartAscii
@Tool(name="chart_ascii", description="Render a horizontal-bar ASCII chart from a label\u2192value {data} map (numeric values). Optional {title} appears above the chart. Each bar\'s width is proportional to its value relative to the max. Useful for quick terminal-friendly visualizations the LLM can include verbatim in Markdown answers. Pure-JDK; no auth.", keywords={"chart","ascii","bar","visualization"}, idempotent=true) public String chartAscii(@ToolParam(description="Label \u2192 numeric value map (insertion order preserved)") Map<String, Number> data, @ToolParam(description="Optional chart title",required=false,defaultValue="") String title) -
tableFormat
@Tool(name="table_format", description="Format a list of row maps (each row = column\u2192value) as a table. {format} is one of \"ascii\" (Unicode box drawing \u2014 default), \"markdown\" (GFM), or \"csv\". Output is capped at 100 rows; longer inputs are truncated with a marker line. Pure-JDK; no auth.", keywords={"table","format","ascii","markdown","csv"}, idempotent=true) public String tableFormat(@ToolParam(description="Row maps (each row is a column\u2192value map)") List<Map<String, Object>> rows, @ToolParam(description="Output format: ascii / markdown / csv",required=false,defaultValue="ascii") String format) -
infographicTemplates
@Tool(name="infographic_templates", description="List the built-in infographic templates (15 templates: comparison / timeline / process / statistics / hierarchy / pie_chart / bar_chart / list / quote / fact_sheet / pros_cons / features / roadmap / funnel / flowchart). Returns the list of {id, description} records. Pure-JDK; no auth.", keywords={"infographic","templates","list","visualization"}, idempotent=true) public List<VisualizationTools.Template> infographicTemplates()
-