Fix Squiggle components build

This commit is contained in:
Sam Nolan 2022-04-21 19:07:24 -04:00
parent cfb969f2b3
commit 9ea7d23489
2 changed files with 6 additions and 7 deletions

View File

@ -6,7 +6,7 @@ import {
errorValueToString,
squiggleExpression,
} from "@quri/squiggle-lang";
import type { samplingParams, exportEnv } from "@quri/squiggle-lang";
import type { samplingParams } from "@quri/squiggle-lang";
import { NumberShower } from "./NumberShower";
import { DistributionChart } from "./DistributionChart";
import { ErrorBox } from "./ErrorBox";
@ -129,9 +129,9 @@ export interface SquiggleChartProps {
/** If the result is a function, how many points along the function it samples */
diagramCount?: number;
/** variables declared before this expression */
environment?: exportEnv;
environment?: unknown;
/** When the environment changes */
onEnvChange?(env: exportEnv): void;
onEnvChange?(env: unknown): void;
/** CSS width of the element */
width?: number;
height?: number;
@ -155,7 +155,7 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = ({
sampleCount: sampleCount,
xyPointLength: outputXYPoints,
};
let expressionResult = run(squiggleString, samplingInputs, environment);
let expressionResult = run(squiggleString, samplingInputs);
let internal: JSX.Element;
if (expressionResult.tag === "Ok") {
onEnvChange(environment);

View File

@ -2,7 +2,6 @@ import * as React from "react";
import * as ReactDOM from "react-dom";
import { SquiggleChart } from "./SquiggleChart";
import { CodeEditor } from "./CodeEditor";
import type { exportEnv } from "@quri/squiggle-lang";
import styled from "styled-components";
export interface SquiggleEditorProps {
@ -21,9 +20,9 @@ export interface SquiggleEditorProps {
/** If the result is a function, how many points along the function it samples */
diagramCount?: number;
/** The environment, other variables that were already declared */
environment?: exportEnv;
environment?: unknown;
/** when the environment changes. Used again for notebook magic*/
onEnvChange?(env: exportEnv): void;
onEnvChange?(env: unknown): void;
/** The width of the element */
width: number;
}