From 3250d6009a6788e2b9f7123b52d154b6b0c17ae3 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 22 Jul 2022 11:50:56 -0700 Subject: [PATCH 1/4] Updated colors and light styles of homepage --- .../src/stories/SquiggleChart.stories.mdx | 4 +- packages/website/docs/Api/DistSampleSet.md | 2 +- packages/website/docs/Discussions/Bugs.mdx | 2 +- packages/website/docs/Guides/Functions.mdx | 14 +--- packages/website/docs/Guides/Language.mdx | 2 +- packages/website/docusaurus.config.js | 7 +- .../components/HomepageFeatures.module.css | 5 ++ packages/website/src/css/custom.css | 81 +++++++++++++++---- packages/website/src/pages/index.js | 5 +- packages/website/src/pages/index.module.css | 5 +- 10 files changed, 92 insertions(+), 35 deletions(-) diff --git a/packages/components/src/stories/SquiggleChart.stories.mdx b/packages/components/src/stories/SquiggleChart.stories.mdx index 2febfb6f..bc289c36 100644 --- a/packages/components/src/stories/SquiggleChart.stories.mdx +++ b/packages/components/src/stories/SquiggleChart.stories.mdx @@ -43,7 +43,7 @@ could be continuous, discrete or mixed. @@ -57,7 +57,7 @@ could be continuous, discrete or mixed. diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md index cadc1496..eaed6942 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.md @@ -38,7 +38,7 @@ Gets the internal samples of a sampleSet distribution. This is separate from the **Examples** ``` -toList(toSampleSet(normal(5,2))) +toList(SampleSet.fromDist(normal(5,2))) ``` ### map diff --git a/packages/website/docs/Discussions/Bugs.mdx b/packages/website/docs/Discussions/Bugs.mdx index db53a6f6..49bf347b 100644 --- a/packages/website/docs/Discussions/Bugs.mdx +++ b/packages/website/docs/Discussions/Bugs.mdx @@ -31,6 +31,6 @@ The means of sample set distributions can vary dramatically, especially as the n diff --git a/packages/website/docs/Guides/Functions.mdx b/packages/website/docs/Guides/Functions.mdx index a428ac7c..56a4929c 100644 --- a/packages/website/docs/Guides/Functions.mdx +++ b/packages/website/docs/Guides/Functions.mdx @@ -208,21 +208,15 @@ The `sample(distribution)` samples a given distribution. Recall the [three formats of distributions](https://develop--squiggle-documentation.netlify.app/docs/Discussions/Three-Types-Of-Distributions). We can force any distribution into `SampleSet` format - + Or `PointSet` format - - -### `toSampleSet` has two signatures - -Above, we saw the unary `toSampleSet`, which uses an internal hardcoded number of samples. If you'd like to provide the number of samples, it has a binary signature as well (floored) - - + #### Validity -- Second argument to `toSampleSet` must be a number. +- Second argument to `SampleSet.fromDist` must be a number. ## Normalization @@ -246,7 +240,7 @@ We provide a predicate `isNormalized`, for when we have simple control flow You may like to debug by right clicking your browser and using the _inspect_ functionality on the webpage, and viewing the _console_ tab. Then, wrap your squiggle output with `inspect` to log an internal representation. - + Save for a logging side effect, `inspect` does nothing to input and returns it. diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 2f26cdd6..3a195c1f 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -18,7 +18,7 @@ import { SquiggleEditor } from "../../src/components/SquiggleEditor"; ### Arrays ### Records diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 68baf7c8..f811da95 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -10,7 +10,7 @@ const path = require("path"); /** @type {import('@docusaurus/types').Config} */ const config = { title: "Squiggle", - tagline: "An estimation language for forecasters", + tagline: "A simple programming language for intuitive probabilistic estimation", url: "https://squiggle-language.com", baseUrl: "/", onBrokenLinks: "throw", @@ -72,6 +72,11 @@ const config = { }, { to: "/blog", label: "Blog", position: "left" }, { to: "/playground", label: "Playground", position: "left" }, + { + href: "https://github.com/quantified-uncertainty/squiggle/discussions", + label: "Issues & Discussion", + position: "right", + }, { href: "https://github.com/quantified-uncertainty/squiggle", label: "GitHub", diff --git a/packages/website/src/components/HomepageFeatures.module.css b/packages/website/src/components/HomepageFeatures.module.css index b248eb2e..9a1b2eba 100644 --- a/packages/website/src/components/HomepageFeatures.module.css +++ b/packages/website/src/components/HomepageFeatures.module.css @@ -5,6 +5,11 @@ width: 100%; } +.features h3 { + font-family: "Lora", serif; + font-size: 1.5em; +} + .featureSvg { height: 200px; width: 200px; diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css index 02c5ff6b..b9126b2d 100644 --- a/packages/website/src/css/custom.css +++ b/packages/website/src/css/custom.css @@ -4,27 +4,29 @@ * work well for content-centric websites. */ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Lato:wght@100;400;700;900&family=Lora:wght@400;500;600&display=swap'); + /* You can override the default Infima variables here. */ :root { - --ifm-color-primary: #2488df; - --ifm-color-primary-dark: #176fcd; - --ifm-color-primary-darker: #1f58cb; - --ifm-color-primary-darkest: #1e2672; - --ifm-color-primary-light: #49acd3; - --ifm-color-primary-lighter: #4fb1c7; - --ifm-color-primary-lightest: #3dbfd3; + --ifm-color-primary: #e74c0f; + --ifm-color-primary-dark: #bb4b05; + --ifm-color-primary-darker: #9d0c02; + --ifm-color-primary-darkest: #5d2200; + --ifm-color-primary-light: #e6a036; + --ifm-color-primary-lighter: #e79d1d; + --ifm-color-primary-lightest: #f5e191; --ifm-code-font-size: 95%; } /* For readability concerns, you should choose a lighter palette in dark mode. */ html[data-theme="dark"] { - --ifm-color-primary: #25c2a0; - --ifm-color-primary-dark: #21af90; - --ifm-color-primary-darker: #1fa588; - --ifm-color-primary-darkest: #1a8870; - --ifm-color-primary-light: #29d5b0; - --ifm-color-primary-lighter: #32d8b4; - --ifm-color-primary-lightest: #4fddbf; + --ifm-color-primary: #df774d; + --ifm-color-primary-dark: #db8651; + --ifm-color-primary-darker: #d7584f; + --ifm-color-primary-darkest: #b3693e; + --ifm-color-primary-light: #edb25a; + --ifm-color-primary-lighter: #ebd489; + --ifm-color-primary-lightest: #faf2d4; } .docusaurus-highlight-code-line { @@ -37,3 +39,54 @@ html[data-theme="dark"] { html[data-theme="dark"] .docusaurus-highlight-code-line { background-color: rgba(0, 0, 0, 0.3); } + +.hero h1{ + font-size: 4em; + font-weight: 900; + margin-bottom: 0.5rem; + color: rgb(230, 72, 79); + font-family: "Lato", sans-serif; +} + +.navbar__title { + font-family: "Lato", sans-serif; + font-weight: 900; + color: rgb(205, 88, 53); +} + +.hero__subtitle { + color: #888; + font-size:1.25em; +} + +.hero__subtitle2 { + color: #ba3e3e; + font-size: 1.5em; + font-family: "Lora"; + font-weight: 500; + margin-top: 1em; + margin-left: auto; + margin-right: auto; + max-width: 500px; +} + +h1 { + font-family: "Lora", serif; + font-size: 2.5em; +} + +h2 { + font-weight: 600; +} + +.menu__link, .navbar__item { + font-family: "Lora", serif; +} + +.navbar__item { + font-weight: 700; +} + +:root { + /* --ifm-font-family-base: 'Lora'; */ +} \ No newline at end of file diff --git a/packages/website/src/pages/index.js b/packages/website/src/pages/index.js index c156bec0..616093d5 100644 --- a/packages/website/src/pages/index.js +++ b/packages/website/src/pages/index.js @@ -13,10 +13,9 @@ function HomepageHeader() {

