Data Agent Custom Web Report
This topic explains how to build structured, interactive data analytics reports using the Data Agent custom web report feature and JSON DSL configuration.
Prerequisites
You have activated the DMS Data Agent service.
You have created at least one active data source.
For first-time learning, use the built-in data source internal_data_employees provided by DataAgent to follow this tutorial.
Getting Started
Create a custom Agent and enable the report feature
The custom web report feature requires you to create a custom Agent.
Log in to DMS 5.0.
From the top navigation bar, select , or in Simplified Mode, click the
icon in the upper-left corner and select to open Data Agent.
In DataAgent, on the homepage, select Custom Agent in the navigation pane on the left.
On the Custom Agent page, click Start creating.
On the Create a custom Agent page, in the Basic Information section, enter a Name and Description.
In the Context section, turn on Select the data range. Then select the built-in data source
internal_data_employeesprovided by DataAgent.Expand Advanced Configuration, find and turn on the toggle for Customize Web Report.
NoteDuring the trial phase, set Execution Plan, Execute SQL Query, Output Web Report, and In-process Inquiries to run automatically. This lets you view the full result right away.
In the configuration area below, paste your web report definition. For more information, see Appendix: Complete Configuration Example.

After you finish configuring, start a session and select your custom Agent. You will see the generated web report. Adjust the configuration until it matches your desired appearance.

During the trial, generating a full report from the
internal_data_employeesdatabase takes about 5 to 10 minutes. Please wait.
Understand the basic structure of the report configuration
To customize a web report, provide a JSON-formatted configuration. It has a basic structure with four core parts:
Field | Required | Purpose |
| Optional | The configuration protocol version. Use |
| Required | The report skeleton. Defines the overall content and structure of the report. |
| Optional | Defines global styling for the report, such as colors and font sizes. Ensures AI follows consistent rules. |
| Optional | Defines SQL queries to run in the report. These are called by |
Understand the root and node concepts
The root is the top-level element of the report. It organizes content using parent-child relationships. Think of each node as a building block. The root is where all blocks begin.
Each node has three basic properties:
type(Type): Defines what kind of block it is. There are four types:Type
Description
ContainerContainer: A transparent box that does not display content. Used only to group and arrange other blocks (child nodes).
TextPlain text: Displays fixed text that you write in the configuration.
AGUIAI-generated content: A "magic canvas". AI generates text, charts, and more based on your prompt.
BICustom SQL data: A "data display board". Shows analysis results from SQL queries you define.
description(Description): The block's instruction manual. In aTextnode, it is the text to display. InAGUIandBInodes, it is the prompt or instruction that guides content generation.layout(Layout): Controls the block's appearance and styling. Different node types support different layouts. These are covered later.
Write your first report
Start with the simplest configuration. The example below creates a report with only a title:
{
"version": "1.0",
"root": {
"type": "Container",
"layout": "Single",
"children": [
{
"type": "AGUI",
"description": "Generate a report title area with a gradient blue-purple background. Use large font size to highlight the fixed text: 'Employee Compensation Structure and Fairness Report'.",
"layout": "Block"
}
]
}
}
Code explanation:
We use a
Containeras the root node and set its layout toSingle(child nodes stack vertically).We add one
AGUIchild node to thechildrenarray of this container.The
AGUInode'sdescriptiontells AI: "Generate a title with a blue-purple gradient background. The text is 'Employee Compensation Structure and Fairness Report'."
The result looks like this — a clean title card:

A Container node adds child nodes using its dedicated children field. To add content to your report, add new nodes to the children array.
Add more content to your report
A report with only a title is too simple. If you want to add a section on overall employee salary analysis, include a subtitle, a salary distribution histogram, and analysis conclusions. Do this by adding a new Container to the root node's children array. Then place three child nodes inside this new container.
A
Textnode (layoutAdaptiveTitle) for the section subtitle.An
AGUInode (layoutChart) to draw the salary histogram.An
AGUInode (layoutCard) to show salary analysis conclusions.
{
"version": "1.0",
"root": {
"type": "Container",
"layout": "Single",
"children": [
{
"type": "AGUI",
"description": "Generate a report title area with a gradient blue-purple background...",
"layout": "Block"
},
// New analysis module
{
"type": "Container",
"layout": "Card", // Use Card layout to make this module look like a card
"children": [
{
"type": "Text",
"description": "Overall Employee Salary Distribution",
"layout": "AdaptiveTitle"
},
{
"type": "AGUI",
"description": "Draw a histogram of current employee salaries. X-axis: salary. Y-axis: number of employees. Show exact count on hover.",
"layout": "Chart"
},
{
"type": "AGUI",
"description": "Generate a card with a light purple background and a purple vertical bar on the left. Summarize key features of the salary distribution in concise text.",
"layout": "Card"
}
]
}
]
}
}
The result looks like this — a report with a title and a complete analysis module:

