Rename imports to jsImports in components

This commit is contained in:
Sam Nolan 2022-04-29 20:58:06 +00:00
parent b710289096
commit 2131e4eac1
2 changed files with 9 additions and 9 deletions

View File

@ -154,7 +154,7 @@ export interface SquiggleChartProps {
/** Bindings of previous variables declared */ /** Bindings of previous variables declared */
bindings?: bindings; bindings?: bindings;
/** JS imported parameters */ /** JS imported parameters */
imports?: jsImports; jsImports?: jsImports;
} }
const ChartWrapper = styled.div` const ChartWrapper = styled.div`
@ -170,14 +170,14 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = ({
onChange = () => {}, onChange = () => {},
height = 60, height = 60,
bindings = defaultBindings, bindings = defaultBindings,
imports = defaultImports, jsImports = defaultImports,
width = NaN, width = NaN,
}: SquiggleChartProps) => { }: SquiggleChartProps) => {
let samplingInputs: samplingParams = { let samplingInputs: samplingParams = {
sampleCount: sampleCount, sampleCount: sampleCount,
xyPointLength: outputXYPoints, xyPointLength: outputXYPoints,
}; };
let expressionResult = run(squiggleString, bindings, samplingInputs, imports); let expressionResult = run(squiggleString, bindings, samplingInputs, jsImports);
let internal: JSX.Element; let internal: JSX.Element;
if (expressionResult.tag === "Ok") { if (expressionResult.tag === "Ok") {
let expression = expressionResult.value; let expression = expressionResult.value;

View File

@ -41,7 +41,7 @@ export interface SquiggleEditorProps {
/** Previous variable declarations */ /** Previous variable declarations */
bindings: bindings; bindings: bindings;
/** JS Imports */ /** JS Imports */
imports: jsImports; jsImports: jsImports;
} }
const Input = styled.div` const Input = styled.div`
@ -63,7 +63,7 @@ export let SquiggleEditor: React.FC<SquiggleEditorProps> = ({
onChange, onChange,
environment, environment,
bindings = defaultBindings, bindings = defaultBindings,
imports = defaultImports, jsImports = defaultImports,
}: SquiggleEditorProps) => { }: SquiggleEditorProps) => {
let [expression, setExpression] = React.useState(initialSquiggleString); let [expression, setExpression] = React.useState(initialSquiggleString);
return ( return (
@ -90,7 +90,7 @@ export let SquiggleEditor: React.FC<SquiggleEditorProps> = ({
environment={environment} environment={environment}
onChange={onChange} onChange={onChange}
bindings={bindings} bindings={bindings}
imports={imports} jsImports={jsImports}
/> />
</div> </div>
); );
@ -150,7 +150,7 @@ export interface SquigglePartialProps {
/** Previously declared variables */ /** Previously declared variables */
bindings?: bindings; bindings?: bindings;
/** Variables imported from js */ /** Variables imported from js */
imports?: jsImports; jsImports?: jsImports;
} }
export let SquigglePartial: React.FC<SquigglePartialProps> = ({ export let SquigglePartial: React.FC<SquigglePartialProps> = ({
@ -159,7 +159,7 @@ export let SquigglePartial: React.FC<SquigglePartialProps> = ({
bindings = defaultBindings, bindings = defaultBindings,
sampleCount = 1000, sampleCount = 1000,
outputXYPoints = 1000, outputXYPoints = 1000,
imports = defaultImports, jsImports = defaultImports,
}: SquigglePartialProps) => { }: SquigglePartialProps) => {
let samplingInputs: samplingParams = { let samplingInputs: samplingParams = {
sampleCount: sampleCount, sampleCount: sampleCount,
@ -170,7 +170,7 @@ export let SquigglePartial: React.FC<SquigglePartialProps> = ({
expression, expression,
bindings, bindings,
samplingInputs, samplingInputs,
imports jsImports
); );
if (squiggleResult.tag == "Ok") { if (squiggleResult.tag == "Ok") {
if (onChange) onChange(squiggleResult.value); if (onChange) onChange(squiggleResult.value);