Skip to content

Commit 73fc993

Browse files
Committed HeatMap Sample
1 parent 33733cb commit 73fc993

17 files changed

Lines changed: 381 additions & 0 deletions

‎.editorconfig‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

‎.gitignore‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# Compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
/bazel-out
8+
9+
# Node
10+
/node_modules
11+
npm-debug.log
12+
yarn-error.log
13+
14+
# IDEs and editors
15+
.idea/
16+
.project
17+
.classpath
18+
.c9/
19+
*.launch
20+
.settings/
21+
*.sublime-workspace
22+
23+
# Visual Studio Code
24+
.vscode/*
25+
!.vscode/settings.json
26+
!.vscode/tasks.json
27+
!.vscode/launch.json
28+
!.vscode/extensions.json
29+
.history/*
30+
31+
# Miscellaneous
32+
/.angular/cache
33+
.sass-cache/
34+
/connect.lock
35+
/coverage
36+
/libpeerconnection.log
37+
testem.log
38+
/typings
39+
40+
# System files
41+
.DS_Store
42+
Thumbs.db

‎angular.json‎

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"myangularapp": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:application",
15+
"options": {
16+
"outputPath": "dist/myangularapp",
17+
"index": "src/index.html",
18+
"browser": "src/main.ts",
19+
"polyfills": [
20+
"zone.js"
21+
],
22+
"tsConfig": "tsconfig.app.json",
23+
"assets": [
24+
{
25+
"glob": "**/*",
26+
"input": "public"
27+
}
28+
],
29+
"styles": [
30+
"src/styles.css"
31+
],
32+
"scripts": []
33+
},
34+
"configurations": {
35+
"production": {
36+
"budgets": [
37+
{
38+
"type": "initial",
39+
"maximumWarning": "500kB",
40+
"maximumError": "1MB"
41+
},
42+
{
43+
"type": "anyComponentStyle",
44+
"maximumWarning": "2kB",
45+
"maximumError": "4kB"
46+
}
47+
],
48+
"outputHashing": "all"
49+
},
50+
"development": {
51+
"optimization": false,
52+
"extractLicenses": false,
53+
"sourceMap": true
54+
}
55+
},
56+
"defaultConfiguration": "production"
57+
},
58+
"serve": {
59+
"builder": "@angular-devkit/build-angular:dev-server",
60+
"configurations": {
61+
"production": {
62+
"buildTarget": "myangularapp:build:production"
63+
},
64+
"development": {
65+
"buildTarget": "myangularapp:build:development"
66+
}
67+
},
68+
"defaultConfiguration": "development"
69+
},
70+
"extract-i18n": {
71+
"builder": "@angular-devkit/build-angular:extract-i18n"
72+
},
73+
"test": {
74+
"builder": "@angular-devkit/build-angular:karma",
75+
"options": {
76+
"polyfills": [
77+
"zone.js",
78+
"zone.js/testing"
79+
],
80+
"tsConfig": "tsconfig.spec.json",
81+
"assets": [
82+
{
83+
"glob": "**/*",
84+
"input": "public"
85+
}
86+
],
87+
"styles": [
88+
"src/styles.css"
89+
],
90+
"scripts": []
91+
}
92+
}
93+
}
94+
}
95+
},
96+
"cli": {
97+
"analytics": false
98+
}
99+
}

‎package.json‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "myangularapp",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"watch": "ng build --watch --configuration development",
9+
"test": "ng test"
10+
},
11+
"private": true,
12+
"dependencies": {
13+
"@angular/animations": "^18.1.0",
14+
"@angular/common": "^18.1.0",
15+
"@angular/compiler": "^18.1.0",
16+
"@angular/core": "^18.1.0",
17+
"@angular/forms": "^18.1.0",
18+
"@angular/platform-browser": "^18.1.0",
19+
"@angular/platform-browser-dynamic": "^18.1.0",
20+
"@angular/router": "^18.1.0",
21+
"@syncfusion/ej2-angular-heatmap": "^26.2.5",
22+
"rxjs": "~7.8.0",
23+
"tslib": "^2.3.0",
24+
"zone.js": "~0.14.3"
25+
},
26+
"devDependencies": {
27+
"@angular-devkit/build-angular": "^18.1.4",
28+
"@angular/cli": "^18.1.4",
29+
"@angular/compiler-cli": "^18.1.0",
30+
"@types/jasmine": "~5.1.0",
31+
"jasmine-core": "~5.1.0",
32+
"karma": "~6.4.0",
33+
"karma-chrome-launcher": "~3.2.0",
34+
"karma-coverage": "~2.2.0",
35+
"karma-jasmine": "~5.1.0",
36+
"karma-jasmine-html-reporter": "~2.1.0",
37+
"typescript": "~5.5.2"
38+
}
39+
}