After you finish configuring, start a session and select your custom Agent. You will see the generated web report. Then adjust the JSON configuration until the report matches your expectations.
Detailed node types and layouts
This section covers each supported layout for every node type. Each entry includes code examples and screenshots to help you choose quickly.
Container (container node)
A Container displays no business content. Its only job is to organize and arrange child nodes. Only Container nodes can use the children field to hold child nodes.
Layout | Effect | Use case |
| Single-column layout: Child nodes stack vertically. Each node takes the full width. | Major sections in a report. Links multiple content blocks. |
| Two-column layout: Child nodes split into left and right columns. Use the | Comparison scenarios, such as image-and-text analysis. |
| Responsive grid layout: Child nodes form a multi-column grid based on screen width. | Displaying multiple similar cards side by side, such as KPI cards. |
| Card container: A styled card area. All child nodes appear inside the same card. | Group strongly related content (such as title + chart + text) into a visual unit. |
| Footer layout: A small gray text area at the bottom of the page. | Place disclaimers, data sources, or generation timestamps. |
Single— Single-column layoutCode example:
{ "type": "Container", "description": "Key Findings and Recommendations", "layout": "Single", "children": [ { "type": "Text", "description": "Key Findings and Recommendations", "layout": "AdaptiveTitle" }, { "type": "AGUI", "description": "Main findings card with light purple background (#F5F0FF) and purple left vertical bar (#7C3AED). Title 'Main Findings' uses bold dark purple (#5B21B6). List key findings with ordinal numbers.", "layout": "Card" }, { "type": "AGUI", "description": "Actionable recommendations card with light green background (#F0F9F1) and green left vertical bar (#16A34A). Display recommendations in a table.", "layout": "Table" } ] }Screenshot example:

Double— Two-column layoutCode example:
{ "type": "Container", "description": "Gender Salary Comparison Section", "layout": "Double", "ratio": "1:1", "gap": "4", "children": [ { "type": "AGUI", "description": "Overall fairness evaluation card with light green background.", "layout": "Card" }, { "type": "AGUI", "description": "Key issue discovery card with light yellow background.", "layout": "Card" } ] }Example:

ImportantWhen using the
Doublelayout, always declare theratiofield (e.g.,"1:1"or"1:2"). Otherwise, column widths may be unpredictable.Flex— Responsive grid layoutCode example:
{ "type": "Container", "description": "Key Metrics Card Group", "layout": "Flex", "gap": "4", "children": [ { "type": "AGUI", "description": "Average salary metric block with white background and shadow. Large centered number. Small label below. Blue top bar.", "layout": "Block" }, { "type": "AGUI", "description": "Total employee count metric block with white background and shadow. Large centered number. Small label below. Green top bar.", "layout": "Block" }, { "type": "AGUI", "description": "Department count metric block with white background and shadow. Large centered number. Small label below. Purple top bar.", "layout": "Block" } ] }Example:

Card— Card containerCode example:
{ "type": "Container", "description": "Module Five: Gender and Salary Disparity Analysis", "layout": "Card", "children": [ { "type": "Text", "description": "Five. Gender and Salary Disparity Analysis", "layout": "AdaptiveTitle" }, { "type": "AGUI", "description": "Draw a quadrant scatter chart showing department salary and headcount distribution.", "layout": "Chart" } ] }Example:

Footer— Footer layoutCode example:
{ "type": "Container", "description": "Report footer section", "layout": "Footer", "children": [ { "type": "AGUI", "description": "Footer information block with dark gray background and white text. Center-align data source, generation timestamp, and copyright. Use small font size.", "layout": "Block" } ] }Example of the effect:

Text (plain text node)
A Text node displays fixed, static text. Its description appears as-is. AI does not process it.
Layout | Effect | Use case |
| Title or paragraph text that adjusts styling based on context. | Main report title, section subtitles, paragraph descriptions. |
| A short inline text block. | Small labels or brief notes inside cards. |
AdaptiveTitle— Adaptive titleCode example:
{ "type": "Text", "description": "Key Findings and Recommendations", "layout": "AdaptiveTitle" }Effect example:

Span— Short text labelCode example:
{ "type": "Text", "description": "Key Issue Discovery", "layout": "Span" }Example result:

AGUI (AI-generated content node)
An AGUI node uses a Large Language Model (LLM) to generate content based on the prompt in description. The description is not final text. It is an instruction for AI.
Tip for beginners: Be specific in the description — include colors, layout, and data requirements. Avoid vague instructions like "write some analysis".Layout | Effect | Use case |
| A visually prominent header card. Ideal for section covers. | Opening title area for a major content section. |
| A visualization chart built with the Recharts library (bar chart, line chart, pie chart, etc.). | Visualizing various types of data. |
| A data table with headers and body rows. | Detailed data tables, ranking tables, comparison tables. |
| A standard card with border, shadow, and padding. Usually includes icons, titles, and body text. | Displaying metrics, insights, or recommendations — text-heavy content. |
| A flexible content area. Mixes text, lists, icons, and more. Styling is adaptable. | Complex analysis paragraphs that need formatting but not strict card styling. |
| Text-focused, but adds icons, bold text, and other visual elements for impact. | Key explanations or critical insights. |
CardHeader— Section header cardCode example:
{ "type": "AGUI", "description": "Salary analysis report header with gradient blue-purple background. Main title 'Deep Salary Structure Analysis' uses bold large white font. Subtitle 'Comprehensive assessment based on full-year 2003 data' uses medium-size light font.", "layout": "CardHeader" }Example:

Chart— A chartCode example:
{ "type": "AGUI", "description": "Draw a bar chart comparing salary coefficient of variation across positions. X-axis: position name. Y-axis: coefficient of variation. Sort bars from highest to lowest. Use purple color scheme.", "layout": "Chart" }Screenshot example:

