Skip to content

Commit 91d2ecb

Browse files
author
tfsbuild
committed
Adding changes from build igniteui-xplat-examples-output+PRs_2025.1.31.2
1 parent 9f01fe8 commit 91d2ecb

File tree

14 files changed

+587
-9
lines changed

14 files changed

+587
-9
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export class DashboardGaugeDataSourceItem {
2+
public constructor(init: Partial<DashboardGaugeDataSourceItem>) {
3+
Object.assign(this, init);
4+
}
5+
6+
public value: number;
7+
8+
}
9+
export class DashboardGaugeDataSource extends Array<DashboardGaugeDataSourceItem> {
10+
public constructor(items: Array<DashboardGaugeDataSourceItem> | number = -1) {
11+
if (Array.isArray(items)) {
12+
super(...items);
13+
} else {
14+
const newItems = [
15+
new DashboardGaugeDataSourceItem(
16+
{
17+
value: 40
18+
}),
19+
];
20+
super(...newItems.slice(0));
21+
}
22+
}
23+
}

samples/charts/dashboard-tile/gauge-dashboard/src/index.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { IgcDashboardTileModule, IgcDataChartDashboardTileModule, IgcGeographicMapDashboardTileModule, IgcLinearGaugeDashboardTileModule, IgcPieChartDashboardTileModule, IgcRadialGaugeDashboardTileModule } from 'igniteui-webcomponents-dashboards';
22
import { IgcDashboardTileComponent } from 'igniteui-webcomponents-dashboards';
3+
import { DashboardGaugeDataSourceItem, DashboardGaugeDataSource } from './DashboardGaugeDataSource';
34

45
import { ModuleManager } from 'igniteui-webcomponents-core';
56

