From 9cbeee04515c7f290a80ff39981c51d4ffbfef59 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Tue, 12 Jul 2022 17:09:24 +1000 Subject: [PATCH 01/46] Add multiple plotting --- .../src/components/DistributionChart.tsx | 76 +++++++++++++++--- .../src/components/SquiggleItem.tsx | 17 +++- .../src/lib/distributionSpecBuilder.ts | 79 +++++++++++++------ 3 files changed, 135 insertions(+), 37 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index af644d29..0b9535b2 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -4,6 +4,7 @@ import { result, distributionError, distributionErrorToString, + squiggleExpression, } from "@quri/squiggle-lang"; import { Vega } from "react-vega"; import { ErrorAlert } from "./Alert"; @@ -23,16 +24,58 @@ export type DistributionPlottingSettings = { showControls: boolean; } & DistributionChartSpecOptions; +export type Plot = { + distributions: Distribution[]; +}; + export type DistributionChartProps = { - distribution: Distribution; + plot: Plot; width?: number; height: number; actions?: boolean; } & DistributionPlottingSettings; +export function defaultPlot(distribution: Distribution): Plot { + return { distributions: [distribution] }; +} +export function makePlot(expression: { + [key: string]: squiggleExpression; +}): Plot | void { + if (expression["distributions"].tag === "array") { + let distributions: Distribution[] = expression["distributions"].value + .map((x) => { + if (x.tag === "distribution") { + return x.value; + } + }) + .filter((x): x is Distribution => x !== undefined); + return { distributions }; + } +} +function all(arr: boolean[]): boolean { + return arr.reduce((x, y) => x && y, true); +} + +function flattenResult(x: result[]): result { + if (x.length === 0) { + return { tag: "Ok", value: [] }; + } else { + if (x[0].tag === "Error") { + return x[0]; + } else { + let rest = flattenResult(x.splice(1)); + if (rest.tag === "Error") { + return rest; + } else { + return { tag: "Ok", value: [x[0].value].concat(rest.value) }; + } + } + } +} + export const DistributionChart: React.FC = (props) => { const { - distribution, + plot, height, showSummary, width, @@ -47,19 +90,23 @@ export const DistributionChart: React.FC = (props) => { React.useEffect(() => setLogX(logX), [logX]); React.useEffect(() => setExpY(expY), [expY]); - const shape = distribution.pointSet(); const [sized] = useSize((size) => { - if (shape.tag === "Error") { + let shapes = flattenResult(plot.distributions.map((x) => x.pointSet())); + if (shapes.tag === "Error") { return ( - {distributionErrorToString(shape.value)} + {distributionErrorToString(shapes.value)} ); } - const massBelow0 = - shape.value.continuous.some((x) => x.x <= 0) || - shape.value.discrete.some((x) => x.x <= 0); + const massBelow0 = all( + shapes.value.map( + (shape) => + shape.continuous.some((x) => x.x <= 0) || + shape.discrete.some((x) => x.x <= 0) + ) + ); const spec = buildVegaSpec(props); let widthProp = width ? width : size.width; @@ -69,13 +116,20 @@ export const DistributionChart: React.FC = (props) => { ); widthProp = 20; } + let continuousPoints = shapes.value.flatMap((shape, i) => + shape.continuous.map((point) => ({ ...point, name: i + 1 })) + ); + let discretePoints = shapes.value.flatMap((shape, i) => + shape.discrete.map((point) => ({ ...point, name: i + 1 })) + ); + console.log(continuousPoints); return (
{!(isLogX && massBelow0) ? ( = (props) => { )}
- {showSummary && } + {showSummary && plot.distributions.length == 1 && ( + + )}
{showControls && (
diff --git a/packages/components/src/components/SquiggleItem.tsx b/packages/components/src/components/SquiggleItem.tsx index 48a8a0fb..09b9fa27 100644 --- a/packages/components/src/components/SquiggleItem.tsx +++ b/packages/components/src/components/SquiggleItem.tsx @@ -8,6 +8,8 @@ import { NumberShower } from "./NumberShower"; import { DistributionChart, DistributionPlottingSettings, + makePlot, + defaultPlot, } from "./DistributionChart"; import { FunctionChart, FunctionChartSettings } from "./FunctionChart"; @@ -102,7 +104,7 @@ export const SquiggleItem: React.FC = ({
{expression.value.toString()}
) : null} = ({ ); case "record": + let plot = makePlot(expression.value); + if (plot) { + return ( + + ); + } return (
@@ -246,7 +259,7 @@ export const SquiggleItem: React.FC = ({
{Object.entries(expression.value) - .filter(([key, r]) => key !== "Math") + .filter(([key, _]) => key !== "Math") .map(([key, r]) => (
diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index 4286dbdb..515a1b9f 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -137,7 +137,21 @@ export function buildVegaSpec( }, ], signals: [], - scales: [xScale, expY ? expYScale : linearYScale], + scales: [ + xScale, + expY ? expYScale : linearYScale, + { + name: "color", + type: "ordinal", + domain: { + fields: [ + { data: "con", field: "name" }, + { data: "dis", field: "name" }, + ], + }, + range: { scheme: "category20b" }, + }, + ], axes: [ { orient: "bottom", @@ -153,33 +167,48 @@ export function buildVegaSpec( ], marks: [ { - type: "area", + name: "group", + type: "group", from: { - data: "con", - }, - encode: { - update: { - interpolate: { value: "linear" }, - x: { - scale: "xscale", - field: "x", - }, - y: { - scale: "yscale", - field: "y", - }, - y2: { - scale: "yscale", - value: 0, - }, - fill: { - value: color, - }, - fillOpacity: { - value: 1, - }, + facet: { + name: "faceted_path_main", + data: "con", + groupby: ["name"], }, }, + marks: [ + { + name: "distribution_charts", + type: "area", + from: { + data: "faceted_path_main", + }, + encode: { + update: { + interpolate: { value: "linear" }, + x: { + scale: "xscale", + field: "x", + }, + y: { + scale: "yscale", + field: "y", + }, + y2: { + scale: "yscale", + value: 0, + }, + fill: { + field: "name", + scale: "color", + }, + fillOpacity: { + value: 1, + }, + }, + }, + }, + ], }, { type: "rect", From 98ae0459c96765126e530918ab1e8494bc870fd1 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Wed, 13 Jul 2022 14:15:07 +1000 Subject: [PATCH 02/46] Refactor specification to include discrete --- .../src/components/DistributionChart.tsx | 48 +++- .../src/components/FunctionChart1Dist.tsx | 3 +- .../src/lib/distributionSpecBuilder.ts | 267 ++++++++---------- 3 files changed, 157 insertions(+), 161 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 0b9535b2..f1253629 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -5,6 +5,7 @@ import { distributionError, distributionErrorToString, squiggleExpression, + resultMap, } from "@quri/squiggle-lang"; import { Vega } from "react-vega"; import { ErrorAlert } from "./Alert"; @@ -24,8 +25,10 @@ export type DistributionPlottingSettings = { showControls: boolean; } & DistributionChartSpecOptions; +export type LabeledDistribution = { name: string; distribution: Distribution }; + export type Plot = { - distributions: Distribution[]; + distributions: LabeledDistribution[]; }; export type DistributionChartProps = { @@ -36,19 +39,29 @@ export type DistributionChartProps = { } & DistributionPlottingSettings; export function defaultPlot(distribution: Distribution): Plot { - return { distributions: [distribution] }; + return { distributions: [{ name: "default", distribution }] }; } + export function makePlot(expression: { [key: string]: squiggleExpression; }): Plot | void { if (expression["distributions"].tag === "array") { - let distributions: Distribution[] = expression["distributions"].value + let distributions: LabeledDistribution[] = expression["distributions"].value .map((x) => { - if (x.tag === "distribution") { - return x.value; + if ( + x.tag === "record" && + x.value["name"] && + x.value["name"].tag === "string" && + x.value["distribution"] && + x.value["distribution"].tag === "distribution" + ) { + return { + name: x.value["name"].value, + distribution: x.value["distribution"].value, + }; } }) - .filter((x): x is Distribution => x !== undefined); + .filter((x): x is LabeledDistribution => x !== undefined); return { distributions }; } } @@ -91,7 +104,15 @@ export const DistributionChart: React.FC = (props) => { React.useEffect(() => setExpY(expY), [expY]); const [sized] = useSize((size) => { - let shapes = flattenResult(plot.distributions.map((x) => x.pointSet())); + let shapes = flattenResult( + plot.distributions.map((x) => + resultMap(x.distribution.pointSet(), (shape) => ({ + name: x.name, + continuous: shape.continuous, + discrete: shape.discrete, + })) + ) + ); if (shapes.tag === "Error") { return ( @@ -116,20 +137,17 @@ export const DistributionChart: React.FC = (props) => { ); widthProp = 20; } - let continuousPoints = shapes.value.flatMap((shape, i) => - shape.continuous.map((point) => ({ ...point, name: i + 1 })) - ); - let discretePoints = shapes.value.flatMap((shape, i) => - shape.discrete.map((point) => ({ ...point, name: i + 1 })) + const domain = shapes.value.flatMap((shape) => + shape.discrete.concat(shape.continuous) ); + console.log(shapes.value); - console.log(continuousPoints); return (
{!(isLogX && massBelow0) ? ( = (props) => { )}
{showSummary && plot.distributions.length == 1 && ( - + )}
{showControls && ( diff --git a/packages/components/src/components/FunctionChart1Dist.tsx b/packages/components/src/components/FunctionChart1Dist.tsx index 650d2753..3b203de5 100644 --- a/packages/components/src/components/FunctionChart1Dist.tsx +++ b/packages/components/src/components/FunctionChart1Dist.tsx @@ -16,6 +16,7 @@ import * as percentilesSpec from "../vega-specs/spec-percentiles.json"; import { DistributionChart, DistributionPlottingSettings, + defaultPlot, } from "./DistributionChart"; import { NumberShower } from "./NumberShower"; import { ErrorAlert } from "./Alert"; @@ -177,7 +178,7 @@ export const FunctionChart1Dist: React.FC = ({ let showChart = mouseItem.tag === "Ok" && mouseItem.value.tag === "distribution" ? ( Date: Wed, 13 Jul 2022 15:29:39 +1000 Subject: [PATCH 03/46] Make parser of distributions stricter --- .../src/components/DistributionChart.tsx | 116 +++++++++++++++--- 1 file changed, 97 insertions(+), 19 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index f1253629..b8310609 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -42,27 +42,105 @@ export function defaultPlot(distribution: Distribution): Plot { return { distributions: [{ name: "default", distribution }] }; } -export function makePlot(expression: { +function error(err: b): result { + return { tag: "Error", value: err }; +} + +function ok(x: a): result { + return { tag: "Ok", value: x }; +} + +function parseString(expr: squiggleExpression): result { + if (expr.tag === "string") { + return ok(expr.value); + } else { + return error("Expression was not string"); + } +} + +function parseRecord( + expr: squiggleExpression +): result<{ [key: string]: squiggleExpression }, string> { + if (expr.tag === "record") { + return ok(expr.value); + } else { + return error("Expression was not a record"); + } +} + +function parseDistribution( + expr: squiggleExpression +): result { + if (expr.tag === "distribution") { + return ok(expr.value); + } else { + return error("Expression was not a distribution"); + } +} + +function parseArray( + expr: squiggleExpression +): result { + if (expr.tag === "array") { + return ok(expr.value); + } else { + return error("Expression was not a distribution"); + } +} + +function parseField( + record: { [key: string]: squiggleExpression }, + field: string, + parser: (expr: squiggleExpression) => result +): result { + if (record[field]) { + return parser(record[field]); + } else { + return error("record does not have field " + field); + } +} + +function resultBind( + x: result, + fn: (y: a) => result +): result { + if (x.tag === "Ok") { + return fn(x.value); + } else { + return x; + } +} + +function parseLabeledDistribution( + x: squiggleExpression +): result { + return resultBind(parseRecord(x), (record) => + resultBind(parseField(record, "name", parseString), (name) => + resultBind( + parseField(record, "distribution", parseDistribution), + (distribution) => ok({ name, distribution }) + ) + ) + ); +} + +function parsePlot(record: { + [key: string]: squiggleExpression; +}): result { + return resultBind(parseField(record, "distributions", parseArray), (array) => + resultBind( + flattenResult(array.map(parseLabeledDistribution)), + (distributions) => ok({ distributions }) + ) + ); +} + +export function makePlot(record: { [key: string]: squiggleExpression; }): Plot | void { - if (expression["distributions"].tag === "array") { - let distributions: LabeledDistribution[] = expression["distributions"].value - .map((x) => { - if ( - x.tag === "record" && - x.value["name"] && - x.value["name"].tag === "string" && - x.value["distribution"] && - x.value["distribution"].tag === "distribution" - ) { - return { - name: x.value["name"].value, - distribution: x.value["distribution"].value, - }; - } - }) - .filter((x): x is LabeledDistribution => x !== undefined); - return { distributions }; + const plotResult = parsePlot(record); + if (plotResult.tag == "Ok") { + return plotResult.value; } } function all(arr: boolean[]): boolean { From 0c7ac98aaf1e9055b434cc526ab87fd9a79441ce Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Wed, 13 Jul 2022 15:32:28 +1000 Subject: [PATCH 04/46] Color discrete components of distributions --- packages/components/src/lib/distributionSpecBuilder.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index 36f298d2..229e9ffe 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -213,6 +213,10 @@ export function buildVegaSpec( scale: "yscale", value: 0, }, + fill: { + scale: "color", + field: { parent: "name" }, + }, }, }, }, @@ -240,6 +244,10 @@ export function buildVegaSpec( scale: "yscale", field: "y", }, + fill: { + scale: "color", + field: { parent: "name" }, + }, }, }, }, From a5a131daf15766c50bde4df2802cdf05446a4893 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Wed, 13 Jul 2022 15:33:38 +1000 Subject: [PATCH 05/46] Remove console.log --- packages/components/src/components/DistributionChart.tsx | 1 - packages/components/src/components/SquigglePlayground.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index b8310609..6d4e7c55 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -218,7 +218,6 @@ export const DistributionChart: React.FC = (props) => { const domain = shapes.value.flatMap((shape) => shape.discrete.concat(shape.continuous) ); - console.log(shapes.value); return (
diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 534be721..d24ba141 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -529,7 +529,6 @@ export const SquigglePlayground: FC = ({ const withoutEditor =
{tabs}
; - console.log(vars); return ( From 9cc000070b4544e97873e077f6bd5d2350c554eb Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Wed, 13 Jul 2022 15:54:45 +1000 Subject: [PATCH 06/46] Refactor parsing to lib files --- .../src/components/DistributionChart.tsx | 121 +----------------- packages/components/src/lib/plotting.ts | 90 +++++++++++++ packages/components/src/lib/utility.ts | 33 +++++ 3 files changed, 125 insertions(+), 119 deletions(-) create mode 100644 packages/components/src/lib/plotting.ts create mode 100644 packages/components/src/lib/utility.ts diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 6d4e7c55..7556da26 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -17,6 +17,8 @@ import { DistributionChartSpecOptions, } from "../lib/distributionSpecBuilder"; import { NumberShower } from "./NumberShower"; +import { Plot, parsePlot } from "../lib/plotting"; +import { flattenResult, all } from "../lib/utility"; export type DistributionPlottingSettings = { /** Whether to show a summary of means, stdev, percentiles etc */ @@ -25,12 +27,6 @@ export type DistributionPlottingSettings = { showControls: boolean; } & DistributionChartSpecOptions; -export type LabeledDistribution = { name: string; distribution: Distribution }; - -export type Plot = { - distributions: LabeledDistribution[]; -}; - export type DistributionChartProps = { plot: Plot; width?: number; @@ -42,99 +38,6 @@ export function defaultPlot(distribution: Distribution): Plot { return { distributions: [{ name: "default", distribution }] }; } -function error(err: b): result { - return { tag: "Error", value: err }; -} - -function ok(x: a): result { - return { tag: "Ok", value: x }; -} - -function parseString(expr: squiggleExpression): result { - if (expr.tag === "string") { - return ok(expr.value); - } else { - return error("Expression was not string"); - } -} - -function parseRecord( - expr: squiggleExpression -): result<{ [key: string]: squiggleExpression }, string> { - if (expr.tag === "record") { - return ok(expr.value); - } else { - return error("Expression was not a record"); - } -} - -function parseDistribution( - expr: squiggleExpression -): result { - if (expr.tag === "distribution") { - return ok(expr.value); - } else { - return error("Expression was not a distribution"); - } -} - -function parseArray( - expr: squiggleExpression -): result { - if (expr.tag === "array") { - return ok(expr.value); - } else { - return error("Expression was not a distribution"); - } -} - -function parseField
( - record: { [key: string]: squiggleExpression }, - field: string, - parser: (expr: squiggleExpression) => result -): result { - if (record[field]) { - return parser(record[field]); - } else { - return error("record does not have field " + field); - } -} - -function resultBind( - x: result, - fn: (y: a) => result -): result { - if (x.tag === "Ok") { - return fn(x.value); - } else { - return x; - } -} - -function parseLabeledDistribution( - x: squiggleExpression -): result { - return resultBind(parseRecord(x), (record) => - resultBind(parseField(record, "name", parseString), (name) => - resultBind( - parseField(record, "distribution", parseDistribution), - (distribution) => ok({ name, distribution }) - ) - ) - ); -} - -function parsePlot(record: { - [key: string]: squiggleExpression; -}): result { - return resultBind(parseField(record, "distributions", parseArray), (array) => - resultBind( - flattenResult(array.map(parseLabeledDistribution)), - (distributions) => ok({ distributions }) - ) - ); -} - export function makePlot(record: { [key: string]: squiggleExpression; }): Plot | void { @@ -143,26 +46,6 @@ export function makePlot(record: { return plotResult.value; } } -function all(arr: boolean[]): boolean { - return arr.reduce((x, y) => x && y, true); -} - -function flattenResult(x: result[]): result { - if (x.length === 0) { - return { tag: "Ok", value: [] }; - } else { - if (x[0].tag === "Error") { - return x[0]; - } else { - let rest = flattenResult(x.splice(1)); - if (rest.tag === "Error") { - return rest; - } else { - return { tag: "Ok", value: [x[0].value].concat(rest.value) }; - } - } - } -} export const DistributionChart: React.FC = (props) => { const { diff --git a/packages/components/src/lib/plotting.ts b/packages/components/src/lib/plotting.ts new file mode 100644 index 00000000..5b7ca31d --- /dev/null +++ b/packages/components/src/lib/plotting.ts @@ -0,0 +1,90 @@ +import { Distribution, result, squiggleExpression } from "@quri/squiggle-lang"; +import { flattenResult, resultBind } from "./utility"; + +export type LabeledDistribution = { name: string; distribution: Distribution }; + +export type Plot = { + distributions: LabeledDistribution[]; +}; + +function error(err: b): result { + return { tag: "Error", value: err }; +} + +function ok(x: a): result { + return { tag: "Ok", value: x }; +} + +function parseString(expr: squiggleExpression): result { + if (expr.tag === "string") { + return ok(expr.value); + } else { + return error("Expression was not string"); + } +} + +function parseRecord( + expr: squiggleExpression +): result<{ [key: string]: squiggleExpression }, string> { + if (expr.tag === "record") { + return ok(expr.value); + } else { + return error("Expression was not a record"); + } +} + +function parseDistribution( + expr: squiggleExpression +): result { + if (expr.tag === "distribution") { + return ok(expr.value); + } else { + return error("Expression was not a distribution"); + } +} + +function parseArray( + expr: squiggleExpression +): result { + if (expr.tag === "array") { + return ok(expr.value); + } else { + return error("Expression was not a distribution"); + } +} + +function parseField( + record: { [key: string]: squiggleExpression }, + field: string, + parser: (expr: squiggleExpression) => result +): result { + if (record[field]) { + return parser(record[field]); + } else { + return error("record does not have field " + field); + } +} + +function parseLabeledDistribution( + x: squiggleExpression +): result { + return resultBind(parseRecord(x), (record) => + resultBind(parseField(record, "name", parseString), (name) => + resultBind( + parseField(record, "distribution", parseDistribution), + (distribution) => ok({ name, distribution }) + ) + ) + ); +} + +export function parsePlot(record: { + [key: string]: squiggleExpression; +}): result { + return resultBind(parseField(record, "distributions", parseArray), (array) => + resultBind( + flattenResult(array.map(parseLabeledDistribution)), + (distributions) => ok({ distributions }) + ) + ); +} diff --git a/packages/components/src/lib/utility.ts b/packages/components/src/lib/utility.ts new file mode 100644 index 00000000..4a5ecc6b --- /dev/null +++ b/packages/components/src/lib/utility.ts @@ -0,0 +1,33 @@ +import { result } from "@quri/squiggle-lang"; + +export function flattenResult(x: result[]): result { + if (x.length === 0) { + return { tag: "Ok", value: [] }; + } else { + if (x[0].tag === "Error") { + return x[0]; + } else { + let rest = flattenResult(x.splice(1)); + if (rest.tag === "Error") { + return rest; + } else { + return { tag: "Ok", value: [x[0].value].concat(rest.value) }; + } + } + } +} + +export function resultBind( + x: result, + fn: (y: a) => result +): result { + if (x.tag === "Ok") { + return fn(x.value); + } else { + return x; + } +} + +export function all(arr: boolean[]): boolean { + return arr.reduce((x, y) => x && y, true); +} From ad1d391f49d5ba34f11cfd41aadf06d746ea946c Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Thu, 14 Jul 2022 16:36:12 +1000 Subject: [PATCH 07/46] Rename plotting to plotParser --- packages/components/src/components/DistributionChart.tsx | 2 +- packages/components/src/lib/{plotting.ts => plotParser.ts} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/components/src/lib/{plotting.ts => plotParser.ts} (100%) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 7556da26..f3f84adf 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -17,7 +17,7 @@ import { DistributionChartSpecOptions, } from "../lib/distributionSpecBuilder"; import { NumberShower } from "./NumberShower"; -import { Plot, parsePlot } from "../lib/plotting"; +import { Plot, parsePlot } from "../lib/plotParser"; import { flattenResult, all } from "../lib/utility"; export type DistributionPlottingSettings = { diff --git a/packages/components/src/lib/plotting.ts b/packages/components/src/lib/plotParser.ts similarity index 100% rename from packages/components/src/lib/plotting.ts rename to packages/components/src/lib/plotParser.ts From fc88b065f583159c98832e7eb1bc8e3dacbe2d43 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 28 Jul 2022 13:42:27 +0200 Subject: [PATCH 08/46] remove unused test file --- .../Reducer_Category_Module_TypeChecker_test.res | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/squiggle-lang/__tests__/Reducer/Reducer_Category/Reducer_Category_Module_TypeChecker_test.res diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Category/Reducer_Category_Module_TypeChecker_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Category/Reducer_Category_Module_TypeChecker_test.res deleted file mode 100644 index b5351787..00000000 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Category/Reducer_Category_Module_TypeChecker_test.res +++ /dev/null @@ -1,4 +0,0 @@ -open Jest -open Expect - -test("todo", () => expect("1")->toBe("1")) From 673331940319978b2bcd3c9648a3a346f885c971 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 28 Jul 2022 21:27:46 +0200 Subject: [PATCH 09/46] switch replacement by type checking --- .../Reducer_Type_switch_replacement_test.res | 123 ++++++++++++++++++ .../Reducer_Dispatch_ChainPiece.res | 19 +++ .../Reducer_Dispatch/Reducer_Dispatch_T.res | 20 +++ .../Reducer_Type/Reducer_Type_Compile.res | 9 ++ .../Reducer_Type/Reducer_Type_TypeChecker.res | 7 + .../ReducerInterface_StdLib.res | 3 +- 6 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res create mode 100644 packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_ChainPiece.res create mode 100644 packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_T.res diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res new file mode 100644 index 00000000..a439bb3c --- /dev/null +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res @@ -0,0 +1,123 @@ +open Jest +open Expect + +module DispatchT = Reducer_Dispatch_T +module Expression = Reducer_Expression +module ExpressionT = Reducer_Expression_T +module TypeCompile = Reducer_Type_Compile +module TypeChecker = Reducer_Type_TypeChecker +open ReducerInterface_InternalExpressionValue + +type errorValue = Reducer_ErrorValue.errorValue + +// Let's build a function to replace switch statements +// In dispatchChainPiece, we execute an return the result of execution if there is a type match. +// Otherwise we return None so that the call chain can continue. +// So we want to build a function like +// dispatchChainPiece = (call: functionCall, environment): option> + +// Now lets make the dispatchChainPiece itself. +// Note that I am not passing the reducer to the dispatchChainPiece as an argument because it is in the context anyway. +// Keep in mind that reducerFn is necessary for map/reduce so dispatchChainPiece should have a reducerFn in context. + +let makeMyDispatchChainPiece = (reducer: ExpressionT.reducerFn): DispatchT.dispatchChainPiece => { + // Let's have a pure implementations + module Implementation = { + let stringConcat = (a: string, b: string): string => Js.String2.concat(a, b) + let arrayConcat = ( + a: Js.Array2.t, + b: Js.Array2.t, + ): Js.Array2.t => Js.Array2.concat(a, b) + let plot = _r => "yey, plotted" + } + + let extractStringString = args => + switch args { + | [IEvString(a), IEvString(b)] => (a, b) + | _ => raise(Reducer_Exception.ImpossibleException("extractStringString developer error")) + } + + let extractArrayArray = args => + switch args { + | [IEvArray(a), IEvArray(b)] => (a, b) + | _ => raise(Reducer_Exception.ImpossibleException("extractArrayArray developer error")) + } + + // Let's bridge the pure implementation to expression values + module Bridge = { + let stringConcat: DispatchT.genericIEvFunction = (args, _environment) => { + let (a, b) = extractStringString(args) + Implementation.stringConcat(a, b)->IEvString->Ok + } + let arrayConcat: DispatchT.genericIEvFunction = (args, _environment) => { + let (a, b) = extractArrayArray(args) + Implementation.arrayConcat(a, b)->IEvArray->Ok + } + let plot: DispatchT.genericIEvFunction = (args, _environment) => { + switch args { + // Just assume that we are doing the business of extracting and converting the deep record + | [IEvRecord(_)] => Implementation.plot({"title": "This is a plot"})->IEvString->Ok + | _ => raise(Reducer_Exception.ImpossibleException("plot developer error")) + } + } + } + + // concat functions are to illustrate polymoprhism. And the plot function is to illustrate complex types + let jumpTable = [ + ( + "concat", + TypeCompile.fromTypeExpressionExn("string=>string=>string", reducer), + Bridge.stringConcat, + ), + ( + "concat", + TypeCompile.fromTypeExpressionExn("[any]=>[any]=>[any]", reducer), + Bridge.arrayConcat, + ), + ( + "plot", + TypeCompile.fromTypeExpressionExn( + // Nested complex types are available + // records {property: type} + // arrays [type] + // tuples [type, type] + // <- type contracts are available naturally and they become part of dispatching + // Here we are not enumerating the possibilities because type checking has a dedicated test + "{title: string, line: {width: number, color: string}}=>string", + reducer, + ), + Bridge.plot, + ), + ] + + //Here we are creating a dispatchChainPiece function that will do the actual dispatch from the jumpTable + Reducer_Dispatch_ChainPiece.makeFromTypes(jumpTable) +} + +// And finally, let's write a library dispatch for our external library +// Exactly the same as the one used in real life +let _dispatch = ( + call: functionCall, + environment, + reducer: Reducer_Expression_T.reducerFn, + chain, +): result => { + let dispatchChainPiece = makeMyDispatchChainPiece(reducer) + dispatchChainPiece(call, environment)->E.O2.default(chain(call, environment, reducer)) +} + +// What is important about this implementation? +// A) Exactly the same function jump table can be used to create type guarded lambda functions +// Guarded lambda functions will be the basis of the next version of Squiggle +// B) Complicated recursive record types are not a problem. + +describe("Type Dispatch", () => { + let reducerFn = Expression.reduceExpression + let dispatchChainPiece = makeMyDispatchChainPiece(reducerFn) + test("stringConcat", () => { + let call: functionCall = ("concat", [IEvString("hello"), IEvString("world")]) + + let result = dispatchChainPiece(call, defaultEnvironment) + expect(result)->toEqual(Some(Ok(IEvString("helloworld")))) + }) +}) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_ChainPiece.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_ChainPiece.res new file mode 100644 index 00000000..6cebfef5 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_ChainPiece.res @@ -0,0 +1,19 @@ +module TypeChecker = Reducer_Type_TypeChecker +module T = Reducer_Dispatch_T +open ReducerInterface_InternalExpressionValue + +type errorValue = Reducer_ErrorValue.errorValue + +let makeFromTypes = jumpTable => { + let dispatchChainPiece: T.dispatchChainPiece = ((fnName, fnArgs): functionCall, environment) => { + let jumpTableEntry = jumpTable->Js.Array2.find(elem => { + let (candidName, candidType, _) = elem + candidName == fnName && TypeChecker.checkITypeArgumentsBool(candidType, fnArgs) + }) + switch jumpTableEntry { + | Some((_, _, bridgeFn)) => bridgeFn(fnArgs, environment)->Some + | _ => None + } + } + dispatchChainPiece +} diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_T.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_T.res new file mode 100644 index 00000000..f6234976 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_T.res @@ -0,0 +1,20 @@ +module InternalExpressionValue = ReducerInterface_InternalExpressionValue +module ExpressionT = Reducer_Expression_T + +// Each piece of the dispatch chain computes the result or returns None so that the chain can continue +type dispatchChainPiece = ( + InternalExpressionValue.functionCall, + InternalExpressionValue.environment, +) => option> + +type dispatchChainPieceWithReducer = ( + InternalExpressionValue.functionCall, + InternalExpressionValue.environment, + ExpressionT.reducerFn, +) => option> + +// This is a switch statement case implementation: get the arguments and compute the result +type genericIEvFunction = ( + array, + InternalExpressionValue.environment, +) => result diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res index 2119ee62..896f4a12 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_Compile.res @@ -38,3 +38,12 @@ let fromTypeExpression = ( (reducerFn: ExpressionT.reducerFn), )->Belt.Result.map(T.fromIEvValue) } + +let fromTypeExpressionExn = ( + typeExpressionSourceCode: string, + reducerFn: ExpressionT.reducerFn, +): T.t => + switch fromTypeExpression(typeExpressionSourceCode, reducerFn) { + | Ok(value) => value + | _ => `Cannot compile ${typeExpressionSourceCode}`->Reducer_Exception.ImpossibleException->raise + } diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res index e4336df5..fa118079 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res @@ -149,6 +149,13 @@ let checkITypeArguments = (anIType: T.iType, args: array): bool => { + switch checkITypeArguments(anIType, args) { + | Ok(_) => true + | _ => false + } +} + let checkArguments = ( typeExpressionSourceCode: string, args: array, diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res index 6c133332..ec6c4fd4 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_StdLib.res @@ -1,6 +1,7 @@ module Bindings = Reducer_Bindings -let internalStdLib = Bindings.emptyBindings->SquiggleLibrary_Math.makeBindings->SquiggleLibrary_Versions.makeBindings +let internalStdLib = + Bindings.emptyBindings->SquiggleLibrary_Math.makeBindings->SquiggleLibrary_Versions.makeBindings @genType let externalStdLib = internalStdLib->Bindings.toTypeScriptBindings From e1c53c90875ba9b2dd70fa99aeea323774ebd5b3 Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 28 Jul 2022 22:25:51 +0200 Subject: [PATCH 10/46] any type any will be depreciated after the implementation of binding type variables --- .../Reducer_Type/Reducer_Type_TypeChecker_test.res | 2 ++ .../Reducer_Type/Reducer_Type_TypeChecker.res | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res index efd9bb18..a3ee2712 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_TypeChecker_test.res @@ -68,3 +68,5 @@ myTypeCheckTest(test, "number | string", "1", "Ok") myTypeCheckTest(test, "date | string", "1", "Expected type: (date | string) but got: 1") myTypeCheckTest(test, "number<-min(10)", "10", "Ok") myTypeCheckTest(test, "number<-min(10)", "0", "Expected type: number<-min(10) but got: 0") +myTypeCheckTest(test, "any", "0", "Ok") +myTypeCheckTest(test, "any", "'a'", "Ok") diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res index fa118079..33cbbeca 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Type/Reducer_Type_TypeChecker.res @@ -7,10 +7,15 @@ open InternalExpressionValue let rec isITypeOf = (anIType: T.iType, aValue): result => { let caseTypeIdentifier = (anUpperTypeName, aValue) => { let aTypeName = anUpperTypeName->Js.String2.toLowerCase - let valueTypeName = aValue->valueToValueType->valueTypeToString->Js.String2.toLowerCase - switch aTypeName == valueTypeName { - | true => Ok(true) - | false => T.TypeMismatch(anIType, aValue)->Error + switch aTypeName { + | "any" => Ok(true) + | _ => { + let valueTypeName = aValue->valueToValueType->valueTypeToString->Js.String2.toLowerCase + switch aTypeName == valueTypeName { + | true => Ok(true) + | false => T.TypeMismatch(anIType, aValue)->Error + } + } } } From c6eb69628d67e77a04893b7c2c15f5e35b10925e Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Fri, 29 Jul 2022 05:53:47 +0200 Subject: [PATCH 11/46] merge issue 904 --- .../Reducer_Type/Reducer_Type_switch_replacement_test.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res index a439bb3c..16f0f118 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Type/Reducer_Type_switch_replacement_test.res @@ -103,7 +103,7 @@ let _dispatch = ( chain, ): result => { let dispatchChainPiece = makeMyDispatchChainPiece(reducer) - dispatchChainPiece(call, environment)->E.O2.default(chain(call, environment, reducer)) + dispatchChainPiece(call, environment)->E.O2.defaultFn(() => chain(call, environment, reducer)) } // What is important about this implementation? From 2aaa43008d0497cc65df19d4fe75865e16c77fcb Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 8 Aug 2022 10:31:05 -0700 Subject: [PATCH 12/46] Very simple implementation of pointset mapY --- .../FunctionRegistry/Library/FR_Pointset.res | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res index 4f4e1731..c0270e48 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -23,6 +23,31 @@ let inputsTodist = (inputs: array, makeDist) => { expressionValue } +module Internal = { + type t = PointSetDist.t + + let toType = (r): result< + ReducerInterface_InternalExpressionValue.t, + Reducer_ErrorValue.errorValue, + > => + switch r { + | Ok(r) => Ok(Wrappers.evDistribution(PointSet(r))) + | Error(err) => Error(REOperationError(err)) + } + + let doLambdaCall = (aLambdaValue, list, environment, reducer) => + switch Reducer_Expression_Lambda.doLambdaCall(aLambdaValue, list, environment, reducer) { + | Ok(IEvNumber(f)) => Ok(f) + | _ => Error(Operation.SampleMapNeedsNtoNFunction) + } + + let mapY = (pointSetDist: t, aLambdaValue, env, reducer) => { + let fn = r => doLambdaCall(aLambdaValue, list{IEvNumber(r)}, env, reducer) + let foo = PointSetDist.T.mapYResult(~fn, pointSetDist) + foo->toType + } +} + let library = [ Function.make( ~name="fromDist", @@ -53,6 +78,26 @@ let library = [ ], (), ), + Function.make( + ~name="mapY", + ~nameSpace, + ~requiresNamespace=true, + ~examples=[`PointSet.mapY(mx(normal(5,2)), {|x| x + 1})`], + ~output=ReducerInterface_InternalExpressionValue.EvtDistribution, + ~definitions=[ + FnDefinition.make( + ~name="mapY", + ~inputs=[FRTypeDist, FRTypeLambda], + ~run=(inputs, _, env, reducer) => + switch inputs { + | [IEvDistribution(PointSet(dist)), IEvLambda(lambda)] => Internal.mapY(dist, lambda, env, reducer)->E.R2.errMap(_ => "") + | _ => Error(impossibleError) + }, + (), + ), + ], + (), + ), Function.make( ~name="makeContinuous", ~nameSpace, From 63e2b1f8c94de8e03f25fcd4555fabf5715fef87 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 9 Aug 2022 11:55:49 -0700 Subject: [PATCH 13/46] Updated npm versions to 0.3.0 --- packages/components/package.json | 2 +- packages/squiggle-lang/package.json | 2 +- yarn.lock | 107 ++++++++++++++++++++++++++-- 3 files changed, 102 insertions(+), 9 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 0ffbed0a..05e4cd88 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@quri/squiggle-components", - "version": "0.2.24", + "version": "0.3.0", "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^1.0.0", diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index bdedfd6e..a94197f8 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -1,6 +1,6 @@ { "name": "@quri/squiggle-lang", - "version": "0.2.11", + "version": "0.3.0", "homepage": "https://squiggle-language.com", "license": "MIT", "scripts": { diff --git a/yarn.lock b/yarn.lock index 6accd635..05a625a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2188,11 +2188,23 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@floating-ui/core@^0.7.3": + version "0.7.3" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-0.7.3.tgz#d274116678ffae87f6b60e90f88cc4083eefab86" + integrity sha512-buc8BXHmG9l82+OQXOFU3Kr2XQx9ys01U/Q9HMIrZ300iLc8HLMgh7dcCqgYzAzf4BkoQvDcXf5Y+CuEZ5JBYg== + "@floating-ui/core@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.0.0.tgz#ec1d31f54c72dd0460276e2149e59bd13c0f01f6" integrity sha512-sm3nW0hHAxTv3gRDdCH8rNVQxijF+qPFo5gAeXCErRjKC7Qc28lIQ3R9Vd7Gw+KgwfA7RhRydDFuGeI0peGq7A== +"@floating-ui/dom@^0.5.3": + version "0.5.4" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-0.5.4.tgz#4eae73f78bcd4bd553ae2ade30e6f1f9c73fe3f1" + integrity sha512-419BMceRLq0RrmTSDxn8hf9R3VCJv2K9PUfugh5JyEFmdjzDo+e8U5EdR8nzKq8Yj1htzLm3b6eQEEam3/rrtg== + dependencies: + "@floating-ui/core" "^0.7.3" + "@floating-ui/dom@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.0.0.tgz#66923a56755b6cb7a5958ecf25fe293912672d65" @@ -2200,6 +2212,15 @@ dependencies: "@floating-ui/core" "^1.0.0" +"@floating-ui/react-dom-interactions@^0.6.6": + version "0.6.6" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.6.6.tgz#8542e8c4bcbee2cd0d512de676c6a493e0a2d168" + integrity sha512-qnao6UPjSZNHnXrF+u4/n92qVroQkx0Umlhy3Avk1oIebm/5ee6yvDm4xbHob0OjY7ya8WmUnV3rQlPwX3Atwg== + dependencies: + "@floating-ui/react-dom" "^0.7.2" + aria-hidden "^1.1.3" + use-isomorphic-layout-effect "^1.1.1" + "@floating-ui/react-dom-interactions@^0.9.1": version "0.9.1" resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.9.1.tgz#93f17ed89b664795251ce5a2f228c50fc8ada059" @@ -2208,6 +2229,14 @@ "@floating-ui/react-dom" "^1.0.0" aria-hidden "^1.1.3" +"@floating-ui/react-dom@^0.7.2": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-0.7.2.tgz#0bf4ceccb777a140fc535c87eb5d6241c8e89864" + integrity sha512-1T0sJcpHgX/u4I1OzIEhlcrvkUN8ln39nz7fMoE/2HDHrPiMFoOGR7++GYyfUmIQHkkrTinaeQsO3XWubjSvGg== + dependencies: + "@floating-ui/dom" "^0.5.3" + use-isomorphic-layout-effect "^1.1.1" + "@floating-ui/react-dom@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-1.0.0.tgz#e0975966694433f1f0abffeee5d8e6bb69b7d16e" @@ -2250,7 +2279,7 @@ resolved "https://registry.yarnpkg.com/@heroicons/react/-/react-1.0.6.tgz#35dd26987228b39ef2316db3b1245c42eb19e324" integrity sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ== -"@hookform/resolvers@^2.9.7": +"@hookform/resolvers@^2.9.6", "@hookform/resolvers@^2.9.7": version "2.9.7" resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.7.tgz#8b257ae67234ce0270e6b044c1a61fb98ec02b4b" integrity sha512-BloehX3MOLwuFEwT4yZnmolPjVmqyn8VsSuodLfazbCIqxBHsQ4qUZsi+bvNNCduRli1AGWFrkDLGD5QoNzsoA== @@ -2654,7 +2683,7 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@motionone/animation@^10.13.1": +"@motionone/animation@^10.12.0", "@motionone/animation@^10.13.1": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.13.2.tgz#174a55a3bac1b6fb314cc1c3627093dc790ae081" integrity sha512-YGWss58IR2X4lOjW89rv1Q+/Nq/QhfltaggI7i8sZTpKC1yUvM+XYDdvlRpWc6dk8LviMBrddBJAlLdbaqeRmw== @@ -2664,6 +2693,18 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" +"@motionone/dom@10.12.0": + version "10.12.0" + resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.12.0.tgz#ae30827fd53219efca4e1150a5ff2165c28351ed" + integrity sha512-UdPTtLMAktHiqV0atOczNYyDd/d8Cf5fFsd1tua03PqTwwCe/6lwhLSQ8a7TbnQ5SN0gm44N1slBfj+ORIhrqw== + dependencies: + "@motionone/animation" "^10.12.0" + "@motionone/generators" "^10.12.0" + "@motionone/types" "^10.12.0" + "@motionone/utils" "^10.12.0" + hey-listen "^1.0.8" + tslib "^2.3.1" + "@motionone/dom@10.13.1": version "10.13.1" resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.13.1.tgz#fc29ea5d12538f21b211b3168e502cfc07a24882" @@ -2684,7 +2725,7 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/generators@^10.13.1": +"@motionone/generators@^10.12.0", "@motionone/generators@^10.13.1": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.13.2.tgz#dd972195b899e7a556d65bd27fae2fd423055e10" integrity sha512-QMoXV1MXEEhR6D3dct/RMMS1FwJlAsW+kMPbFGzBA4NbweblgeYQCft9DcDAVpV9wIwD6qvlBG9u99sOXLfHiA== @@ -2693,12 +2734,12 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/types@^10.13.0", "@motionone/types@^10.13.2": +"@motionone/types@^10.12.0", "@motionone/types@^10.13.0", "@motionone/types@^10.13.2": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.13.2.tgz#c560090d81bd0149e7451aae23ab7af458570363" integrity sha512-yYV4q5v5F0iADhab4wHfqaRJnM/eVtQLjUPhyEcS72aUz/xyOzi09GzD/Gu+K506BDfqn5eULIilUI77QNaqhw== -"@motionone/utils@^10.13.1", "@motionone/utils@^10.13.2": +"@motionone/utils@^10.12.0", "@motionone/utils@^10.13.1", "@motionone/utils@^10.13.2": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.13.2.tgz#ce79bfe1d133493c217cdc0584960434e065648d" integrity sha512-6Lw5bDA/w7lrPmT/jYWQ76lkHlHs9fl2NZpJ22cVy1kKDdEH+Cl1U6hMTpdphO6VQktQ6v2APngag91WBKLqlA== @@ -2777,6 +2818,44 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== +"@quri/squiggle-components@^0.2.23": + version "0.2.24" + resolved "https://registry.yarnpkg.com/@quri/squiggle-components/-/squiggle-components-0.2.24.tgz#16a2d72fb16f46a0bf71388c85d1238927676923" + integrity sha512-slBGryELfCsM6WX+AwQcqiPPoImLRHNyXZDueL7a+OKEAx09w3pKOqVzLWNGL7+dJe3dF8as9X/Gv1JbbIj5yw== + dependencies: + "@floating-ui/react-dom" "^0.7.2" + "@floating-ui/react-dom-interactions" "^0.6.6" + "@headlessui/react" "^1.6.6" + "@heroicons/react" "^1.0.6" + "@hookform/resolvers" "^2.9.6" + "@quri/squiggle-lang" "^0.2.8" + "@react-hook/size" "^2.1.2" + clsx "^1.2.1" + framer-motion "^6.5.1" + lodash "^4.17.21" + react "^18.1.0" + react-ace "^10.1.0" + react-hook-form "^7.33.1" + react-use "^17.4.0" + react-vega "^7.6.0" + vega "^5.22.1" + vega-embed "^6.21.0" + vega-lite "^5.3.0" + vscode-uri "^3.0.3" + yup "^0.32.11" + +"@quri/squiggle-lang@^0.2.11", "@quri/squiggle-lang@^0.2.8": + version "0.2.12" + resolved "https://registry.yarnpkg.com/@quri/squiggle-lang/-/squiggle-lang-0.2.12.tgz#e8fdb22a84aa75df71c071d1ed4ae5c55f15d447" + integrity sha512-fgv9DLvPlX/TqPSacKSW3GZ5S9H/YwqaMoRdFrn5SJjHnnMh/xJW/9iyzzgOxPCXov9xFeDvL159tkbStMm7vw== + dependencies: + "@rescript/std" "^9.1.4" + "@stdlib/stats" "^0.0.13" + jstat "^1.9.5" + lodash "^4.17.21" + mathjs "^11.0.1" + pdfast "^0.2.0" + "@react-hook/latest@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/@react-hook/latest/-/latest-1.0.3.tgz#c2d1d0b0af8b69ec6e2b3a2412ba0768ac82db80" @@ -9608,6 +9687,20 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" +framer-motion@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-6.5.1.tgz#802448a16a6eb764124bf36d8cbdfa6dd6b931a7" + integrity sha512-o1BGqqposwi7cgDrtg0dNONhkmPsUFDaLcKXigzuTFC5x58mE8iyTazxSudFzmT6MEyJKfjjU8ItoMe3W+3fiw== + dependencies: + "@motionone/dom" "10.12.0" + framesync "6.0.1" + hey-listen "^1.0.8" + popmotion "11.0.3" + style-value-types "5.0.0" + tslib "^2.1.0" + optionalDependencies: + "@emotion/is-prop-valid" "^0.8.2" + framer-motion@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.0.0.tgz#5fb580d0fe5a2a3ec055d2b7b5b57313a96683b7" @@ -15021,7 +15114,7 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.34.0: +react-hook-form@^7.33.1, react-hook-form@^7.34.0: version "7.34.0" resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.0.tgz#22883b5e014e5c5e35f3061d0e3862153b0df2ec" integrity sha512-s0/TJ09NVlEk2JPp3yit1WnMuPNBXFmUKEQPulgDi9pYBw/ZmmAFHe6AXWq73Y+kp8ye4OcMf0Jv+i/qLPektg== @@ -18092,7 +18185,7 @@ vega-label@~1.2.0: vega-scenegraph "^4.9.2" vega-util "^1.15.2" -vega-lite@^5.4.0: +vega-lite@^5.3.0, vega-lite@^5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.4.0.tgz#d09331e2a1c87843d5865de0fa7704919796ab56" integrity sha512-e/P5iOtBE62WEWZhKP7sLcBd92YS9prfUQafelxoOeloooSSrkUwM/ZDmN5Q5ffByEZTiKfODtnwD6/xKDYUmw== From 80e17be903428b519051a9592e616d20acd41ad2 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 9 Aug 2022 13:53:29 -0700 Subject: [PATCH 14/46] Updated Squiggle components package --- packages/components/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 05e4cd88..370befea 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@quri/squiggle-components", - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^1.0.0", @@ -8,7 +8,7 @@ "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", "@hookform/resolvers": "^2.9.7", - "@quri/squiggle-lang": "^0.2.8", + "@quri/squiggle-lang": "^0.3.0", "@react-hook/size": "^2.1.2", "clsx": "^1.2.1", "framer-motion": "^7.0.0", From c288fd58c36a342a3198134ce7027f7cb05096b9 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 9 Aug 2022 13:57:45 -0700 Subject: [PATCH 15/46] versions correction (manual) --- .release-please-manifest.json | 6 +++--- packages/website/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 60a035fb..1f1ac6f3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,7 +1,7 @@ { "packages/cli": "0.0.3", - "packages/components": "0.2.24", - "packages/squiggle-lang": "0.2.11", + "packages/components": "0.3.1", + "packages/squiggle-lang": "0.3.0", "packages/vscode-ext": "0.3.1", - "packages/website": "0.2.1" + "packages/website": "0.3.0" } diff --git a/packages/website/package.json b/packages/website/package.json index 9f21ad98..7bd1f80c 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "squiggle-website", - "version": "0.2.1", + "version": "0.3.0", "private": true, "license": "MIT", "scripts": { From 4aab78b45cd98dce56e5e38de7a48086869aaaa9 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Thu, 11 Aug 2022 12:31:44 +0100 Subject: [PATCH 16/46] Format code --- packages/components/src/components/DistributionChart.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 741e8f6a..50715229 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -46,14 +46,7 @@ export function makePlot(record: { } export const DistributionChart: React.FC = (props) => { - const { - plot, - height, - showSummary, - width, - logX, - actions = false, - } = props; + const { plot, height, showSummary, width, logX, actions = false } = props; const shape = distribution.pointSet(); const [sized] = useSize((size) => { let shapes = flattenResult( From c97d1d457ef69d49c1639b50af98036c8940962a Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Thu, 11 Aug 2022 14:22:55 +0100 Subject: [PATCH 17/46] Remove unneccesary line --- packages/components/src/components/DistributionChart.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 50715229..12f52754 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -47,7 +47,6 @@ export function makePlot(record: { export const DistributionChart: React.FC = (props) => { const { plot, height, showSummary, width, logX, actions = false } = props; - const shape = distribution.pointSet(); const [sized] = useSize((size) => { let shapes = flattenResult( plot.distributions.map((x) => From 70f26a08ba66734aa9f23da6ca81e64ca792a46b Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Sat, 13 Aug 2022 10:52:56 +0100 Subject: [PATCH 18/46] Fix multiple charting --- .../src/components/DistributionChart.tsx | 2 +- .../SquiggleViewer/ExpressionViewer.tsx | 75 ++++++++++++++----- packages/components/src/lib/utility.ts | 4 + 3 files changed, 61 insertions(+), 20 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 12f52754..84bc5fef 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -80,7 +80,7 @@ export const DistributionChart: React.FC = (props) => { return (
- {logX && hasMassBelowZero(shape.value) ? ( + {logX && shapes.value.some(hasMassBelowZero) ? ( Cannot graph distribution with negative values on logarithmic scale. diff --git a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx index 9a3e266e..51f8dcb4 100644 --- a/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx +++ b/packages/components/src/components/SquiggleViewer/ExpressionViewer.tsx @@ -1,7 +1,7 @@ import React from "react"; import { squiggleExpression, declaration } from "@quri/squiggle-lang"; import { NumberShower } from "../NumberShower"; -import { DistributionChart } from "../DistributionChart"; +import { DistributionChart, defaultPlot, makePlot } from "../DistributionChart"; import { FunctionChart, FunctionChartSettings } from "../FunctionChart"; import clsx from "clsx"; import { VariableBox } from "./VariableBox"; @@ -102,7 +102,7 @@ export const ExpressionViewer: React.FC = ({ {(settings) => { return ( = ({ case "module": { return ( - {(settings) => + {(_) => Object.entries(expression.value) - .filter(([key, r]) => !key.match(/^(Math|System)\./)) + .filter(([key, _]) => !key.match(/^(Math|System)\./)) .map(([key, r]) => ( = ({ ); } case "record": - return ( - - {(settings) => - Object.entries(expression.value).map(([key, r]) => ( - - )) - } - - ); + const plot = makePlot(expression.value); + if (plot) { + return ( + { + let disableLogX = plot.distributions.some((x) => { + let pointSet = x.distribution.pointSet(); + return ( + pointSet.tag === "Ok" && hasMassBelowZero(pointSet.value) + ); + }); + return ( + + ); + }} + > + {(settings) => { + return ( + + ); + }} + + ); + } else { + return ( + + {(_) => + Object.entries(expression.value).map(([key, r]) => ( + + )) + } + + ); + } case "array": return ( - {(settings) => + {(_) => expression.value.map((r, i) => ( ( export function all(arr: boolean[]): boolean { return arr.reduce((x, y) => x && y, true); } + +export function some(arr: boolean[]): boolean { + return arr.reduce((x, y) => x || y, false); +} From b55bd592191e3f47445997bc103b9f6af17650a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:39:20 +0000 Subject: [PATCH 19/46] :arrow_up: Bump @floating-ui/react-dom-interactions from 0.9.1 to 0.9.2 Bumps [@floating-ui/react-dom-interactions](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/react-dom-interactions) from 0.9.1 to 0.9.2. - [Release notes](https://github.com/floating-ui/floating-ui/releases) - [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/react-dom-interactions@0.9.2/packages/react-dom-interactions) --- updated-dependencies: - dependency-name: "@floating-ui/react-dom-interactions" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 370befea..10d70bc0 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -4,7 +4,7 @@ "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^1.0.0", - "@floating-ui/react-dom-interactions": "^0.9.1", + "@floating-ui/react-dom-interactions": "^0.9.2", "@headlessui/react": "^1.6.6", "@heroicons/react": "^1.0.6", "@hookform/resolvers": "^2.9.7", diff --git a/yarn.lock b/yarn.lock index 05a625a3..1e6e67a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2221,10 +2221,10 @@ aria-hidden "^1.1.3" use-isomorphic-layout-effect "^1.1.1" -"@floating-ui/react-dom-interactions@^0.9.1": - version "0.9.1" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.9.1.tgz#93f17ed89b664795251ce5a2f228c50fc8ada059" - integrity sha512-LNWB7FvGn/mI4Gw4DKbt/VblEhQOe3LUljBwp6BayFC2hEe+vhUMq2ExPFwMkgpKpoZVQPRYU8ejCKffBY5UMQ== +"@floating-ui/react-dom-interactions@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.9.2.tgz#9a364cc44ecbc242b5218dff0e0d071de115e13a" + integrity sha512-1I0urs4jlGuo4FRukvjtMmdUwxqvgwtTlESEPVwEvFGHXVh1PKkKaPZJ0Dcp9B8DQt4ewQEbwJxsoker2pDYTQ== dependencies: "@floating-ui/react-dom" "^1.0.0" aria-hidden "^1.1.3" From 5e16c2f76eb02e8d7f9a5bf2729588a4f93f078b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:40:22 +0000 Subject: [PATCH 20/46] :arrow_up: Bump react-hook-form from 7.34.0 to 7.34.1 Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.34.0 to 7.34.1. - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.34.0...v7.34.1) --- updated-dependencies: - dependency-name: react-hook-form dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 370befea..7fe083e9 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -15,7 +15,7 @@ "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", - "react-hook-form": "^7.34.0", + "react-hook-form": "^7.34.1", "react-use": "^17.4.0", "react-vega": "^7.6.0", "vega": "^5.22.1", diff --git a/yarn.lock b/yarn.lock index 05a625a3..06fe74fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15114,10 +15114,10 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.33.1, react-hook-form@^7.34.0: - version "7.34.0" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.0.tgz#22883b5e014e5c5e35f3061d0e3862153b0df2ec" - integrity sha512-s0/TJ09NVlEk2JPp3yit1WnMuPNBXFmUKEQPulgDi9pYBw/ZmmAFHe6AXWq73Y+kp8ye4OcMf0Jv+i/qLPektg== +react-hook-form@^7.33.1, react-hook-form@^7.34.1: + version "7.34.1" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.1.tgz#06cb216daf706bf9ae4969747115afae0d09410d" + integrity sha512-tH7TaZgAURMhjzVE2M/EFmxHz2HdaPMAVs9FXTweNW551VlhXSuVcpcYlkiMZf2zHQiTztupVFpBHJFTma+N7w== react-inspector@^5.1.0: version "5.1.1" From 1d9d24e08c3e8906a19144caa4f83b59ebe6372f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:41:28 +0000 Subject: [PATCH 21/46] :arrow_up: Bump framer-motion from 7.0.0 to 7.1.1 Bumps [framer-motion](https://github.com/framer/motion) from 7.0.0 to 7.1.1. - [Release notes](https://github.com/framer/motion/releases) - [Changelog](https://github.com/framer/motion/blob/main/CHANGELOG.md) - [Commits](https://github.com/framer/motion/compare/v7.0.0...v7.1.1) --- updated-dependencies: - dependency-name: framer-motion dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 53 +++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 370befea..f385864d 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -11,7 +11,7 @@ "@quri/squiggle-lang": "^0.3.0", "@react-hook/size": "^2.1.2", "clsx": "^1.2.1", - "framer-motion": "^7.0.0", + "framer-motion": "^7.1.1", "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", diff --git a/yarn.lock b/yarn.lock index 05a625a3..5801d936 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9701,17 +9701,17 @@ framer-motion@^6.5.1: optionalDependencies: "@emotion/is-prop-valid" "^0.8.2" -framer-motion@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.0.0.tgz#5fb580d0fe5a2a3ec055d2b7b5b57313a96683b7" - integrity sha512-mOUKle6LouYVP4KLz+cMiNI6fL3qP9hQY4PBaN3E1FyPhcvuAgvs/JPgYktvK5zdRbIRU0gpBsr0CW5hP2KzKA== +framer-motion@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.1.1.tgz#4d56ed18a7cf2c6a1a4a1af5b57714f8e6b52d9e" + integrity sha512-ONFaG7as1GBBYYIqzX8ENVsfa4eh6f7/nSc3QCADAHOaCt1Lh3UdWbQ0+HVGOOORvEW2L99GlCr4wQc0GLddXg== dependencies: "@motionone/dom" "10.13.1" - framesync "6.0.1" + framesync "6.1.2" hey-listen "^1.0.8" - popmotion "11.0.3" - style-value-types "5.1.0" - tslib "^2.1.0" + popmotion "11.0.5" + style-value-types "5.1.2" + tslib "2.4.0" optionalDependencies: "@emotion/is-prop-valid" "^0.8.2" @@ -9722,6 +9722,13 @@ framesync@6.0.1: dependencies: tslib "^2.1.0" +framesync@6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.1.2.tgz#755eff2fb5b8f3b4d2b266dd18121b300aefea27" + integrity sha512-jBTqhX6KaQVDyus8muwZbBeGGP0XgujBRbQ7gM7BRdS3CadCZIHiawyzYLnafYcvZIh5j8WE7cxZKFn7dXhu9g== + dependencies: + tslib "2.4.0" + fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" @@ -13932,6 +13939,16 @@ popmotion@11.0.3: style-value-types "5.0.0" tslib "^2.1.0" +popmotion@11.0.5: + version "11.0.5" + resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.5.tgz#8e3e014421a0ffa30ecd722564fd2558954e1f7d" + integrity sha512-la8gPM1WYeFznb/JqF4GiTkRRPZsfaj2+kCxqQgr2MJylMmIKUwBfWW8Wa5fml/8gmtlD5yI01MP1QCZPWmppA== + dependencies: + framesync "6.1.2" + hey-listen "^1.0.8" + style-value-types "5.1.2" + tslib "2.4.0" + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" @@ -16929,13 +16946,13 @@ style-value-types@5.0.0: hey-listen "^1.0.8" tslib "^2.1.0" -style-value-types@5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.1.0.tgz#228b02bd9418c57db46c1f450b85577e634a877f" - integrity sha512-DRIfBtjxQ4ztBZpexkFcI+UR7pODC5qLMf2Syt+bH98PAHHRH2tQnzxBuDQlqcAoYar6GzWnj8iAfqfwnEzCiQ== +style-value-types@5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.1.2.tgz#6be66b237bd546048a764883528072ed95713b62" + integrity sha512-Vs9fNreYF9j6W2VvuDTP7kepALi7sk0xtk2Tu8Yxi9UoajJdEVpNpCov0HsLTqXvNGKX+Uv09pkozVITi1jf3Q== dependencies: hey-listen "^1.0.8" - tslib "^2.3.1" + tslib "2.4.0" stylehacks@^5.1.0: version "5.1.0" @@ -17498,16 +17515,16 @@ tsconfig-paths@^4.0.0: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.4.0, tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0, tslib@~2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + tslib@^1.0.0, tslib@^1.8.1: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0, tslib@~2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== - tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" From a1e79422a9d179631c10c9523d3243b0780761a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:43:38 +0000 Subject: [PATCH 22/46] :arrow_up: Bump webpack-dev-server from 4.9.3 to 4.10.0 Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.9.3 to 4.10.0. - [Release notes](https://github.com/webpack/webpack-dev-server/releases) - [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.9.3...v4.10.0) --- updated-dependencies: - dependency-name: webpack-dev-server dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 370befea..7759d781 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -58,7 +58,7 @@ "web-vitals": "^2.1.4", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", - "webpack-dev-server": "^4.9.3" + "webpack-dev-server": "^4.10.0" }, "peerDependencies": { "react": "^16.8.0 || ^17 || ^18", diff --git a/yarn.lock b/yarn.lock index 05a625a3..47239aa8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18676,10 +18676,10 @@ webpack-dev-middleware@^5.3.1: range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@^4.6.0, webpack-dev-server@^4.9.3: - version "4.9.3" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.9.3.tgz#2360a5d6d532acb5410a668417ad549ee3b8a3c9" - integrity sha512-3qp/eoboZG5/6QgiZ3llN8TUzkSpYg1Ko9khWX1h40MIEUNS2mDoIa8aXsPfskER+GbTvs/IJZ1QTBBhhuetSw== +webpack-dev-server@^4.10.0, webpack-dev-server@^4.6.0, webpack-dev-server@^4.9.3: + version "4.10.0" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.10.0.tgz#de270d0009eba050546912be90116e7fd740a9ca" + integrity sha512-7dezwAs+k6yXVFZ+MaL8VnE+APobiO3zvpp3rBHe/HmWQ+avwh0Q3d0xxacOiBybZZ3syTZw9HXzpa3YNbAZDQ== dependencies: "@types/bonjour" "^3.5.9" "@types/connect-history-api-fallback" "^1.3.5" From e7bae5fcb53828c1b8664fba3d2b607069714677 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:44:23 +0000 Subject: [PATCH 23/46] :arrow_up: Bump @types/node from 18.6.4 to 18.7.4 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.6.4 to 18.7.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 370befea..e0b366c6 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -39,7 +39,7 @@ "@testing-library/user-event": "^14.4.2", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", - "@types/node": "^18.6.4", + "@types/node": "^18.7.4", "@types/react": "^18.0.9", "@types/styled-components": "^5.1.24", "@types/webpack": "^5.28.0", diff --git a/yarn.lock b/yarn.lock index 05a625a3..8322ebdd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4793,10 +4793,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@18.x", "@types/node@^18.6.4": - version "18.6.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.4.tgz#fd26723a8a3f8f46729812a7f9b4fc2d1608ed39" - integrity sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg== +"@types/node@*", "@types/node@18.x", "@types/node@^18.7.4": + version "18.7.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.4.tgz#95baa50846ae112a7376869d49fec23b2506c69d" + integrity sha512-RzRcw8c0B8LzryWOR4Wj7YOTFXvdYKwvrb6xQQyuDfnlTxwYXGCV5RZ/TEbq5L5kn+w3rliHAUyRcG1RtbmTFg== "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0": version "16.11.41" From 00c6ea7d3e62d7393f6d206b01dc04232caafce5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:44:53 +0000 Subject: [PATCH 24/46] :arrow_up: Bump eslint from 8.21.0 to 8.22.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.21.0 to 8.22.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.21.0...v8.22.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/vscode-ext/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index b4e00587..efce7a88 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -131,7 +131,7 @@ "@types/vscode": "^1.70.0", "@typescript-eslint/eslint-plugin": "^5.32.0", "@typescript-eslint/parser": "^5.32.0", - "eslint": "^8.21.0", + "eslint": "^8.22.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", "typescript": "^4.7.4", diff --git a/yarn.lock b/yarn.lock index 05a625a3..73c07d6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9032,10 +9032,10 @@ eslint-webpack-plugin@^3.1.1: normalize-path "^3.0.0" schema-utils "^3.1.1" -eslint@^8.21.0, eslint@^8.3.0: - version "8.21.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.21.0.tgz#1940a68d7e0573cef6f50037addee295ff9be9ef" - integrity sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA== +eslint@^8.22.0, eslint@^8.3.0: + version "8.22.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.22.0.tgz#78fcb044196dfa7eef30a9d65944f6f980402c48" + integrity sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA== dependencies: "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.10.4" From 39b37960dde3dc5803fc4a884c521f964f35366e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:45:23 +0000 Subject: [PATCH 25/46] :arrow_up: Bump @testing-library/user-event from 14.4.2 to 14.4.3 Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 14.4.2 to 14.4.3. - [Release notes](https://github.com/testing-library/user-event/releases) - [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md) - [Commits](https://github.com/testing-library/user-event/compare/v14.4.2...v14.4.3) --- updated-dependencies: - dependency-name: "@testing-library/user-event" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 370befea..0605696e 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -36,7 +36,7 @@ "@storybook/react": "^6.5.10", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.3.0", - "@testing-library/user-event": "^14.4.2", + "@testing-library/user-event": "^14.4.3", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.182", "@types/node": "^18.6.4", diff --git a/yarn.lock b/yarn.lock index 05a625a3..68d796af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4485,10 +4485,10 @@ "@testing-library/dom" "^8.5.0" "@types/react-dom" "^18.0.0" -"@testing-library/user-event@^14.4.2": - version "14.4.2" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.4.2.tgz#d3fb5d24e2d7d019a7d2e9978a8deb90b0aa230b" - integrity sha512-1gVTWtueNimveOjcm2ApFCnCTeky7WqY3EX31/GRKLWyCd+HfH+Gd2l1J8go9FpDNe+0Mx8X4zbQHTg0WWNJwg== +"@testing-library/user-event@^14.4.3": + version "14.4.3" + resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.4.3.tgz#af975e367743fa91989cd666666aec31a8f50591" + integrity sha512-kCUc5MEwaEMakkO5x7aoD+DLi02ehmEM2QCGWvNqAS1dV/fAvORWEjnjsEIvml59M7Y5kCkWN6fCCyPOe8OL6Q== "@tootallnate/once@1": version "1.1.2" From bef4dc91f272b614462aa51affc53761dafc709c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 15:00:01 +0000 Subject: [PATCH 26/46] :arrow_up: Bump @typescript-eslint/parser from 5.32.0 to 5.33.0 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.32.0 to 5.33.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.33.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/vscode-ext/package.json | 2 +- yarn.lock | 48 +++++++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index efce7a88..106fec41 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -130,7 +130,7 @@ "@types/node": "18.x", "@types/vscode": "^1.70.0", "@typescript-eslint/eslint-plugin": "^5.32.0", - "@typescript-eslint/parser": "^5.32.0", + "@typescript-eslint/parser": "^5.33.0", "eslint": "^8.22.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index 3d43b8b0..14437cd8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5094,14 +5094,14 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@^5.32.0", "@typescript-eslint/parser@^5.5.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.32.0.tgz#1de243443bc6186fb153b9e395b842e46877ca5d" - integrity sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A== +"@typescript-eslint/parser@^5.33.0", "@typescript-eslint/parser@^5.5.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.0.tgz#26ec3235b74f0667414613727cb98f9b69dc5383" + integrity sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w== dependencies: - "@typescript-eslint/scope-manager" "5.32.0" - "@typescript-eslint/types" "5.32.0" - "@typescript-eslint/typescript-estree" "5.32.0" + "@typescript-eslint/scope-manager" "5.33.0" + "@typescript-eslint/types" "5.33.0" + "@typescript-eslint/typescript-estree" "5.33.0" debug "^4.3.4" "@typescript-eslint/scope-manager@5.29.0": @@ -5120,6 +5120,14 @@ "@typescript-eslint/types" "5.32.0" "@typescript-eslint/visitor-keys" "5.32.0" +"@typescript-eslint/scope-manager@5.33.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz#509d7fa540a2c58f66bdcfcf278a3fa79002e18d" + integrity sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw== + dependencies: + "@typescript-eslint/types" "5.33.0" + "@typescript-eslint/visitor-keys" "5.33.0" + "@typescript-eslint/type-utils@5.32.0": version "5.32.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz#45a14506fe3fb908600b4cef2f70778f7b5cdc79" @@ -5139,6 +5147,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.32.0.tgz#484273021eeeae87ddb288f39586ef5efeb6dcd8" integrity sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ== +"@typescript-eslint/types@5.33.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.0.tgz#d41c584831805554b063791338b0220b613a275b" + integrity sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw== + "@typescript-eslint/typescript-estree@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz#e83d19aa7fd2e74616aab2f25dfbe4de4f0b5577" @@ -5165,6 +5178,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.33.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz#02d9c9ade6f4897c09e3508c27de53ad6bfa54cf" + integrity sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ== + dependencies: + "@typescript-eslint/types" "5.33.0" + "@typescript-eslint/visitor-keys" "5.33.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + "@typescript-eslint/utils@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.29.0.tgz#775046effd5019667bd086bcf326acbe32cd0082" @@ -5205,6 +5231,14 @@ "@typescript-eslint/types" "5.32.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.33.0": + version "5.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz#fbcbb074e460c11046e067bc3384b5d66b555484" + integrity sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw== + dependencies: + "@typescript-eslint/types" "5.33.0" + eslint-visitor-keys "^3.3.0" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" From 7c92808c67ecf2cafc835f946867ee2462f11515 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 15:01:43 +0000 Subject: [PATCH 27/46] :arrow_up: Bump @types/styled-components from 5.1.25 to 5.1.26 Bumps [@types/styled-components](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/styled-components) from 5.1.25 to 5.1.26. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/styled-components) --- updated-dependencies: - dependency-name: "@types/styled-components" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 810713d4..a82a3718 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -41,7 +41,7 @@ "@types/lodash": "^4.14.182", "@types/node": "^18.7.4", "@types/react": "^18.0.9", - "@types/styled-components": "^5.1.24", + "@types/styled-components": "^5.1.26", "@types/webpack": "^5.28.0", "cross-env": "^7.0.3", "mini-css-extract-plugin": "^2.6.1", diff --git a/yarn.lock b/yarn.lock index 3d43b8b0..d253ac28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4961,10 +4961,10 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== -"@types/styled-components@^5.1.24": - version "5.1.25" - resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-5.1.25.tgz#0177c4ab5fa7c6ed0565d36f597393dae3f380ad" - integrity sha512-fgwl+0Pa8pdkwXRoVPP9JbqF0Ivo9llnmsm+7TCI330kbPIFd9qv1Lrhr37shf4tnxCOSu+/IgqM7uJXLWZZNQ== +"@types/styled-components@^5.1.26": + version "5.1.26" + resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-5.1.26.tgz#5627e6812ee96d755028a98dae61d28e57c233af" + integrity sha512-KuKJ9Z6xb93uJiIyxo/+ksS7yLjS1KzG6iv5i78dhVg/X3u5t1H7juRWqVmodIdz6wGVaIApo1u01kmFRdJHVw== dependencies: "@types/hoist-non-react-statics" "*" "@types/react" "*" From 6bed1cb7de0888faa7893dfbc918f467c720bf2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Aug 2022 17:54:58 +0000 Subject: [PATCH 28/46] :arrow_up: Bump @typescript-eslint/eslint-plugin from 5.32.0 to 5.33.1 Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.32.0 to 5.33.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.33.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/vscode-ext/package.json | 2 +- yarn.lock | 106 +++++++++++++++---------------- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 106fec41..331861ff 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -129,7 +129,7 @@ "@types/glob": "^7.2.0", "@types/node": "18.x", "@types/vscode": "^1.70.0", - "@typescript-eslint/eslint-plugin": "^5.32.0", + "@typescript-eslint/eslint-plugin": "^5.33.1", "@typescript-eslint/parser": "^5.33.0", "eslint": "^8.22.0", "glob": "^8.0.3", diff --git a/yarn.lock b/yarn.lock index a5c3fe2b..79d240a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5072,14 +5072,14 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.32.0", "@typescript-eslint/eslint-plugin@^5.5.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.32.0.tgz#e27e38cffa4a61226327c874a7be965e9a861624" - integrity sha512-CHLuz5Uz7bHP2WgVlvoZGhf0BvFakBJKAD/43Ty0emn4wXWv5k01ND0C0fHcl/Im8Td2y/7h44E9pca9qAu2ew== +"@typescript-eslint/eslint-plugin@^5.33.1", "@typescript-eslint/eslint-plugin@^5.5.0": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.1.tgz#c0a480d05211660221eda963cc844732fe9b1714" + integrity sha512-S1iZIxrTvKkU3+m63YUOxYPKaP+yWDQrdhxTglVDVEVBf+aCSw85+BmJnyUaQQsk5TXFG/LpBu9fa+LrAQ91fQ== dependencies: - "@typescript-eslint/scope-manager" "5.32.0" - "@typescript-eslint/type-utils" "5.32.0" - "@typescript-eslint/utils" "5.32.0" + "@typescript-eslint/scope-manager" "5.33.1" + "@typescript-eslint/type-utils" "5.33.1" + "@typescript-eslint/utils" "5.33.1" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -5112,14 +5112,6 @@ "@typescript-eslint/types" "5.29.0" "@typescript-eslint/visitor-keys" "5.29.0" -"@typescript-eslint/scope-manager@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.32.0.tgz#763386e963a8def470580cc36cf9228864190b95" - integrity sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg== - dependencies: - "@typescript-eslint/types" "5.32.0" - "@typescript-eslint/visitor-keys" "5.32.0" - "@typescript-eslint/scope-manager@5.33.0": version "5.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz#509d7fa540a2c58f66bdcfcf278a3fa79002e18d" @@ -5128,12 +5120,20 @@ "@typescript-eslint/types" "5.33.0" "@typescript-eslint/visitor-keys" "5.33.0" -"@typescript-eslint/type-utils@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz#45a14506fe3fb908600b4cef2f70778f7b5cdc79" - integrity sha512-0gSsIhFDduBz3QcHJIp3qRCvVYbqzHg8D6bHFsDMrm0rURYDj+skBK2zmYebdCp+4nrd9VWd13egvhYFJj/wZg== +"@typescript-eslint/scope-manager@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.1.tgz#8d31553e1b874210018ca069b3d192c6d23bc493" + integrity sha512-8ibcZSqy4c5m69QpzJn8XQq9NnqAToC8OdH/W6IXPXv83vRyEDPYLdjAlUx8h/rbusq6MkW4YdQzURGOqsn3CA== dependencies: - "@typescript-eslint/utils" "5.32.0" + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/visitor-keys" "5.33.1" + +"@typescript-eslint/type-utils@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.33.1.tgz#1a14e94650a0ae39f6e3b77478baff002cec4367" + integrity sha512-X3pGsJsD8OiqhNa5fim41YtlnyiWMF/eKsEZGsHID2HcDqeSC5yr/uLOeph8rNF2/utwuI0IQoAK3fpoxcLl2g== + dependencies: + "@typescript-eslint/utils" "5.33.1" debug "^4.3.4" tsutils "^3.21.0" @@ -5142,16 +5142,16 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/types@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.32.0.tgz#484273021eeeae87ddb288f39586ef5efeb6dcd8" - integrity sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ== - "@typescript-eslint/types@5.33.0": version "5.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.0.tgz#d41c584831805554b063791338b0220b613a275b" integrity sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw== +"@typescript-eslint/types@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.1.tgz#3faef41793d527a519e19ab2747c12d6f3741ff7" + integrity sha512-7K6MoQPQh6WVEkMrMW5QOA5FO+BOwzHSNd0j3+BlBwd6vtzfZceJ8xJ7Um2XDi/O3umS8/qDX6jdy2i7CijkwQ== + "@typescript-eslint/typescript-estree@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.29.0.tgz#e83d19aa7fd2e74616aab2f25dfbe4de4f0b5577" @@ -5165,19 +5165,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.32.0.tgz#282943f34babf07a4afa7b0ff347a8e7b6030d12" - integrity sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg== - dependencies: - "@typescript-eslint/types" "5.32.0" - "@typescript-eslint/visitor-keys" "5.32.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.33.0": version "5.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz#02d9c9ade6f4897c09e3508c27de53ad6bfa54cf" @@ -5191,6 +5178,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz#a573bd360790afdcba80844e962d8b2031984f34" + integrity sha512-JOAzJ4pJ+tHzA2pgsWQi4804XisPHOtbvwUyqsuuq8+y5B5GMZs7lI1xDWs6V2d7gE/Ez5bTGojSK12+IIPtXA== + dependencies: + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/visitor-keys" "5.33.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + "@typescript-eslint/utils@5.29.0": version "5.29.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.29.0.tgz#775046effd5019667bd086bcf326acbe32cd0082" @@ -5203,15 +5203,15 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/utils@5.32.0", "@typescript-eslint/utils@^5.13.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.32.0.tgz#eccb6b672b94516f1afc6508d05173c45924840c" - integrity sha512-W7lYIAI5Zlc5K082dGR27Fczjb3Q57ECcXefKU/f0ajM5ToM0P+N9NmJWip8GmGu/g6QISNT+K6KYB+iSHjXCQ== +"@typescript-eslint/utils@5.33.1", "@typescript-eslint/utils@^5.13.0": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.33.1.tgz#171725f924fe1fe82bb776522bb85bc034e88575" + integrity sha512-uphZjkMaZ4fE8CR4dU7BquOV6u0doeQAr8n6cQenl/poMaIyJtBu8eys5uk6u5HiDH01Mj5lzbJ5SfeDz7oqMQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.32.0" - "@typescript-eslint/types" "5.32.0" - "@typescript-eslint/typescript-estree" "5.32.0" + "@typescript-eslint/scope-manager" "5.33.1" + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/typescript-estree" "5.33.1" eslint-scope "^5.1.1" eslint-utils "^3.0.0" @@ -5223,14 +5223,6 @@ "@typescript-eslint/types" "5.29.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@5.32.0": - version "5.32.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.32.0.tgz#b9715d0b11fdb5dd10fd0c42ff13987470525394" - integrity sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g== - dependencies: - "@typescript-eslint/types" "5.32.0" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.33.0": version "5.33.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz#fbcbb074e460c11046e067bc3384b5d66b555484" @@ -5239,6 +5231,14 @@ "@typescript-eslint/types" "5.33.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.33.1": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.1.tgz#0155c7571c8cd08956580b880aea327d5c34a18b" + integrity sha512-nwIxOK8Z2MPWltLKMLOEZwmfBZReqUdbEoHQXeCpa+sRVARe5twpJGHCB4dk9903Yaf0nMAlGbQfaAH92F60eg== + dependencies: + "@typescript-eslint/types" "5.33.1" + eslint-visitor-keys "^3.3.0" + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" From 127fbe50a287f8a89559a5ca34e65941418b619a Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Thu, 18 Aug 2022 15:13:23 -0700 Subject: [PATCH 29/46] docs site: algolia search --- packages/website/docusaurus.config.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index f48ac952..3949e98b 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -52,6 +52,29 @@ const config = { themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ + algolia: { + // The application ID provided by Algolia + appId: "NEUN2KAR5K", + + // Public API key: it is safe to commit it + apiKey: "1f5c74a2d72799add24eb7682531a1b0", + + indexName: "squiggle_docs", + + // Optional: see doc section below + contextualSearch: true, + + // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them. + // externalUrlRegex: 'external\\.com|domain\\.com', + + // Optional: Algolia search parameters + searchParameters: {}, + + // Optional: path for search page that enabled by default (`false` to disable it) + searchPagePath: "search", + + //... other Algolia params + }, navbar: { title: "Squiggle", hideOnScroll: true, From 61051ffe5fe0f3d9cf16303c9bfb261eaf2869b1 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 29 Jul 2022 18:10:57 +0400 Subject: [PATCH 30/46] multiple plots story --- .../src/stories/SquiggleChart.stories.mdx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/components/src/stories/SquiggleChart.stories.mdx b/packages/components/src/stories/SquiggleChart.stories.mdx index bc289c36..14a3f1fe 100644 --- a/packages/components/src/stories/SquiggleChart.stories.mdx +++ b/packages/components/src/stories/SquiggleChart.stories.mdx @@ -93,6 +93,20 @@ could be continuous, discrete or mixed. +## Multiple plots + + + + {Template.bind({})} + + + ## Constants A constant is a simple number as a result. This has special formatting rules From 7866203ac49c5b07da356b1b27487ad313884688 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 19 Aug 2022 15:17:31 +0400 Subject: [PATCH 31/46] reimplement parsePlot with yup --- packages/components/src/lib/plotParser.ts | 109 ++++++++-------------- 1 file changed, 40 insertions(+), 69 deletions(-) diff --git a/packages/components/src/lib/plotParser.ts b/packages/components/src/lib/plotParser.ts index 5b7ca31d..033ac2a3 100644 --- a/packages/components/src/lib/plotParser.ts +++ b/packages/components/src/lib/plotParser.ts @@ -1,5 +1,5 @@ +import * as yup from "yup"; import { Distribution, result, squiggleExpression } from "@quri/squiggle-lang"; -import { flattenResult, resultBind } from "./utility"; export type LabeledDistribution = { name: string; distribution: Distribution }; @@ -15,76 +15,47 @@ function ok(x: a): result { return { tag: "Ok", value: x }; } -function parseString(expr: squiggleExpression): result { - if (expr.tag === "string") { - return ok(expr.value); - } else { - return error("Expression was not string"); - } -} - -function parseRecord( - expr: squiggleExpression -): result<{ [key: string]: squiggleExpression }, string> { - if (expr.tag === "record") { - return ok(expr.value); - } else { - return error("Expression was not a record"); - } -} - -function parseDistribution( - expr: squiggleExpression -): result { - if (expr.tag === "distribution") { - return ok(expr.value); - } else { - return error("Expression was not a distribution"); - } -} - -function parseArray( - expr: squiggleExpression -): result { - if (expr.tag === "array") { - return ok(expr.value); - } else { - return error("Expression was not a distribution"); - } -} - -function parseField( - record: { [key: string]: squiggleExpression }, - field: string, - parser: (expr: squiggleExpression) => result -): result { - if (record[field]) { - return parser(record[field]); - } else { - return error("record does not have field " + field); - } -} - -function parseLabeledDistribution( - x: squiggleExpression -): result { - return resultBind(parseRecord(x), (record) => - resultBind(parseField(record, "name", parseString), (name) => - resultBind( - parseField(record, "distribution", parseDistribution), - (distribution) => ok({ name, distribution }) - ) - ) - ); -} +const schema = yup + .object() + .strict() + .noUnknown() + .shape({ + distributions: yup.object().shape({ + tag: yup.mixed().oneOf(["array"]), + value: yup + .array() + .of( + yup.object().shape({ + tag: yup.mixed().oneOf(["record"]), + value: yup.object().shape({ + name: yup.object().shape({ + tag: yup.mixed().oneOf(["string"]), + value: yup.string().required(), + }), + distribution: yup.object().shape({ + tag: yup.mixed().oneOf(["distribution"]), + value: yup.mixed(), + }), + }), + }) + ) + .required(), + }), + }); export function parsePlot(record: { [key: string]: squiggleExpression; }): result { - return resultBind(parseField(record, "distributions", parseArray), (array) => - resultBind( - flattenResult(array.map(parseLabeledDistribution)), - (distributions) => ok({ distributions }) - ) - ); + try { + const plotRecord = schema.validateSync(record); + return ok({ + distributions: plotRecord.distributions.value.map((x) => ({ + name: x.value.name.value, + distribution: x.value.distribution.value, + })), + }); + } catch (e) { + const message = e instanceof Error ? e.message : "Unknown error"; + return error(message); + } } From fc29a7211ee3bccbd8c25a40f9d75ace34514caf Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 19 Aug 2022 15:17:41 +0400 Subject: [PATCH 32/46] minor improvements --- packages/components/src/components/DistributionChart.tsx | 2 +- packages/components/src/lib/distributionSpecBuilder.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index 84bc5fef..a09e8b69 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -40,7 +40,7 @@ export function makePlot(record: { [key: string]: squiggleExpression; }): Plot | void { const plotResult = parsePlot(record); - if (plotResult.tag == "Ok") { + if (plotResult.tag === "Ok") { return plotResult.value; } } diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index a0af7f0c..a6aaf915 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -83,7 +83,7 @@ export function buildVegaSpec( let spec: VisualizationSpec = { $schema: "https://vega.github.io/schema/vega/v5.json", - description: "A basic area chart example", + description: "Squiggle plot chart", width: 500, height: 100, padding: 5, From bf02f69acaa6a4dbea6806e5df2ba3f4d13318fd Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 19 Aug 2022 21:14:08 +0400 Subject: [PATCH 33/46] legends, blues colors scheme, remove color setting --- .../src/components/DistributionChart.tsx | 5 ++- .../src/components/SquigglePlayground.tsx | 7 +--- .../SquiggleViewer/ItemSettingsMenu.tsx | 7 +--- .../src/components/ViewSettings.tsx | 12 +----- .../src/lib/distributionSpecBuilder.ts | 42 ++++++++++++++----- packages/components/src/lib/plotParser.ts | 17 ++++++-- .../src/stories/SquiggleChart.stories.mdx | 15 ++++++- 7 files changed, 65 insertions(+), 40 deletions(-) diff --git a/packages/components/src/components/DistributionChart.tsx b/packages/components/src/components/DistributionChart.tsx index a09e8b69..79536e12 100644 --- a/packages/components/src/components/DistributionChart.tsx +++ b/packages/components/src/components/DistributionChart.tsx @@ -17,7 +17,7 @@ import { } from "../lib/distributionSpecBuilder"; import { NumberShower } from "./NumberShower"; import { Plot, parsePlot } from "../lib/plotParser"; -import { flattenResult, all } from "../lib/utility"; +import { flattenResult } from "../lib/utility"; import { hasMassBelowZero } from "../lib/distributionUtils"; export type DistributionPlottingSettings = { @@ -52,6 +52,7 @@ export const DistributionChart: React.FC = (props) => { plot.distributions.map((x) => resultMap(x.distribution.pointSet(), (shape) => ({ name: x.name, + // color: x.color, // not supported yet continuous: shape.continuous, discrete: shape.discrete, })) @@ -94,7 +95,7 @@ export const DistributionChart: React.FC = (props) => { /> )}
- {showSummary && plot.distributions.length == 1 && ( + {showSummary && plot.distributions.length === 1 && ( )}
diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 626fc354..c3e38b1a 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -37,10 +37,7 @@ import { InputItem } from "./ui/InputItem"; import { Text } from "./ui/Text"; import { ViewSettings, viewSettingsSchema } from "./ViewSettings"; import { HeadedSection } from "./ui/HeadedSection"; -import { - defaultColor, - defaultTickFormat, -} from "../lib/distributionSpecBuilder"; +import { defaultTickFormat } from "../lib/distributionSpecBuilder"; import { Button } from "./ui/Button"; type PlaygroundProps = SquiggleChartProps & { @@ -240,7 +237,6 @@ export const SquigglePlayground: FC = ({ title, minX, maxX, - color = defaultColor, tickFormat = defaultTickFormat, distributionChartActions, code: controlledCode, @@ -268,7 +264,6 @@ export const SquigglePlayground: FC = ({ title, minX, maxX, - color, tickFormat, distributionChartActions, showSummary, diff --git a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx index 2c26b9aa..49c2eacc 100644 --- a/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx +++ b/packages/components/src/components/SquiggleViewer/ItemSettingsMenu.tsx @@ -6,10 +6,7 @@ import { Modal } from "../ui/Modal"; import { ViewSettings, viewSettingsSchema } from "../ViewSettings"; import { Path, pathAsString } from "./utils"; import { ViewerContext } from "./ViewerContext"; -import { - defaultColor, - defaultTickFormat, -} from "../../lib/distributionSpecBuilder"; +import { defaultTickFormat } from "../../lib/distributionSpecBuilder"; import { PlaygroundContext } from "../SquigglePlayground"; type Props = { @@ -46,7 +43,6 @@ const ItemSettingsModal: React.FC< tickFormat: mergedSettings.distributionPlotSettings.format || defaultTickFormat, title: mergedSettings.distributionPlotSettings.title, - color: mergedSettings.distributionPlotSettings.color || defaultColor, minX: mergedSettings.distributionPlotSettings.minX, maxX: mergedSettings.distributionPlotSettings.maxX, distributionChartActions: mergedSettings.distributionPlotSettings.actions, @@ -66,7 +62,6 @@ const ItemSettingsModal: React.FC< expY: vars.expY, format: vars.tickFormat, title: vars.title, - color: vars.color, minX: vars.minX, maxX: vars.maxX, actions: vars.distributionChartActions, diff --git a/packages/components/src/components/ViewSettings.tsx b/packages/components/src/components/ViewSettings.tsx index 9a2ce562..7d70bfc8 100644 --- a/packages/components/src/components/ViewSettings.tsx +++ b/packages/components/src/components/ViewSettings.tsx @@ -5,10 +5,7 @@ import { InputItem } from "./ui/InputItem"; import { Checkbox } from "./ui/Checkbox"; import { HeadedSection } from "./ui/HeadedSection"; import { Text } from "./ui/Text"; -import { - defaultColor, - defaultTickFormat, -} from "../lib/distributionSpecBuilder"; +import { defaultTickFormat } from "../lib/distributionSpecBuilder"; export const viewSettingsSchema = yup.object({}).shape({ chartHeight: yup.number().required().positive().integer().default(350), @@ -18,7 +15,6 @@ export const viewSettingsSchema = yup.object({}).shape({ expY: yup.boolean().required(), tickFormat: yup.string().default(defaultTickFormat), title: yup.string(), - color: yup.string().default(defaultColor).required(), minX: yup.number(), maxX: yup.number(), distributionChartActions: yup.boolean(), @@ -114,12 +110,6 @@ export const ViewSettings: React.FC<{ register={register} label="Tick Format" /> -
diff --git a/packages/components/src/lib/distributionSpecBuilder.ts b/packages/components/src/lib/distributionSpecBuilder.ts index a6aaf915..2b3ac952 100644 --- a/packages/components/src/lib/distributionSpecBuilder.ts +++ b/packages/components/src/lib/distributionSpecBuilder.ts @@ -10,8 +10,6 @@ export type DistributionChartSpecOptions = { minX?: number; /** The maximum x coordinate shown on the chart */ maxX?: number; - /** The color of the chart */ - color?: string; /** The title of the chart */ title?: string; /** The formatting of the ticks */ @@ -57,14 +55,12 @@ export let expYScale: PowScale = { }; export const defaultTickFormat = ".9~s"; -export const defaultColor = "#739ECC"; export function buildVegaSpec( specOptions: DistributionChartSpecOptions ): VisualizationSpec { const { format = defaultTickFormat, - color = defaultColor, title, minX, maxX, @@ -106,7 +102,7 @@ export function buildVegaSpec( data: "data", field: "name", }, - range: { scheme: "category10" }, + range: { scheme: "blues" }, }, ], axes: [ @@ -120,6 +116,7 @@ export function buildVegaSpec( domainOpacity: 0.0, format: format, tickCount: 10, + labelOverlap: "greedy", }, ], marks: [ @@ -259,15 +256,38 @@ export function buildVegaSpec( ], }, ], - }; - if (title) { - spec = { - ...spec, + legends: [ + { + fill: "color", + orient: "top", + labelFontSize: 12, + encode: { + symbols: { + update: { + fill: [ + { test: "length(domain('color')) == 1", value: "transparent" }, + { scale: "color", field: "value" }, + ], + }, + }, + labels: { + interactive: true, + update: { + fill: [ + { test: "length(domain('color')) == 1", value: "transparent" }, + { value: "black" }, + ], + }, + }, + }, + }, + ], + ...(title && { title: { text: title, }, - }; - } + }), + }; return spec; } diff --git a/packages/components/src/lib/plotParser.ts b/packages/components/src/lib/plotParser.ts index 033ac2a3..9d5e224a 100644 --- a/packages/components/src/lib/plotParser.ts +++ b/packages/components/src/lib/plotParser.ts @@ -1,7 +1,11 @@ import * as yup from "yup"; import { Distribution, result, squiggleExpression } from "@quri/squiggle-lang"; -export type LabeledDistribution = { name: string; distribution: Distribution }; +export type LabeledDistribution = { + name: string; + distribution: Distribution; + color?: string; +}; export type Plot = { distributions: LabeledDistribution[]; @@ -27,12 +31,18 @@ const schema = yup .of( yup.object().shape({ tag: yup.mixed().oneOf(["record"]), - value: yup.object().shape({ + value: yup.object({ name: yup.object().shape({ tag: yup.mixed().oneOf(["string"]), value: yup.string().required(), }), - distribution: yup.object().shape({ + // color: yup + // .object({ + // tag: yup.mixed().oneOf(["string"]), + // value: yup.string().required(), + // }) + // .default(undefined), + distribution: yup.object({ tag: yup.mixed().oneOf(["distribution"]), value: yup.mixed(), }), @@ -51,6 +61,7 @@ export function parsePlot(record: { return ok({ distributions: plotRecord.distributions.value.map((x) => ({ name: x.value.name.value, + // color: x.value.color?.value, // not supported yet distribution: x.value.distribution.value, })), }); diff --git a/packages/components/src/stories/SquiggleChart.stories.mdx b/packages/components/src/stories/SquiggleChart.stories.mdx index 14a3f1fe..3c272982 100644 --- a/packages/components/src/stories/SquiggleChart.stories.mdx +++ b/packages/components/src/stories/SquiggleChart.stories.mdx @@ -99,7 +99,20 @@ could be continuous, discrete or mixed. From c46845705216da85f93bedec60031c7cf444ef97 Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Fri, 19 Aug 2022 21:54:29 +0400 Subject: [PATCH 34/46] update squiggle-components version (fixes playground) --- packages/website/package.json | 2 +- yarn.lock | 122 +++------------------------------- 2 files changed, 9 insertions(+), 115 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index 7bd1f80c..53d94c2d 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -15,7 +15,7 @@ "@docusaurus/core": "2.0.1", "@docusaurus/preset-classic": "2.0.1", "@heroicons/react": "^1.0.6", - "@quri/squiggle-components": "^0.2.23", + "@quri/squiggle-components": "^0.3", "base64-js": "^1.5.1", "clsx": "^1.2.1", "hast-util-is-element": "2.1.2", diff --git a/yarn.lock b/yarn.lock index 79d240a0..b341972f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2188,23 +2188,11 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@floating-ui/core@^0.7.3": - version "0.7.3" - resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-0.7.3.tgz#d274116678ffae87f6b60e90f88cc4083eefab86" - integrity sha512-buc8BXHmG9l82+OQXOFU3Kr2XQx9ys01U/Q9HMIrZ300iLc8HLMgh7dcCqgYzAzf4BkoQvDcXf5Y+CuEZ5JBYg== - "@floating-ui/core@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.0.0.tgz#ec1d31f54c72dd0460276e2149e59bd13c0f01f6" integrity sha512-sm3nW0hHAxTv3gRDdCH8rNVQxijF+qPFo5gAeXCErRjKC7Qc28lIQ3R9Vd7Gw+KgwfA7RhRydDFuGeI0peGq7A== -"@floating-ui/dom@^0.5.3": - version "0.5.4" - resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-0.5.4.tgz#4eae73f78bcd4bd553ae2ade30e6f1f9c73fe3f1" - integrity sha512-419BMceRLq0RrmTSDxn8hf9R3VCJv2K9PUfugh5JyEFmdjzDo+e8U5EdR8nzKq8Yj1htzLm3b6eQEEam3/rrtg== - dependencies: - "@floating-ui/core" "^0.7.3" - "@floating-ui/dom@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.0.0.tgz#66923a56755b6cb7a5958ecf25fe293912672d65" @@ -2212,15 +2200,6 @@ dependencies: "@floating-ui/core" "^1.0.0" -"@floating-ui/react-dom-interactions@^0.6.6": - version "0.6.6" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.6.6.tgz#8542e8c4bcbee2cd0d512de676c6a493e0a2d168" - integrity sha512-qnao6UPjSZNHnXrF+u4/n92qVroQkx0Umlhy3Avk1oIebm/5ee6yvDm4xbHob0OjY7ya8WmUnV3rQlPwX3Atwg== - dependencies: - "@floating-ui/react-dom" "^0.7.2" - aria-hidden "^1.1.3" - use-isomorphic-layout-effect "^1.1.1" - "@floating-ui/react-dom-interactions@^0.9.2": version "0.9.2" resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.9.2.tgz#9a364cc44ecbc242b5218dff0e0d071de115e13a" @@ -2229,14 +2208,6 @@ "@floating-ui/react-dom" "^1.0.0" aria-hidden "^1.1.3" -"@floating-ui/react-dom@^0.7.2": - version "0.7.2" - resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-0.7.2.tgz#0bf4ceccb777a140fc535c87eb5d6241c8e89864" - integrity sha512-1T0sJcpHgX/u4I1OzIEhlcrvkUN8ln39nz7fMoE/2HDHrPiMFoOGR7++GYyfUmIQHkkrTinaeQsO3XWubjSvGg== - dependencies: - "@floating-ui/dom" "^0.5.3" - use-isomorphic-layout-effect "^1.1.1" - "@floating-ui/react-dom@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-1.0.0.tgz#e0975966694433f1f0abffeee5d8e6bb69b7d16e" @@ -2279,7 +2250,7 @@ resolved "https://registry.yarnpkg.com/@heroicons/react/-/react-1.0.6.tgz#35dd26987228b39ef2316db3b1245c42eb19e324" integrity sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ== -"@hookform/resolvers@^2.9.6", "@hookform/resolvers@^2.9.7": +"@hookform/resolvers@^2.9.7": version "2.9.7" resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.7.tgz#8b257ae67234ce0270e6b044c1a61fb98ec02b4b" integrity sha512-BloehX3MOLwuFEwT4yZnmolPjVmqyn8VsSuodLfazbCIqxBHsQ4qUZsi+bvNNCduRli1AGWFrkDLGD5QoNzsoA== @@ -2683,7 +2654,7 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@motionone/animation@^10.12.0", "@motionone/animation@^10.13.1": +"@motionone/animation@^10.13.1": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/animation/-/animation-10.13.2.tgz#174a55a3bac1b6fb314cc1c3627093dc790ae081" integrity sha512-YGWss58IR2X4lOjW89rv1Q+/Nq/QhfltaggI7i8sZTpKC1yUvM+XYDdvlRpWc6dk8LviMBrddBJAlLdbaqeRmw== @@ -2693,18 +2664,6 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/dom@10.12.0": - version "10.12.0" - resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.12.0.tgz#ae30827fd53219efca4e1150a5ff2165c28351ed" - integrity sha512-UdPTtLMAktHiqV0atOczNYyDd/d8Cf5fFsd1tua03PqTwwCe/6lwhLSQ8a7TbnQ5SN0gm44N1slBfj+ORIhrqw== - dependencies: - "@motionone/animation" "^10.12.0" - "@motionone/generators" "^10.12.0" - "@motionone/types" "^10.12.0" - "@motionone/utils" "^10.12.0" - hey-listen "^1.0.8" - tslib "^2.3.1" - "@motionone/dom@10.13.1": version "10.13.1" resolved "https://registry.yarnpkg.com/@motionone/dom/-/dom-10.13.1.tgz#fc29ea5d12538f21b211b3168e502cfc07a24882" @@ -2725,7 +2684,7 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/generators@^10.12.0", "@motionone/generators@^10.13.1": +"@motionone/generators@^10.13.1": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/generators/-/generators-10.13.2.tgz#dd972195b899e7a556d65bd27fae2fd423055e10" integrity sha512-QMoXV1MXEEhR6D3dct/RMMS1FwJlAsW+kMPbFGzBA4NbweblgeYQCft9DcDAVpV9wIwD6qvlBG9u99sOXLfHiA== @@ -2734,12 +2693,12 @@ "@motionone/utils" "^10.13.2" tslib "^2.3.1" -"@motionone/types@^10.12.0", "@motionone/types@^10.13.0", "@motionone/types@^10.13.2": +"@motionone/types@^10.13.0", "@motionone/types@^10.13.2": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/types/-/types-10.13.2.tgz#c560090d81bd0149e7451aae23ab7af458570363" integrity sha512-yYV4q5v5F0iADhab4wHfqaRJnM/eVtQLjUPhyEcS72aUz/xyOzi09GzD/Gu+K506BDfqn5eULIilUI77QNaqhw== -"@motionone/utils@^10.12.0", "@motionone/utils@^10.13.1", "@motionone/utils@^10.13.2": +"@motionone/utils@^10.13.1", "@motionone/utils@^10.13.2": version "10.13.2" resolved "https://registry.yarnpkg.com/@motionone/utils/-/utils-10.13.2.tgz#ce79bfe1d133493c217cdc0584960434e065648d" integrity sha512-6Lw5bDA/w7lrPmT/jYWQ76lkHlHs9fl2NZpJ22cVy1kKDdEH+Cl1U6hMTpdphO6VQktQ6v2APngag91WBKLqlA== @@ -2818,33 +2777,7 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== -"@quri/squiggle-components@^0.2.23": - version "0.2.24" - resolved "https://registry.yarnpkg.com/@quri/squiggle-components/-/squiggle-components-0.2.24.tgz#16a2d72fb16f46a0bf71388c85d1238927676923" - integrity sha512-slBGryELfCsM6WX+AwQcqiPPoImLRHNyXZDueL7a+OKEAx09w3pKOqVzLWNGL7+dJe3dF8as9X/Gv1JbbIj5yw== - dependencies: - "@floating-ui/react-dom" "^0.7.2" - "@floating-ui/react-dom-interactions" "^0.6.6" - "@headlessui/react" "^1.6.6" - "@heroicons/react" "^1.0.6" - "@hookform/resolvers" "^2.9.6" - "@quri/squiggle-lang" "^0.2.8" - "@react-hook/size" "^2.1.2" - clsx "^1.2.1" - framer-motion "^6.5.1" - lodash "^4.17.21" - react "^18.1.0" - react-ace "^10.1.0" - react-hook-form "^7.33.1" - react-use "^17.4.0" - react-vega "^7.6.0" - vega "^5.22.1" - vega-embed "^6.21.0" - vega-lite "^5.3.0" - vscode-uri "^3.0.3" - yup "^0.32.11" - -"@quri/squiggle-lang@^0.2.11", "@quri/squiggle-lang@^0.2.8": +"@quri/squiggle-lang@^0.2.11": version "0.2.12" resolved "https://registry.yarnpkg.com/@quri/squiggle-lang/-/squiggle-lang-0.2.12.tgz#e8fdb22a84aa75df71c071d1ed4ae5c55f15d447" integrity sha512-fgv9DLvPlX/TqPSacKSW3GZ5S9H/YwqaMoRdFrn5SJjHnnMh/xJW/9iyzzgOxPCXov9xFeDvL159tkbStMm7vw== @@ -9721,20 +9654,6 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -framer-motion@^6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-6.5.1.tgz#802448a16a6eb764124bf36d8cbdfa6dd6b931a7" - integrity sha512-o1BGqqposwi7cgDrtg0dNONhkmPsUFDaLcKXigzuTFC5x58mE8iyTazxSudFzmT6MEyJKfjjU8ItoMe3W+3fiw== - dependencies: - "@motionone/dom" "10.12.0" - framesync "6.0.1" - hey-listen "^1.0.8" - popmotion "11.0.3" - style-value-types "5.0.0" - tslib "^2.1.0" - optionalDependencies: - "@emotion/is-prop-valid" "^0.8.2" - framer-motion@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.1.1.tgz#4d56ed18a7cf2c6a1a4a1af5b57714f8e6b52d9e" @@ -9749,13 +9668,6 @@ framer-motion@^7.1.1: optionalDependencies: "@emotion/is-prop-valid" "^0.8.2" -framesync@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.0.1.tgz#5e32fc01f1c42b39c654c35b16440e07a25d6f20" - integrity sha512-fUY88kXvGiIItgNC7wcTOl0SNRCVXMKSWW2Yzfmn7EKNc+MpCzcz9DhdHcdjbrtN3c6R4H5dTY2jiCpPdysEjA== - dependencies: - tslib "^2.1.0" - framesync@6.1.2: version "6.1.2" resolved "https://registry.yarnpkg.com/framesync/-/framesync-6.1.2.tgz#755eff2fb5b8f3b4d2b266dd18121b300aefea27" @@ -13963,16 +13875,6 @@ polished@^4.2.2: dependencies: "@babel/runtime" "^7.17.8" -popmotion@11.0.3: - version "11.0.3" - resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.3.tgz#565c5f6590bbcddab7a33a074bb2ba97e24b0cc9" - integrity sha512-Y55FLdj3UxkR7Vl3s7Qr4e9m0onSnP8W7d/xQLsoJM40vs6UKHFdygs6SWryasTZYqugMjm3BepCF4CWXDiHgA== - dependencies: - framesync "6.0.1" - hey-listen "^1.0.8" - style-value-types "5.0.0" - tslib "^2.1.0" - popmotion@11.0.5: version "11.0.5" resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.5.tgz#8e3e014421a0ffa30ecd722564fd2558954e1f7d" @@ -15165,7 +15067,7 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.33.1, react-hook-form@^7.34.1: +react-hook-form@^7.34.1: version "7.34.1" resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.1.tgz#06cb216daf706bf9ae4969747115afae0d09410d" integrity sha512-tH7TaZgAURMhjzVE2M/EFmxHz2HdaPMAVs9FXTweNW551VlhXSuVcpcYlkiMZf2zHQiTztupVFpBHJFTma+N7w== @@ -16972,14 +16874,6 @@ style-to-object@0.3.0, style-to-object@^0.3.0: dependencies: inline-style-parser "0.1.1" -style-value-types@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.0.0.tgz#76c35f0e579843d523187989da866729411fc8ad" - integrity sha512-08yq36Ikn4kx4YU6RD7jWEv27v4V+PUsOGa4n/as8Et3CuODMJQ00ENeAVXAeydX4Z2j1XHZF1K2sX4mGl18fA== - dependencies: - hey-listen "^1.0.8" - tslib "^2.1.0" - style-value-types@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.1.2.tgz#6be66b237bd546048a764883528072ed95713b62" @@ -18236,7 +18130,7 @@ vega-label@~1.2.0: vega-scenegraph "^4.9.2" vega-util "^1.15.2" -vega-lite@^5.3.0, vega-lite@^5.4.0: +vega-lite@^5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.4.0.tgz#d09331e2a1c87843d5865de0fa7704919796ab56" integrity sha512-e/P5iOtBE62WEWZhKP7sLcBd92YS9prfUQafelxoOeloooSSrkUwM/ZDmN5Q5ffByEZTiKfODtnwD6/xKDYUmw== From a04761226d28be90129f15b8b84d99ddf80cde5e Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Aug 2022 15:50:30 -0700 Subject: [PATCH 35/46] Improved error messages of function library --- .../FunctionRegistry/Library/FR_Pointset.res | 6 +++--- .../FunctionRegistry/Library/FR_Sampleset.res | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res index c0270e48..44b6abd2 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Pointset.res @@ -43,8 +43,7 @@ module Internal = { let mapY = (pointSetDist: t, aLambdaValue, env, reducer) => { let fn = r => doLambdaCall(aLambdaValue, list{IEvNumber(r)}, env, reducer) - let foo = PointSetDist.T.mapYResult(~fn, pointSetDist) - foo->toType + PointSetDist.T.mapYResult(~fn, pointSetDist)->toType } } @@ -90,7 +89,8 @@ let library = [ ~inputs=[FRTypeDist, FRTypeLambda], ~run=(inputs, _, env, reducer) => switch inputs { - | [IEvDistribution(PointSet(dist)), IEvLambda(lambda)] => Internal.mapY(dist, lambda, env, reducer)->E.R2.errMap(_ => "") + | [IEvDistribution(PointSet(dist)), IEvLambda(lambda)] => + Internal.mapY(dist, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) }, (), diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res index 27b870ee..ec6df20c 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -92,7 +92,7 @@ let library = [ GenericDist.toSampleSetDist(dist, env.sampleCount) ->E.R2.fmap(Wrappers.sampleSet) ->E.R2.fmap(Wrappers.evDistribution) - ->E.R2.errMap(_ => "") + ->E.R2.errMap(DistributionTypes.Error.toString) | _ => Error(impossibleError) }, (), @@ -158,7 +158,7 @@ let library = [ | [IEvLambda(lambda)] => switch Internal.fromFn(lambda, env, reducer) { | Ok(r) => Ok(r->Wrappers.sampleSet->Wrappers.evDistribution) - | Error(_) => Error("issue") + | Error(e) => Error(Operation.Error.toString(e)) } | _ => Error(impossibleError) }, @@ -180,7 +180,7 @@ let library = [ ~run=(inputs, _, env, reducer) => switch inputs { | [IEvDistribution(SampleSet(dist)), IEvLambda(lambda)] => - Internal.map1(dist, lambda, env, reducer)->E.R2.errMap(_ => "") + Internal.map1(dist, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) }, (), @@ -207,7 +207,7 @@ let library = [ IEvDistribution(SampleSet(dist2)), IEvLambda(lambda), ] => - Internal.map2(dist1, dist2, lambda, env, reducer)->E.R2.errMap(_ => "") + Internal.map2(dist1, dist2, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) } }, @@ -236,7 +236,7 @@ let library = [ IEvDistribution(SampleSet(dist3)), IEvLambda(lambda), ] => - Internal.map3(dist1, dist2, dist3, lambda, env, reducer)->E.R2.errMap(_ => "") + Internal.map3(dist1, dist2, dist3, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) }, (), @@ -259,9 +259,7 @@ let library = [ ~run=(inputs, _, env, reducer) => switch inputs { | [IEvArray(dists), IEvLambda(lambda)] => - Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(_e => { - "AHHH doesn't work" - }) + Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) | _ => Error(impossibleError) }, (), From 15debbddea9ead8481d85ee624db9fb2c891ae68 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Aug 2022 15:56:59 -0700 Subject: [PATCH 36/46] Added very minimal documentation for PointSet mapY --- packages/website/docs/Api/DistPointSet.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index 9c9c3d0d..a966f296 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -46,3 +46,13 @@ PointSet.makeDiscrete([ { x: 3, y: 0.1 }, ]); ``` + +### mapY + +``` +PointSet.mapY: (pointSetDist, (number => number)) => pointSetDist +``` + +```javascript +normal(5,3) |> PointSet.fromDist |> PointSet.mapY({|x| x ^ 2}) |> normalize +``` \ No newline at end of file From 72b1d6af3e7504af935f32f40cc036c7e0e8dfaf Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 20 Aug 2022 15:59:25 -0700 Subject: [PATCH 37/46] Formatted --- .../FunctionRegistry/Library/FR_Sampleset.res | 12 +++++++++--- packages/website/docs/Api/DistPointSet.md | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res index ec6df20c..c40fe349 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Sampleset.res @@ -207,7 +207,9 @@ let library = [ IEvDistribution(SampleSet(dist2)), IEvLambda(lambda), ] => - Internal.map2(dist1, dist2, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) + Internal.map2(dist1, dist2, lambda, env, reducer)->E.R2.errMap( + Reducer_ErrorValue.errorToString, + ) | _ => Error(impossibleError) } }, @@ -236,7 +238,9 @@ let library = [ IEvDistribution(SampleSet(dist3)), IEvLambda(lambda), ] => - Internal.map3(dist1, dist2, dist3, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) + Internal.map3(dist1, dist2, dist3, lambda, env, reducer)->E.R2.errMap( + Reducer_ErrorValue.errorToString, + ) | _ => Error(impossibleError) }, (), @@ -259,7 +263,9 @@ let library = [ ~run=(inputs, _, env, reducer) => switch inputs { | [IEvArray(dists), IEvLambda(lambda)] => - Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap(Reducer_ErrorValue.errorToString) + Internal.mapN(dists, lambda, env, reducer)->E.R2.errMap( + Reducer_ErrorValue.errorToString, + ) | _ => Error(impossibleError) }, (), diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index a966f296..bfd8ae82 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -55,4 +55,4 @@ PointSet.mapY: (pointSetDist, (number => number)) => pointSetDist ```javascript normal(5,3) |> PointSet.fromDist |> PointSet.mapY({|x| x ^ 2}) |> normalize -``` \ No newline at end of file +``` From 9bffa25dea688369e2ab2ba51748929bed7efb88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:20:27 +0000 Subject: [PATCH 38/46] :arrow_up: Bump @typescript-eslint/parser from 5.33.0 to 5.33.1 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.33.0 to 5.33.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.33.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/vscode-ext/package.json | 2 +- yarn.lock | 48 +++++--------------------------- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 331861ff..98d5a2a3 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -130,7 +130,7 @@ "@types/node": "18.x", "@types/vscode": "^1.70.0", "@typescript-eslint/eslint-plugin": "^5.33.1", - "@typescript-eslint/parser": "^5.33.0", + "@typescript-eslint/parser": "^5.33.1", "eslint": "^8.22.0", "glob": "^8.0.3", "js-yaml": "^4.1.0", diff --git a/yarn.lock b/yarn.lock index b341972f..ff2a2a00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5027,14 +5027,14 @@ dependencies: "@typescript-eslint/utils" "5.29.0" -"@typescript-eslint/parser@^5.33.0", "@typescript-eslint/parser@^5.5.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.0.tgz#26ec3235b74f0667414613727cb98f9b69dc5383" - integrity sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w== +"@typescript-eslint/parser@^5.33.1", "@typescript-eslint/parser@^5.5.0": + version "5.33.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.1.tgz#e4b253105b4d2a4362cfaa4e184e2d226c440ff3" + integrity sha512-IgLLtW7FOzoDlmaMoXdxG8HOCByTBXrB1V2ZQYSEV1ggMmJfAkMWTwUjjzagS6OkfpySyhKFkBw7A9jYmcHpZA== dependencies: - "@typescript-eslint/scope-manager" "5.33.0" - "@typescript-eslint/types" "5.33.0" - "@typescript-eslint/typescript-estree" "5.33.0" + "@typescript-eslint/scope-manager" "5.33.1" + "@typescript-eslint/types" "5.33.1" + "@typescript-eslint/typescript-estree" "5.33.1" debug "^4.3.4" "@typescript-eslint/scope-manager@5.29.0": @@ -5045,14 +5045,6 @@ "@typescript-eslint/types" "5.29.0" "@typescript-eslint/visitor-keys" "5.29.0" -"@typescript-eslint/scope-manager@5.33.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz#509d7fa540a2c58f66bdcfcf278a3fa79002e18d" - integrity sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw== - dependencies: - "@typescript-eslint/types" "5.33.0" - "@typescript-eslint/visitor-keys" "5.33.0" - "@typescript-eslint/scope-manager@5.33.1": version "5.33.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.1.tgz#8d31553e1b874210018ca069b3d192c6d23bc493" @@ -5075,11 +5067,6 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.29.0.tgz#7861d3d288c031703b2d97bc113696b4d8c19aab" integrity sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg== -"@typescript-eslint/types@5.33.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.0.tgz#d41c584831805554b063791338b0220b613a275b" - integrity sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw== - "@typescript-eslint/types@5.33.1": version "5.33.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.1.tgz#3faef41793d527a519e19ab2747c12d6f3741ff7" @@ -5098,19 +5085,6 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/typescript-estree@5.33.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz#02d9c9ade6f4897c09e3508c27de53ad6bfa54cf" - integrity sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ== - dependencies: - "@typescript-eslint/types" "5.33.0" - "@typescript-eslint/visitor-keys" "5.33.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.33.1": version "5.33.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.1.tgz#a573bd360790afdcba80844e962d8b2031984f34" @@ -5156,14 +5130,6 @@ "@typescript-eslint/types" "5.29.0" eslint-visitor-keys "^3.3.0" -"@typescript-eslint/visitor-keys@5.33.0": - version "5.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz#fbcbb074e460c11046e067bc3384b5d66b555484" - integrity sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw== - dependencies: - "@typescript-eslint/types" "5.33.0" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.33.1": version "5.33.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.1.tgz#0155c7571c8cd08956580b880aea327d5c34a18b" From e205133c8e78bac084e030db545ad942c30f6830 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:22:07 +0000 Subject: [PATCH 39/46] :arrow_up: Bump @types/lodash from 4.14.182 to 4.14.184 Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.182 to 4.14.184. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash) --- updated-dependencies: - dependency-name: "@types/lodash" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index a82a3718..e715d28a 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -38,7 +38,7 @@ "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^14.4.3", "@types/jest": "^27.5.0", - "@types/lodash": "^4.14.182", + "@types/lodash": "^4.14.184", "@types/node": "^18.7.4", "@types/react": "^18.0.9", "@types/styled-components": "^5.1.26", diff --git a/yarn.lock b/yarn.lock index b341972f..fb82e18a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4696,10 +4696,10 @@ resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.11.1.tgz#34de04477dcf79e2ef6c8d23b41a3d81f9ebeaf5" integrity sha512-DUlIj2nk0YnJdlWgsFuVKcX27MLW0KbKmGVoUHmFr+74FYYNUDAaj9ZqTADvsbE8rfxuVmSFc7KczYn5Y09ozg== -"@types/lodash@^4.14.167", "@types/lodash@^4.14.175", "@types/lodash@^4.14.182": - version "4.14.182" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" - integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== +"@types/lodash@^4.14.167", "@types/lodash@^4.14.175", "@types/lodash@^4.14.184": + version "4.14.184" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.184.tgz#23f96cd2a21a28e106dc24d825d4aa966de7a9fe" + integrity sha512-RoZphVtHbxPZizt4IcILciSWiC6dcn+eZ8oX9IWEYfDMcocdd42f7NPI6fQj+6zI8y4E0L7gu2pcZKLGTRaV9Q== "@types/mdast@^3.0.0": version "3.0.10" From 6b46817f7096720c2969c1ee0776ab0294d869f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:22:54 +0000 Subject: [PATCH 40/46] :arrow_up: Bump vega-lite from 5.4.0 to 5.5.0 Bumps [vega-lite](https://github.com/vega/vega-lite) from 5.4.0 to 5.5.0. - [Release notes](https://github.com/vega/vega-lite/releases) - [Changelog](https://github.com/vega/vega-lite/blob/v5.5.0/CHANGELOG.md) - [Commits](https://github.com/vega/vega-lite/compare/v5.4.0...v5.5.0) --- updated-dependencies: - dependency-name: vega-lite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index a82a3718..a1874c64 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -20,7 +20,7 @@ "react-vega": "^7.6.0", "vega": "^5.22.1", "vega-embed": "^6.21.0", - "vega-lite": "^5.4.0", + "vega-lite": "^5.5.0", "vscode-uri": "^3.0.3", "yup": "^0.32.11" }, diff --git a/yarn.lock b/yarn.lock index b341972f..fae96955 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18130,10 +18130,10 @@ vega-label@~1.2.0: vega-scenegraph "^4.9.2" vega-util "^1.15.2" -vega-lite@^5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.4.0.tgz#d09331e2a1c87843d5865de0fa7704919796ab56" - integrity sha512-e/P5iOtBE62WEWZhKP7sLcBd92YS9prfUQafelxoOeloooSSrkUwM/ZDmN5Q5ffByEZTiKfODtnwD6/xKDYUmw== +vega-lite@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.5.0.tgz#07345713d538cd63278748ec119c261722be66ff" + integrity sha512-MQBJt/iaUegvhRTS/hZVWfMOSF5ai4awlR2qtwTgHd84bErf9v7GtaZ9ArhJqXCb+FizvZ2jatmoYCzovgAhkg== dependencies: "@types/clone" "~2.1.1" array-flat-polyfill "^1.0.1" From 2eb011d965397c1b630ca6b7e1ba52e54344ed17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:23:50 +0000 Subject: [PATCH 41/46] :arrow_up: Bump framer-motion from 7.1.1 to 7.2.0 Bumps [framer-motion](https://github.com/framer/motion) from 7.1.1 to 7.2.0. - [Release notes](https://github.com/framer/motion/releases) - [Changelog](https://github.com/framer/motion/blob/main/CHANGELOG.md) - [Commits](https://github.com/framer/motion/compare/v7.1.1...v7.2.0) --- updated-dependencies: - dependency-name: framer-motion dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index a82a3718..7ce11698 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -11,7 +11,7 @@ "@quri/squiggle-lang": "^0.3.0", "@react-hook/size": "^2.1.2", "clsx": "^1.2.1", - "framer-motion": "^7.1.1", + "framer-motion": "^7.2.0", "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", diff --git a/yarn.lock b/yarn.lock index b341972f..e10281f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9654,10 +9654,10 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -framer-motion@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.1.1.tgz#4d56ed18a7cf2c6a1a4a1af5b57714f8e6b52d9e" - integrity sha512-ONFaG7as1GBBYYIqzX8ENVsfa4eh6f7/nSc3QCADAHOaCt1Lh3UdWbQ0+HVGOOORvEW2L99GlCr4wQc0GLddXg== +framer-motion@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-7.2.0.tgz#1abc8090e185eaac8a3b3729e2529154d2edcb17" + integrity sha512-D24ZHtbtdpiaByamNYiVXafVU6JfBxjrVlR1beyNupJL80haaDE23xS4dR0b/Qb64frtw/Mpdd9VYwSCv+UtSw== dependencies: "@motionone/dom" "10.13.1" framesync "6.1.2" From fabd8daf9a7e8fde99db4a7cb0f2183f4e8df02b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:27:31 +0000 Subject: [PATCH 42/46] :arrow_up: Bump react-hook-form from 7.34.1 to 7.34.2 Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.34.1 to 7.34.2. - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.34.1...v7.34.2) --- updated-dependencies: - dependency-name: react-hook-form dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index a82a3718..61f37f62 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -15,7 +15,7 @@ "lodash": "^4.17.21", "react": "^18.1.0", "react-ace": "^10.1.0", - "react-hook-form": "^7.34.1", + "react-hook-form": "^7.34.2", "react-use": "^17.4.0", "react-vega": "^7.6.0", "vega": "^5.22.1", diff --git a/yarn.lock b/yarn.lock index b341972f..bd68e629 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15067,10 +15067,10 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.34.1: - version "7.34.1" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.1.tgz#06cb216daf706bf9ae4969747115afae0d09410d" - integrity sha512-tH7TaZgAURMhjzVE2M/EFmxHz2HdaPMAVs9FXTweNW551VlhXSuVcpcYlkiMZf2zHQiTztupVFpBHJFTma+N7w== +react-hook-form@^7.34.2: + version "7.34.2" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.34.2.tgz#9ac6d1a309a7c4aaa369d1269357a70e9e9bf4de" + integrity sha512-1lYWbEqr0GW7HHUjMScXMidGvV0BE2RJV3ap2BL7G0EJirkqpccTaawbsvBO8GZaB3JjCeFBEbnEWI1P8ZoLRQ== react-inspector@^5.1.0: version "5.1.1" From 7eec5b397ccb2a09e8fdea632b09fac3937c813c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 15:03:39 +0000 Subject: [PATCH 43/46] :arrow_up: Bump @types/node from 18.7.4 to 18.7.9 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.7.4 to 18.7.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index 41eb19b6..d8be7b6c 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -39,7 +39,7 @@ "@testing-library/user-event": "^14.4.3", "@types/jest": "^27.5.0", "@types/lodash": "^4.14.184", - "@types/node": "^18.7.4", + "@types/node": "^18.7.9", "@types/react": "^18.0.9", "@types/styled-components": "^5.1.26", "@types/webpack": "^5.28.0", diff --git a/yarn.lock b/yarn.lock index 442cb77b..87f127f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4726,10 +4726,10 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@18.x", "@types/node@^18.7.4": - version "18.7.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.4.tgz#95baa50846ae112a7376869d49fec23b2506c69d" - integrity sha512-RzRcw8c0B8LzryWOR4Wj7YOTFXvdYKwvrb6xQQyuDfnlTxwYXGCV5RZ/TEbq5L5kn+w3rliHAUyRcG1RtbmTFg== +"@types/node@*", "@types/node@18.x", "@types/node@^18.7.9": + version "18.7.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.9.tgz#180bfc495c91dc62573967edf047e15dbdce1491" + integrity sha512-0N5Y1XAdcl865nDdjbO0m3T6FdmQ4ijE89/urOHLREyTXbpMWbSafx9y7XIsgWGtwUP2iYTinLyyW3FatAxBLQ== "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0": version "16.11.41" From 063b6b67a176e6acf9ed465e8378dfcedba9cccd Mon Sep 17 00:00:00 2001 From: Orpheus Lummis Date: Mon, 22 Aug 2022 11:08:51 -0500 Subject: [PATCH 44/46] fix: Update vscode ext manifest repository link --- packages/vscode-ext/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vscode-ext/package.json b/packages/vscode-ext/package.json index 98d5a2a3..73ca9dd6 100644 --- a/packages/vscode-ext/package.json +++ b/packages/vscode-ext/package.json @@ -7,7 +7,7 @@ "publisher": "QURI", "repository": { "type": "git", - "url": "git+https://github.com/quantified-uncertainty/squiggle.git" + "url": "https://github.com/quantified-uncertainty/squiggle.git" }, "icon": "media/vendor/icon.png", "engines": { @@ -143,4 +143,4 @@ "vscode-languageserver-textdocument": "^1.0.5", "@quri/squiggle-lang": "^0.2.11" } -} +} \ No newline at end of file From 6a2ff402794c491553eb870fc7117c7abbb1922d Mon Sep 17 00:00:00 2001 From: Quinn Date: Tue, 23 Aug 2022 08:59:52 -0400 Subject: [PATCH 45/46] Replace algolia app They ended up giving us premium for free (I think: the dashboard is pretty bad so it's hard to tell), so I'm replacing the algolia app with another one. --- packages/website/docusaurus.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 3949e98b..1f712dab 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -54,10 +54,10 @@ const config = { ({ algolia: { // The application ID provided by Algolia - appId: "NEUN2KAR5K", + appId: "KBED3M1CMD", // Public API key: it is safe to commit it - apiKey: "1f5c74a2d72799add24eb7682531a1b0", + apiKey: "c61bc7603893cf287ed6971983af8bad", indexName: "squiggle_docs", From d29b77ca610314c6a53492edf7aa004034352cef Mon Sep 17 00:00:00 2001 From: Umur Ozkul Date: Thu, 25 Aug 2022 22:19:29 +0200 Subject: [PATCH 46/46] fix #1007 variables that start with true/false --- .../Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy index 15837da4..00467d86 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.peggy @@ -250,8 +250,8 @@ float 'float' d = [0-9] boolean 'boolean' - = ('true'/'false') - { return h.nodeBoolean(text() === 'true')} + = ('true'/'false') ! [a-z]i ! [_$] + { return h.nodeBoolean(text() === 'true')} valueConstructor = recordConstructor