Skip to content

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

Open
@schanzer

Description

@schanzer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions