gcp-material-ui 0.0.4
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/.agents/skills/charts/SKILL.MD +103 -0
- package/.agents/skills/creating-common-components/SKILL.MD +121 -0
- package/.agents/skills/creating-pages/SKILL.MD +205 -0
- package/.agents/skills/sidebar/SKILL.MD +63 -0
- package/.agents/skills/workflow-graph/SKILL.MD +160 -0
- package/.dockerignore +4 -0
- package/.editorconfig +17 -0
- package/.prettierrc +12 -0
- package/Dockerfile +14 -0
- package/PUBLISH_GUIDE.md +33 -0
- package/README.md +48 -0
- package/angular.json +79 -0
- package/deploy.sh +47 -0
- package/nginx.conf +15 -0
- package/package.json +48 -0
- package/public/favicon.ico +0 -0
- package/public/google-cloud-combined.svg +1 -0
- package/publish.sh +14 -0
- package/src/_variables.scss +183 -0
- package/src/app/app.config.ts +19 -0
- package/src/app/app.html +1 -0
- package/src/app/app.routes.ts +65 -0
- package/src/app/app.scss +0 -0
- package/src/app/app.spec.ts +23 -0
- package/src/app/app.ts +12 -0
- package/src/app/auth/auth.guard.ts +7 -0
- package/src/app/auth/auth.service.ts +50 -0
- package/src/app/components/page/page.html +20 -0
- package/src/app/components/page/page.scss +41 -0
- package/src/app/components/page/page.ts +15 -0
- package/src/app/dashboard/dashboard.html +287 -0
- package/src/app/dashboard/dashboard.scss +196 -0
- package/src/app/dashboard/dashboard.ts +24 -0
- package/src/app/demo-components/buttons/buttons-demo.html +92 -0
- package/src/app/demo-components/buttons/buttons-demo.scss +38 -0
- package/src/app/demo-components/buttons/buttons-demo.ts +23 -0
- package/src/app/demo-components/card/card-demo.html +52 -0
- package/src/app/demo-components/card/card-demo.scss +47 -0
- package/src/app/demo-components/card/card-demo.ts +21 -0
- package/src/app/demo-components/charts/charts-demo.html +88 -0
- package/src/app/demo-components/charts/charts-demo.scss +50 -0
- package/src/app/demo-components/charts/charts-demo.ts +201 -0
- package/src/app/demo-components/chips/chips-demo.html +87 -0
- package/src/app/demo-components/chips/chips-demo.scss +6 -0
- package/src/app/demo-components/chips/chips-demo.ts +57 -0
- package/src/app/demo-components/code-snippet/code-snippet-demo.html +52 -0
- package/src/app/demo-components/code-snippet/code-snippet-demo.scss +20 -0
- package/src/app/demo-components/code-snippet/code-snippet-demo.ts +31 -0
- package/src/app/demo-components/dialog/dialog-demo.html +47 -0
- package/src/app/demo-components/dialog/dialog-demo.ts +90 -0
- package/src/app/demo-components/dialog/dialog-examples.ts +126 -0
- package/src/app/demo-components/expand-button/expand-button-demo.html +28 -0
- package/src/app/demo-components/expand-button/expand-button-demo.scss +45 -0
- package/src/app/demo-components/expand-button/expand-button-demo.ts +28 -0
- package/src/app/demo-components/expansion/expansion-demo.html +105 -0
- package/src/app/demo-components/expansion/expansion-demo.scss +11 -0
- package/src/app/demo-components/expansion/expansion-demo.ts +49 -0
- package/src/app/demo-components/forms/forms-demo.html +114 -0
- package/src/app/demo-components/forms/forms-demo.scss +43 -0
- package/src/app/demo-components/forms/forms-demo.ts +57 -0
- package/src/app/demo-components/message/message-demo.html +47 -0
- package/src/app/demo-components/message/message-demo.ts +33 -0
- package/src/app/demo-components/message/message.html +15 -0
- package/src/app/demo-components/message/message.scss +115 -0
- package/src/app/demo-components/message/message.ts +39 -0
- package/src/app/demo-components/sidebar/sidebar-demo.html +46 -0
- package/src/app/demo-components/sidebar/sidebar-demo.scss +47 -0
- package/src/app/demo-components/sidebar/sidebar-demo.ts +27 -0
- package/src/app/demo-components/sidebar/sidebar.html +15 -0
- package/src/app/demo-components/sidebar/sidebar.scss +25 -0
- package/src/app/demo-components/sidebar/sidebar.ts +87 -0
- package/src/app/demo-components/slide-toggle/slide-toggle-demo.html +110 -0
- package/src/app/demo-components/slide-toggle/slide-toggle-demo.scss +45 -0
- package/src/app/demo-components/slide-toggle/slide-toggle-demo.ts +39 -0
- package/src/app/demo-components/stepper/stepper-demo.html +99 -0
- package/src/app/demo-components/stepper/stepper-demo.ts +84 -0
- package/src/app/demo-components/tables/clean_tables_scss.py +16 -0
- package/src/app/demo-components/tables/tables-demo.html +64 -0
- package/src/app/demo-components/tables/tables-demo.scss +18 -0
- package/src/app/demo-components/tables/tables-demo.ts +89 -0
- package/src/app/demo-components/tabs/tabs-demo.html +168 -0
- package/src/app/demo-components/tabs/tabs-demo.scss +22 -0
- package/src/app/demo-components/tabs/tabs-demo.ts +76 -0
- package/src/app/demo-components/toolbars/toolbars-demo.html +50 -0
- package/src/app/demo-components/toolbars/toolbars-demo.scss +29 -0
- package/src/app/demo-components/toolbars/toolbars-demo.ts +25 -0
- package/src/app/demo-components/tooltip/tooltip-demo.html +80 -0
- package/src/app/demo-components/tooltip/tooltip-demo.scss +30 -0
- package/src/app/demo-components/tooltip/tooltip-demo.ts +27 -0
- package/src/app/demo-components/typography/typography-demo.html +23 -0
- package/src/app/demo-components/typography/typography-demo.scss +49 -0
- package/src/app/demo-components/typography/typography-demo.ts +72 -0
- package/src/app/demo-components/workflow-graph/workflow-graph-demo.html +25 -0
- package/src/app/demo-components/workflow-graph/workflow-graph-demo.scss +48 -0
- package/src/app/demo-components/workflow-graph/workflow-graph-demo.ts +133 -0
- package/src/app/layout/layout.html +12 -0
- package/src/app/layout/layout.scss +21 -0
- package/src/app/layout/layout.ts +19 -0
- package/src/app/layout/side-menu/side-menu.html +32 -0
- package/src/app/layout/side-menu/side-menu.scss +52 -0
- package/src/app/layout/side-menu/side-menu.ts +70 -0
- package/src/app/layout/top-action-bar/top-action-bar.html +41 -0
- package/src/app/layout/top-action-bar/top-action-bar.scss +98 -0
- package/src/app/layout/top-action-bar/top-action-bar.ts +68 -0
- package/src/app/page-templates/complex-form/complex-form.html +103 -0
- package/src/app/page-templates/complex-form/complex-form.scss +110 -0
- package/src/app/page-templates/complex-form/complex-form.ts +66 -0
- package/src/app/page-templates/firewall-add/firewall-add.html +78 -0
- package/src/app/page-templates/firewall-add/firewall-add.scss +1 -0
- package/src/app/page-templates/firewall-add/firewall-add.ts +94 -0
- package/src/app/page-templates/firewall-details/firewall-details.html +115 -0
- package/src/app/page-templates/firewall-details/firewall-details.scss +21 -0
- package/src/app/page-templates/firewall-details/firewall-details.ts +91 -0
- package/src/app/page-templates/firewall-list/firewall-list.html +99 -0
- package/src/app/page-templates/firewall-list/firewall-list.scss +21 -0
- package/src/app/page-templates/firewall-list/firewall-list.ts +85 -0
- package/src/app/page-templates/firewall.service.ts +84 -0
- package/src/app/services/project.service.ts +24 -0
- package/src/index.html +17 -0
- package/src/main.ts +6 -0
- package/src/styles.scss +739 -0
- package/start_server.sh +4 -0
- package/tsconfig.app.json +15 -0
- package/tsconfig.json +33 -0
- package/tsconfig.spec.json +15 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<app-page title="Buttons Showcase">
|
|
2
|
+
<div class="showcase-container default-container-padding">
|
|
3
|
+
<mat-card class="showcase-card">
|
|
4
|
+
<mat-card-header>
|
|
5
|
+
<mat-card-title>Flat Buttons</mat-card-title>
|
|
6
|
+
<mat-card-subtitle>Solid background buttons without elevation shadow</mat-card-subtitle>
|
|
7
|
+
</mat-card-header>
|
|
8
|
+
<mat-card-content class="showcase-grid">
|
|
9
|
+
<button mat-flat-button color="primary">Primary</button>
|
|
10
|
+
<button mat-flat-button disabled>Disabled</button>
|
|
11
|
+
</mat-card-content>
|
|
12
|
+
</mat-card>
|
|
13
|
+
|
|
14
|
+
<mat-card class="showcase-card">
|
|
15
|
+
<mat-card-header>
|
|
16
|
+
<mat-card-title>Stroked Buttons</mat-card-title>
|
|
17
|
+
<mat-card-subtitle>Outlined buttons with transparent background</mat-card-subtitle>
|
|
18
|
+
</mat-card-header>
|
|
19
|
+
<mat-card-content class="showcase-grid">
|
|
20
|
+
<button mat-stroked-button>Basic</button>
|
|
21
|
+
<button mat-stroked-button color="primary">Primary</button>
|
|
22
|
+
<button mat-stroked-button disabled>Disabled</button>
|
|
23
|
+
</mat-card-content>
|
|
24
|
+
</mat-card>
|
|
25
|
+
|
|
26
|
+
<mat-card class="showcase-card">
|
|
27
|
+
<mat-card-header>
|
|
28
|
+
<mat-card-title>Text Buttons</mat-card-title>
|
|
29
|
+
<mat-card-subtitle>Border-less with transparent background buttons</mat-card-subtitle>
|
|
30
|
+
</mat-card-header>
|
|
31
|
+
<mat-card-content class="showcase-grid">
|
|
32
|
+
<button mat-button>Basic</button>
|
|
33
|
+
<button mat-button color="primary">Primary</button>
|
|
34
|
+
<button mat-button disabled>Disabled</button>
|
|
35
|
+
</mat-card-content>
|
|
36
|
+
</mat-card>
|
|
37
|
+
|
|
38
|
+
<mat-card class="showcase-card">
|
|
39
|
+
<mat-card-header>
|
|
40
|
+
<mat-card-title>Icon Buttons</mat-card-title>
|
|
41
|
+
<mat-card-subtitle>Circular flat icon actions</mat-card-subtitle>
|
|
42
|
+
</mat-card-header>
|
|
43
|
+
<mat-card-content class="showcase-grid">
|
|
44
|
+
<button mat-icon-button><mat-icon>home</mat-icon></button>
|
|
45
|
+
<button mat-icon-button color="primary"><mat-icon>favorite</mat-icon></button>
|
|
46
|
+
<button mat-icon-button color="accent"><mat-icon>star</mat-icon></button>
|
|
47
|
+
<button mat-icon-button color="warn"><mat-icon>delete</mat-icon></button>
|
|
48
|
+
<button mat-icon-button disabled><mat-icon>block</mat-icon></button>
|
|
49
|
+
</mat-card-content>
|
|
50
|
+
</mat-card>
|
|
51
|
+
|
|
52
|
+
<mat-card class="showcase-card">
|
|
53
|
+
<mat-card-header>
|
|
54
|
+
<mat-card-title>Small Buttons (28px)</mat-card-title>
|
|
55
|
+
<mat-card-subtitle>Displaying dense variants using `.btn-small` class modifier</mat-card-subtitle>
|
|
56
|
+
</mat-card-header>
|
|
57
|
+
<mat-card-content class="showcase-grid">
|
|
58
|
+
<button mat-flat-button color="primary" class="btn-small">Flat Small</button>
|
|
59
|
+
<button mat-stroked-button color="primary" class="btn-small">Stroked Small</button>
|
|
60
|
+
<button mat-button color="primary" class="btn-small">Text Small</button>
|
|
61
|
+
|
|
62
|
+
<button mat-flat-button color="accent" class="btn-small">
|
|
63
|
+
<mat-icon style="font-size: 16px; width: 16px; height: 16px;">add</mat-icon>
|
|
64
|
+
<span>With Icon</span>
|
|
65
|
+
</button>
|
|
66
|
+
</mat-card-content>
|
|
67
|
+
</mat-card>
|
|
68
|
+
|
|
69
|
+
<mat-card class="showcase-card">
|
|
70
|
+
<mat-card-header>
|
|
71
|
+
<mat-card-title>Button Features</mat-card-title>
|
|
72
|
+
<mat-card-subtitle>Combinations containing icons and sizing structures</mat-card-subtitle>
|
|
73
|
+
</mat-card-header>
|
|
74
|
+
<mat-card-content class="showcase-grid">
|
|
75
|
+
<button mat-flat-button color="primary">
|
|
76
|
+
<mat-icon>cloud_upload</mat-icon>
|
|
77
|
+
<span>Upload File</span>
|
|
78
|
+
</button>
|
|
79
|
+
|
|
80
|
+
<button mat-stroked-button color="accent">
|
|
81
|
+
<mat-icon>download</mat-icon>
|
|
82
|
+
<span>Download</span>
|
|
83
|
+
</button>
|
|
84
|
+
|
|
85
|
+
<button mat-button color="warn">
|
|
86
|
+
<mat-icon>delete_forever</mat-icon>
|
|
87
|
+
<span>Remove Item</span>
|
|
88
|
+
</button>
|
|
89
|
+
</mat-card-content>
|
|
90
|
+
</mat-card>
|
|
91
|
+
</div>
|
|
92
|
+
</app-page>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.showcase-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 24px;
|
|
5
|
+
max-width: 1000px;
|
|
6
|
+
margin: 0 auto;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.showcase-card {
|
|
10
|
+
margin-bottom: 8px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.showcase-grid {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
gap: 16px;
|
|
17
|
+
padding-top: 16px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.column-group {
|
|
22
|
+
display: flex;
|
|
23
|
+
gap: 16px;
|
|
24
|
+
align-items: center;
|
|
25
|
+
width: 100%;
|
|
26
|
+
padding: 8px 0;
|
|
27
|
+
|
|
28
|
+
label {
|
|
29
|
+
min-width: 200px;
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
color: var(--mat-sys-on-surface-variant, #44474e);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
mat-divider {
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
6
|
+
import { MatCardModule } from '@angular/material/card';
|
|
7
|
+
import { PageComponent } from '../../components/page/page';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-buttons-demo',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [
|
|
13
|
+
CommonModule,
|
|
14
|
+
MatButtonModule,
|
|
15
|
+
MatIconModule,
|
|
16
|
+
MatDividerModule,
|
|
17
|
+
MatCardModule,
|
|
18
|
+
PageComponent
|
|
19
|
+
],
|
|
20
|
+
templateUrl: './buttons-demo.html',
|
|
21
|
+
styleUrls: ['./buttons-demo.scss']
|
|
22
|
+
})
|
|
23
|
+
export class ButtonsDemoComponent {}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<app-page title="Card Showcase">
|
|
2
|
+
<div class="showcase-container default-container-padding">
|
|
3
|
+
|
|
4
|
+
<!-- Basic Card -->
|
|
5
|
+
<mat-card class="showcase-card">
|
|
6
|
+
<mat-card-header>
|
|
7
|
+
<mat-card-title>Basic Card</mat-card-title>
|
|
8
|
+
<mat-card-subtitle>Simple text content</mat-card-subtitle>
|
|
9
|
+
</mat-card-header>
|
|
10
|
+
<mat-card-content class="showcase-grid">
|
|
11
|
+
<p>This is a standard Angular Material card context. It provides a simple container for text or components.</p>
|
|
12
|
+
</mat-card-content>
|
|
13
|
+
</mat-card>
|
|
14
|
+
|
|
15
|
+
<!-- Card with Actions -->
|
|
16
|
+
<mat-card class="showcase-card">
|
|
17
|
+
<mat-card-header>
|
|
18
|
+
<mat-card-title>Card with Actions</mat-card-title>
|
|
19
|
+
<mat-card-subtitle>Action buttons at the bottom</mat-card-subtitle>
|
|
20
|
+
</mat-card-header>
|
|
21
|
+
<mat-card-content class="showcase-grid">
|
|
22
|
+
<p>You can add action buttons to the bottom of a card using `mat-card-actions`.</p>
|
|
23
|
+
</mat-card-content>
|
|
24
|
+
<mat-card-actions [align]="'end'">
|
|
25
|
+
<button mat-button>Cancel</button>
|
|
26
|
+
<button mat-flat-button color="primary">Accept</button>
|
|
27
|
+
</mat-card-actions>
|
|
28
|
+
</mat-card>
|
|
29
|
+
|
|
30
|
+
<!-- Rich Card with Media -->
|
|
31
|
+
<mat-card class="showcase-card">
|
|
32
|
+
<div mat-card-image class="mock-image">
|
|
33
|
+
<span>Image Placeholder (Mock)</span>
|
|
34
|
+
</div>
|
|
35
|
+
<mat-card-header>
|
|
36
|
+
<div mat-card-avatar class="circle-avatar">
|
|
37
|
+
<mat-icon>person</mat-icon>
|
|
38
|
+
</div>
|
|
39
|
+
<mat-card-title>Rich Content Card</mat-card-title>
|
|
40
|
+
<mat-card-subtitle>Subhead and Avatar</mat-card-subtitle>
|
|
41
|
+
</mat-card-header>
|
|
42
|
+
<mat-card-content class="showcase-grid">
|
|
43
|
+
<p>This card demonstrates header avatars, images, and action buttons for news or profiles.</p>
|
|
44
|
+
</mat-card-content>
|
|
45
|
+
<mat-card-actions>
|
|
46
|
+
<button mat-icon-button><mat-icon>favorite</mat-icon></button>
|
|
47
|
+
<button mat-icon-button><mat-icon>share</mat-icon></button>
|
|
48
|
+
</mat-card-actions>
|
|
49
|
+
</mat-card>
|
|
50
|
+
|
|
51
|
+
</div>
|
|
52
|
+
</app-page>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@use '@angular/material' as mat;
|
|
2
|
+
@use '../../../styles' as *; // Assuming styles.scss has global variables or we reference variables.scss
|
|
3
|
+
@use '../../../variables' as *;
|
|
4
|
+
|
|
5
|
+
.showcase-container {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 24px;
|
|
9
|
+
max-width: 1000px;
|
|
10
|
+
margin: 0 auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.showcase-card {
|
|
14
|
+
margin-bottom: 8px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.showcase-grid {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 16px;
|
|
21
|
+
padding: 16px;
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Mock elements for demo
|
|
26
|
+
.mock-image {
|
|
27
|
+
height: 200px;
|
|
28
|
+
background-color: $grey200; // Light gray using variable
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
color: $grey500;
|
|
34
|
+
border-top-left-radius: inherit;
|
|
35
|
+
border-top-right-radius: inherit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.circle-avatar {
|
|
39
|
+
background-color: $blue500; // Blue using variable
|
|
40
|
+
color: $white;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
width: 40px;
|
|
46
|
+
height: 40px;
|
|
47
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatCardModule } from '@angular/material/card';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
6
|
+
import { PageComponent } from '../../components/page/page';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-card-demo',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [
|
|
12
|
+
CommonModule,
|
|
13
|
+
MatCardModule,
|
|
14
|
+
MatButtonModule,
|
|
15
|
+
MatIconModule,
|
|
16
|
+
PageComponent
|
|
17
|
+
],
|
|
18
|
+
templateUrl: './card-demo.html',
|
|
19
|
+
styleUrls: ['./card-demo.scss']
|
|
20
|
+
})
|
|
21
|
+
export class CardDemoComponent {}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<app-page title="System Dashboard & Analytics">
|
|
2
|
+
<div class="charts-grid default-container-padding">
|
|
3
|
+
<!-- Line Chart -->
|
|
4
|
+
<mat-card class="chart-card">
|
|
5
|
+
<mat-card-header>
|
|
6
|
+
<mat-card-title>Network Traffic</mat-card-title>
|
|
7
|
+
<mat-card-subtitle>Line Chart demonstrating data over time</mat-card-subtitle>
|
|
8
|
+
</mat-card-header>
|
|
9
|
+
<mat-card-content>
|
|
10
|
+
<div class="chart-wrapper">
|
|
11
|
+
<canvas baseChart
|
|
12
|
+
[data]="lineChartData"
|
|
13
|
+
[options]="lineChartOptions"
|
|
14
|
+
[type]="lineChartType">
|
|
15
|
+
</canvas>
|
|
16
|
+
</div>
|
|
17
|
+
</mat-card-content>
|
|
18
|
+
</mat-card>
|
|
19
|
+
|
|
20
|
+
<!-- Bar Chart -->
|
|
21
|
+
<mat-card class="chart-card">
|
|
22
|
+
<mat-card-header>
|
|
23
|
+
<mat-card-title>Compute Allocation</mat-card-title>
|
|
24
|
+
<mat-card-subtitle>Bar Chart showing resource distribution per server</mat-card-subtitle>
|
|
25
|
+
</mat-card-header>
|
|
26
|
+
<mat-card-content>
|
|
27
|
+
<div class="chart-wrapper">
|
|
28
|
+
<canvas baseChart
|
|
29
|
+
[data]="barChartData"
|
|
30
|
+
[options]="barChartOptions"
|
|
31
|
+
[type]="barChartType">
|
|
32
|
+
</canvas>
|
|
33
|
+
</div>
|
|
34
|
+
</mat-card-content>
|
|
35
|
+
</mat-card>
|
|
36
|
+
|
|
37
|
+
<!-- Pie Chart -->
|
|
38
|
+
<mat-card class="chart-card">
|
|
39
|
+
<mat-card-header>
|
|
40
|
+
<mat-card-title>Traffic Distribution</mat-card-title>
|
|
41
|
+
<mat-card-subtitle>Pie Chart of referral sources</mat-card-subtitle>
|
|
42
|
+
</mat-card-header>
|
|
43
|
+
<mat-card-content>
|
|
44
|
+
<div class="chart-wrapper small-chart">
|
|
45
|
+
<canvas baseChart
|
|
46
|
+
[data]="pieChartData"
|
|
47
|
+
[options]="pieChartOptions"
|
|
48
|
+
[type]="pieChartType">
|
|
49
|
+
</canvas>
|
|
50
|
+
</div>
|
|
51
|
+
</mat-card-content>
|
|
52
|
+
</mat-card>
|
|
53
|
+
|
|
54
|
+
<!-- Doughnut Chart -->
|
|
55
|
+
<mat-card class="chart-card">
|
|
56
|
+
<mat-card-header>
|
|
57
|
+
<mat-card-title>Storage Usage</mat-card-title>
|
|
58
|
+
<mat-card-subtitle>Doughnut Chart of disk metrics</mat-card-subtitle>
|
|
59
|
+
</mat-card-header>
|
|
60
|
+
<mat-card-content>
|
|
61
|
+
<div class="chart-wrapper small-chart">
|
|
62
|
+
<canvas baseChart
|
|
63
|
+
[data]="doughnutChartData"
|
|
64
|
+
[options]="doughnutChartOptions"
|
|
65
|
+
[type]="doughnutChartType">
|
|
66
|
+
</canvas>
|
|
67
|
+
</div>
|
|
68
|
+
</mat-card-content>
|
|
69
|
+
</mat-card>
|
|
70
|
+
|
|
71
|
+
<!-- Radar Chart -->
|
|
72
|
+
<mat-card class="chart-card">
|
|
73
|
+
<mat-card-header>
|
|
74
|
+
<mat-card-title>Cluster Performance</mat-card-title>
|
|
75
|
+
<mat-card-subtitle>Radar Chart comparing metrics across clusters</mat-card-subtitle>
|
|
76
|
+
</mat-card-header>
|
|
77
|
+
<mat-card-content>
|
|
78
|
+
<div class="chart-wrapper radar-chart">
|
|
79
|
+
<canvas baseChart
|
|
80
|
+
[data]="radarChartData"
|
|
81
|
+
[options]="radarChartOptions"
|
|
82
|
+
[type]="radarChartType">
|
|
83
|
+
</canvas>
|
|
84
|
+
</div>
|
|
85
|
+
</mat-card-content>
|
|
86
|
+
</mat-card>
|
|
87
|
+
</div>
|
|
88
|
+
</app-page>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@use '@angular/material' as mat;
|
|
2
|
+
@use '../../../_variables' as theme;
|
|
3
|
+
|
|
4
|
+
.charts-grid {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: theme.px-to-rem(24);
|
|
8
|
+
|
|
9
|
+
.chart-card {
|
|
10
|
+
background: #fff;
|
|
11
|
+
border: 1px solid theme.$grey200;
|
|
12
|
+
border-radius: theme.px-to-rem(8);
|
|
13
|
+
box-shadow: none !important; /* Material overrides override this usually */
|
|
14
|
+
|
|
15
|
+
mat-card-header {
|
|
16
|
+
padding: theme.px-to-rem(16) theme.px-to-rem(16) 0;
|
|
17
|
+
|
|
18
|
+
mat-card-title {
|
|
19
|
+
font-size: theme.px-to-rem(16);
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
color: theme.$grey900;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
mat-card-subtitle {
|
|
25
|
+
font-size: theme.px-to-rem(12);
|
|
26
|
+
color: theme.$grey600;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
mat-card-content {
|
|
31
|
+
padding: theme.px-to-rem(16);
|
|
32
|
+
|
|
33
|
+
.chart-wrapper {
|
|
34
|
+
position: relative;
|
|
35
|
+
height: theme.px-to-rem(300);
|
|
36
|
+
width: 100%;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
|
|
39
|
+
&.small-chart {
|
|
40
|
+
height: theme.px-to-rem(250);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.radar-chart {
|
|
44
|
+
height: theme.px-to-rem(350);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatCardModule } from '@angular/material/card';
|
|
4
|
+
import { BaseChartDirective } from 'ng2-charts';
|
|
5
|
+
import { ChartConfiguration, ChartData, ChartType, ChartOptions } from 'chart.js';
|
|
6
|
+
import { PageComponent } from '../../components/page/page';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-charts-demo',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [CommonModule, MatCardModule, BaseChartDirective, PageComponent],
|
|
12
|
+
templateUrl: './charts-demo.html',
|
|
13
|
+
styleUrl: './charts-demo.scss'
|
|
14
|
+
})
|
|
15
|
+
export class ChartsDemoComponent {
|
|
16
|
+
// --- Theme Colors ---
|
|
17
|
+
private colors = {
|
|
18
|
+
blue600: '#0c67df',
|
|
19
|
+
blue400: '#669df6',
|
|
20
|
+
blue200: '#aecbfa',
|
|
21
|
+
red600: '#d93025',
|
|
22
|
+
red400: '#ee675c',
|
|
23
|
+
red200: '#f6aea9',
|
|
24
|
+
grey600: '#80868b',
|
|
25
|
+
grey400: '#bdc1c6',
|
|
26
|
+
grey200: '#e8eaed'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// --- Line Chart Configuration ---
|
|
30
|
+
public lineChartData: ChartConfiguration['data'] = {
|
|
31
|
+
datasets: [
|
|
32
|
+
{
|
|
33
|
+
data: [65, 59, 80, 81, 56, 55, 40],
|
|
34
|
+
label: 'Network In (Mbps)',
|
|
35
|
+
backgroundColor: 'rgba(12, 103, 223, 0.2)',
|
|
36
|
+
borderColor: this.colors.blue600,
|
|
37
|
+
pointBackgroundColor: this.colors.blue600,
|
|
38
|
+
pointBorderColor: '#fff',
|
|
39
|
+
pointHoverBackgroundColor: '#fff',
|
|
40
|
+
pointHoverBorderColor: this.colors.blue600,
|
|
41
|
+
fill: 'origin',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
data: [28, 48, 40, 19, 86, 27, 90],
|
|
45
|
+
label: 'Network Out (Mbps)',
|
|
46
|
+
backgroundColor: 'rgba(217, 48, 37, 0.2)',
|
|
47
|
+
borderColor: this.colors.red600,
|
|
48
|
+
pointBackgroundColor: this.colors.red600,
|
|
49
|
+
pointBorderColor: '#fff',
|
|
50
|
+
pointHoverBackgroundColor: '#fff',
|
|
51
|
+
pointHoverBorderColor: this.colors.red600,
|
|
52
|
+
fill: 'origin',
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
public lineChartOptions: ChartConfiguration['options'] = {
|
|
59
|
+
responsive: true,
|
|
60
|
+
maintainAspectRatio: false,
|
|
61
|
+
plugins: {
|
|
62
|
+
legend: { display: true, position: 'bottom' }
|
|
63
|
+
},
|
|
64
|
+
scales: {
|
|
65
|
+
y: {
|
|
66
|
+
beginAtZero: true,
|
|
67
|
+
grid: { color: this.colors.grey200 }
|
|
68
|
+
},
|
|
69
|
+
x: {
|
|
70
|
+
grid: { display: false }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
public lineChartType: 'line' = 'line';
|
|
76
|
+
|
|
77
|
+
// --- Bar Chart Configuration ---
|
|
78
|
+
public barChartData: ChartData<'bar'> = {
|
|
79
|
+
labels: ['Server A', 'Server B', 'Server C', 'Server D', 'Server E'],
|
|
80
|
+
datasets: [
|
|
81
|
+
{
|
|
82
|
+
data: [4.2, 5.8, 2.3, 7.1, 4.9],
|
|
83
|
+
label: 'CPU Usage (Cores)',
|
|
84
|
+
backgroundColor: this.colors.blue400,
|
|
85
|
+
hoverBackgroundColor: this.colors.blue600
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
data: [12, 16, 8, 24, 14],
|
|
89
|
+
label: 'Memory Usage (GB)',
|
|
90
|
+
backgroundColor: this.colors.red400,
|
|
91
|
+
hoverBackgroundColor: this.colors.red600
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
public barChartOptions: ChartConfiguration['options'] = {
|
|
97
|
+
responsive: true,
|
|
98
|
+
maintainAspectRatio: false,
|
|
99
|
+
plugins: {
|
|
100
|
+
legend: { display: true, position: 'bottom' }
|
|
101
|
+
},
|
|
102
|
+
scales: {
|
|
103
|
+
y: {
|
|
104
|
+
beginAtZero: true,
|
|
105
|
+
grid: { color: this.colors.grey200 }
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
public barChartType: 'bar' = 'bar';
|
|
111
|
+
|
|
112
|
+
// --- Pie Chart Configuration ---
|
|
113
|
+
public pieChartData: ChartData<'pie', number[], string> = {
|
|
114
|
+
labels: ['Direct', 'Organic Search', 'Social Media', 'Referral'],
|
|
115
|
+
datasets: [{
|
|
116
|
+
data: [350, 450, 120, 80],
|
|
117
|
+
backgroundColor: [
|
|
118
|
+
this.colors.blue600,
|
|
119
|
+
this.colors.blue400,
|
|
120
|
+
this.colors.blue200,
|
|
121
|
+
this.colors.grey400
|
|
122
|
+
]
|
|
123
|
+
}]
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
public pieChartOptions: ChartConfiguration['options'] = {
|
|
127
|
+
responsive: true,
|
|
128
|
+
maintainAspectRatio: false,
|
|
129
|
+
plugins: {
|
|
130
|
+
legend: { display: true, position: 'bottom' }
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
public pieChartType: 'pie' = 'pie';
|
|
135
|
+
|
|
136
|
+
// --- Doughnut Chart Configuration ---
|
|
137
|
+
public doughnutChartData: ChartData<'doughnut', number[], string> = {
|
|
138
|
+
labels: ['Used Space', 'Free Space', 'Reserved'],
|
|
139
|
+
datasets: [{
|
|
140
|
+
data: [65, 25, 10],
|
|
141
|
+
backgroundColor: [
|
|
142
|
+
this.colors.red400,
|
|
143
|
+
this.colors.grey200,
|
|
144
|
+
this.colors.grey400
|
|
145
|
+
],
|
|
146
|
+
borderWidth: 0
|
|
147
|
+
}]
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
public doughnutChartOptions: ChartOptions<'doughnut'> = {
|
|
151
|
+
responsive: true,
|
|
152
|
+
maintainAspectRatio: false,
|
|
153
|
+
cutout: '70%',
|
|
154
|
+
plugins: {
|
|
155
|
+
legend: { display: true, position: 'bottom' }
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
public doughnutChartType: 'doughnut' = 'doughnut';
|
|
160
|
+
|
|
161
|
+
// --- Radar Chart Configuration ---
|
|
162
|
+
public radarChartData: ChartData<'radar'> = {
|
|
163
|
+
labels: ['Availability', 'Performance', 'Reliability', 'Scalability', 'Security', 'Cost'],
|
|
164
|
+
datasets: [
|
|
165
|
+
{
|
|
166
|
+
data: [95, 80, 90, 85, 95, 75],
|
|
167
|
+
label: 'Cluster A',
|
|
168
|
+
backgroundColor: 'rgba(12, 103, 223, 0.2)',
|
|
169
|
+
borderColor: this.colors.blue600,
|
|
170
|
+
pointBackgroundColor: this.colors.blue600,
|
|
171
|
+
pointBorderColor: '#fff',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
data: [85, 90, 85, 95, 80, 90],
|
|
175
|
+
label: 'Cluster B',
|
|
176
|
+
backgroundColor: 'rgba(217, 48, 37, 0.2)',
|
|
177
|
+
borderColor: this.colors.red600,
|
|
178
|
+
pointBackgroundColor: this.colors.red600,
|
|
179
|
+
pointBorderColor: '#fff',
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
public radarChartOptions: ChartConfiguration['options'] = {
|
|
185
|
+
responsive: true,
|
|
186
|
+
maintainAspectRatio: false,
|
|
187
|
+
plugins: {
|
|
188
|
+
legend: { display: true, position: 'bottom' }
|
|
189
|
+
},
|
|
190
|
+
scales: {
|
|
191
|
+
r: {
|
|
192
|
+
angleLines: { color: this.colors.grey200 },
|
|
193
|
+
grid: { color: this.colors.grey200 },
|
|
194
|
+
pointLabels: { font: { size: 11 } },
|
|
195
|
+
beginAtZero: true
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
public radarChartType: 'radar' = 'radar';
|
|
201
|
+
}
|