-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(highcharts-configs): new library
- Loading branch information
Showing
19 changed files
with
1,072 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h2>Highcharts configs playground</h2> | ||
|
||
<h3>Categorical</h3> | ||
<highcharts-chart | ||
[Highcharts]="Highcharts" | ||
[options]="categoricalOptions" | ||
style="width: 100%; height: 400px; display: block" | ||
></highcharts-chart> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved. | ||
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. | ||
* This software is released under MIT license. | ||
* The full license information can be found in LICENSE in the root directory of this project. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved. | ||
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. | ||
* This software is released under MIT license. | ||
* The full license information can be found in LICENSE in the root directory of this project. | ||
*/ | ||
|
||
import { Component } from '@angular/core'; | ||
import { Categorical } from '@clr/highcharts-configs'; | ||
import * as Highcharts from 'highcharts'; | ||
|
||
type DataItem = { | ||
data: number[]; | ||
type: 'column'; | ||
name: string; | ||
}; | ||
|
||
function generateArray(n: number): DataItem[] { | ||
const generateRandomData = (length: number): number[] => | ||
Array.from({ length }, () => Math.floor(Math.random() * 500) + 1); | ||
|
||
return Array.from({ length: n }, (_, index) => ({ | ||
data: generateRandomData(12), | ||
type: 'column', | ||
name: `Test ${index + 1}`, | ||
})); | ||
} | ||
|
||
@Component({ | ||
selector: 'app-charts', | ||
templateUrl: './charts.component.html', | ||
styleUrls: ['./charts.component.scss'], | ||
}) | ||
export class ChartsComponent { | ||
Highcharts: typeof Highcharts = Highcharts; | ||
categoricalOptions: Highcharts.Options = Categorical.applyRecommendedConfig({ | ||
title: { | ||
text: 'Test Title', | ||
}, | ||
xAxis: { | ||
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], | ||
}, | ||
series: generateArray(3), | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved. | ||
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. | ||
* This software is released under MIT license. | ||
* The full license information can be found in LICENSE in the root directory of this project. | ||
*/ | ||
|
||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { HighchartsChartModule } from 'highcharts-angular'; | ||
|
||
import { ChartsComponent } from './charts.component'; | ||
import { ChartsRoutingModule } from './charts.demo.routing'; | ||
|
||
@NgModule({ | ||
declarations: [ChartsComponent], | ||
imports: [CommonModule, ChartsRoutingModule, HighchartsChartModule], | ||
}) | ||
export class ChartsModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved. | ||
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. | ||
* This software is released under MIT license. | ||
* The full license information can be found in LICENSE in the root directory of this project. | ||
*/ | ||
|
||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
|
||
import { ChartsComponent } from './charts.component'; | ||
|
||
const routes: Routes = [{ path: '', component: ChartsComponent }]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class ChartsRoutingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# HighchartsConfigs | ||
|
||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0. | ||
|
||
## Code scaffolding | ||
|
||
Run `ng generate component component-name --project highcharts-configs` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project highcharts-configs`. | ||
|
||
> Note: Don't forget to add `--project highcharts-configs` or else it will be added to the default project in your `angular.json` file. | ||
## Build | ||
|
||
Run `ng build highcharts-configs` to build the project. The build artifacts will be stored in the `dist/` directory. | ||
|
||
## Publishing | ||
|
||
After building your library with `ng build highcharts-configs`, go to the dist folder `cd dist/highcharts-configs` and run `npm publish`. | ||
|
||
## Running unit tests | ||
|
||
Run `ng test highcharts-configs` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/highcharts-configs", | ||
"lib": { | ||
"entryFile": "src/public-api.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "@clr/highcharts-configs", | ||
"version": "0.0.1", | ||
"peerDependencies": { | ||
"@cds/core": ">= 6.15.0" | ||
}, | ||
"sideEffects": false | ||
} |
Oops, something went wrong.