{"version":3,"file":"eklipse-charts-area.mjs","sources":["../../../projects/charts/area/area.colors.ts","../../../projects/charts/area/area.component.ts","../../../projects/charts/area/area.component.html","../../../projects/charts/area/area.module.ts","../../../projects/charts/area/public-api.ts","../../../projects/charts/area/eklipse-charts-area.ts"],"sourcesContent":["export const CHARTJS_AREA_COLORS = ['77,226,194', '24,146,195', '184,191,191'];\r\n","import {\r\n  AfterViewInit,\r\n  ChangeDetectionStrategy,\r\n  Component,\r\n  Input,\r\n  ViewEncapsulation,\r\n} from '@angular/core';\r\nimport { Chart, ChartItem, registerables } from 'chart.js';\r\nimport { CHARTJS_AREA_COLORS } from './area.colors';\r\n\r\n@Component({\r\n  selector: 'gcm-area',\r\n  templateUrl: './area.component.html',\r\n  styleUrls: ['./area.component.scss'],\r\n  encapsulation: ViewEncapsulation.None,\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class GcmAreaComponent implements AfterViewInit {\r\n  public id: string = (Math.floor(Math.random() * (999999 - 111111)) + 111111).toString();\r\n\r\n  @Input() class: string = '';\r\n\r\n  @Input() style: string = '';\r\n\r\n  @Input() description: string = '';\r\n\r\n  @Input() data!: any;\r\n\r\n  constructor() {\r\n    Chart.register(...registerables);\r\n  }\r\n\r\n  public ngAfterViewInit(): void {\r\n    this.data.datasets.map((r: any, i: number) => {\r\n      if (r.backgroundColor || CHARTJS_AREA_COLORS[i]) {\r\n        r.backgroundColor = r.backgroundColor || `rgba(${CHARTJS_AREA_COLORS[i]},0.4)`;\r\n        r.borderColor = r.borderColor || `rgba(${CHARTJS_AREA_COLORS[i]})`;\r\n        r.pointBorderColor = r.pointBorderColor || `rgba(${CHARTJS_AREA_COLORS[i]})`;\r\n        r.pointBackgroundColor = r.pointBackgroundColor || `rgba(${CHARTJS_AREA_COLORS[i]})`;\r\n        r.pointHoverBorderColor = r.pointHoverBorderColor || `rgba(${CHARTJS_AREA_COLORS[i]})`;\r\n      }\r\n      r.lineTension = 0.5;\r\n      r.radius = 3;\r\n      r.fill = true;\r\n    });\r\n\r\n    let data: any,\r\n      options: any,\r\n      chart: any,\r\n      ctx: ChartItem | any = document.getElementById(this.id) as HTMLElement;\r\n\r\n    data = this.data;\r\n\r\n    options = {\r\n      responsive: true,\r\n      maintainAspectRatio: true,\r\n      plugins: {\r\n        title: {\r\n          display: false,\r\n          position: 'top',\r\n          text: 'Area Chartjs',\r\n          fontSize: 12,\r\n          fontColor: '#666',\r\n        },\r\n        legend: {\r\n          display: false,\r\n        },\r\n      },\r\n    };\r\n\r\n    chart = new Chart(ctx, {\r\n      type: 'line',\r\n      data: data,\r\n      options: options,\r\n    });\r\n  }\r\n}\r\n","<div class=\"gcm__chartjs__area__container {{ class }}\" [style]=\"style\">\r\n  <span class=\"gcm__chartjs__area__description\">{{ description }}</span>\r\n  <canvas [id]=\"id\" class=\"gcm__chartjs__area__canvas\"></canvas>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { GcmAreaComponent } from './area.component';\r\nimport { NgChartsModule } from 'ng2-charts';\r\n\r\nconst components = [GcmAreaComponent];\r\n\r\n@NgModule({\r\n  declarations: components,\r\n  imports: [CommonModule, NgChartsModule],\r\n  exports: components,\r\n})\r\nexport class GcmAreaModule {}\r\n","/*\r\n * Public API Surface of @eklipse/charts/area\r\n */\r\n\r\nexport * from './area.component';\r\nexport * from './area.module';\r\nexport * from './area.colors';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAa,MAAA,mBAAmB,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa;;MCiBhE,gBAAgB,CAAA;AAW3B,IAAA,WAAA,GAAA;QAVO,IAAE,CAAA,EAAA,GAAW,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,CAAC;AAE/E,QAAA,IA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