Table: A tableCode example:
{ "type": "AGUI", "description": "Actionable recommendations card with light green background (#F0F9F1) and green left vertical bar (#16A34A). Display recommendations in a table. Headers: 'Problem Area' and 'Recommended Actions'.", "layout": "Table" }Example:

Card— A cardCode example:
{ "type": "AGUI", "description": "Core salary distribution features card with light purple background (#F5F0FF) and purple left vertical bar (#7C3AED). Title 'Distribution Features' uses bold dark purple. Summarize features in concise text.", "layout": "Card" }Example:

Block— Flexible content blockCode example:
{ "type": "AGUI", "description": "Department count metric block with white background and shadow. Large number '9' centered. Small label 'Number of Business Departments' below. Purple top bar. Building icon in upper-right corner.", "layout": "Block" }Screenshot example:

Text— Enhanced text blockCode example:
{ "type": "AGUI", "description": "Data description text block with dark gray text. Content: 'This report uses HR system data covering full-year 2003 salary records. Analysis methods include descriptive statistics, correlation analysis, and trend prediction. All monetary units are CNY.' Left-aligned. Standard font size.", "layout": "Text" }Example:

BI (custom SQL data node)
A BI node inserts SQL query results into your report. It links to SQL defined in the top-level metric field and the metrics array.
AGUI gives AI freedom. BI gives you precise control over data. You write the SQL. The system runs it. Results appear directly.
Layout | Effect | Use case |
| A data table with advanced features like number formatting, labels, and icons. | Tables that require precise data display, such as risk level tables. |
| A quadrant scatter chart with X/Y mean reference lines. Used for classification analysis. | Quadrant analysis scenarios, such as "high salary, high headcount". |
| A large display card for a single key metric. Includes title, main value, and icon. | Highlighting core KPIs, such as average salary or total employees. |
Table— BI tableCode example:
{ "type": "BI", "metric": "salary_info", "description": "Department salary summary table. Shows employee count, average salary, and salary standard deviation per department. Table has borders. Alternate row background colors.", "layout": "Table", "params": { "bordered": true, "striped": true, "headerBg": "bg-blue-100", "column_styles": { "Average Salary": { "numberFormat": { "type": "fixed", "decimalPlaces": 2 }, "unit": " CNY" }, "Salary Standard Deviation": { "numberFormat": { "type": "fixed", "decimalPlaces": 2 }, "unit": " CNY" } } }, "select_columns": ["dept_name", "Employee Count", "Average Salary", "Salary Standard Deviation"] }Example:

ImportantThe
metricvalue (here,salary_info) must match thenamefield of an item in the top-levelmetricsarray exactly.ScatterQuadrant— Quadrant scatter chartCode example:
{ "type": "BI", "metric": "salary_info", "description": "Department salary quadrant chart. X-axis: average salary. Y-axis: salary standard deviation.", "layout": "ScatterQuadrant", "params": { "xColumn": "Average Salary", "yColumn": "Salary Standard Deviation", "labelColumn": "dept_name", "xAxisLabel": "Department Average Salary (CNY)", "yAxisLabel": "Department Salary Standard Deviation (CNY)" } }Example:

MetricCard— KPI metric cardCode example:
{ "type": "BI", "metric": "avg_salary", "description": "Average salary metric card.", "layout": "MetricCard", "params": { "title": "Company Average Salary", "icon": "TrendingUp", "iconColor": "#16a34a" } }Example:

