quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
157 stars 23 forks source link

Function charts lengthen infinitely in preview #3124

Open OAGr opened 8 months ago

OAGr commented 8 months ago

Description of suggestion or shortcoming:

image

When I hover over a function chart variable, it expands forever, similar to what happened before with dists. I assume a similar fix should work here.

https://github.com/quantified-uncertainty/squiggle/issues/3013

OAGr commented 8 months ago

Huh, I'm having trouble replicating it now. Seems sporadic. Will keep an eye out for a replicable example.

OAGr commented 7 months ago

Here's a replication: https://www.squiggle-language.com/playground?v=dev#code=eNptjcEKwjAQRH9lySnBWtpiBQue9Au8iVEIZAPFdlvSiJTSf3cbDwoKexh23sxMwqIzjyYcOouiEkMwPsAejiZg2po7yiIrNgnw5UoTkv1jbt%2BmJkcy1C1WcIk9yQ%2BZ5wt6VVwyaQKwtXOsQ3dG44cYhjXEsFr8kd%2FNeOIWpqjzrWnkBH1ZwTpLiwT6HcssLWGOuKHhiZ5RmcPqK6zgFqc%2BjKZZk5hfbJtNuA%3D%3D

start = Date.make(2024, 4, 1)
end = Date.make(2024, 6, 1)

fn(time: [start, Date.make(2024, 11, 1)]) = {
  diff = toYears(time - start)
  yearlyRate = normal({ p5: -0.2, p95: 0.5 })
  answer = (1 + yearlyRate) ^ diff
  answer
}