{siteConfig.title}

- Early access + Early Access

-

{siteConfig.tagline}

-
+

{siteConfig.tagline}

); diff --git a/packages/website/src/pages/index.module.css b/packages/website/src/pages/index.module.css index 666feb6a..f4518419 100644 --- a/packages/website/src/pages/index.module.css +++ b/packages/website/src/pages/index.module.css @@ -4,10 +4,11 @@ */ .heroBanner { - padding: 4rem 0; + padding: 2rem 0; text-align: center; position: relative; overflow: hidden; + background: rgb(255, 246, 237) } @media screen and (max-width: 966px) { @@ -20,4 +21,4 @@ display: flex; align-items: center; justify-content: center; -} +} \ No newline at end of file From 349b99b3ef62b945de62bf1907de3440ccef7698 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 22 Jul 2022 15:31:05 -0700 Subject: [PATCH 2/4] Minor docs cleanup --- packages/website/docs/Api/DistGeneric.mdx | 2 +- .../docs/Discussions/Future-Features.md | 6 ---- .../docs/Guides/DistributionCreation.mdx | 6 ++-- packages/website/docs/Guides/Functions.mdx | 30 ++++++------------- 4 files changed, 13 insertions(+), 31 deletions(-) diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index 982af57c..e37c6f75 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -339,7 +339,7 @@ A log loss score. Often that often acts as a [scoring rule](https://en.wikipedia Note that it is fairly slow. ``` -logScore: ({estimate: distribution, ?prior: distribution, answer: distribution|number}) => number +Dist.logScore: ({estimate: distribution, ?prior: distribution, answer: distribution|number}) => number ``` **Examples** diff --git a/packages/website/docs/Discussions/Future-Features.md b/packages/website/docs/Discussions/Future-Features.md index d1b45583..6070dbba 100644 --- a/packages/website/docs/Discussions/Future-Features.md +++ b/packages/website/docs/Discussions/Future-Features.md @@ -23,12 +23,6 @@ Squiggle is still very early. The main first goal is to become stable. This mean ## Distribution Features -`Distribution.fromSamples([])` -Converts a list of samples, for example, from Guesstimate, into a distribution shape. Maybe takes a list of optional parameters. - -`Distribution.fromCoordinates({xs, ys})` -Convert XY coordinates into a distribution. Figure out a good way to do this for continuous, discrete, and mixed distributions. - [Metalog Distribution](https://en.wikipedia.org/wiki/Metalog_distribution) Add the Metalog distribution, and some convenient methods for generating these distributions. This might be a bit tricky because we might need or build a library to fit data. There's no Metalog javascript library yet, this would be pretty useful. There's already a Metalog library in Python, so that one could be used for inspiration. diff --git a/packages/website/docs/Guides/DistributionCreation.mdx b/packages/website/docs/Guides/DistributionCreation.mdx index 95e03b7b..23a4bf0e 100644 --- a/packages/website/docs/Guides/DistributionCreation.mdx +++ b/packages/website/docs/Guides/DistributionCreation.mdx @@ -343,13 +343,13 @@ Creates a [triangular distribution](https://en.wikipedia.org/wiki/Triangular_dis -## FromSamples +## FromList -`fromSamples(samples:number[])` +`SampleSet.fromList(samples:number[])` Creates a sample set distribution using an array of samples. - + ### Arguments diff --git a/packages/website/docs/Guides/Functions.mdx b/packages/website/docs/Guides/Functions.mdx index 56a4929c..28029651 100644 --- a/packages/website/docs/Guides/Functions.mdx +++ b/packages/website/docs/Guides/Functions.mdx @@ -47,7 +47,7 @@ dist1 * dist2`} We also provide concatenation of two distributions as a syntax sugar for `*` - + ### Division @@ -88,16 +88,13 @@ log(dist)`} /> Base `x` #### Validity @@ -114,9 +111,7 @@ For every point on the x-axis, operate the corresponding points in the y axis of TODO: this isn't in the new interpreter/parser yet. ### Pointwise subtraction @@ -124,33 +119,26 @@ dist1 .+ dist2`} TODO: this isn't in the new interpreter/parser yet. ### Pointwise multiplication + ### Pointwise division ### Pointwise exponentiation ## Standard functions on distributions From ff1f8e8e84ee5dab4b82425e00786655598c4ee1 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 23 Jul 2022 11:06:15 -0700 Subject: [PATCH 3/4] Several small documentation improvements --- packages/website/docs/Guides/Language.mdx | 41 ++++++++++++----------- packages/website/docs/Introduction.md | 14 +++++++- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 3a195c1f..1bfe58e2 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -7,44 +7,47 @@ import { SquiggleEditor } from "../../src/components/SquiggleEditor"; ## Expressions -### Distributions - - - ### Numbers -### Arrays +### Distributions + + + +### Lists -### Records + + +### Dictionaries -## Statements - -A statement assigns expressions to names. It looks like ` = ` - - - ### Functions -We can define functions + + + +### Anonymous Functions ## See more diff --git a/packages/website/docs/Introduction.md b/packages/website/docs/Introduction.md index e04157c2..57c2ce36 100644 --- a/packages/website/docs/Introduction.md +++ b/packages/website/docs/Introduction.md @@ -3,7 +3,19 @@ sidebar_position: 1 title: Introduction --- -Squiggle is an _estimation language_, and a syntax for _calculating and expressing beliefs_ involving uncertainty. It has use cases in forecasting and writing evaluations. +Squiggle is a simple programming language for intuitive probabilistic estimation. It's meant for quantitative forecasting and evaluations. + +The basics of Squiggle can be pretty simple and intuitive. The more advanced functionality can take some time to learn. + +## What Squiggle Is +- A simple programming language for doing math with probability distributions +- An embeddable language that can be used in Javascript applications +- A tool to embed functions as forecasts that can be embedded in other applications + +## What Squiggle Is Not +- A complete replacement for enterprise Risk Analysis tools (See Crystal Ball, @Risk, Lumina Analytica) +- A Probabilistic Programming Language with backwards inference and sophisticated sampling algorithms. (See [PPLs](https://en.wikipedia.org/wiki/Probabilistic_programming)) +- A visual tool aimed at casual users (see Guesstimate, Causal) ## Get started From 8414cde819a91063e5135df14829df8d5e290005 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 23 Jul 2022 11:41:12 -0700 Subject: [PATCH 4/4] Ran formatting --- packages/website/docs/Guides/Functions.mdx | 29 +++++---------------- packages/website/docs/Guides/Language.mdx | 15 +++++------ packages/website/docs/Introduction.md | 2 ++ packages/website/docusaurus.config.js | 3 ++- packages/website/src/css/custom.css | 11 ++++---- packages/website/src/pages/index.js | 4 +-- packages/website/src/pages/index.module.css | 4 +-- 7 files changed, 26 insertions(+), 42 deletions(-) diff --git a/packages/website/docs/Guides/Functions.mdx b/packages/website/docs/Guides/Functions.mdx index 28029651..843cf888 100644 --- a/packages/website/docs/Guides/Functions.mdx +++ b/packages/website/docs/Guides/Functions.mdx @@ -87,15 +87,11 @@ A projection over a stretched x-axis. log(dist)`} /> - + Base `x` - + #### Validity @@ -110,36 +106,25 @@ For every point on the x-axis, operate the corresponding points in the y axis of TODO: this isn't in the new interpreter/parser yet. - + ### Pointwise subtraction TODO: this isn't in the new interpreter/parser yet. - + ### Pointwise multiplication - - + ### Pointwise division - + ### Pointwise exponentiation - + ## Standard functions on distributions diff --git a/packages/website/docs/Guides/Language.mdx b/packages/website/docs/Guides/Language.mdx index 1bfe58e2..90ee25b5 100644 --- a/packages/website/docs/Guides/Language.mdx +++ b/packages/website/docs/Guides/Language.mdx @@ -13,11 +13,13 @@ import { SquiggleEditor } from "../../src/components/SquiggleEditor"; ### Distributions - +{a:a, b:b, c:c, d:d}`} +/> ### Lists @@ -25,9 +27,7 @@ d = mixture(a,b,c, [0.3, 0.3, .4]) defaultCode={`[beta(1,10), 4, isNormalized(SampleSet.fromDist(1 to 2))]`} /> - + ### Dictionaries @@ -43,12 +43,9 @@ d.dist`} f`} /> - ### Anonymous Functions - + ## See more diff --git a/packages/website/docs/Introduction.md b/packages/website/docs/Introduction.md index 57c2ce36..22359de2 100644 --- a/packages/website/docs/Introduction.md +++ b/packages/website/docs/Introduction.md @@ -8,11 +8,13 @@ Squiggle is a simple programming language for intuitive probabilistic estimation The basics of Squiggle can be pretty simple and intuitive. The more advanced functionality can take some time to learn. ## What Squiggle Is + - A simple programming language for doing math with probability distributions - An embeddable language that can be used in Javascript applications - A tool to embed functions as forecasts that can be embedded in other applications ## What Squiggle Is Not + - A complete replacement for enterprise Risk Analysis tools (See Crystal Ball, @Risk, Lumina Analytica) - A Probabilistic Programming Language with backwards inference and sophisticated sampling algorithms. (See [PPLs](https://en.wikipedia.org/wiki/Probabilistic_programming)) - A visual tool aimed at casual users (see Guesstimate, Causal) diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index f811da95..16ff6afa 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -10,7 +10,8 @@ const path = require("path"); /** @type {import('@docusaurus/types').Config} */ const config = { title: "Squiggle", - tagline: "A simple programming language for intuitive probabilistic estimation", + tagline: + "A simple programming language for intuitive probabilistic estimation", url: "https://squiggle-language.com", baseUrl: "/", onBrokenLinks: "throw", diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css index b9126b2d..f5aa047d 100644 --- a/packages/website/src/css/custom.css +++ b/packages/website/src/css/custom.css @@ -4,7 +4,7 @@ * work well for content-centric websites. */ -@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Lato:wght@100;400;700;900&family=Lora:wght@400;500;600&display=swap'); +@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Lato:wght@100;400;700;900&family=Lora:wght@400;500;600&display=swap"); /* You can override the default Infima variables here. */ :root { @@ -40,7 +40,7 @@ html[data-theme="dark"] .docusaurus-highlight-code-line { background-color: rgba(0, 0, 0, 0.3); } -.hero h1{ +.hero h1 { font-size: 4em; font-weight: 900; margin-bottom: 0.5rem; @@ -56,7 +56,7 @@ html[data-theme="dark"] .docusaurus-highlight-code-line { .hero__subtitle { color: #888; - font-size:1.25em; + font-size: 1.25em; } .hero__subtitle2 { @@ -79,7 +79,8 @@ h2 { font-weight: 600; } -.menu__link, .navbar__item { +.menu__link, +.navbar__item { font-family: "Lora", serif; } @@ -89,4 +90,4 @@ h2 { :root { /* --ifm-font-family-base: 'Lora'; */ -} \ No newline at end of file +} diff --git a/packages/website/src/pages/index.js b/packages/website/src/pages/index.js index 616093d5..05278aad 100644 --- a/packages/website/src/pages/index.js +++ b/packages/website/src/pages/index.js @@ -12,9 +12,7 @@ function HomepageHeader() {

{siteConfig.title}

-

- Early Access -

+

Early Access

{siteConfig.tagline}

diff --git a/packages/website/src/pages/index.module.css b/packages/website/src/pages/index.module.css index f4518419..e746813a 100644 --- a/packages/website/src/pages/index.module.css +++ b/packages/website/src/pages/index.module.css @@ -8,7 +8,7 @@ text-align: center; position: relative; overflow: hidden; - background: rgb(255, 246, 237) + background: rgb(255, 246, 237); } @media screen and (max-width: 966px) { @@ -21,4 +21,4 @@ display: flex; align-items: center; justify-content: center; -} \ No newline at end of file +}