0.9.0
Published Dec 28, 2023
@quri/squiggle-lang (opens in a new tab)
Tags and decorators
Squiggle now supports tags (Tag.*
functions) and decorators (@decoratorName
) that can be used to affect how the value is displayed. (#2572 (opens in a new tab) and others).
Tags can be attached to any value, and decorators can be attached to any variable or function definition.
Decorators are proxied to Tag functions, e.g. @name("X var") x = 5
is the same as x = 5 -> Tag.name("X var")
.
Builtin tags: @name
, @description
, @format
, @showAs
, @hide
.
-
Tag percentage values with percentage format, so that they're rendered as percentages in viewer (#2759 (opens in a new tab))
-
Removed
title
attribute fromTable.make()
; you can use@name
and@description
tags instead (#2718 (opens in a new tab))
Dates and Durations improvements (#2572 (opens in a new tab)).
Added date domains, f(x: [Date(1980), Date(2050)])
, that's used in function plots for the x axis.
You can now type Date(2023)
to represent Jan 1 2023.
Standard library
-
Alias
Module.make()
methods toModule()
(#2681 (opens in a new tab))
Examples:List.make()
->List()
,Dist.make()
->Dist()
, etc. -
Added
Calculator(fn)
shorthand (#2660 (opens in a new tab))
It also works for functions with n>0 params (#2694 (opens in a new tab)) -
Added
List.sortBy
,List.maxBy
,List.minBy
,Dict.has
,Dict.size
,Dict.delete
(#2551 (opens in a new tab)) -
Added definitions to
Number.min
andNumber.max
that support two number params (#2551 (opens in a new tab)) -
Breaking: Change
Number.rangeDomain({min, max})
to berangeDomain(min, max)
(#2692 (opens in a new tab)) -
Breaking:
Plot.scatter
now only accepts sampleset distributions. (#2655 (opens in a new tab)) -
Added
Dist.median
,Number.quantile
,Number.median
(#2577 (opens in a new tab)) -
Added data-first definitions for
Plot.dist
,Plot.dists
,Plot.numericFn
,Plot.distFn
,Table.make
,Calculator.make
. Deprecate old versions. (#2676 (opens in a new tab)) -
Breaking: Removed
points(number)
fromPlot.distFn
andPlot.numericFn
plots, replaced withxPoints(number[])
. (#2768 (opens in a new tab)) -
Fix
!
operator:!0
now evaluates totrue
, and!1
tofalse
(#2658 (opens in a new tab))
Other changes
-
Fix pointwise combination precision issues on discrete PointSet dists. This was affecting
mixture
and pointwise operators. (#2514 (opens in a new tab)) -
Expose
getFunctionDocumentation
function to render documentation in the playground (#2583 (opens in a new tab))
@quri/squiggle-components (opens in a new tab)
-
Updated distribution charts to be prettier and better support different sizes (#2782 (opens in a new tab))
-
Tooltips and inline documentation for stdlib functions in editor (#2583 (opens in a new tab))
-
New dropdown menu on each value in viewer (#2549 (opens in a new tab))
-
Hide calculator top when empty, auto-close widgets with strings of less than 25 chars, expose errors when items are focused. (#2547 (opens in a new tab))
-
Calculator result functions no longer re-run on input changes (#2525 (opens in a new tab))
-
Added
window.squiggleOutput
output for debugging (#2564 (opens in a new tab)) -
Show vertical lines when distribution summary table cells are hovered (#2585 (opens in a new tab))
@quri/prettier-plugin-squiggle (opens in a new tab)
- Improved formatting for pipe statements and newlines (
b5d1394
(opens in a new tab))
vscode-squiggle (opens in a new tab)
-
Use 0.9.0 Squiggle
-
Convert webview implementation to TypeScript