componentDidLoad()

in packages/synchro-charts/src/testing/test-routes/charts/shaders/sc-multiple-lines-overlapping.tsx [42:83]


  componentDidLoad() {
    const container = this.el.querySelector('#test-container') as HTMLDivElement;
    const scene = chartScene({
      viewport: {
        start: X_MIN,
        end: X_MAX,
        yMin: Y_MIN,
        yMax: Y_MAX,
      },
      dataStreams: [
        {
          id: 'stream-1',
          name: 'stream-1-name',
          color: 'red',
          data: [STREAM_1_POINT_1, STREAM_1_POINT_2],
          resolution: 0,
          dataType: DataType.NUMBER,
        },
        {
          id: 'stream-2',
          name: 'stream-2-name',
          color: 'green',
          data: [STREAM_2_POINT_1, STREAM_2_POINT_2],
          resolution: 0,
          dataType: DataType.NUMBER,
        },
      ],
      container,
      chartSize: CHART_SIZE,
      minBufferSize: 100,
      bufferFactor: 2,
      thresholdOptions: {
        showColor: false,
      },
      thresholds: [],
    });

    webGLRenderer.addChartScene({ manager: scene });

    const rect = container.getBoundingClientRect() as DOMRect;
    webGLRenderer.setChartRect(scene.id, { density: 1, ...rect.toJSON() });
  }