Advanced Configuration
Global style control:metadata
The metadata field sets general rules for the report. These rules become part of the global prompt sent to the AI model. All AGUI nodes follow these rules when generating content. You do not need to repeat them in each node's description.
Recommended configuration structure:
"metadata": { "ai_code_requirements": { "framework": "React", "empty_state_handling": { ... }, "style": "...", "data_format": "...", "language_style": "...", "coding_style": "...", "avoid_paths": [ ... ] } }Configuration parameter details:
Parameter Name
Purpose
Configuration Example
frameworkDeclare the frontend framework type
React— Generate React functional componentsempty_state_handlingDefine display rules when data is empty or calculations fail
Set empty state messages for
card_value,chart,table, andai_textstyleGlobal visual style guidance
Blue-purple = insight, yellow-orange = alert, green = positive, gray = neutral
data_formatNumber formatting rules
0.123 → 12.3%, salaries shown as integers with "CNY"
language_styleConstraints on AI text style
Reduce repetition. Support claims with specific data.
coding_styleJSX coding standards
Wrap special characters with
{""}avoid_pathsKnown error cases
Disable
ButtonGroup; avoid raw>/<Configuration example:
"metadata": { "ai_code_requirements": { "framework": "React", "empty_state_handling": { "null_data_per_module": { "card_value": "Show '--' or 'No data'", "chart": "Show blank chart + centered text 'No data'", "table": "Show headers + one row 'No data'", "ai_text": "Show 'No analysis recommendations. Confirm business data exists for this period.'" }, "calculation_error": "If denominator is zero, show '--'" }, "style": "Rich visual effects. Use background colors, colored left bars, and icons. Apply different card styles for different analysis types: blue/purple for insights, yellow/orange for alerts, green for positive conclusions, gray for general notes. Ensure proper font contrast: titles stand out, body text is comfortable. Base font size is ShadCN's text-sm. Adjust others relative to this.", "data_format": "Include units with numbers. Never omit % signs. Convert decimal percentages to percentage format. Round all decimals to one place. Show salaries as integers or two-decimal numbers with 'CNY'.", "language_style": "Avoid repeated text (e.g., parallel structures or list prefixes) to keep content concise. Write professionally. Support inferences and recommendations with real data. Avoid guessed numbers, especially for action items. Reference specific data to back up claims.", "coding_style": "Wrap brackets with {\"\"}, e.g., 2 {\">\"} 1 ; 1 {\"<\"} 2", "avoid_paths": [ "ButtonGroup is not exported -- don't use ButtonGroup", "Unexpected token `>` -- avoid to use raw > or <" ] } }
Custom SQL Query:metrics
The metrics field is a top-level array. It defines all SQL queries needed for the report.
Define SQL queries:
In themetricsarray, define aname(unique identifier) andsql(query statement) for each query."metrics": [ { "name": "salary_info", "sql": "SELECT d.dept_name, COUNT(s.emp_no) AS Employee Count, AVG(s.salary) AS Average Salary, STDDEV(s.salary) AS Salary Standard Deviation FROM `salaries` s INNER JOIN `dept_emp` de ON s.emp_no = de.emp_no INNER JOIN `departments` d ON de.dept_no = d.dept_no WHERE s.to_date = '2003-01-01' AND de.to_date = '2003-01-01' GROUP BY d.dept_name;" }, { "name": "total_employees", "sql": "SELECT COUNT(DISTINCT de.emp_no) AS total FROM `dept_emp` de WHERE de.to_date = '2003-01-01';" }, { "name": "avg_salary", "sql": "SELECT AVG(s.salary) AS average_salary FROM `salaries` s WHERE s.to_date = '2003-01-01';" } ]Field
Type
Description
namestringUnique identifier for the metric. BI nodes reference query results using this name.
sqlstringThe SQL query to run.
Reference in
BInodes:
In aBInode, set themetricfield to the matchingnamevalue.{ "type": "BI", "metric": "salary_info", "description": "Department salary summary table (BI Table example). Shows employee count, average salary, and salary standard deviation per department. Table has borders. Alternate row background colors.", "layout": "Table", "params": { "bordered": true, "striped": true, "headerBg": "bg-blue-100", "column_styles": { "Average Salary": { "numberFormat": { "type": "fixed", "decimalPlaces": 2 }, "unit": " CNY" } } }, "select_columns": [ "dept_name", "Employee Count", "Average Salary", "Salary Standard Deviation" ] }ImportantThe
BInode'smetricvalue must match themetricsarray'snameexactly.
Use Skill to generate configuration with one click
If writing JSON by hand feels tedious, use the Skill tool to help. Describe your report content and style in plain language. Skill generates a draft configuration. Then fine-tune it based on the result.
Skill configuration file (skill.md)
Use this configuration in your Skill (see
web-report-json-builderskill for details):--- name: web-report-json-builder description: Builds compliant web report JSON structures. Covers ContainerNode/TextNode/BINode/AGUINode details, common layout patterns, metadata rules, metric management, and common error avoidance. Use this skill when generating JSON for renderable web reports (with layout containers, static text, BI visualizations, AI-generated content, etc.). --- # Web Report JSON Builder Guide > This skill provides Claude with complete rules for building web report JSON. All content is a hard requirement for Claude to follow. Not a suggestion. ## Core Principles - **TextNode contains only final text**: No prompts like "Please generate" or "Analysis below" - **AGUI description is an instruction**: Must include structure + style + example + edge-case handling - **Container is pure layout**: Carries no business logic. Only organizes child node layout - **Reuse over repetition**: Manage metrics in root.metrics. Define global rules in metadata ## Node Quick Reference ### ContainerNode (layout container) ```json { "type": "Container", "layout": "Card|Single|Double|Flex|Footer", "ratio": "1:2", // Required only for Double layout "children": [...] } ``` ✅ **Required** - Use `Card` instead of deprecated CardWithHeader/CardWithoutHeader - Declare `ratio` explicitly for two-column layouts (e.g., "1:1") ❌ **Forbidden** - Writing business explanations in `description` (used for debugging only) - Embedding text content (use TextNode instead) ### TextNode (static text) ```json { "type": "Text", "layout": "AdaptiveTitle|Span", "description": "Module title" // Must be final rendered text } ``` ✅ **Use for**: Titles, labels, fixed descriptions ❌ **Forbidden**: - `"description": "Please write a business summary"` → Should be `"Weekly Business Summary"` - Any content requiring AI generation ### BINode (BI visualization) ```json { "type": "BI", "layout": "Table|ScatterQuadrant|MetricCard", "metric": "shop_core", // Must match metrics.name "select_columns": ["Metric Name", "Current Value"], "params": { "column_styles": { "Current Value": { "numberFormat": { "type": "percentage", "decimalPlaces": 1 } } } } } ``` ✅ **Required** - Declare `select_columns` explicitly (avoid extra columns) - Define formats like percentages in `params`. Syntax follows component support. ❌ **Forbidden**: Using metrics not registered in root.metrics ### AGUINode (AI-generated content) ```json { "type": "AGUI", "layout": "Card|Block", "description": "Generate a light yellow background card (#FFF9E6) with dark brown text (#5A3E1F). Content: 1. Potential section (title + impact) 2. Key actions (action title + impact). Only for underperforming metrics, 1–2 items. Example: Improve sell-through → Sell-through rate drops 15.5%. Show 'No user feedback' if no data." } ``` **Six Prompt Elements** (all required): 1. Content structure (bullets/titles) 2. Output scope ("only underperforming metrics") 3. Data basis ("based on metric association model") 4. Style details (colors/font sizes/components) 5. Format example ("Improve...→ drops X%") 6. Edge-case handling ("show 'No user feedback' if no data") ❌ **Forbidden**: Vague instructions like "write some analysis" or "freely generate" ## Global Rules ### metadata (root field) ```json "metadata": { "ai_code_requirements": { "framework": "React", "style": "Base font size text-sm. Use background colors and icons well", "data_format": "Percentages show one decimal place and % sign", "language_style": "Avoid geeky style. Recommendations must be evidence-based", "avoid_paths": ["Disable ButtonGroup", "Avoid raw >"] } } ``` → All AGUI nodes inherit these rules. Avoid repeating them. ### metrics (root field) ```json "metrics": [ { "name": "shop_cnt", "sql": "SELECT count(*) FROM `shops` WHERE manager_name='{Manager Name}'" } ] ``` ✅ **Required** - Compress SQL into one line (escape newlines with `\n`) - Use `{Variable Name}` for templates (e.g., `{Start Date}`) - Reuse the same metric in multiple places ## Common Patterns (copy and use) ### Pattern 1: Standard Module ```json { "type": "Container", "layout": "Card", "children": [ {"type": "Text", "description": "Sales Analysis", "layout": "AdaptiveTitle"}, {"type": "BI", "layout": "Table", "metric": "sales_data", "select_columns": ["Category", "Sales"]}, {"type": "AGUI", "layout": "Card", "description": "Generate a blue title card... (follow six elements)"} ] } ``` ### Pattern 2: Two-Column Comparison ```json { "type": "Container", "layout": "Double", "ratio": "1:1", "children": [ {"type": "BI", "metric": "metric_a"}, {"type": "BI", "metric": "metric_b"} ] } ``` ### Pattern 3: Metric Card Group ```json { "type": "Container", "layout": "Flex", "children": [ {"type": "BI", "layout": "MetricCard", "metric": "a"}, {"type": "BI", "layout": "MetricCard", "metric": "b"} ] } ``` ## Common Error Quick Reference | Error | Fix | |-------|-----| | TextNode says "Please generate title" | Use "Weekly Business Summary" | | Container uses CardWithHeader | Replace with `"layout": "Card"` | | AGUI prompt is vague | Add all six elements (structure, scope, basis, style, example, edge case) | | BI omits select_columns | Declare required column names | | Ignore empty data handling | Rely on metadata rules or declare in prompt | ## Checklist (review before generating) - [ ] All TextNode.description values are final text - [ ] AGUI prompts include all six elements - [ ] BINode.metric names exist in root.metrics - [ ] Containers use only Card/Single/Double/Flex - [ ] metadata defines global style and empty-state rules - [ ] Two-column layouts declare ratio - [ ] Metric SQL uses template variables (e.g., `{Manager Name}`) > This skill is self-contained. No external resources needed. Follow all rules strictly to ensure JSON renders correctly.Example prompt
Send your analysis plan and style requirements to AI. Ask it to call Skill to generate the configuration. For example:
<requirement> <plan> <item> <order>1</order> <name>Overall Employee Salary Distribution and Trend Analysis</name> <description>Understand company-wide salary levels, distribution features, and time trends from 1985 to 2002. Provides foundation for deeper analysis.</description> <content> - Calculate annual average, median, highest, and lowest salaries for active employees. - Show salary trends over time (e.g., annual average salary curve). - Analyze salary distribution shape (e.g., histogram of employee counts by salary range). - Identify salary outliers or extremes (e.g., very high or low salary records). </content> <type>trend</type> <dependency></dependency> </item> <item> <order>2</order> <name>Department-Level Salary Comparison</name> <description>Reveal salary differences across departments. Supports fair compensation and resource allocation review.</description> <content> - Group by department (dept_name). Calculate average salary, total salary, and employee count for active records. - Compare historical average salary trends per department (1985–2002). - Identify departments with salaries significantly above or below company average. - Link to department managers to assess manager vs. staff salary gaps. </content> <type>classification</type> <dependency>1</dependency> </item> <item> <order>3</order> <name>Job Level Impact on Salary</name> <description>Explore the relationship between job level (title) and salary. Validate alignment between job grades and pay structure.</description> <content> - Group by job title (title). Calculate average salary, salary range, and headcount per level. - Analyze salary dispersion within each level (standard deviation or interquartile range). - Track salary trends over time for typical job levels. - Identify "same role, different pay" and possible causes (e.g., hire date, gender). </content> <type>insight</type> <dependency>1</dependency> </item> <item> <order>4</order> <name>Gender and Salary Fairness Analysis</name> <description>Assess gender pay gap. Support HR policy compliance and fairness reviews.</description> <content> - Group by gender (gender). Calculate average and median salaries. Compare salaries per job level. - Analyze gender's independent effect on salary after controlling for job, department, and tenure (descriptive level). - Calculate gender ratios in top earners (e.g., top 10% salary). - Compare salary growth rates and promotion opportunities for men and women (using titles and salaries tables). </content> <type>insight</type> <dependency>1,2,3</dependency> </item> </plan> <questions> </questions> </requirement> This is the analysis plan. Now generate a web report configuration using /web_report_config_generator. Use a blue-yellow tint palette. In the root, assign one task per child node — draw a bar chart, draw a line chart, summarize analysis, etc. Overwrite the result to test.json.Example output

