diff --git a/.gitignore b/.gitignore index 86d943a..e1166b2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ /bazel-out # dependencies -/node_modules +node_modules # profiling files chrome-profiler-events*.json diff --git a/package.json b/package.json index d0d0a7f..9ff0a01 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@angular/platform-browser": "~12.0.3", "@angular/platform-browser-dynamic": "~12.0.3", "@angular/router": "~12.0.3", + "angular-highcharts": "file:dist/angular-highcharts", "highcharts": "^9.1.1", "rxjs": "~7.1.0", "tslib": "^2.2.0", diff --git a/projects/angular-highcharts/ng-package.json b/projects/angular-highcharts/ng-package.json index bba9943..775eef7 100644 --- a/projects/angular-highcharts/ng-package.json +++ b/projects/angular-highcharts/ng-package.json @@ -5,9 +5,9 @@ "entryFile": "src/public-api.ts", "umdModuleIds": { "highcharts": "Highcharts", - "highcharts/highmaps": "Highmaps", - "highcharts/highstock": "Highstock", - "highcharts/highcharts-gantt": "HighchartsGantt" + "highcharts/modules/map.src": "Highmaps", + "highcharts/modules/stock.src": "Highstock", + "highcharts/modules/gantt.src": "HighchartsGantt" } } } diff --git a/projects/angular-highcharts/src/lib/highcharts-gantt.ts b/projects/angular-highcharts/src/lib/highcharts-gantt.ts index 0852e6d..0b9bf07 100644 --- a/projects/angular-highcharts/src/lib/highcharts-gantt.ts +++ b/projects/angular-highcharts/src/lib/highcharts-gantt.ts @@ -1,5 +1,6 @@ import { ElementRef } from '@angular/core'; -import * as Highcharts from 'highcharts/highcharts-gantt'; +import { Chart, Options } from 'highcharts/highcharts.src'; +import { Highcharts } from 'highcharts/modules/gantt.src'; import { AsyncSubject, Observable } from 'rxjs'; /** @@ -11,16 +12,17 @@ import { AsyncSubject, Observable } from 'rxjs'; * https://github.com/cebor/angular-highcharts/blob/master/LICENSE */ export class HighchartsGantt { - private refSubject: AsyncSubject = new AsyncSubject(); - ref$: Observable = this.refSubject.asObservable(); - ref: Highcharts.Chart; + private refSubject: AsyncSubject = new AsyncSubject(); + ref$: Observable = this.refSubject.asObservable(); + ref: Chart; - constructor(private options: Highcharts.Options = { series: [] }) {} + constructor(private options: Options = { series: [] }) {} init(el: ElementRef): void { if (!this.ref) { - Highcharts.ganttChart(el.nativeElement, this.options, chart => { - if (!this.ref) { // TODO: workaround for doubled callbacks on exporting charts: issue #238 + Highcharts.ganttChart(el.nativeElement, this.options, (chart) => { + if (!this.ref) { + // TODO: workaround for doubled callbacks on exporting charts: issue #238 this.refSubject.next(chart); this.ref = chart; this.refSubject.complete(); diff --git a/projects/angular-highcharts/src/lib/mapchart.ts b/projects/angular-highcharts/src/lib/mapchart.ts index 1f1c946..e67f572 100644 --- a/projects/angular-highcharts/src/lib/mapchart.ts +++ b/projects/angular-highcharts/src/lib/mapchart.ts @@ -1,6 +1,6 @@ import { ElementRef } from '@angular/core'; -// import * as Highcharts from 'highcharts'; -import * as Highmaps from 'highcharts/highmaps'; +import { Chart, Options } from 'highcharts/highcharts.src'; +import { Highcharts } from 'highcharts/modules/map.src'; import { AsyncSubject, Observable } from 'rxjs'; /** @@ -12,16 +12,17 @@ import { AsyncSubject, Observable } from 'rxjs'; * https://github.com/cebor/angular-highcharts/blob/master/LICENSE */ export class MapChart { - private refSubject: AsyncSubject = new AsyncSubject(); - ref$: Observable = this.refSubject.asObservable(); - ref: Highmaps.Chart; + private refSubject: AsyncSubject = new AsyncSubject(); + ref$: Observable = this.refSubject.asObservable(); + ref: Chart; - constructor(private options: Highmaps.Options = { series: [] }) {} + constructor(private options: Options = { series: [] }) {} init(el: ElementRef): void { if (!this.ref) { - Highmaps.mapChart(el.nativeElement, this.options, chart => { - if (!this.ref) { // TODO: workaround for doubled callbacks on exporting charts: issue #238 + Highcharts.mapChart(el.nativeElement, this.options, (chart) => { + if (!this.ref) { + // TODO: workaround for doubled callbacks on exporting charts: issue #238 this.refSubject.next(chart); this.ref = chart; this.refSubject.complete(); diff --git a/projects/angular-highcharts/src/lib/stockchart.ts b/projects/angular-highcharts/src/lib/stockchart.ts index fc5b567..ecdc2aa 100644 --- a/projects/angular-highcharts/src/lib/stockchart.ts +++ b/projects/angular-highcharts/src/lib/stockchart.ts @@ -1,9 +1,8 @@ import { ElementRef } from '@angular/core'; -//import * as Highcharts from 'highcharts'; -import * as Highstock from 'highcharts/highstock'; +import { Chart, Options } from 'highcharts/highcharts.src'; +import { Highcharts } from 'highcharts/modules/stock.src'; import { AsyncSubject, Observable } from 'rxjs'; - /** * @license * Copyright Felix Itzenplitz. All Rights Reserved. @@ -16,15 +15,16 @@ import { AsyncSubject, Observable } from 'rxjs'; * @author Timothy A. Perez (contributor) */ export class StockChart { - private refSubject: AsyncSubject = new AsyncSubject(); - ref$: Observable = this.refSubject.asObservable(); - ref: Highstock.Chart; - constructor(private options: Highstock.Options = { series: [] }) {} + private refSubject: AsyncSubject = new AsyncSubject(); + ref$: Observable = this.refSubject.asObservable(); + ref: Chart; + constructor(private options: Options = { series: [] }) {} init(el: ElementRef): void { if (!this.ref) { - Highstock.stockChart(el.nativeElement, this.options, chart => { - if (!this.ref) { // TODO: workaround for doubled callbacks on exporting charts: issue #238 + Highcharts.stockChart(el.nativeElement, this.options, (chart) => { + if (!this.ref) { + // TODO: workaround for doubled callbacks on exporting charts: issue #238 this.refSubject.next(chart); this.ref = chart; this.refSubject.complete();