@@ -17,19 +18,25 @@ ModuleManager.register(
1718
export class Sample {
1819

1920
private dashboard: IgcDashboardTileComponent
21+
private _bind: () => void;
2022

2123
constructor() {
2224
var dashboard = this.dashboard = document.getElementById('dashboard') as IgcDashboardTileComponent;
2325

24-
this.dashboardTileGaugeOnInit();
25-
}
26-
26+
this._bind = () => {
27+
dashboard.dataSource = this.dashboardGaugeDataSource;
28+
}
29+
this._bind();
2730

28-
public dashboardTileGaugeOnInit(): void {
29-
30-
var target = this.dashboard;
31+
}
3132

32-
target.dataSource = 40;
33+
private _dashboardGaugeDataSource: DashboardGaugeDataSource = null;
34+
public get dashboardGaugeDataSource(): DashboardGaugeDataSource {
35+
if (this._dashboardGaugeDataSource == null)
36+
{
37+
this._dashboardGaugeDataSource = new DashboardGaugeDataSource();
38+
}
39+
return this._dashboardGaugeDataSource;
3340
}
3441

3542
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 250,
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": false,
7+
"trailingComma": "none",
8+
"bracketSpacing": true,
9+
"jsxBracketSameLine": false,
10+
"fluid": false
11+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Sample | Ignite UI | Web Components | infragistics</title>
5+
<meta charset="UTF-8" />
6+
7+
<link rel="shortcut icon" href="https://static.infragistics.com/xplatform/images/browsers/wc.png" >
8+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
9+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Kanit&display=swap" />
10+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium Web" />
11+
<link rel="stylesheet" href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css" />
12+
<link rel="stylesheet" href="/src/index.css" type="text/css" />
13+
14+
</head>
15+
16+
<body>
17+
<div id="root">
18+
19+
<div class="container sample">
20+
21+
<div class="legend-title">
22+
Renewable Energy Consumption
23+
</div>
24+
25+
<div class="legend">
26+
<igc-legend
27+
name="legend"
28+
id="legend"
29+
orientation="Horizontal">
30+
</igc-legend>
31+
</div>
32+
33+
<div class="container fill">
34+
<igc-data-chart
35+
name="chart"
36+
id="chart"
37+
is-horizontal-zoom-enabled="false"
38+
is-vertical-zoom-enabled="false"
39+
selection-mode="SelectionColorFill"
40+
selection-behavior="Auto"
41+
selection-brush="orange">
42+
<igc-category-y-axis
43+
name="yAxis"
44+
id="yAxis"
45+
label="location"
46+
is-inverted="true">
47+
</igc-category-y-axis>
48+
<igc-numeric-x-axis
49+
name="xAxis"
50+
id="xAxis"
51+
minimum-value="0"
52+
title="TWh">
53+
</igc-numeric-x-axis>
54+
<igc-stacked-100-bar-series
55+
name="stacked100BarSeries"
56+
id="stacked100BarSeries"
57+
show-default-tooltip="true"
58+
area-fill-opacity="1">
59+
<igc-stacked-fragment-series
60+
name="s1"
61+
id="s1"
62+
value-member-path="hydro"
63+
title="Hydro">
64+
</igc-stacked-fragment-series>
65+
<igc-stacked-fragment-series
66+
name="s2"
67+
id="s2"
68+
value-member-path="wind"
69+
title="Wind">
70+
</igc-stacked-fragment-series>
71+
<igc-stacked-fragment-series
72+
name="s3"
73+
id="s3"
74+
value-member-path="solar"
75+
title="Solar">
76+
</igc-stacked-fragment-series>
77+
<igc-stacked-fragment-series
78+
name="s4"
79+
id="s4"
80+
value-member-path="other"
81+
title="Other">
82+
</igc-stacked-fragment-series>
83+
</igc-stacked-100-bar-series>
84+
<igc-data-tool-tip-layer
85+
name="dataToolTipLayer"
86+
id="dataToolTipLayer">
87+
</igc-data-tool-tip-layer>
88+
</igc-data-chart>
89+
</div>
90+
</div>
91+
92+
</div>
93+
94+
<!-- This script is needed only for parcel and it will be excluded for webpack -->
95+
<% if (false) { %><script src="src/index.ts"></script><% } %>
96+
</body>
97+
</html>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "example-ignite-ui-web-components",
3+
"description": "This project provides example of using Ignite UI for Web Components",
4+
"author": "Infragistics",
5+
"version": "1.0.0",
6+
"license": "",
7+
"private": true,
8+
"homepage": ".",
9+
"main": "src/index.ts",
10+
"scripts": {
11+
"build": "npm run build:prod",
12+
"build:dev": "webpack --mode development --config ./webpack.config.js --progress --color --display-error-details",
13+
"build:prod": "webpack --env.NODE_ENV=production --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
14+
"serve:dev": "node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --config ./webpack.config.js --hot --progress --open",
15+
"serve:prod": "webpack-dev-server --env.NODE_ENV=production --mode production --config ./webpack.config.js --port 3000 --host 0.0.0.0 --hot --progress --open --content-base dist/",
16+
"start": "npm run serve:dev",
17+
"build:legacy": "npm run build:prod:legacy",
18+
"build:dev:legacy": "webpack --env.legacy=true --mode development --config ./webpack.config.js --progress --color --display-error-details",
19+
"build:prod:legacy": "webpack --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
20+
"serve:dev:legacy": "node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --env.legacy=true --mode development --config ./webpack.config.js --hot --progress --open",
21+
"serve:prod:legacy": "webpack-dev-server --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --port 3000 --host 0.0.0.0 --hot --progress --open --content-base dist/",
22+
"start:legacy": "npm run serve:dev:legacy"
23+
},
24+
"dependencies": {
25+
"babel-runtime": "^6.26.0",
26+
"igniteui-webcomponents-charts": "5.2.0",
27+
"igniteui-webcomponents-core": "5.2.0",
28+
"lit-html": "^3.2.0",
29+
"tslib": "^2.0.0"
30+
},
31+
"devDependencies": {
32+
"@babel/cli": "^7.8.3",
33+
"@babel/core": "^7.8.3",
34+
"@babel/plugin-proposal-class-properties": "^7.8.3",
35+
"@babel/plugin-transform-runtime": "^7.10.0",
36+
"@babel/preset-env": "^7.8.3",
37+
"@babel/preset-typescript": "^7.8.3",
38+
"@types/source-map": "^0.5.7",
39+
"babel-loader": "^8.1.0",
40+
"babel-plugin-transform-custom-element-classes": "^0.1.0",
41+
"css-loader": "^1.0.0",
42+
"csv-loader": "^3.0.2",
43+
"file-loader": "^4.2.0",
44+
"fork-ts-checker-webpack-plugin": "^4.1.5",
45+
"html-webpack-plugin": "^4.3.0",
46+
"parcel-bundler": "^1.6.1",
47+
"source-map": "^0.7.3",
48+
"style-loader": "^0.22.1",
49+
"tsconfig-paths-webpack-plugin": "^4.0.0",
50+
"typescript": "^4.4.4",
51+
"webpack": "^5.96.1",
52+
"webpack-cli": "^4.10.0",
53+
"webpack-dev-server": "^4.11.1",
54+
"worker-loader": "^3.0.8",
55+
"xml-loader": "^1.2.1"
56+
}
57+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"infiniteLoopProtection": false,
3+
"hardReloadOnChange": false,
4+
"view": "browser",
5+
"template": "parcel"
6+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
export class EnergyRenewableConsumptionItem {
2+
public constructor(init: Partial<EnergyRenewableConsumptionItem>) {
3+
Object.assign(this, init);
4+
}
5+
6+
public location: string;
7+
public year: number;
8+
public hydro: number;
9+
public solar: number;
10+
public wind: number;
11+
public other: number;
12+
13+
}
14+
export class EnergyRenewableConsumption extends Array<EnergyRenewableConsumptionItem> {
15+
public constructor(items: Array<EnergyRenewableConsumptionItem> | number = -1) {
16+
if (Array.isArray(items)) {
17+
super(...items);
18+
} else {
19+
const newItems = [
20+
new EnergyRenewableConsumptionItem(
21+
{
22+
location: `China`,
23+
year: 2019,
24+
hydro: 1269.5,
25+
solar: 223,
26+
wind: 405.2,
27+
other: 102.8
28+
}),
29+
new EnergyRenewableConsumptionItem(
30+
{
31+
location: `Europe`,
32+
year: 2019,
33+
hydro: 632.54,
34+
solar: 154,
35+
wind: 461.3,
36+
other: 220.3
37+
}),
38+
new EnergyRenewableConsumptionItem(
39+
{
40+
location: `USA`,
41+
year: 2019,
42+
hydro: 271.16,
43+
solar: 108,
44+
wind: 303.4,
45+
other: 78.34
46+
}),
47+
new EnergyRenewableConsumptionItem(
48+
{
49+
location: `Brazil`,
50+
year: 2019,
51+
hydro: 399.3,
52+
solar: 5.5,
53+
wind: 55.83,
54+
other: 56.25
55+
}),
56+
new EnergyRenewableConsumptionItem(
57+
{
58+
location: `Canada`,
59+
year: 2019,
60+
hydro: 381.98,
61+
solar: 4.3,
62+
wind: 34.17,
63+
other: 10.81
64+
}),
65+
];
66+
super(...newItems.slice(0));
67+
}
68+
}
69+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* shared styles are loaded from: */
2+
/* https://static.infragistics.com/xplatform/css/samples */
3+

0 commit comments

Comments
 (0)