Appendix: Complete Configuration Example
Below is a full custom web report configuration. It covers most node types and layouts described earlier. Use it as a template and modify it for your needs.
{
"version": "1.0",
"root": {
"type": "Container",
"description": "Root container for the page. Contains all business modules in a single-column layout.",
"layout": "Single",
"children": [
{
"type": "AGUI",
"description": "Report title area with gradient blue-purple background. Highlight fixed text 'Employee Compensation Structure and Fairness Report' in large font. Subtitle in smaller font: 'Data as of Jan 1, 2003 · Covers 240,124 active employees'.",
"layout": "Block"
},
{
"type": "Container",
"description": "Key Findings and Recommendations",
"layout": "Single",
"children": [
{
"type": "Text",
"description": "Key Findings and Recommendations",
"layout": "AdaptiveTitle"
},
{
"type": "AGUI",
"description": "Main findings card with light purple background (#F5F0FF) and purple left vertical bar (#7C3AED). Title 'Main Findings' uses bold dark purple (#5B21B6). List key findings with ordinal numbers. Add spacing between items. Bold key data.",
"layout": "Card"
},
{
"type": "AGUI",
"description": "Actionable recommendations card with light green background (#F0F9F1) and green left vertical bar (#16A34A). Title uses bold dark green (#2E6B3E). Title text is 'Actionable Recommendations'. Display recommendations in a table. Headers: 'Problem Area' and 'Recommended Actions'. Header has dark green background. Text color is dark green (#2E6B3E).",
"layout": "Table"
}
]
},
{
"type": "Container",
"description": "Module One: Overall Employee Salary Distribution",
"layout": "Card",
"children": [
{
"type": "Text",
"description": "One. Overall Employee Salary Distribution",
"layout": "AdaptiveTitle"
},
{
"type": "AGUI",
"description": "Draw a histogram of current employee salaries. X-axis: salary. Y-axis: employee count. Show salary range and count on hover.",
"layout": "Chart"
},
{
"type": "Container",
"description": "Salary distribution analysis text area",
"layout": "Single",
"children": [
{
"type": "AGUI",
"description": "Core salary distribution features card with light purple background (#F5F0FF) and purple left vertical bar (#7C3AED). Title 'Distribution Features' uses bold dark purple. Summarize features in concise text. Bold key data.",
"layout": "Card"
}
]
}
]
},
{
"type": "Container",
"description": "Module Two: Department-Level Salary Comparison",
"layout": "Card",
"children": [
{
"type": "Text",
"description": "Two. Department-Level Salary Comparison",
"layout": "AdaptiveTitle"
},
{
"type": "AGUI",
"description": "Draw a bar chart comparing average salaries across departments. X-axis: department name. Y-axis: average salary (CNY). Chart title: 'Department Average Salary Comparison'. Sort bars from highest to lowest. Use purple color scheme.",
"layout": "Chart"
},
{
"type": "Container",
"description": "Department salary analysis text area",
"layout": "Single",
"children": [
{
"type": "AGUI",
"description": "Department salary tier card with light blue background (#EFF6FF) and blue title. Title 'Department Salary Tier Distribution' uses bold blue (#1D4ED8). Structured content shows tiers by average department salary. Sort by average salary. Show headcount, standard deviation, and average salary per department. Separate tiers with line breaks. Bold key data.",
"layout": "Card"
},
{
"type": "AGUI",
"description": "Direct cause attribution card with gray background (#F9FAFB) and blue left vertical bar (#2563EB). CardHeader: '\ud83d\udcca Attribution Analysis', bold. Analyze reasons for department salary differences. Bold key numbers.",
"layout": "Card"
}
]
}
]
},
{
"type": "Container",
"description": "Module Three: Salary and Job Level Association Analysis",
"layout": "Card",
"children": [
{
"type": "Text",
"description": "Three. Salary and Job Level Association Analysis",
"layout": "AdaptiveTitle"
},
{
"type": "AGUI",
"description": "Draw a bar chart comparing average salaries across job titles. X-axis: job title. Y-axis: average salary (CNY). Chart title: 'Job Title Average Salary Comparison'. Sort bars from highest to lowest. Use purple color scheme.",
"layout": "Chart"
},
{
"type": "Container",
"description": "Job level salary analysis text area",
"layout": "Single",
"children": [
{
"type": "AGUI",
"description": "Job level-salary anomaly alert card with gray background (#F9FAFB) and red left vertical bar (#DC2626). Content in two paragraphs. Anomaly data highlighted in bold red (Manager: 77,724 CNY {\u201c<\u201d} Senior Staff: 80,707 CNY).",
"layout": "Card"
},
{
"type": "AGUI",
"description": "Draw a bar chart comparing salary coefficient of variation across job titles. X-axis: job title. Y-axis: coefficient of variation. Chart title: 'Job Title Salary Coefficient of Variation Comparison'. Sort bars from highest to lowest. Use purple color scheme.",
"layout": "Chart"
},
{
"type": "AGUI",
"description": "Non-technical role dispersion insight card with light yellow background (#FFF9E6) and yellow left vertical bar (#CA8A04). Title uses bold dark brown (#5A3E1F) with \ud83d\udca1 icon prefix. Present content in comparison format. Text color is dark brown (#5A3E1F). Bold key coefficient numbers.",
"layout": "Card"
}
]
}
]
},
{
"type": "Container",
"description": "Module Four: Salary Trend Analysis Over Time",
"layout": "Card",
"children": [
{
"type": "Text",
"description": "Four. Salary Trend Analysis Over Time",
"layout": "AdaptiveTitle"
},
{
"type": "AGUI",
"description": "Draw a line chart showing company-wide annual average salary trends. X-axis: year. Y-axis: average salary (CNY). Chart title: 'Company Annual Average Salary Trend'. Use dark purple color.",
"layout": "Chart"
},
{
"type": "Container",
"description": "Trend analysis text area",
"layout": "Single",
"children": [
{
"type": "AGUI",
"description": "Overall growth trend card with light blue background (#EFF6FF) and blue left vertical bar (#2563EB). Title uses bold blue (#1D4ED8) with \ud83d\udcc8 icon prefix. Analyze growth value and speed changes over the analysis period. Bold key growth rates and salary numbers. Separate points with line breaks.",
"layout": "Card"
},
{
"type": "AGUI",
"description": "Draw a multi-line chart comparing salary growth curves for employees hired in different decades. X-axis: salary year. Y-axis: average salary (CNY). Chart title: 'Salary Growth Curve Comparison Across Hire Decades'. Include three lines for 1980s, 1990s, and 2000s hires. Add legend. Use purple gradient colors with clear distinction.",
"layout": "Chart"
},
{
"type": "AGUI",
"description": "Hire decade group divergence insight card with gray background (#F9FAFB) and purple left vertical bar (#7C3AED). CardHeader: '\ud83d\udca1 Growth Path Divergence Across Hire Decades', bold. Present content in three rows. Bold key percentage increases and salary numbers. Separate rows with spacing.",
"layout": "Card"
}
]
}
]
},
{
"type": "Container",
"description": "Module Five: Gender and Salary Disparity Analysis",
"layout": "Card",
"children": [
{
"type": "Text",
"description": "Five. Gender and Salary Disparity Analysis",
"layout": "AdaptiveTitle"
},
{
"type": "AGUI",
"description": "Draw a quadrant scatter chart showing department salary and headcount distribution. X-axis: average salary. Y-axis: employee count. Add X and Y axis mean reference lines. Chart title: 'Department Salary and Size Quadrant Analysis'. Use purple color scheme.",
"layout": "Chart",
"chart_type": "ScatterWithReferenceLines"
},
{
"type": "Container",
"description": "Gender salary comparison section (Double layout example)",
"layout": "Double",
"ratio": "1:1",
"gap": "4",
"children": [
{
"type": "AGUI",
"description": "Overall fairness evaluation card with light green background (#F0F9F1) and green left vertical bar (#16A34A). Title uses bold dark green (#2E6B3E) with \u2705 icon prefix. Compare male and female salary distribution features. Text color is dark green (#2E6B3E). Bold key percentage numbers.",
"layout": "Card"
},
{
"type": "AGUI",
"description": "Key issue discovery card with light yellow background (#FFF9E6) and orange left vertical bar (#EA580C). Title uses bold dark brown (#5A3E1F) with \u26a0\ufe0f icon prefix. Present content in progressive order with improvement suggestions. Text color is dark brown (#5A3E1F). Bold key percentage numbers.",
"layout": "Card"
}
]
}
]
},
{
"type": "Container",
"description": "Module Six: Additional Layout Examples",
"layout": "Card",
"children": [
{
"type": "Text",
"description": "Six. Full Layout Combination Example",
"layout": "AdaptiveTitle"
},
{
"type": "Text",
"description": "Key Issue Discovery",
"layout": "Span"
},
{
"type": "AGUI",
"description": "Salary analysis report header with gradient blue-purple background. Main title 'Deep Salary Structure Analysis' uses bold large white font. Subtitle 'Comprehensive assessment based on full-year 2003 data' uses medium-size light font.",
"layout": "CardHeader"
},
{
"type": "Container",
"description": "Key metrics card group (Flex layout example)",
"layout": "Flex",
"gap": "4",
"children": [
{
"type": "AGUI",
"description": "Average salary metric block with white background and shadow. Large centered number '63,810 CNY'. Small label 'Company-wide average salary' below. Blue top bar. Money bag icon in upper-right corner.",
"layout": "Block"
},
{
"type": "AGUI",
"description": "Total employee count metric block with white background and shadow. Large centered number '240,124'. Small label 'Total active employees' below. Green top bar. User icon in upper-right corner.",
"layout": "Block"
},
{
"type": "AGUI",
"description": "Department count metric block with white background and shadow. Large centered number '9'. Small label 'Number of business departments' below. Purple top bar. Building icon in upper-right corner.",
"layout": "Block"
}
]
},
{
"type": "AGUI",
"description": "Data description text block (Text layout) with dark gray text. Content: 'This report uses HR system data covering full-year 2003 salary records. Analysis methods include descriptive statistics, correlation analysis, and trend prediction. All monetary units are CNY.' Left-aligned. Standard font size.",
"layout": "Text"
},
{
"type": "BI",
"metric": "salary_info",
"description": "Department salary summary table (BI Table example). Shows employee count, average salary, and salary standard deviation per department. Table has borders. Alternate row background colors.",
"layout": "Table",
"params": {
"bordered": true,
"striped": true,
"headerBg": "bg-blue-100",
"column_styles": {
"Average Salary": {
"numberFormat": {
"type": "fixed",
"decimalPlaces": 2
},
"unit": " CNY"
},
"Salary Standard Deviation": {
"numberFormat": {
"type": "fixed",
"decimalPlaces": 2
},
"unit": " CNY"
}
}
},
"select_columns": [
"dept_name",
"Employee Count",
"Average Salary",
"Salary Standard Deviation"
]
},
{
"type": "BI",
"metric": "salary_info",
"description": "Department salary quadrant chart (BI ScatterQuadrant example). X-axis: average salary. Y-axis: salary standard deviation. Analyze department salary structure using quadrants.",
"layout": "ScatterQuadrant",
"params": {
"xColumn": "Average Salary",
"yColumn": "Salary Standard Deviation",
"labelColumn": "dept_name",
"xAxisLabel": "Department Average Salary (CNY)",
"yAxisLabel": "Department Salary Standard Deviation (CNY)"
}
},
{
"type": "AGUI",
"description": "BI MetricCard explanation card. Content: 'BI MetricCard layout displays a single KPI metric card. Requires a SQL query that returns a single value. Example: SELECT COUNT(*) as total FROM employees. Set layout to MetricCard. Params include title, icon, and iconColor.' Light gray background, left blue vertical bar.",
"layout": "Card"
},
{
"type": "BI",
"metric": "avg_salary",
"description": "Average salary analysis card showing employee count, average salary, and salary standard deviation per department.",
"layout": "MetricCard",
"params": {
"title": "Company Average Salary",
"icon": "TrendingUp",
"iconColor": "#16a34a"
}
}
]
},
{
"type": "Container",
"description": "Report footer section (Footer layout example)",
"layout": "Footer",
"children": [
{
"type": "AGUI",
"description": "Footer information block with dark gray background (#374151) and white text. Center-align three lines: Line one: 'Data Source: HR System | Analysis Period: Full Year 2003'. Line two: 'Report Generation Time | Confidentiality Level: Internal Use'. Line three: '© 2003 Company HR Analytics Team'. Use small font size.",
"layout": "Block"
}
]
}
]
},
"metadata": {
"ai_code_requirements": {
"framework": "React",
"empty_state_handling": {
"null_data_per_module": {
"card_value": "Show '--' or 'No data'",
"chart": "Show blank chart + centered text 'No data'",
"table": "Show headers + one row 'No data'",
"ai_text": "Show 'No analysis recommendations. Confirm business data exists for this period.'"
},
"calculation_error": "If denominator is zero, show '--'"
},
"style": "Rich visual effects. Use background colors, colored left bars, and icons. Apply different card styles for different analysis types: blue/purple for insights, yellow/orange for alerts, green for positive conclusions, gray for general notes. Ensure proper font contrast: titles stand out, body text is comfortable. Base font size is ShadCN's text-sm. Adjust others relative to this.",
"data_format": "Include units with numbers. Never omit % signs. Convert decimal percentages to percentage format. Round all decimals to one place. Show salaries as integers or two-decimal numbers with 'CNY'.",
"language_style": "Avoid repeated text (e.g., parallel structures or list prefixes) to keep content concise. Write professionally. Support inferences and recommendations with real data. Avoid guessed numbers, especially for action items. Reference specific data to back up claims.",
"coding_style": "Wrap brackets with {\"\"}, e.g., 2 {\">\"} 1 ; 1 {\"<\"} 2 ; Reason A {\"->\"} Conclusion B",
"avoid_paths": [
"ButtonGroup is not exported by \"src/components/ui/button.tsx\" -- don't use ButtonGroup",
" Unexpected token `>`. Did you mean `>` or `{\">\"}` -- avoid to use raw > or < "
]
}
},
"metrics": [
{
"name": "salary_info",
"sql": "SELECT d.dept_name, COUNT(s.emp_no) AS Employee Count, AVG(s.salary) AS Average Salary, STDDEV(s.salary) AS Salary Standard Deviation FROM `salaries` s INNER JOIN `dept_emp` de ON s.emp_no = de.emp_no INNER JOIN `departments` d ON de.dept_no = d.dept_no WHERE s.to_date = '2003-01-01' AND de.to_date = '2003-01-01' GROUP BY d.dept_name;"
},
{
"name": "total_employees",
"sql": "SELECT COUNT(DISTINCT de.emp_no) AS total FROM `dept_emp` de WHERE de.to_date = '2003-01-01';"
},
{
"name": "avg_salary",
"sql": "SELECT AVG(s.salary) AS average_salary FROM `salaries` s WHERE s.to_date = '2003-01-01';"
}
]
}