‎public/favicon.ico‎

14.7 KB
Binary file not shown.

‎src/app/app.component.css‎

Whitespace-only changes.

‎src/app/app.component.html‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<ejs-heatmap style="margin-left:20%;"
2+
[dataSource]="heatMapData"
3+
[titleSettings]="titleSettings"
4+
[xAxis]="xAxis"
5+
[yAxis]="yAxis"
6+
[paletteSettings]="paletteSettings"
7+
height="350px"
8+
width="750px"
9+
[cellSettings]="cellSettings"
10+
showTooltip="true">
11+
</ejs-heatmap>

‎src/app/app.component.spec.ts‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { TestBed } from '@angular/core/testing';
2+
import { AppComponent } from './app.component';
3+
4+
describe('AppComponent', () => {
5+
beforeEach(async () => {
6+
await TestBed.configureTestingModule({
7+
imports: [AppComponent],
8+
}).compileComponents();
9+
});
10+
11+
it('should create the app', () => {
12+
const fixture = TestBed.createComponent(AppComponent);
13+
const app = fixture.componentInstance;
14+
expect(app).toBeTruthy();
15+
});
16+
17+
it(`should have the 'myangularapp' title`, () => {
18+
const fixture = TestBed.createComponent(AppComponent);
19+
const app = fixture.componentInstance;
20+
expect(app.title).toEqual('myangularapp');
21+
});
22+
23+
it('should render title', () => {
24+
const fixture = TestBed.createComponent(AppComponent);
25+
fixture.detectChanges();
26+
const compiled = fixture.nativeElement as HTMLElement;
27+
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, myangularapp');
28+
});
29+
});

‎src/app/app.component.ts‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { Component } from '@angular/core';
2+
import { RouterOutlet } from '@angular/router';
3+
import { HeatMapModule, TooltipService } from '@syncfusion/ej2-angular-heatmap';
4+
5+
@Component({
6+
selector: 'app-root',
7+
standalone: true,
8+
imports: [RouterOutlet, HeatMapModule],
9+
providers: [TooltipService],
10+
templateUrl: './app.component.html',
11+
styleUrl: './app.component.css'
12+
})
13+
export class AppComponent {
14+
public cellSettings: Object = {
15+
format: '${value}'
16+
};
17+
public paletteSettings: Object = {
18+
palette: [
19+
{ color: '#C06C84' },
20+
{ color: '#6C5B7B' },
21+
{ color: '#355C7D' }
22+
],
23+
type: 'Fixed'
24+
};
25+
public xAxis: Object = {
26+
labels: ['Nancy', 'Andrew', 'Janet', 'Margaret', 'Steven', 'Michael', 'Robert',
27+
'Laura', 'Anne', 'Paul', 'Karin', 'Mario']
28+
};
29+
public yAxis: Object = {
30+
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
31+
};
32+
public titleSettings: Object = {
33+
text: 'Sales Revenue per Employee (in $1000 USD)'
34+
};
35+
public heatMapData: Object[] = [
36+
[73, 39, 26, null, 94, 0],
37+
[93, 58, 53, 38, 26, 68],
38+
[99, 28, null, 4, 66, 90],
39+
[14, 26, 97, 69, 69, 3],
40+
[7, null, 47, 47, 88, 6],
41+
[41, 55, 73, 23, 3, 79],
42+
[56, 69, 21, 86, 3, 33],
43+
[45, 7, 53, null, 95, 79],
44+
[60, 77, 74, 68, 88, 51],
45+
[25, 25, null, 12, 78, 14],
46+
[25, 56, 55, 58, 12, 82],
47+
[74, 33, null, 23, 86, 59]
48+
];
49+
title = 'myangularapp';
50+
}

‎src/app/app.config.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2+
import { provideRouter } from '@angular/router';
3+
4+
import { routes } from './app.routes';
5+
6+
export const appConfig: ApplicationConfig = {
7+
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)]
8+
};

0 commit comments

Comments
 (0)