componentDidLoad()

in packages/synchro-charts/src/testing/test-routes/charts/shaders/status-timeline/multiple-statuses.tsx [32:80]


  componentDidLoad() {
    const container = this.el.querySelector('#test-container') as HTMLDivElement;
    const scene = chartScene({
      alarms: { expires: HOUR_IN_MS * 5 },
      viewport: {
        start: X_MIN,
        end: X_MAX,
        yMin: 0,
        yMax: HEIGHT,
      },
      dataStreams: [
        {
          id: 'test-stream',
          aggregates: {
            [HOUR_IN_MS * 5]: [TEST_DATA_POINT_1],
          },
          data: [],
          resolution: HOUR_IN_MS * 5,
          name: 'test-stream-name',
          color: 'black',
          dataType: DataType.NUMBER,
        },
        {
          id: 'test-stream-2',
          aggregates: {
            [HOUR_IN_MS * 5]: [TEST_DATA_POINT_2],
          },
          data: [],
          name: 'test-stream-name-2',
          color: 'red',
          resolution: HOUR_IN_MS * 5,
          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() });
  }