Class VisualizationRunner
java.lang.Object
neqsim.mcp.runners.VisualizationRunner
Generates inline visual content (SVG charts, Mermaid diagrams, HTML tables) that can be rendered
directly in chat interfaces supporting rich content.
Output types:
- Phase envelope SVG — PT diagram with phase boundaries
- Process flowsheet — Mermaid diagram of equipment connections
- Compressor map SVG — performance curves with operating point
- Property comparison — styled HTML table comparing multi-case results
- Version:
- 1.0
- Author:
- Even Solbraa
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor — all methods are static. -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringCreates a standard error JSON response.private static StringescapeHtml(String text) Escapes HTML special characters.private static StringEscapes XML special characters.private static StringgenerateBarChartSVG(com.google.gson.JsonObject input) Generates an SVG bar chart for comparing values.private static StringgenerateCompressorMapSVG(com.google.gson.JsonObject input) Generates a compressor performance map SVG.private static StringgenerateFlowsheetDiagram(com.google.gson.JsonObject input) Generates a Mermaid flowsheet diagram from process simulation results.private static StringgenerateLineChartSVG(com.google.gson.JsonObject input) Generates an SVG line chart for trend/time-series data.private static StringgeneratePhaseEnvelopeSVG(com.google.gson.JsonObject input) Generates an SVG phase envelope (PT diagram) for a fluid composition.private static StringgeneratePieChartSVG(com.google.gson.JsonObject input) Generates an SVG pie chart showing proportions.private static StringgenerateStyledTable(com.google.gson.JsonObject input) Generates a styled HTML table for property comparisons.private static StringgetEquipmentShape(String type) Maps equipment type to Mermaid shape syntax.static StringMain entry point for visualization generation.
-
Field Details
-
GSON
private static final com.google.gson.Gson GSON
-
-
Constructor Details
-
VisualizationRunner
private VisualizationRunner()Private constructor — all methods are static.
-
-
Method Details
-
run
-
generatePhaseEnvelopeSVG
Generates an SVG phase envelope (PT diagram) for a fluid composition.- Parameters:
input- JSON with components and model- Returns:
- JSON with SVG string and data points
-
generateFlowsheetDiagram
Generates a Mermaid flowsheet diagram from process simulation results.- Parameters:
input- JSON with equipment list and connections- Returns:
- JSON with Mermaid diagram string
-
generateBarChartSVG
Generates an SVG bar chart for comparing values.- Parameters:
input- JSON with labels and values- Returns:
- JSON with SVG string
-
generateCompressorMapSVG
Generates a compressor performance map SVG.- Parameters:
input- JSON with compressor data and operating point- Returns:
- JSON with SVG and data
-
generateStyledTable
Generates a styled HTML table for property comparisons.- Parameters:
input- JSON with headers and rows- Returns:
- JSON with HTML table string
-
getEquipmentShape
-
escapeXml
-
escapeHtml
-
errorJson
-
generatePieChartSVG
Generates an SVG pie chart showing proportions.- Parameters:
input- JSON with categories and values arrays- Returns:
- JSON with SVG string
-
generateLineChartSVG
Generates an SVG line chart for trend/time-series data.- Parameters:
input- JSON with xValues, yValues arrays, labels, and optional series- Returns:
- JSON with SVG string
-