import { BaseDrawer } from './base-drawer';
/** The PathDrawer class draws a path on a chart using provided data and color options. */
export class PathDrawer extends BaseDrawer {
  /** This function adds interaction support */
  // eslint-disable-next-line @typescript-eslint/no-empty-function
  addInteractionSupport() { }
  /**
   * This function draws a path on a chart using specified options.
   */
  draw() {
    const { positions, colors } = this.options.renderOptions;
    let renderPositions = positions;
    if (positions && positions[0] && !Array.isArray(positions[0])) {
      renderPositions = [positions];
    }
    renderPositions.forEach((item, index) => {
      const color = this.getColorByIndex(index, colors);
      this.renderer.drawLinePath(item, this.getColorFromToken(color));
      item.forEach((position) => {
        this.renderer.drawCircle(position, 4, this.getColorFromToken('bg-primary'), 2, this.getColorFromToken(color));
      });
    });
  }
}
