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

View File

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