Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

charts with custom images lose those images when composed with other charts #471

Open
schanzer opened this issue May 26, 2023 · 0 comments

Comments

@schanzer
Copy link
Contributor

schanzer commented May 26, 2023

The following code works as-expected:

image-scatter-plot :: (t :: Table, xs :: String, ys :: String, f :: (Row -> Image)) -> Image
fun image-scatter-plot(t, xs, ys, f) block:
  images = t.all-rows().map(f)
  render-charts([list: 
          from-list.image-scatter-plot(images, ensure-numbers(t.column(xs)), ensure-numbers(t.column(ys)))])
    .x-axis(xs)
    .y-axis(ys)
    .display()
end

test = table: x,y
  row: 1,2
  row: 10, 20
end

image-scatter-plot(test, "x","y", lam(r): triangle(15, "solid", "red") end)

(Note that I'm using render-charts on purpose in this example. The real code just uses render-chart.)

Now change the render-charts line to add a function plot:

  render-charts([list:
       from-list.function-plot(num-sqr), 
       from-list.image-scatter-plot(images, ensure-numbers(t.column(xs)), ensure-numbers(t.column(ys)))])

And the custom triangles disappear.

I don't see any JS errors in the console either, and re-arranging the order of the dataseries in the list has no impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant