Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions samples/charts/data-chart/user-annotation-layer/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 250,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"fluid": false
}
56 changes: 56 additions & 0 deletions samples/charts/data-chart/user-annotation-layer/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!-- NOTE: do not change this file because it's auto re-generated from template: -->
<!-- https://github.com/IgniteUI/igniteui-wc-examples/tree/vnext/templates/browser/sample/ReadMe.md -->

This folder contains implementation of Web Components application with example of Actions Built In Data Chart feature using [Toolbar](https://infragistics.com/webcomponentssite/components/general-getting-started.html) component.


<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<body>
<a target="_blank" href="https://infragistics.com/webcomponentssite/components/general-getting-started.html" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem" alt="View Docs" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-docs.png"/>
</a>
<a target="_blank" href="./src/index.ts" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="View Code" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-code.png"/>
</a>
<a target="_blank" href="https://www.infragistics.com/webcomponents-demos/samples/charts/toolbar/actions-built-in-data-chart" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-run.png"/>
</a>
<a target="_blank" href="https://codesandbox.io/s/github/IgniteUI/igniteui-wc-examples/tree/master/samples/charts/toolbar/actions-built-in-data-chart?fontsize=14&hidenavigation=1&theme=dark&view=preview&file=/src/{SampleFile}" rel="noopener noreferrer">
<img height="40px" style="border-radius: 0rem; max-width: 100%;" alt="Run Sample" src="https://github.com/IgniteUI/igniteui-blazor-examples/raw/vnext/templates/sample/images/button-sandbox.png"/>
</a>
</body>
</html>

## Branches

> **_NOTE:_** You should use [master](https://github.com/IgniteUI/igniteui-angular-examples/tree/master) branch of this repository if you want to run samples on your computer. Use the [vnext](https://github.com/IgniteUI/igniteui-angular-examples/tree/vnext) branch only when you want to contribute new samples to this repository.

## Instructions

To set up this project locally, execute these commands:

```
git clone https://github.com/IgniteUI/igniteui-wc-examples.git
git checkout master
cd ./igniteui-wc-examples
cd ./samples/charts/toolbar/actions-built-in-data-chart
```

open above folder in VS Code or type:
```
code .
```

In terminal window, run:

```
npm install
npm run start
```

Then open http://localhost:4200/ in your browser


## Learn More

To learn more about **Ignite UI for Web Components**, check out the [Web Components documentation](https://infragistics.com/webcomponentssite/components/general-getting-started.html).
74 changes: 74 additions & 0 deletions samples/charts/data-chart/user-annotation-layer/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<title>Sample | Ignite UI | Web Components | infragistics</title>
<meta charset="UTF-8" />

<link rel="shortcut icon" href="https://static.infragistics.com/xplatform/images/browsers/wc.png" >
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Kanit&display=swap" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium Web" />
<link rel="stylesheet" href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css" />
<link rel="stylesheet" href="/src/index.css" type="text/css" />

</head>

<body>
<div id="root">
<div class="container sample">

<div class="aboveContentSplit">
<div class="aboveContentLeftContainer">
<igc-toolbar name="toolbar" id="toolbar" orientation="Horizontal">
</igc-toolbar>
</div>
</div>

<div class="container fill">
<igc-data-chart is-horizontal-zoom-enabled="true" is-vertical-zoom-enabled="true"
computed-plot-area-margin-mode="Series" name="chart" id="chart" is-user-annotations-enabled="true">
<igc-category-x-axis name="xAxis" id="xAxis" label="year">
</igc-category-x-axis>
<igc-numeric-y-axis name="yAxis" id="yAxis" title="TWh">
</igc-numeric-y-axis>
<igc-line-series name="lineSeries1" id="lineSeries1" title="Electricity" value-member-path="america">
</igc-line-series>
<igc-line-series name="lineSeries2" id="lineSeries2" title="Electricity" value-member-path="europe">
</igc-line-series>
<igc-line-series name="lineSeries3" id="lineSeries3" title="Electricity" value-member-path="china">
</igc-line-series>
</igc-data-chart>

<div class="annotationPopup">
<div>
<label>Label:</label>
<igc-input id="annotationInput" display-type="text"></igc-input>
</div>

<div>
<label>Details:</label>
<igc-textarea id="annotationTextArea"></igc-textarea>
</div>

<div>
<label>Badge Color:</label>
<igc-color-editor id="annotationBadgeColorEditor"></igc-color-editor>

<label>Main Color:</label>
<igc-color-editor id="annotationMainColorEditor"></igc-color-editor>
</div>

<div>
<button id="doneButton">Done</button>
<button id="cancelButton">Cancel</button>
</div>
</div>
</div>
</div>

</div>

<!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><script src="src/index.ts"></script><% } %>
</body>
</html>
61 changes: 61 additions & 0 deletions samples/charts/data-chart/user-annotation-layer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "example-ignite-ui-web-components",
"description": "This project provides example of using Ignite UI for Web Components",
"author": "Infragistics",
"version": "1.0.0",
"license": "",
"private": true,
"homepage": ".",
"main": "src/index.ts",
"scripts": {
"build": "npm run build:prod",
"build:dev": "webpack --mode development --config ./webpack.config.js --progress --color --display-error-details",
"build:prod": "webpack --env.NODE_ENV=production --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
"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",
"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/",
"start": "npm run serve:dev",
"build:legacy": "npm run build:prod:legacy",
"build:dev:legacy": "webpack --env.legacy=true --mode development --config ./webpack.config.js --progress --color --display-error-details",
"build:prod:legacy": "webpack --env.NODE_ENV=production --env.legacy=true --mode production --config ./webpack.config.js --progress --color --display-error-details --bail",
"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",
"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/",
"start:legacy": "npm run serve:dev:legacy"
},
"dependencies": {
"babel-runtime": "^6.26.0",
"igniteui-webcomponents": "^6.3.6",
"igniteui-webcomponents-charts": "6.3.0-beta.0",
"igniteui-webcomponents-core": "6.3.0-beta.0",
"igniteui-webcomponents-inputs": "6.3.0-beta.0",
"igniteui-webcomponents-layouts": "6.3.0-beta.0",
"lit-html": "^3.3.1",
"tslib": "^2.8.1"
},
"devDependencies": {
"@babel/cli": "^7.28.3",
"@babel/core": "^7.28.4",
"@babel/plugin-transform-class-properties": "^7.27.1",
"@babel/plugin-transform-class-static-block": "^7.28.3",
"@babel/plugin-transform-runtime": "^7.28.3",
"@babel/preset-env": "^7.28.3",
"@babel/preset-typescript": "^7.27.1",
"@types/source-map": "^0.5.7",
"babel-loader": "^10.0.0",
"babel-plugin-transform-custom-element-classes": "^0.1.0",
"css-loader": "^7.1.2",
"csv-loader": "^3.0.5",
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^9.1.0",
"html-webpack-plugin": "^5.6.4",
"parcel-bundler": "^1.12.5",
"source-map": "^0.7.6",
"style-loader": "^4.0.0",
"tsconfig-paths-webpack-plugin": "^4.2.0",
"typescript": "^5.9.2",
"webpack": "^5.101.3",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.2",
"worker-loader": "^3.0.8",
"xml-loader": "^1.2.1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"infiniteLoopProtection": false,
"hardReloadOnChange": false,
"view": "browser",
"template": "parcel"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
export class CountryRenewableElectricityItem {
public constructor(init: Partial<CountryRenewableElectricityItem>) {
Object.assign(this, init);
}

public year: string;
public europe: number;
public china: number;
public america: number;

}
export class CountryRenewableElectricity extends Array<CountryRenewableElectricityItem> {
public constructor(items: Array<CountryRenewableElectricityItem> | number = -1) {
if (Array.isArray(items)) {
super(...items);
} else {
const newItems = [
new CountryRenewableElectricityItem({ year: `2009`, europe: 34, china: 21, america: 19 }),
new CountryRenewableElectricityItem({ year: `2010`, europe: 43, china: 26, america: 24 }),
new CountryRenewableElectricityItem({ year: `2011`, europe: 66, china: 29, america: 28 }),
new CountryRenewableElectricityItem({ year: `2012`, europe: 69, china: 32, america: 26 }),
new CountryRenewableElectricityItem({ year: `2013`, europe: 58, china: 47, america: 38 }),
new CountryRenewableElectricityItem({ year: `2014`, europe: 40, china: 46, america: 31 }),
new CountryRenewableElectricityItem({ year: `2015`, europe: 78, china: 50, america: 19 }),
new CountryRenewableElectricityItem({ year: `2016`, europe: 13, china: 90, america: 52 }),
new CountryRenewableElectricityItem({ year: `2017`, europe: 78, china: 132, america: 50 }),
new CountryRenewableElectricityItem({ year: `2018`, europe: 40, china: 134, america: 34 }),
new CountryRenewableElectricityItem({ year: `2018`, europe: 40, china: 134, america: 34 }),
new CountryRenewableElectricityItem({ year: `2019`, europe: 80, china: 96, america: 38 }),
];
super(...newItems.slice(0));
}
}
}
36 changes: 36 additions & 0 deletions samples/charts/data-chart/user-annotation-layer/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* shared styles are loaded from: */
/* https://static.infragistics.com/xplatform/css/samples */

.aboveContentSplit {
display: flex;
flex-direction: row;
}
.aboveContentLeftContainer {
margin-left: 1.25rem;
display: flex;
flex-grow: 1;
justify-content: flex-start;
align-items: flex-end;
}
.aboveContentRightContainer {
margin-right: 1.25rem;
display: flex;
flex-grow: 1;
justify-content: flex-end;
align-items: flex-end;
}

.annotationPopup {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 20%;
height: 350px;
background-color: white;
border: 1px black solid;
display: none;
border-radius: 5px;
padding-left: 10px;
padding-right: 10px;
}
Loading
Loading