2022-09-09 09:38:21 +00:00
|
|
|
import { DynamicSquiggleEditor as SquiggleEditor } from "../components/DynamicSquiggleEditor"
|
2022-08-01 07:43:16 +00:00
|
|
|
|
|
|
|
# Squiggle demonstration
|
|
|
|
|
|
|
|
We can enter in arbitrary, live squiggle code in the `defaultCode` argument of our `SquiggleEditor` component.
|
|
|
|
|
|
|
|
<SquiggleEditor defaultCode={`
|
|
|
|
x = 1 to 2
|
|
|
|
y = {a: x, b: 1e1}
|
|
|
|
f(t) = normal(t, 1.1)
|
|
|
|
z = y.b * y.a
|
|
|
|
f(z)`} />
|
|
|
|
|
|
|
|
We can also import assignments from files that live in `/public/estimates/` of the repo.
|
|
|
|
|
2022-09-09 09:38:21 +00:00
|
|
|
<SquiggleEditor
|
|
|
|
defaultCode={`
|
|
|
|
@import(estimates/baz.squiggle, baz)
|
|
|
|
baz.foo.bar(beta(1,2), baz.ski)`}
|
|
|
|
/>
|
2022-08-01 07:43:16 +00:00
|
|
|
|
|
|
|
Files you import for bindings have to consist only of assignments: they cannot end in an expression, unless that expression is a record.
|