remove showTypes setting

This commit is contained in:
Vyacheslav Matyukhin 2022-07-08 17:13:26 +04:00
parent a4684ddf39
commit 3ca80daee8
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C
7 changed files with 2 additions and 28 deletions

View File

@ -54,7 +54,6 @@ export function DynamicSquiggleChart({ squiggleString }) {
width={445}
height={200}
showSummary={true}
showTypes={true}
/>
);
}

View File

@ -36,8 +36,6 @@ export interface SquiggleChartProps {
jsImports?: jsImports;
/** Whether to show a summary of the distribution */
showSummary?: boolean;
/** Whether to show type information about returns, default false */
showTypes?: boolean;
/** Whether to show graph controls (scale etc)*/
showControls?: boolean;
/** Set the x scale to be logarithmic by deault */
@ -58,7 +56,6 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = React.memo(
jsImports = defaultImports,
showSummary = false,
width,
showTypes = false,
showControls = false,
logX = false,
expY = false,
@ -97,7 +94,6 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = React.memo(
width={width}
height={height}
distributionPlotSettings={distributionPlotSettings}
showTypes={showTypes}
chartSettings={chartSettings}
environment={environment ?? defaultEnvironment}
/>

View File

@ -106,8 +106,6 @@ export interface SquiggleItemProps {
width?: number;
height: number;
distributionPlotSettings: DistributionPlottingSettings;
/** Whether to show type information; deprecated */
showTypes?: boolean;
/** Settings for displaying functions */
chartSettings: FunctionChartSettings;
/** Environment for further function executions */
@ -120,7 +118,6 @@ export const SquiggleItem: React.FC<SquiggleItemProps> = ({
width,
height,
distributionPlotSettings,
showTypes = false,
chartSettings,
environment,
}) => {

View File

@ -32,8 +32,6 @@ interface PlaygroundProps {
defaultCode?: string;
/** How many pixels high is the playground */
height?: number;
/** Whether to show the types of outputs in the playground */
showTypes?: boolean;
/** Whether to show the log scale controls in the playground */
showControls?: boolean;
/** Whether to show the summary table in the playground */
@ -76,7 +74,6 @@ const schema = yup.object({}).shape({
.min(10)
.max(100)
.default(50),
showTypes: yup.boolean().required(),
showControls: yup.boolean().required(),
showSummary: yup.boolean().required(),
showEditor: yup.boolean().required(),
@ -181,11 +178,6 @@ const ViewSettings: React.FC<{ register: UseFormRegister<FormFields> }> = ({
register={register}
label="Chart Height (in pixels)"
/>
<Checkbox
name="showTypes"
register={register}
label="Show information about displayed types"
/>
</div>
</HeadedSection>
@ -380,7 +372,6 @@ const useRunnerState = (code: string) => {
export const SquigglePlayground: FC<PlaygroundProps> = ({
defaultCode = "",
height = 500,
showTypes = false,
showControls = false,
showSummary = false,
logX = false,
@ -404,7 +395,6 @@ export const SquigglePlayground: FC<PlaygroundProps> = ({
sampleCount: 1000,
xyPointLength: 1000,
chartHeight: 150,
showTypes,
showControls,
logX,
expY,
@ -444,7 +434,6 @@ export const SquigglePlayground: FC<PlaygroundProps> = ({
diagramStop={Number(vars.diagramStop)}
diagramCount={Number(vars.diagramCount)}
height={vars.chartHeight}
showTypes={vars.showTypes}
showControls={vars.showControls}
showSummary={vars.showSummary}
logX={vars.logX}

View File

@ -9,7 +9,6 @@
React.createElement(squiggle_components.SquigglePlayground, {
code: text,
showEditor: false,
showTypes: Boolean(showSettings.showTypes),
showControls: Boolean(showSettings.showControls),
showSummary: Boolean(showSettings.showSummary),
})

View File

@ -105,11 +105,6 @@
"configuration": {
"title": "Squiggle",
"properties": {
"squiggle.playground.showTypes": {
"type": "boolean",
"default": false,
"description": "Whether to show the types of outputs in the playground"
},
"squiggle.playground.showControls": {
"type": "boolean",
"default": false,

View File

@ -44,12 +44,11 @@ export default function PlaygroundPage() {
const playgroundProps = {
defaultCode: "normal(0,1)",
height: 700,
showTypes: true,
...hashData,
onCodeChange: (code) => setHashData({ initialSquiggleString: code }),
onSettingsChange: (settings) => {
const { showTypes, showControls, showSummary, showEditor } = settings;
setHashData({ showTypes, showControls, showSummary, showEditor });
const { showControls, showSummary, showEditor } = settings;
setHashData({ showControls, showSummary, showEditor });
},
};
return (