{"version":3,"file":"index.d.ts","sources":["../src/elements/LinearAxis.ts","../src/elements/LineSegment.ts","../src/controllers/ParallelCoordinatesController.ts","../src/controllers/LogarithmicParallelCoordinatesController.ts","../src/scales/PCPScale.ts"],"sourcesContent":["import {\n  LinearScale,\n  LogarithmicScale,\n  defaults,\n  LogarithmicScaleOptions,\n  CartesianScaleOptions,\n  Element,\n  LinearScaleOptions,\n  ScriptableAndArrayOptions,\n  ScriptableContext,\n  ChartType,\n} from 'chart.js';\nimport { merge } from 'chart.js/helpers';\n\nexport interface IAxisOptions extends CartesianScaleOptions {\n  // all options from\n  // https://www.chartjs.org/docs/latest/axes/cartesian/linear.html#linear-cartesian-axis\n  /**\n   * width of the visible axis\n   * @default 30\n   */\n  axisWidth: number;\n}\n\nexport interface IAxisProps {\n  x: number;\n  y: number;\n  width: number;\n  height: number;\n  top: number;\n  bottom: number;\n  left: number;\n  right: number;\n}\n\nconst scaleDefaults = {\n  axis: 'y',\n  // a dummy scriptable option to enforce a context environment\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  dummyOption: (_ctx: unknown) => 0,\n  axisWidth: 10,\n  position: 'right',\n};\n\nexport type ILinearAxisOptions = IAxisOptions & LinearScaleOptions;\n\nexport class LinearAxis extends LinearScale<ILinearAxisOptions> {\n  static readonly id = 'linearAxis';\n\n  static readonly defaults: any = /* #__PURE__ */ merge({}, [defaults.scale, LinearScale.defaults, scaleDefaults]);\n\n  static readonly descriptors = /* #__PURE__ */ {\n    _scriptable: (name: string): boolean =>\n      !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n    _indexable: (name: string): boolean => name !== 'borderDash' && name !== 'tickBorderDash',\n  };\n\n  constructor() {\n    super({});\n  }\n\n  update(): number {\n    const w = this.options.axisWidth;\n    // copy since it could return self\n    const props = {\n      ...(this as unknown as Element<IAxisProps, ILinearAxisOptions>).getProps([\n        'width',\n        'height',\n        'top',\n        'bottom',\n        'left',\n        'right',\n      ]),\n    };\n    const h = props.bottom - props.top;\n    this.left = 0;\n    this.right = w;\n    this.top = props.top;\n    this.bottom = props.bottom;\n\n    const r = super.update(w, h);\n\n    this.top = props.top;\n    this.bottom = props.bottom;\n    this.configure();\n    return r as any;\n  }\n\n  _computeLabelArea(): void {\n    return undefined;\n  }\n\n  draw(c: unknown): void {\n    const ctx = c as CanvasRenderingContext2D;\n    ctx.save();\n    const props = (this as unknown as Element<IAxisProps, ILinearAxisOptions>).getProps([\n      'x',\n      'width',\n      'height',\n      'top',\n      'bottom',\n      'left',\n      'right',\n    ]);\n\n    const w = this.options.axisWidth;\n    if (this.options.position === 'left') {\n      ctx.translate(props.x - w, 0);\n    } else {\n      ctx.translate(props.x, 0);\n    }\n    super.draw(props);\n    ctx.restore();\n  }\n}\n\nexport type ILogarithmicAxisOptions = IAxisOptions & LogarithmicScaleOptions;\n\nexport class LogarithmicAxis extends LogarithmicScale<ILogarithmicAxisOptions> {\n  static readonly id = 'logarithmicAxis';\n\n  /**\n   * @hidden\n   */\n  static readonly defaults: any = /* #__PURE__ */ merge({}, [defaults.scale, LogarithmicScale.defaults, scaleDefaults]);\n\n  /**\n   * @hidden\n   */\n  static readonly descriptors = /* #__PURE__ */ LinearAxis.descriptors;\n\n  constructor() {\n    super({});\n  }\n\n  /**\n   * @hidden\n   */\n\n  _computeLabelArea(): void {\n    return undefined;\n  }\n\n  /**\n   * @hidden\n   */\n  update(): number {\n    return LinearAxis.prototype.update.call(this);\n  }\n\n  /**\n   * @hidden\n   */\n  draw(c: unknown): void {\n    return LinearAxis.prototype.draw.call(this, c);\n  }\n}\n\ndeclare module 'chart.js' {\n  export interface ElementOptionsByType<TType extends ChartType> {\n    linearAxis: ScriptableAndArrayOptions<ILinearAxisOptions, ScriptableContext<TType>>;\n    logarithmicAxis: ScriptableAndArrayOptions<ILogarithmicAxisOptions, ScriptableContext<TType>>;\n  }\n}\n","import type { AnyObject } from '../controllers/ParallelCoordinatesController';\nimport { ChartType, Element, LineElement, LineOptions, ScriptableAndArrayOptions, ScriptableContext } from 'chart.js';\n\nexport interface ILineSegmentOptions extends LineOptions {\n  /**\n   * line tension > 0 (e.g., 0.3) to create bezier curves\n   * @default 0\n   */\n  tension: number;\n}\n\nexport interface ILineSegmentProps {\n  x: number;\n  y: number;\n  x1: number;\n  y1: number;\n  xCPn: number;\n  yCPn: number;\n  xCPp1: number;\n  yCPp1: number;\n}\n\nexport class LineSegment extends Element<ILineSegmentProps & AnyObject, ILineSegmentOptions & AnyObject> {\n  /**\n   * @hidden\n   */\n\n  _getLineParts(props: Pick<ILineSegmentProps, 'x' | 'y' | 'x1' | 'y1'>): { d: number; k: number } {\n    // y = x * k + d\n    const k = (props.y1 - props.y) / (props.x1 - props.x);\n    const d = props.y - props.x * k;\n    return { d, k };\n  }\n\n  /**\n   * @hidden\n   */\n  inRange(mouseX: number, mouseY: number, useFinalPosition: boolean): boolean {\n    const props = this.getProps(['x', 'x1', 'y', 'y1'], useFinalPosition) as unknown as ILineSegmentProps;\n    const dk = this._getLineParts(props);\n    const targetY = mouseX * dk.k + dk.d;\n    const targetX = (mouseY - dk.d) / dk.k + dk.d;\n    const range = this.options.borderWidth * 2;\n    return (\n      (Math.abs(mouseY - targetY) < range || Math.abs(mouseX - targetX) < range) &&\n      mouseX + range >= props.x &&\n      mouseX - range <= props.x1 &&\n      mouseY + range >= Math.min(props.y, props.y1) &&\n      mouseY - range <= Math.max(props.y, props.y1)\n    );\n  }\n\n  /**\n   * @hidden\n   */\n  tooltipPosition(useFinalPosition: boolean): { x: number; y: number; padding: number } {\n    const props = this.getProps(['x', 'x1', 'y', 'y1'], useFinalPosition) as unknown as ILineSegmentProps;\n    return {\n      x: (props.x1 + props.x) / 2,\n      y: (props.y1 + props.y) / 2,\n      padding: this.options.borderWidth,\n    };\n  }\n\n  /**\n   * @hidden\n   */\n  getCenterPoint(useFinalPosition: boolean): { x: number; y: number } {\n    const props = this.getProps(['x', 'x1', 'y', 'y1'], useFinalPosition) as unknown as ILineSegmentProps;\n    return {\n      x: (props.x1 + props.x) / 2,\n      y: (props.y1 + props.y) / 2,\n    };\n  }\n\n  /**\n   * @hidden\n   */\n  inXRange(mouseX: number, useFinalPosition: boolean): boolean {\n    const props = this.getProps(['x', 'x1'], useFinalPosition) as unknown as ILineSegmentProps;\n    const range = this.options.borderWidth * 2;\n    return mouseX + range >= props.x && mouseX - range <= props.x1;\n  }\n\n  /**\n   * @hidden\n   */\n  inYRange(mouseY: number, useFinalPosition: boolean): boolean {\n    const props = this.getProps(['y', 'y1'], useFinalPosition) as unknown as ILineSegmentProps;\n    const range = this.options.borderWidth * 2;\n    return mouseY + range >= Math.min(props.y, props.y1) && mouseY - range <= Math.max(props.y, props.y1);\n  }\n\n  /**\n   * @hidden\n   */\n  draw(ctx: CanvasRenderingContext2D): void {\n    const props = this.getProps([\n      'x',\n      'x1',\n      'y',\n      'y1',\n      'xCPn',\n      'yCPn',\n      'xCPp1',\n      'yCPp1',\n    ]) as unknown as ILineSegmentProps;\n    const { options } = this;\n    ctx.save();\n\n    // Stroke Line Options\n    ctx.lineCap = options.borderCapStyle;\n    ctx.setLineDash(options.borderDash || []);\n    ctx.lineDashOffset = options.borderDashOffset;\n    ctx.lineJoin = options.borderJoinStyle;\n    ctx.lineWidth = options.borderWidth;\n    ctx.strokeStyle = options.borderColor;\n\n    // Stroke Line\n    ctx.beginPath();\n\n    ctx.moveTo(props.x, props.y);\n    if (options.tension) {\n      ctx.bezierCurveTo(props.xCPn, props.yCPn, props.xCPp1, props.yCPp1, props.x1, props.y1);\n    } else {\n      ctx.lineTo(props.x1, props.y1);\n    }\n\n    ctx.stroke();\n    ctx.restore();\n  }\n\n  static readonly id = 'lineSegment';\n\n  /**\n   * @hidden\n   */\n  static readonly defaults = /* #__PURE__ */ {\n    ...LineElement.defaults,\n    hoverBorderWidth: 4,\n    hoverBorderColor: 'rgba(0,0,0,0.8)',\n    borderCapStyle: 'round',\n    tension: 0,\n  };\n\n  /**\n   * @hidden\n   */\n  static readonly defaultRoutes = LineElement.defaultRoutes;\n\n  /**\n   * @hidden\n   */\n  static readonly descriptors = (LineElement as any).descriptors;\n}\n\ndeclare module 'chart.js' {\n  export interface ElementOptionsByType<TType extends ChartType> {\n    lineSegment: ScriptableAndArrayOptions<ILineSegmentOptions, ScriptableContext<TType>>;\n  }\n}\n","import {\n  Chart,\n  DatasetController,\n  ChartItem,\n  ControllerDatasetOptions,\n  ScriptableAndArrayOptions,\n  CommonHoverOptions,\n  TooltipItem,\n  UpdateMode,\n  ChartComponent,\n  ChartMeta,\n  ChartConfiguration,\n  ScriptableContext,\n  Element,\n  CartesianScaleTypeRegistry,\n} from 'chart.js';\nimport { splineCurve } from 'chart.js/helpers';\n\nimport { LinearAxis, LineSegment, ILinearAxisOptions, ILineSegmentOptions, ILineSegmentProps } from '../elements';\nimport { PCPScale } from '../scales';\nimport patchController from './patchController';\n\ninterface IExtendedChartMeta {\n  _metas: ChartMeta<any, any>[];\n  _metaIndex: number;\n}\n\nexport type AnyObject = Record<string, unknown>;\n\nexport class ParallelCoordinatesController extends DatasetController<\n  'pcp',\n  LineSegment & Element<AnyObject, AnyObject>,\n  LinearAxis & Element<AnyObject, AnyObject>\n> {\n  /**\n   * @hidden\n   */\n  declare datasetElementType: ChartComponent;\n\n  /**\n   * @hidden\n   */\n  declare dataElementType: ChartComponent;\n\n  declare private _type: string;\n\n  /**\n   * @hidden\n   */\n  initialize(): void {\n    super.initialize();\n    this.enableOptionSharing = true;\n  }\n\n  /**\n   * @hidden\n   */\n  linkScales(): void {\n    const ds = this.getDataset() as any;\n    ds.yAxisID = ds.label;\n    super.linkScales();\n    this._cachedMeta.vScale = this._cachedMeta.dataset as any;\n    this._cachedMeta.vScale = this._cachedMeta.dataset as any;\n  }\n\n  private resolveAxisOptions(mode: UpdateMode) {\n    return this.resolveDatasetElementOptions(mode) as unknown as ILinearAxisOptions;\n  }\n\n  /**\n   * @hidden\n   */\n  addElements(): void {\n    super.addElements();\n    const meta = this._cachedMeta;\n    const scale = meta.dataset as LinearAxis;\n    meta.yScale = scale;\n    meta.vScale = scale;\n\n    Object.assign(scale, {\n      id: meta.yAxisID,\n      type: this.datasetElementType.id,\n      chart: this.chart,\n      ctx: this.chart.ctx,\n    });\n    const options = this.resolveAxisOptions('reset');\n    // workaround for now\n    Object.assign(options, { setContext: () => 0 });\n    scale.init(options);\n  }\n\n  /**\n   * @hidden\n   */\n  update(mode: UpdateMode): void {\n    // from front to back\n\n    const meta = this._cachedMeta as unknown as IExtendedChartMeta;\n    meta._metas = this.chart.getSortedVisibleDatasetMetas();\n    meta._metaIndex = meta._metas.indexOf(this._cachedMeta);\n    if (meta._metaIndex < 0) {\n      return;\n    }\n\n    const axis = this._cachedMeta.dataset;\n    if (axis) {\n      this.updateAxis(axis, mode);\n    }\n\n    const elements = this._cachedMeta.data || [];\n    this.updateElements(elements, 0, elements.length, mode);\n  }\n\n  /**\n   * @hidden\n   */\n  draw(): void {\n    // from back to front\n    const meta = this._cachedMeta;\n    const metaE = meta as unknown as IExtendedChartMeta;\n    const elements = meta.data || [];\n    const { ctx } = this.chart;\n    if (metaE._metaIndex < 0) {\n      return;\n    }\n\n    if (meta.dataset) {\n      meta.dataset.draw(ctx);\n    }\n    if (meta._metaIndex === 0) {\n      return;\n    }\n    elements.forEach((elem) => {\n      elem.draw(ctx);\n    });\n  }\n\n  /**\n   * @hidden\n   */\n  updateAxis(axis: LinearAxis & Element<AnyObject, AnyObject>, mode: UpdateMode): void {\n    const meta = this._cachedMeta;\n    const metaE = meta as unknown as IExtendedChartMeta;\n    const x = meta.xScale?.getPixelForTick(metaE._metaIndex) ?? 0;\n\n    const baseOptions = this.resolveDatasetElementOptions(mode) as unknown as ILinearAxisOptions;\n    const properties = {\n      x,\n      top: this.chart.chartArea.top,\n      bottom: this.chart.chartArea.bottom,\n      options: {\n        ...baseOptions,\n        position: metaE._metaIndex > 0 ? 'right' : 'left',\n      },\n    };\n    super.updateElement(axis, undefined, properties, mode);\n    axis.update();\n  }\n\n  /**\n   * @hidden\n   */\n  updateElements(\n    rectangles: (LineSegment & Element<AnyObject, AnyObject>)[],\n    start: number,\n    count: number,\n    mode: UpdateMode\n  ): void {\n    const reset = mode === 'reset';\n    const meta = this._cachedMeta as unknown as IExtendedChartMeta;\n\n    const firstOpts = this.resolveDataElementOptions(start, mode);\n    const dummyShared = {};\n    const sharedOptions = this.getSharedOptions(firstOpts) ?? dummyShared;\n    const includeOptions = this.includeOptions(mode, sharedOptions);\n    const getPoint = (metaIndex: number, index: number, defaultValue: { x: number; y: number }) => {\n      const m = meta._metas[metaIndex];\n      if (!m) {\n        return defaultValue;\n      }\n      const x = this._cachedMeta.xScale?.getPixelForTick(metaIndex) ?? 0;\n      const yScale = m.vScale;\n      const y = reset\n        ? yScale?.getBasePixel()\n        : yScale?.getPixelForValue((m._parsed[index] as Record<string, number>)[yScale?.axis ?? 'y'], index);\n\n      return {\n        x,\n        y: y == null || Number.isNaN(y) ? defaultValue.y : y,\n      };\n    };\n\n    this.updateSharedOptions(sharedOptions, mode, firstOpts);\n\n    for (let i = start; i < start + count; i += 1) {\n      const options: typeof firstOpts =\n        sharedOptions === dummyShared ? this.resolveDataElementOptions(i, mode) : sharedOptions;\n\n      const xy = getPoint(meta._metaIndex, i, { x: 0, y: 0 });\n      const xyPrevious = getPoint(meta._metaIndex - 1, i, xy);\n\n      const properties: Partial<ILineSegmentProps> & { options?: ILineSegmentOptions } = {\n        x: xyPrevious.x,\n        y: xyPrevious.y,\n        x1: xy.x,\n        y1: xy.y,\n      };\n\n      if (options.tension) {\n        const xyPrevPrevious = getPoint(meta._metaIndex - 2, i, xyPrevious);\n        const xyNext = getPoint(meta._metaIndex + 1, i, xy);\n\n        const controlPoints = splineCurve(xyPrevPrevious, xyPrevious, xy, options.tension as number);\n        const controlPoints1 = splineCurve(xyPrevious, xy, xyNext, options.tension as number);\n\n        properties.xCPn = controlPoints.next.x;\n        properties.yCPn = controlPoints.next.y;\n        properties.xCPp1 = controlPoints1.previous.x;\n        properties.yCPp1 = controlPoints1.previous.y;\n      }\n\n      if (includeOptions) {\n        properties.options = options as any;\n      }\n      this.updateElement(rectangles[i], i, properties, mode);\n    }\n  }\n\n  private _findOtherControllers() {\n    const metas = this.chart.getSortedVisibleDatasetMetas();\n    return metas.filter(\n      (meta) => (meta.controller as any) !== this && meta.controller instanceof ParallelCoordinatesController\n    );\n  }\n\n  /**\n   * @hidden\n   */\n  removeBaseHoverStyle(\n    element: LineSegment & Element<AnyObject, AnyObject>,\n    datasetIndex: number,\n    index: number\n  ): void {\n    super.removeHoverStyle(element, datasetIndex, index);\n  }\n\n  /**\n   * @hidden\n   */\n  removeHoverStyle(element: LineSegment & Element<AnyObject, AnyObject>, datasetIndex: number, index: number): void {\n    super.removeHoverStyle(element, datasetIndex, index);\n    this._findOtherControllers().forEach((meta) => {\n      (meta.controller as unknown as ParallelCoordinatesController).removeBaseHoverStyle(\n        meta.data[index] as any,\n        meta.index,\n        index\n      );\n    });\n  }\n\n  /**\n   * @hidden\n   */\n  setBaseHoverStyle(element: LineSegment & Element<AnyObject, AnyObject>, datasetIndex: number, index: number): void {\n    super.setHoverStyle(element, datasetIndex, index);\n  }\n\n  /**\n   * @hidden\n   */\n  setHoverStyle(element: LineSegment & Element<AnyObject, AnyObject>, datasetIndex: number, index: number): void {\n    super.setHoverStyle(element, datasetIndex, index);\n    this._findOtherControllers().forEach((meta) => {\n      (meta.controller as unknown as ParallelCoordinatesController).setBaseHoverStyle(\n        meta.data[index] as any,\n        meta.index,\n        index\n      );\n    });\n  }\n\n  static readonly id: string = 'pcp';\n\n  /**\n   * @hidden\n   */\n  static readonly defaults: any = /* #__PURE__ */ {\n    datasetElementType: LinearAxis.id,\n    dataElementType: LineSegment.id,\n    animations: {\n      numbers: {\n        type: 'number',\n        properties: ['x', 'y', 'x1', 'y1', 'axisWidth', 'xCPn', 'yCPn', 'xCPp1', 'yCPp1', 'borderWidth'],\n      },\n    },\n  };\n\n  /**\n   * @hidden\n   */\n  static readonly overrides: any = /* #__PURE__ */ {\n    scales: {\n      x: {\n        type: PCPScale.id,\n        offset: true,\n        grid: {\n          drawBorder: false,\n          display: false,\n        },\n      },\n    },\n\n    plugins: {\n      tooltip: {\n        callbacks: {\n          title() {\n            return '';\n          },\n          label(tooltipItem: TooltipItem<'pcp'>) {\n            const label = tooltipItem.chart.data?.labels?.[tooltipItem.dataIndex];\n            const ds = tooltipItem.chart\n              .getSortedVisibleDatasetMetas()\n              .map((d) => `${d.label}=${d.controller.getDataset().data[tooltipItem.dataIndex]}`);\n\n            return `${label}(${ds.join(', ')})`;\n          },\n        },\n      },\n    },\n  };\n}\n\nexport interface IParallelCoordinatesControllerDatasetOptions\n  extends Omit<ControllerDatasetOptions, 'clip'>,\n    Omit<ILinearAxisOptions, 'backgroundColor'>,\n    ScriptableAndArrayOptions<ILineSegmentOptions, ScriptableContext<'pcp'>>,\n    ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext<'pcp'>> {\n  stack: string;\n}\n\nexport type IParallelCoordinatesChartOptions = ILinearAxisOptions;\n\ndeclare module 'chart.js' {\n  interface ChartTypeRegistry {\n    pcp: {\n      chartOptions: IParallelCoordinatesChartOptions;\n      datasetOptions: IParallelCoordinatesControllerDatasetOptions;\n      defaultDataPoint: number;\n      metaExtensions: Record<string, never>;\n      parsedDataType: { y: number };\n      scales: keyof CartesianScaleTypeRegistry;\n    };\n  }\n}\n\nexport class ParallelCoordinatesChart<DATA extends unknown[] = number[], LABEL = string> extends Chart<\n  'pcp',\n  DATA,\n  LABEL\n> {\n  static id = ParallelCoordinatesController.id;\n\n  constructor(item: ChartItem, config: Omit<ChartConfiguration<'pcp', DATA, LABEL>, 'type'>) {\n    super(item, patchController('pcp', config, ParallelCoordinatesController, [LinearAxis, LineSegment], PCPScale));\n  }\n}\n","import {\n  Chart,\n  ControllerDatasetOptions,\n  ScriptableAndArrayOptions,\n  CommonHoverOptions,\n  ChartItem,\n  ChartConfiguration,\n  ScriptableContext,\n  CartesianScaleTypeRegistry,\n} from 'chart.js';\nimport { LineSegment, LogarithmicAxis, ILineSegmentOptions, ILogarithmicAxisOptions } from '../elements';\nimport { ParallelCoordinatesController } from './ParallelCoordinatesController';\nimport patchController from './patchController';\nimport { PCPScale } from '../scales';\n\nexport class LogarithmicParallelCoordinatesController extends ParallelCoordinatesController {\n  static readonly id = 'logarithmicPcp';\n\n  /**\n   * @hidden\n   */\n  static readonly defaults: any = /* #__PURE__ */ {\n    ...ParallelCoordinatesController.defaults,\n    datasetElementType: LogarithmicAxis.id,\n  };\n\n  /**\n   * @hidden\n   */\n  static readonly overrides: any = /* #__PURE__ */ ParallelCoordinatesController.overrides;\n}\n\nexport interface ILogarithmicParallelCoordinatesControllerDatasetOptions\n  extends Omit<ControllerDatasetOptions, 'clip'>,\n    Omit<ILogarithmicAxisOptions, 'backgroundColor'>,\n    ScriptableAndArrayOptions<ILineSegmentOptions, ScriptableContext<'logarithmicPcp'>>,\n    ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext<'logarithmicPcp'>> {\n  stack: string;\n}\n\nexport type ILogarithmicParallelCoordinatesChartOptions = ILogarithmicAxisOptions;\n\ndeclare module 'chart.js' {\n  interface ChartTypeRegistry {\n    logarithmicPcp: {\n      chartOptions: ILogarithmicParallelCoordinatesChartOptions;\n      datasetOptions: ILogarithmicParallelCoordinatesControllerDatasetOptions;\n      defaultDataPoint: number;\n      metaExtensions: Record<string, never>;\n      parsedDataType: { y: number };\n      scales: keyof CartesianScaleTypeRegistry;\n    };\n  }\n}\n\nexport class LogarithmicParallelCoordinatesChart<DATA extends unknown[] = number[], LABEL = string> extends Chart<\n  'logarithmicPcp',\n  DATA,\n  LABEL\n> {\n  static id = LogarithmicParallelCoordinatesController.id;\n\n  constructor(item: ChartItem, config: Omit<ChartConfiguration<'logarithmicPcp', DATA, LABEL>, 'type'>) {\n    super(\n      item,\n      patchController(\n        'logarithmicPcp',\n        config,\n        LogarithmicParallelCoordinatesController,\n        [LogarithmicAxis, LineSegment],\n        PCPScale\n      )\n    );\n  }\n}\n","import { CategoryScale, CategoryScaleOptions } from 'chart.js';\n\nexport class PCPScale extends CategoryScale {\n  getLabels(): string[] {\n    const { datasets } = this.chart.data;\n    return this.getMatchingVisibleMetas().map((meta) => {\n      const ds = datasets[meta.index];\n      return ds.label ?? '';\n    });\n  }\n\n  static readonly id = 'pcp';\n\n  /**\n   * @hidden\n   */\n  static readonly defaults: any = CategoryScale.defaults;\n}\n\ndeclare module 'chart.js' {\n  export interface ScaleTypeRegistry {\n    pcp: {\n      options: CategoryScaleOptions;\n    };\n  }\n}\n"],"names":[],"mappings":";;;;;;;;;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CO;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;;AC1CO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;;AC5BO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;"}