import React, { useEffect } from 'react';
import { createRoot } from 'react-dom/client';
import ReactMarkdown from 'react-markdown';
import README from './README.md';
import SmoothieComponent, { SmoothieProvider, TimeSeries } from './SmoothieComponent';
const TS = new TimeSeries();
const TS2 = new TimeSeries();
setInterval(() => {
const time = new Date().getTime();
TS.append(time, Math.random());
TS2.append(time, Math.random());
}, 1000);
function TooltipChart() {
const [toggle, setToggle] = React.useState(false);
const [delay, setDelay] = React.useState(0);
return (
<>
streamDelay: {delay}ms
{toggle ? (
<>>
) : (
{
if (!props.display) return ;
return (
{props.time}
{props.data ? (
{props.data.map((data, i) => (
{data.value}
))}
) : (
)}
);
}}
series={[
{
data: TS,
r: 255,
lineWidth: 4,
strokeStyle: { r: 255 },
},
]}
/>
)}
>
);
}
/**
* A bunch of charts sharing one animation loop — the default, no provider needed.
* Open the browser profiler: all charts below render from a single requestAnimationFrame.
*/
function CoordinatedCharts({ count }: { count: number }) {
return (