brownplt / code.pyret.org

Website for serving Pyret to folks.
Other
24 stars 44 forks source link

- Allow interval charts to compose w/other charts that render-charts() takes #497

Closed ds26gte closed 6 months ago

ds26gte commented 7 months ago

486

schanzer commented 7 months ago

@ds26gte Here's the sample program I'm using to test, which combines a scatter plot and an interval chart:

include chart

xs = [list: 1,-2,9,4]
ys = [list: 1,2,3,4]
fn = lam(x): x end
residuals = map2(
  lam(y, prediction): y - prediction end, 
  ys, 
  map(fn, xs))

scatter = from-list.scatter-plot(xs, ys)
fn-plot = from-list.function-plot(fn)
intervals = from-list.interval-chart(xs, ys, residuals)

render-charts([list: scatter, fn-plot, intervals])
  .display()

With this PR, I get the following error:

image
jpolitz commented 6 months ago

Is this at a point where it should be good to review + go or still in progress?

schanzer commented 6 months ago

@jpolitz good to go! Ready for final review and merger

jpolitz commented 6 months ago

@ds26gte @schanzer I think for this go ahead and push directly to horizon so you can get the testing and autodeploy. Might make testing cycles faster! I won't release till you say it's ready.

ds26gte commented 6 months ago

@schanzer brought up a new test case which I'll investigate and then let you know after if it's ready to go.