constructor()

in src/chordChart.ts [578:627]


  constructor(options: VisualConstructorOptions) {
    if (window.location !== window.parent.location) {
      require("core-js/stable");
    }

    this.host = options.host;

    this.interactivityService = createInteractivitySelectionService(this.host);
    this.interactiveBehavior = new InteractiveBehavior();

    this.localizationManager = this.host.createLocalizationManager();

    this.tooltipServiceWrapper = createTooltipServiceWrapper(
      this.host.tooltipService,
      options.element
    );

    this.layout = new VisualLayout(
      ChordChart.DefaultViewPort,
      ChordChart.DefaultMargin
    );
    this.layout.minViewport = ChordChart.DefaultViewPort;

    this.svg = select(options.element)
      .append("svg")
      .style("position", "absolute")
      .classed(ChordChart.VisualClassName, true);

    let svgSelection: Selection<any, any, any, any> =
      (this.mainGraphicsContext = this.svg.append("g"));

    svgSelection.append("g").classed("chords", true);

    this.slices = svgSelection.append("g").classed("slices", true);

    svgSelection.append("g").classed(ChordChart.ticksClass.className, true);

    this.labels = svgSelection
      .append("g")
      .classed(ChordChart.labelGraphicsContextClass.className, true);

    this.lines = svgSelection
      .append("g")
      .classed(ChordChart.linesGraphicsContextClass.className, true);

    this.colors = options.host.colorPalette;
    this.eventService = options.host.eventService;

    this.handleContextMenu();
  }