Rename imports to jsImports in components
This commit is contained in:
parent
b710289096
commit
2131e4eac1
|
@ -154,7 +154,7 @@ export interface SquiggleChartProps {
|
|||
/** Bindings of previous variables declared */
|
||||
bindings?: bindings;
|
||||
/** JS imported parameters */
|
||||
imports?: jsImports;
|
||||
jsImports?: jsImports;
|
||||
}
|
||||
|
||||
const ChartWrapper = styled.div`
|
||||
|
@ -170,14 +170,14 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = ({
|
|||
onChange = () => {},
|
||||
height = 60,
|
||||
bindings = defaultBindings,
|
||||
imports = defaultImports,
|
||||
jsImports = defaultImports,
|
||||
width = NaN,
|
||||
}: SquiggleChartProps) => {
|
||||
let samplingInputs: samplingParams = {
|
||||
sampleCount: sampleCount,
|
||||
xyPointLength: outputXYPoints,
|
||||
};
|
||||
let expressionResult = run(squiggleString, bindings, samplingInputs, imports);
|
||||
let expressionResult = run(squiggleString, bindings, samplingInputs, jsImports);
|
||||
let internal: JSX.Element;
|
||||
if (expressionResult.tag === "Ok") {
|
||||
let expression = expressionResult.value;
|
||||
|
|
|
@ -41,7 +41,7 @@ export interface SquiggleEditorProps {
|
|||
/** Previous variable declarations */
|
||||
bindings: bindings;
|
||||
/** JS Imports */
|
||||
imports: jsImports;
|
||||
jsImports: jsImports;
|
||||
}
|
||||
|
||||
const Input = styled.div`
|
||||
|
@ -63,7 +63,7 @@ export let SquiggleEditor: React.FC<SquiggleEditorProps> = ({
|
|||
onChange,
|
||||
environment,
|
||||
bindings = defaultBindings,
|
||||
imports = defaultImports,
|
||||
jsImports = defaultImports,
|
||||
}: SquiggleEditorProps) => {
|
||||
let [expression, setExpression] = React.useState(initialSquiggleString);
|
||||
return (
|
||||
|
@ -90,7 +90,7 @@ export let SquiggleEditor: React.FC<SquiggleEditorProps> = ({
|
|||
environment={environment}
|
||||
onChange={onChange}
|
||||
bindings={bindings}
|
||||
imports={imports}
|
||||
jsImports={jsImports}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
@ -150,7 +150,7 @@ export interface SquigglePartialProps {
|
|||
/** Previously declared variables */
|
||||
bindings?: bindings;
|
||||
/** Variables imported from js */
|
||||
imports?: jsImports;
|
||||
jsImports?: jsImports;
|
||||
}
|
||||
|
||||
export let SquigglePartial: React.FC<SquigglePartialProps> = ({
|
||||
|
@ -159,7 +159,7 @@ export let SquigglePartial: React.FC<SquigglePartialProps> = ({
|
|||
bindings = defaultBindings,
|
||||
sampleCount = 1000,
|
||||
outputXYPoints = 1000,
|
||||
imports = defaultImports,
|
||||
jsImports = defaultImports,
|
||||
}: SquigglePartialProps) => {
|
||||
let samplingInputs: samplingParams = {
|
||||
sampleCount: sampleCount,
|
||||
|
@ -170,7 +170,7 @@ export let SquigglePartial: React.FC<SquigglePartialProps> = ({
|
|||
expression,
|
||||
bindings,
|
||||
samplingInputs,
|
||||
imports
|
||||
jsImports
|
||||
);
|
||||
if (squiggleResult.tag == "Ok") {
|
||||
if (onChange) onChange(squiggleResult.value);
|
||||
|
|
Loading…
Reference in New Issue
Block a user