import React, { FC, useState } from "react" import { SquiggleChart } from "./SquiggleChart" import CodeEditor from "./CodeEditor" import { Form, Input, Card, Row, Col } from "antd" import 'antd/dist/antd.css'; import { css } from '@emotion/react' 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) } }} /> } let rows = css` >.antCol:firstChild { paddingLeft: 0.25em; paddingRight: 0.125em; } >.antCol:lastChild { paddingLeft: 0.125em; paddingRight: 0.25em; } >.antCol:not(:lastChild):not(:lastChild) { paddingLeft: 0.125em; paddingRight: 0.125em; } ` let parent = css` .antImportNumber { width: 100%; } .anticon { verticalAlign: "zero"; } ` var form = css` backgroundColor: #eee; padding: 1em; ` var dist = css` padding: 1em; ` var spacer = css` marginTop: 1em; ` var groupA = css` .antInputNumberInputs { backgroundColor: #fff7db; } ` var groupB = css` .antInputNumberInput { backgroundColor: #eaf4ff; } ` var Styles = { rows: rows, parent: parent, form: form, dist: dist, spacer: spacer, groupA: groupA, groupB: groupB }; 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(undefined) let [kernelWidth, setKernelWidth] = useState(undefined) let [diagramStart, setDiagramStart] = useState(0) let [diagramStop, setDiagramStop] = useState(10) let [diagramCount, setDiagramCount] = useState(20) var demoDist = return (
{demoDist}
) } export default SquigglePlayground;