JSFiddle - React, Tailwind, and code Playground

by adilrabbani

HTML

<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Float32Arrys with NaNs</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/[email protected]/dist/uPlot.min.css"
    />
  </head>

  <body>
    <div id="chart"></div>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/uPlot.iife.min.js"></script>
      <button id="myButton">
  Make red line dashed
  </button>
    <script>
      const opts2 = {
        title: "Nearest Non-Null (by 30px proximity)",
        width: 800,
        height: 600,
        cursor: {
          hover: {
            prox: 30,
            bias: 0,
            skip: [null],
          },
        },
        hooks: {
        },
        scales: {
          x: {
            time: false,
          },
          y: {
          auto: true
          }
        },
        series: [
          {},
          {
            stroke: "red",
            spanGaps: true,
          },
          {
            stroke: "blue",
            spanGaps: false,
          },
        ],
      }

      const tables = [
        [
          null,
         [
  null,
  0.05386236682534218,
  0.12157758325338364,
  0.1705796718597412,
  0.21396741271018982,
  0.25457409024238586,
  0.2981582581996918,
  0.3552698791027069,
  0.4006049931049347,
  0.44888004660606384,
  0.501764714717865,
  0.5591611266136169,
  0.6096822023391724,
  0.6645497679710388,
  0.7191200256347656,
  0.7864775657653809,
  0.8380260467529297,
  0.897749125957489,
  0.9569851756095886,
  1.0278691053390503,
  1.0742329359054565,
  1.1340745687484741,
  1.1931473016738892,
  1.25791335105896,
  1.3317841291427612,
  1.3913450241088867,
  1.4512088298797607,
  1.583346962928772,
  1.6680006980895996,
  1.7319788932800293,
  1.790816068649292,
  1.8557261228561401,
  1.9080244302749634,
  1.966204285621643,
  2.0077450275421143,
  2.086543560028076,
  2.187164068222046,
 ...