igniteui-cli 15.5.0 → 15.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/templates/blazor/igb/projects/ai-config/files/skills/AGENTS.md +6 -3
- package/templates/blazor/igb/projects/ai-config/files/skills/README.md +30 -45
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/SKILL.md +48 -96
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/charts.md +61 -238
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/data-display.md +60 -193
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/feedback.md +36 -92
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/form-controls.md +66 -224
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout-manager.md +39 -88
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout.md +75 -152
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/setup.md +40 -149
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/SKILL.md +58 -243
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/component-mapping.md +89 -280
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/gotchas.md +143 -431
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/SKILL.md +91 -157
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/data-operations.md +50 -228
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/editing.md +61 -222
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/features.md +67 -360
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/grid-migration.md +55 -236
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/paging-remote.md +53 -202
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/sizing.md +31 -232
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/state.md +27 -119
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/structure.md +88 -363
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/types.md +87 -415
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/SKILL.md +86 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/references/interop-contracts.md +220 -0
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/SKILL.md +83 -211
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/common-patterns.md +93 -184
- package/templates/react/igr-ts/projects/_base/files/src/main.tsx +1 -0
- package/templates/react/igr-ts/projects/_base_with_home/files/src/app/home/style.module.css +3 -3
- package/templates/react/igr-ts/projects/ai-config/files/skills/README.md +30 -83
- package/templates/react/igr-ts/projects/ai-config/files/skills/grid-lite-to-igr-grid-migration/SKILL.md +98 -191
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md +38 -147
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENTS.md +65 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/DATAVIZ.md +90 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP.md +43 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/TROUBLESHOOTING.md +17 -145
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/USAGE.md +85 -0
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/SKILL.md +83 -135
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/CSS-THEMING.md +51 -218
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/SKILL.md +58 -187
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/gotchas.md +55 -154
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-optimize-bundle-size/SKILL.md +48 -401
- package/templates/react/igr-ts/projects/side-nav/files/src/app/app.css +9 -9
- package/templates/react/igr-ts/projects/side-nav/files/src/app/home/style.module.css +7 -7
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/app.css +8 -8
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Login.module.css +1 -69
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Login.tsx +5 -5
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginBar.module.css +5 -26
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/LoginDialog.module.css +0 -1
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Register.module.css +1 -56
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/components/Register.tsx +2 -2
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/Profile.module.css +11 -11
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/RedirectFacebook.tsx +1 -1
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/RedirectGoogle.tsx +1 -1
- package/templates/react/igr-ts/projects/side-nav-auth/files/src/app/authentication/pages/RedirectMicrosoft.tsx +1 -1
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/app.css +9 -9
- package/templates/react/igr-ts/projects/side-nav-mini/files/src/app/home/style.module.css +7 -7
- package/templates/react/igr-ts/projects/side-nav-mini-auth/files/src/app/app.css +7 -7
- package/templates/webcomponents/igc-ts/constants.d.ts +5 -5
- package/templates/webcomponents/igc-ts/constants.js +5 -5
- package/templates/webcomponents/igc-ts/projects/_base/files/package.json +1 -1
- package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +6 -6
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/mcp-setup.md +0 -78
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/mcp-setup.md +0 -78
- package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/mcp-setup.md +0 -81
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md +0 -398
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENT-CATALOGUE.md +0 -161
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/EVENT-HANDLING.md +0 -72
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/INSTALLATION.md +0 -139
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/JSX-PATTERNS.md +0 -187
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP-SERVER.md +0 -77
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/REFS-FORMS.md +0 -232
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/MCP-SERVER.md +0 -67
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/TROUBLESHOOTING.md +0 -35
- package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/component-mapping.md +0 -132
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# Setting Up the Ignite UI CLI MCP Server
|
|
2
|
-
|
|
3
|
-
> **Part of the [`igniteui-blazor-grids`](../SKILL.md) skill hub.**
|
|
4
|
-
|
|
5
|
-
## Contents
|
|
6
|
-
|
|
7
|
-
- [VS Code](#vs-code)
|
|
8
|
-
- [Cursor](#cursor)
|
|
9
|
-
- [Claude Desktop](#claude-desktop)
|
|
10
|
-
- [WebStorm / JetBrains IDEs](#webstorm--jetbrains-ides)
|
|
11
|
-
- [Verifying the Setup](#verifying-the-setup)
|
|
12
|
-
|
|
13
|
-
The Ignite UI CLI MCP server enables AI assistants to discover Ignite UI grid documentation, validate Blazor doc slugs, and avoid borrowing Angular, React, or Web Components APIs. It must be configured in your editor before these tools become available.
|
|
14
|
-
|
|
15
|
-
## VS Code
|
|
16
|
-
|
|
17
|
-
Create or edit `.vscode/mcp.json` in your project:
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
"servers": {
|
|
22
|
-
"igniteui-cli": {
|
|
23
|
-
"command": "npx",
|
|
24
|
-
"args": ["-y", "igniteui-cli", "mcp"]
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
This works whether `igniteui-cli` is installed locally in `node_modules` or needs to be pulled from the npm registry; `npx -y` handles both cases.
|
|
31
|
-
|
|
32
|
-
## Cursor
|
|
33
|
-
|
|
34
|
-
Create or edit `.cursor/mcp.json`:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"mcpServers": {
|
|
39
|
-
"igniteui-cli": {
|
|
40
|
-
"command": "npx",
|
|
41
|
-
"args": ["-y", "igniteui-cli", "mcp"]
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Claude Desktop
|
|
48
|
-
|
|
49
|
-
Edit the Claude Desktop config file:
|
|
50
|
-
|
|
51
|
-
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
52
|
-
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"mcpServers": {
|
|
57
|
-
"igniteui-cli": {
|
|
58
|
-
"command": "npx",
|
|
59
|
-
"args": ["-y", "igniteui-cli", "mcp"]
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## WebStorm / JetBrains IDEs
|
|
66
|
-
|
|
67
|
-
1. Go to **Settings -> Tools -> AI Assistant -> MCP Servers**
|
|
68
|
-
2. Click **+ Add MCP Server**
|
|
69
|
-
3. Set Command to `npx` and Arguments to `igniteui-cli mcp`
|
|
70
|
-
4. Click OK and restart the AI Assistant
|
|
71
|
-
|
|
72
|
-
## Verifying the Setup
|
|
73
|
-
|
|
74
|
-
After configuring the MCP server, ask your AI assistant:
|
|
75
|
-
|
|
76
|
-
> "List all available Ignite UI for Blazor grid docs"
|
|
77
|
-
|
|
78
|
-
If the MCP server is running, `list_components(framework: "blazor", filter: "grid")` or `search_docs(framework: "blazor", query: "grid")` will return available Blazor grid documentation entries.
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# Setting Up the Theming MCP Server
|
|
2
|
-
|
|
3
|
-
> **Part of the [`igniteui-blazor-theming`](../SKILL.md) skill hub.**
|
|
4
|
-
|
|
5
|
-
## Contents
|
|
6
|
-
|
|
7
|
-
- [VS Code](#vs-code)
|
|
8
|
-
- [Cursor](#cursor)
|
|
9
|
-
- [Claude Desktop](#claude-desktop)
|
|
10
|
-
- [WebStorm / JetBrains IDEs](#webstorm--jetbrains-ides)
|
|
11
|
-
- [Verifying the Setup](#verifying-the-setup)
|
|
12
|
-
|
|
13
|
-
The Ignite UI Theming MCP server enables AI assistants to generate Blazor-ready CSS custom properties, palettes, component themes, and global layout tokens. It must be configured in your editor before the theming tools become available.
|
|
14
|
-
|
|
15
|
-
## VS Code
|
|
16
|
-
|
|
17
|
-
Create or edit `.vscode/mcp.json` in your project:
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
"servers": {
|
|
22
|
-
"igniteui-theming": {
|
|
23
|
-
"command": "npx",
|
|
24
|
-
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
This works whether `igniteui-theming` is installed locally in `node_modules` or needs to be pulled from the npm registry; `npx -y` handles both cases.
|
|
31
|
-
|
|
32
|
-
## Cursor
|
|
33
|
-
|
|
34
|
-
Create or edit `.cursor/mcp.json`:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"mcpServers": {
|
|
39
|
-
"igniteui-theming": {
|
|
40
|
-
"command": "npx",
|
|
41
|
-
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Claude Desktop
|
|
48
|
-
|
|
49
|
-
Edit the Claude Desktop config file:
|
|
50
|
-
|
|
51
|
-
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
52
|
-
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"mcpServers": {
|
|
57
|
-
"igniteui-theming": {
|
|
58
|
-
"command": "npx",
|
|
59
|
-
"args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## WebStorm / JetBrains IDEs
|
|
66
|
-
|
|
67
|
-
1. Go to **Settings -> Tools -> AI Assistant -> MCP Servers**
|
|
68
|
-
2. Click **+ Add MCP Server**
|
|
69
|
-
3. Set Command to `npx` and Arguments to `igniteui-theming igniteui-theming-mcp`
|
|
70
|
-
4. Click OK and restart the AI Assistant
|
|
71
|
-
|
|
72
|
-
## Verifying the Setup
|
|
73
|
-
|
|
74
|
-
After configuring the MCP server, ask your AI assistant:
|
|
75
|
-
|
|
76
|
-
> "Read the Ignite UI theming resource for the Blazor platform"
|
|
77
|
-
|
|
78
|
-
If the MCP server is running, the assistant can call
|
|
79
|
-
`read_resource` and return the Blazor theming
|
|
80
|
-
guidance. For Blazor-specific theming, pass
|
|
81
|
-
`platform: "blazor"` to theming tools that accept a platform parameter.
|
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
# Charts, Gauges, Maps & Grid Lite
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
This reference gives high-level guidance on charts and grids, their key features, and common API members. For detailed documentation, call `get_doc` and `get_api_reference` from `igniteui-cli` with the specific chart, or grid component, or feature you're interested in.
|
|
5
|
-
|
|
6
|
-
## Module Registration
|
|
7
|
-
|
|
8
|
-
> **⚠️ IMPORTANT:** Unlike core UI components (from `igniteui-react`), chart, gauge, and map components from `igniteui-react-charts`, `igniteui-react-gauges`, and `igniteui-react-maps` **require explicit module registration** before use. You must import the corresponding `*Module` class and call `.register()` at the module level (outside the component function).
|
|
9
|
-
>
|
|
10
|
-
> **Grid Lite** (`IgrGridLite` from `igniteui-react/grid-lite`) is a React wrapper component that works like any other React component — no `.register()` needed, but requires both `igniteui-react` and `igniteui-grid-lite` packages installed.
|
|
11
|
-
|
|
12
|
-
### Registration Syntax
|
|
13
|
-
|
|
14
|
-
```tsx
|
|
15
|
-
import { IgrCategoryChart, IgrCategoryChartModule } from 'igniteui-react-charts';
|
|
16
|
-
|
|
17
|
-
// ⚠️ REQUIRED — register the module before using the component
|
|
18
|
-
IgrCategoryChartModule.register();
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### Common Module Registrations
|
|
22
|
-
|
|
23
|
-
| Component | Module Import | Registration |
|
|
24
|
-
|---|---|---|
|
|
25
|
-
| `IgrCategoryChart` | `IgrCategoryChartModule` | `IgrCategoryChartModule.register()` |
|
|
26
|
-
| `IgrDataChart` | `IgrDataChartCoreModule` + category/annotation modules (see [Complete Data Chart Example](#complete-data-chart-example)) | Multiple `.register()` calls required |
|
|
27
|
-
| `IgrPieChart` | `IgrPieChartModule` | `IgrPieChartModule.register()` |
|
|
28
|
-
| `IgrFinancialChart` | `IgrFinancialChartModule` | `IgrFinancialChartModule.register()` |
|
|
29
|
-
| `IgrRadialGauge` | `IgrRadialGaugeModule` | `IgrRadialGaugeModule.register()` |
|
|
30
|
-
| `IgrLinearGauge` | `IgrLinearGaugeModule` | `IgrLinearGaugeModule.register()` |
|
|
31
|
-
| `IgrGeographicMap` | `IgrGeographicMapModule` | `IgrGeographicMapModule.register()` |
|
|
32
|
-
| `IgrGridLite` | (no registration needed) | N/A — works like standard React component |
|
|
33
|
-
|
|
34
|
-
## Container Sizing (REQUIRED)
|
|
35
|
-
|
|
36
|
-
> **⚠️ CRITICAL:** Charts, gauges, maps, and Grid Lite **require an explicit-sized container** to render. They inherit their dimensions from the parent element — if the parent has no height/width, the component will not be visible. Always wrap these components in a container with explicit `min-width`, `min-height`, or `flex-grow` styling.
|
|
37
|
-
|
|
38
|
-
```css
|
|
39
|
-
/* Chart container CSS */
|
|
40
|
-
.chart-container {
|
|
41
|
-
min-width: 400px;
|
|
42
|
-
min-height: 300px;
|
|
43
|
-
flex-grow: 1;
|
|
44
|
-
flex-basis: 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* Ensure the chart fills its container */
|
|
48
|
-
.chart-container > * {
|
|
49
|
-
height: 100%;
|
|
50
|
-
width: 100%;
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Complete Chart Example
|
|
55
|
-
|
|
56
|
-
> Call `get_doc('react', 'column-chart')` for full `IgrCategoryChart` and `IgrDataChart` usage, prop tables, and code examples. Call `get_doc('react', 'chart-features')` for axes, annotations, animations, markers, and tooltips.
|
|
57
|
-
|
|
58
|
-
The minimum pattern — register the module at file scope, then wrap the component in a sized container:
|
|
59
|
-
|
|
60
|
-
```tsx
|
|
61
|
-
import { IgrCategoryChart, IgrCategoryChartModule } from 'igniteui-react-charts';
|
|
62
|
-
import styles from './dashboard-view.module.css';
|
|
63
|
-
|
|
64
|
-
// Register the chart module (required, called once at module level)
|
|
65
|
-
IgrCategoryChartModule.register();
|
|
66
|
-
|
|
67
|
-
export default function DashboardView() {
|
|
68
|
-
const salesData = [
|
|
69
|
-
{ month: 'Jan', revenue: 12500 },
|
|
70
|
-
{ month: 'Feb', revenue: 18200 },
|
|
71
|
-
{ month: 'Mar', revenue: 15800 },
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<div className={styles['chart-container']}>
|
|
76
|
-
<IgrCategoryChart
|
|
77
|
-
dataSource={salesData}
|
|
78
|
-
chartType="column"
|
|
79
|
-
xAxisTitle="Month"
|
|
80
|
-
yAxisTitle="Revenue ($)"
|
|
81
|
-
/>
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Complete Data Chart Example
|
|
88
|
-
|
|
89
|
-
> **⚠️ IMPORTANT:** `IgrDataChart` requires registering **multiple modules** depending on the series type used. For bar charts, register the modules shown below. If you miss any module, the chart or axis types will silently fail to render.
|
|
90
|
-
|
|
91
|
-
### Module Registration for Bar Charts
|
|
92
|
-
|
|
93
|
-
```tsx
|
|
94
|
-
import {
|
|
95
|
-
IgrLegendModule,
|
|
96
|
-
IgrDataChartCoreModule,
|
|
97
|
-
IgrDataChartCategoryCoreModule,
|
|
98
|
-
IgrDataChartCategoryModule,
|
|
99
|
-
IgrDataChartInteractivityModule,
|
|
100
|
-
IgrDataChartVerticalCategoryModule,
|
|
101
|
-
IgrDataChartAnnotationModule,
|
|
102
|
-
} from 'igniteui-react-charts';
|
|
103
|
-
|
|
104
|
-
// Register all required modules once at module level (outside any component)
|
|
105
|
-
IgrLegendModule.register();
|
|
106
|
-
IgrDataChartCoreModule.register();
|
|
107
|
-
IgrDataChartCategoryCoreModule.register();
|
|
108
|
-
IgrDataChartCategoryModule.register();
|
|
109
|
-
IgrDataChartInteractivityModule.register();
|
|
110
|
-
IgrDataChartVerticalCategoryModule.register();
|
|
111
|
-
IgrDataChartAnnotationModule.register();
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
| Module | Purpose |
|
|
115
|
-
|---|---|
|
|
116
|
-
| `IgrDataChartCoreModule` | Core chart infrastructure |
|
|
117
|
-
| `IgrDataChartCategoryCoreModule` | Base for category series |
|
|
118
|
-
| `IgrDataChartCategoryModule` | Column, Line, Area, Spline etc. |
|
|
119
|
-
| `IgrDataChartVerticalCategoryModule` | **Bar series** (horizontal bars) |
|
|
120
|
-
| `IgrDataChartInteractivityModule` | Mouse hover, selection |
|
|
121
|
-
| `IgrDataChartAnnotationModule` | Tooltip layers, callout layers |
|
|
122
|
-
| `IgrLegendModule` | `IgrLegend` component |
|
|
123
|
-
|
|
124
|
-
### Axis Choice for Bar Charts
|
|
125
|
-
|
|
126
|
-
| Chart Orientation | Category Axis | Value Axis |
|
|
127
|
-
|---|---|---|
|
|
128
|
-
| Bar (horizontal) | `IgrCategoryYAxis` | `IgrNumericXAxis` |
|
|
129
|
-
| Column (vertical) | `IgrCategoryXAxis` | `IgrNumericYAxis` |
|
|
130
|
-
|
|
131
|
-
> **Bar charts are horizontal** — categories go on the Y-axis and numeric values on the X-axis. This is the opposite of column charts.
|
|
132
|
-
|
|
133
|
-
> For the full `IgrDataChart` API (all series types, axis options, layers), call `get_doc('react', 'bar-chart')` or `get_doc('react', 'column-chart')`.
|
|
134
|
-
|
|
135
|
-
### Complete Bar Chart Component (Multiple Series)
|
|
136
|
-
|
|
137
|
-
```tsx
|
|
138
|
-
import { useRef } from 'react';
|
|
139
|
-
import {
|
|
140
|
-
IgrLegendModule,
|
|
141
|
-
IgrDataChartCoreModule,
|
|
142
|
-
IgrDataChartCategoryCoreModule,
|
|
143
|
-
IgrDataChartCategoryModule,
|
|
144
|
-
IgrDataChartInteractivityModule,
|
|
145
|
-
IgrDataChartVerticalCategoryModule,
|
|
146
|
-
IgrDataChartAnnotationModule,
|
|
147
|
-
IgrLegend,
|
|
148
|
-
IgrDataChart,
|
|
149
|
-
IgrCategoryYAxis,
|
|
150
|
-
IgrNumericXAxis,
|
|
151
|
-
IgrCategoryHighlightLayer,
|
|
152
|
-
IgrBarSeries,
|
|
153
|
-
IgrDataToolTipLayer,
|
|
154
|
-
} from 'igniteui-react-charts';
|
|
155
|
-
import styles from './bar-chart-view.module.css';
|
|
156
|
-
|
|
157
|
-
// Register all required modules once at module level
|
|
158
|
-
IgrLegendModule.register();
|
|
159
|
-
IgrDataChartCoreModule.register();
|
|
160
|
-
IgrDataChartCategoryCoreModule.register();
|
|
161
|
-
IgrDataChartCategoryModule.register();
|
|
162
|
-
IgrDataChartInteractivityModule.register();
|
|
163
|
-
IgrDataChartVerticalCategoryModule.register();
|
|
164
|
-
IgrDataChartAnnotationModule.register();
|
|
165
|
-
|
|
166
|
-
interface MovieFranchise {
|
|
167
|
-
franchise: string;
|
|
168
|
-
totalRevenue: number; // total box office in billions USD
|
|
169
|
-
highestGrossing: number; // highest single film in billions USD
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const movieData: MovieFranchise[] = [
|
|
173
|
-
{ franchise: 'Marvel Universe', totalRevenue: 22.55, highestGrossing: 2.80 },
|
|
174
|
-
{ franchise: 'Star Wars', totalRevenue: 10.32, highestGrossing: 2.07 },
|
|
175
|
-
{ franchise: 'Harry Potter', totalRevenue: 9.19, highestGrossing: 1.34 },
|
|
176
|
-
{ franchise: 'Avengers', totalRevenue: 7.76, highestGrossing: 2.80 },
|
|
177
|
-
{ franchise: 'Spider Man', totalRevenue: 7.22, highestGrossing: 1.28 },
|
|
178
|
-
{ franchise: 'James Bond', totalRevenue: 7.12, highestGrossing: 1.11 },
|
|
179
|
-
];
|
|
180
|
-
|
|
181
|
-
export default function BarChartView() {
|
|
182
|
-
const legendRef = useRef<IgrLegend>(null);
|
|
183
|
-
|
|
184
|
-
return (
|
|
185
|
-
<div className={styles['chart-wrapper']}>
|
|
186
|
-
<h3 className={styles['legend-title']}>Highest Grossing Movie Franchises</h3>
|
|
187
|
-
|
|
188
|
-
{/* Legend must be rendered before the chart so the ref is populated */}
|
|
189
|
-
<IgrLegend ref={legendRef} orientation="Horizontal" />
|
|
190
|
-
|
|
191
|
-
<div className={styles['chart-container']}>
|
|
192
|
-
<IgrDataChart legend={legendRef.current ?? undefined}>
|
|
193
|
-
{/*
|
|
194
|
-
* IgrCategoryYAxis — category axis for horizontal bar charts.
|
|
195
|
-
* - label: field name that supplies the axis labels.
|
|
196
|
-
* - dataSource: the data array (required on the axis for bar charts).
|
|
197
|
-
* - isInverted: renders top-to-bottom instead of bottom-to-top.
|
|
198
|
-
* - gap / overlap: control bar spacing (gap) and multi-series overlap.
|
|
199
|
-
*/}
|
|
200
|
-
<IgrCategoryYAxis
|
|
201
|
-
name="yAxis"
|
|
202
|
-
label="franchise"
|
|
203
|
-
dataSource={movieData}
|
|
204
|
-
isInverted={true}
|
|
205
|
-
gap={0.5}
|
|
206
|
-
overlap={-0.1}
|
|
207
|
-
useEnhancedIntervalManagement={true}
|
|
208
|
-
enhancedIntervalPreferMoreCategoryLabels={true}
|
|
209
|
-
/>
|
|
210
|
-
|
|
211
|
-
{/* IgrNumericXAxis — value axis; start at 0 per bar chart best practices */}
|
|
212
|
-
<IgrNumericXAxis
|
|
213
|
-
name="xAxis"
|
|
214
|
-
title="Billions of U.S. Dollars"
|
|
215
|
-
/>
|
|
216
|
-
|
|
217
|
-
{/* Highlight the hovered category row across all series */}
|
|
218
|
-
<IgrCategoryHighlightLayer name="categoryHighlight" />
|
|
219
|
-
|
|
220
|
-
{/* First series — total franchise revenue */}
|
|
221
|
-
<IgrBarSeries
|
|
222
|
-
name="totalRevenueSeries"
|
|
223
|
-
xAxisName="xAxis"
|
|
224
|
-
yAxisName="yAxis"
|
|
225
|
-
title="Total Revenue of Franchise"
|
|
226
|
-
valueMemberPath="totalRevenue"
|
|
227
|
-
dataSource={movieData}
|
|
228
|
-
showDefaultTooltip={true}
|
|
229
|
-
isTransitionInEnabled={true}
|
|
230
|
-
isHighlightingEnabled={true}
|
|
231
|
-
/>
|
|
232
|
-
|
|
233
|
-
{/* Second series — highest grossing single film */}
|
|
234
|
-
<IgrBarSeries
|
|
235
|
-
name="highestGrossingSeries"
|
|
236
|
-
xAxisName="xAxis"
|
|
237
|
-
yAxisName="yAxis"
|
|
238
|
-
title="Highest Grossing Movie in Series"
|
|
239
|
-
valueMemberPath="highestGrossing"
|
|
240
|
-
dataSource={movieData}
|
|
241
|
-
showDefaultTooltip={true}
|
|
242
|
-
isTransitionInEnabled={true}
|
|
243
|
-
isHighlightingEnabled={true}
|
|
244
|
-
/>
|
|
245
|
-
|
|
246
|
-
{/* Rich tooltip layer — shows all series values on hover */}
|
|
247
|
-
<IgrDataToolTipLayer name="tooltips" />
|
|
248
|
-
</IgrDataChart>
|
|
249
|
-
</div>
|
|
250
|
-
</div>
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
```css
|
|
256
|
-
/* bar-chart-view.module.css */
|
|
257
|
-
.chart-wrapper {
|
|
258
|
-
display: flex;
|
|
259
|
-
flex-direction: column;
|
|
260
|
-
min-width: 500px;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.legend-title {
|
|
264
|
-
font-size: 1rem;
|
|
265
|
-
font-weight: 600;
|
|
266
|
-
text-align: center;
|
|
267
|
-
margin-bottom: 0.5rem;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.chart-container {
|
|
271
|
-
min-height: 400px;
|
|
272
|
-
flex-grow: 1;
|
|
273
|
-
flex-basis: 0;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/* Make the chart fill its container */
|
|
277
|
-
.chart-container > * {
|
|
278
|
-
height: 100%;
|
|
279
|
-
width: 100%;
|
|
280
|
-
}
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
## Complete Grid Lite Example
|
|
284
|
-
|
|
285
|
-
> **⚠️ IMPORTANT:** Grid Lite (`IgrGridLite` from `igniteui-react/grid-lite`) requires installing both `igniteui-react` and `igniteui-grid-lite` packages. It's a React wrapper component (uses `Igr` prefix) and works like any standard React component — no `.register()` needed.
|
|
286
|
-
|
|
287
|
-
**Installation:**
|
|
288
|
-
```bash
|
|
289
|
-
npm install igniteui-react igniteui-grid-lite
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
**Usage:**
|
|
293
|
-
```tsx
|
|
294
|
-
import { IgrGridLite } from 'igniteui-react/grid-lite';
|
|
295
|
-
import { useGetCustomers } from '../hooks/northwind-hooks';
|
|
296
|
-
import styles from './master-view.module.css';
|
|
297
|
-
|
|
298
|
-
export default function MasterView() {
|
|
299
|
-
const { northwindCustomers } = useGetCustomers();
|
|
300
|
-
|
|
301
|
-
return (
|
|
302
|
-
<div className={styles['grid-lite']}>
|
|
303
|
-
<IgrGridLite data={northwindCustomers} autoGenerate={true} />
|
|
304
|
-
</div>
|
|
305
|
-
);
|
|
306
|
-
}
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
```css
|
|
310
|
-
/* master-view.module.css */
|
|
311
|
-
.grid-lite {
|
|
312
|
-
min-width: 400px;
|
|
313
|
-
height: 600px;
|
|
314
|
-
flex-grow: 1;
|
|
315
|
-
flex-basis: 0;
|
|
316
|
-
}
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
## Grid Lite Example with Column Configurations and Templates
|
|
320
|
-
|
|
321
|
-
Use `IgrGridLiteColumn` to define columns explicitly with typed `dataType` and optional `cellTemplate` for custom rendering. Set `autoGenerate={false}` (or omit it) when providing explicit columns.
|
|
322
|
-
|
|
323
|
-
```tsx
|
|
324
|
-
import { IgrGridLite, IgrGridLiteColumn, type IgrCellContext } from 'igniteui-react/grid-lite';
|
|
325
|
-
import styles from './order-list.module.css';
|
|
326
|
-
|
|
327
|
-
interface Order {
|
|
328
|
-
id: number;
|
|
329
|
-
customer: string;
|
|
330
|
-
total: number;
|
|
331
|
-
date: Date;
|
|
332
|
-
status: 'pending' | 'shipped' | 'delivered';
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
const orders: Order[] = [
|
|
336
|
-
{ id: 1, customer: 'Alice', total: 149.99, date: new Date('2024-03-01'), status: 'delivered' },
|
|
337
|
-
{ id: 2, customer: 'Bob', total: 89.50, date: new Date('2024-03-10'), status: 'shipped' },
|
|
338
|
-
{ id: 3, customer: 'Carol', total: 220.00, date: new Date('2024-03-15'), status: 'pending' },
|
|
339
|
-
];
|
|
340
|
-
|
|
341
|
-
// Simple cell templates — render JSX based on the cell value or row data
|
|
342
|
-
const currencyTemplate = (ctx: IgrCellContext<Order>) => (
|
|
343
|
-
<span>${(ctx.value as number).toFixed(2)}</span>
|
|
344
|
-
);
|
|
345
|
-
|
|
346
|
-
const dateTemplate = (ctx: IgrCellContext<Order>) => (
|
|
347
|
-
<span>{(ctx.value as Date).toLocaleDateString()}</span>
|
|
348
|
-
);
|
|
349
|
-
|
|
350
|
-
const statusTemplate = (ctx: IgrCellContext<Order>) => {
|
|
351
|
-
const colors: Record<Order['status'], string> = {
|
|
352
|
-
pending: 'orange',
|
|
353
|
-
shipped: 'blue',
|
|
354
|
-
delivered: 'green',
|
|
355
|
-
};
|
|
356
|
-
return <span style={{ color: colors[ctx.value as Order['status']] }}>{ctx.value}</span>;
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
export default function OrderList() {
|
|
360
|
-
return (
|
|
361
|
-
<div className={styles['grid-lite']}>
|
|
362
|
-
<IgrGridLite data={orders}>
|
|
363
|
-
{/* dataType ensures correct sorting and filtering behavior */}
|
|
364
|
-
<IgrGridLiteColumn field="id" dataType="number" />
|
|
365
|
-
<IgrGridLiteColumn field="customer" dataType="string" />
|
|
366
|
-
{/* Columns with custom cell templates */}
|
|
367
|
-
<IgrGridLiteColumn field="date" cellTemplate={dateTemplate} />
|
|
368
|
-
<IgrGridLiteColumn field="total" dataType="number" cellTemplate={currencyTemplate} />
|
|
369
|
-
<IgrGridLiteColumn field="status" dataType="string" cellTemplate={statusTemplate} />
|
|
370
|
-
</IgrGridLite>
|
|
371
|
-
</div>
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
```css
|
|
377
|
-
/* order-list.module.css */
|
|
378
|
-
.grid-lite {
|
|
379
|
-
min-width: 400px;
|
|
380
|
-
height: 600px;
|
|
381
|
-
flex-grow: 1;
|
|
382
|
-
flex-basis: 0;
|
|
383
|
-
}
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
## Column Width Rule (Grid Lite and Advanced Grids)
|
|
387
|
-
|
|
388
|
-
> **⚠️ Do NOT set `width` on columns unless the user explicitly asks for specific column widths.**
|
|
389
|
-
>
|
|
390
|
-
> - `IgrGridLiteColumn` defaults to `minmax(136px, 1fr)` — columns are already responsive and fill all available space.
|
|
391
|
-
> - `IgrColumn` (in `IgrGrid`, `IgrTreeGrid`, `IgrHierarchicalGrid`) also auto-sizes by default.
|
|
392
|
-
> - Adding explicit pixel widths causes a fixed layout that leaves empty space on the right side of the grid.
|
|
393
|
-
> - If widths are set on some columns, leave at least one column without a `width` so it expands to fill the remaining space.
|
|
394
|
-
|
|
395
|
-
> **Column configuration notes:**
|
|
396
|
-
> - `dataType` accepts `"string"` (default), `"number"`, `"boolean"` — set it explicitly so sorting and filtering work correctly for each column type.
|
|
397
|
-
> - `cellTemplate` receives an `IgrCellContext<T>` where `ctx.value` is the cell value and `ctx.row.data` is the full row object.
|
|
398
|
-
> - When using `cellTemplate`, define the function outside the component (or memoize it) to avoid unnecessary re-renders.
|