squiggle/packages/components/src/stories/SquiggleEditor.stories.mdx

36 lines
714 B
Plaintext
Raw Normal View History

import { SquiggleEditor } from "../components/SquiggleEditor";
2022-03-30 10:39:32 +00:00
import { Canvas, Meta, Story, Props } from "@storybook/addon-docs";
<Meta title="Squiggle/SquiggleEditor" component={SquiggleEditor} />
export const Template = (props) => <SquiggleEditor {...props} />;
# Squiggle Editor
Squiggle Editor is a Squiggle chart with a text editor included for changing
the distribution.
<Canvas>
<Story
name="Normal"
args={{
squiggleString: "normal(5,2)",
2022-03-30 10:39:32 +00:00
}}
>
{Template.bind({})}
</Story>
</Canvas>
You can also name variables like so:
<Canvas>
<Story
name="Variables"
args={{
squiggleString: "x = 2\nnormal(x,2)",
}}
>
{Template.bind({})}
</Story>
</Canvas>