import React, { FC, useState } from "react" import ReactDOM from "react-dom" import { SquiggleChart } from "./SquiggleChart" import CodeEditor from "./CodeEditor" import { Form, Input, Card, Row, Col } from "antd" import 'antd/dist/antd.css'; interface FieldFloatProps { label : string, className? : string, value : number, onChange : (value: number) => void, } function FieldFloat(Props: FieldFloatProps) { let [contents, setContents] = useState(Props.value + ""); return setContents(e.target.value)} onBlur={(_) => { let result = parseFloat(contents); if(result != NaN) { Props.onChange(result) } }} /> } interface Props { initialSquiggleString : string } let SquigglePlayground : FC = (props) => { let [squiggleString, setSquiggleString] = useState(props.initialSquiggleString) let [sampleCount, setSampleCount] = useState(1000) let [outputXYPoints, setOutputXYPoints] = useState(1000) let [pointDistLength, setPointDistLength] = useState(1000) let [diagramStart, setDiagramStart] = useState(0) let [diagramStop, setDiagramStop] = useState(10) let [diagramCount, setDiagramCount] = useState(20) var demoDist = return (
{demoDist}
) } export default SquigglePlayground; export function renderSquigglePlayground(props : Props){ let parent = document.createElement("div"); ReactDOM.render( , parent ); return parent; }