{"version":3,"file":"eklipse-charts-donut.mjs","sources":["../../../projects/charts/donut/donut.colors.ts","../../../projects/charts/donut/donut.component.ts","../../../projects/charts/donut/donut.component.html","../../../projects/charts/donut/donut.module.ts","../../../projects/charts/donut/public-api.ts","../../../projects/charts/donut/eklipse-charts-donut.ts"],"sourcesContent":["export const CHARTJS_DONUT_COLORS = [\r\n  '#006691b6',\r\n  '#2499c7b6',\r\n  '#40cfffb6',\r\n  '#94e7ffb6',\r\n  '#00003db6',\r\n  '#2a8c4ab6',\r\n  '#64c27bb6',\r\n  '#9bfab0b6',\r\n  '#00276cb6',\r\n  '#014ba0b6',\r\n  '#5b7dcfb6',\r\n  '#96b3ffb6',\r\n  '#ff69b4b6',\r\n  '#ffa8d9b6',\r\n  '#0dd76fb6',\r\n  '#2ae585b6',\r\n  '#ff9800b6',\r\n  '#efad4ab6',\r\n  '#734a91b6',\r\n  '#a87bc7b6',\r\n  '#e0b0ffb6',\r\n  '#f1d7ffb6',\r\n  '#503459b6',\r\n  '#81638bb6',\r\n  '#b695c0b6',\r\n  '#dac9dfb6',\r\n  '#867416b6',\r\n  '#bea74bb6',\r\n  '#f8de7eb6',\r\n  '#feeeb8b6',\r\n  '#664300b6',\r\n  '#a87b05b6',\r\n  '#efb810b6',\r\n  '#610000b6',\r\n  '#9c0720b6',\r\n  '#dc143cb6',\r\n  '#f1666db6',\r\n  '#ff9ea2b6',\r\n  '#1c4c96b6',\r\n  '#9ab4ffb6',\r\n  '#9296c3b6',\r\n  '#608ac6b6',\r\n  '#aacde1b6',\r\n  '#77bbd2b6',\r\n  '#b3d7bdb6',\r\n  '#9ac359b6',\r\n  '#e6e89fb6',\r\n  '#f3ed64b6',\r\n  '#f6e3abb6',\r\n  '#db9262b6',\r\n  '#e0a4a6b6',\r\n  '#ca517cb6',\r\n  '#d49ac0b6',\r\n  '#975fa0b6',\r\n  '#aa94c2b6',\r\n];\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_DONUT_COLORS } from './donut.colors';\r\n\r\n@Component({\r\n  selector: 'gcm-donut',\r\n  templateUrl: './donut.component.html',\r\n  styleUrls: ['./donut.component.scss'],\r\n  encapsulation: ViewEncapsulation.None,\r\n  changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class GcmDonutComponent implements AfterViewInit {\r\n  @Input() description: string = '';\r\n\r\n  @Input() labels: any = [];\r\n\r\n  @Input() data: any = [];\r\n\r\n  @Input() class: string = '';\r\n\r\n  @Input() style: string = '';\r\n\r\n  @Input() hasLegend: boolean = false;\r\n\r\n  @Input() positionLegend: 'top' | 'right' | 'left' | 'bottom' = 'top';\r\n\r\n  public id: string = (Math.floor(Math.random() * (999999 - 111111)) + 111111).toString();\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) => {\r\n      if (!r.backgroundColor) {\r\n        r.backgroundColor = CHARTJS_DONUT_COLORS;\r\n      }\r\n      r.hoverOffset = 4;\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    options = {\r\n      responsive: true,\r\n      maintainAspectRatio: true,\r\n      plugins: {\r\n        title: {\r\n          display: false,\r\n        },\r\n        legend: {\r\n          display: this.hasLegend,\r\n          position: this.positionLegend,\r\n        },\r\n      },\r\n    };\r\n\r\n    try {\r\n      chart = new Chart(ctx, {\r\n        type: 'doughnut',\r\n        data: data,\r\n        options: options,\r\n      });\r\n    } catch (error) {}\r\n  }\r\n}\r\n","<div class=\"gcm__chartjs__donut__container {{ class }}\" [style]=\"style\">\r\n  <span class=\"gcm__chartjs__donut__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 { GcmDonutComponent } from './donut.component';\r\nimport { NgChartsModule } from 'ng2-charts';\r\n\r\nconst components = [GcmDonutComponent];\r\n\r\n@NgModule({\r\n  declarations: components,\r\n  imports: [CommonModule, NgChartsModule],\r\n  exports: components,\r\n})\r\nexport class GcmDonutModule {}\r\n","/*\r\n * Public API Surface of @eklipse/charts/donut\r\n */\r\n\r\nexport * from './donut.component';\r\nexport * from './donut.module';\r\nexport * from './donut.colors';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAa,MAAA,oBAAoB,GAAG;IAClC,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;;;MCtCA,iBAAiB,CAAA;AAiB5B,IAAA,WAAA,GAAA;AAhBS,QAAA,IAAW,CAAA,WAAA,GAAW,EAAE,CAAC;AAEzB,QAAA,IAAM,CAAA,MAAA,GAAQ,EAAE,CAAC;AAEjB,QAAA,IAAI,CAAA,IAAA,GAA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