Updating a Kino frame with Kino.Markdown within a grid

Edit: This was a user error. This scenario works fine.

I am trying to build a Kino grid that looks like this:

Cell 1:

md = Kino.Markdown.new(mermaid_graph)
md_frame = Kino.Frame.new()

...create buttons...

Kino.Shorts.grid([md_frame, button_frame])



Then, I want to periodically update that markdown within a process, like this: 

```elixir
  def render(meta) do
    new_diagram = diagram()
    Kino.Frame.render(meta.frame, new_diagram)

    %{meta| diagram: diagram}
  end

If I do this, the original frame within the grid never updates.

Cell 2

But, I can then create a new cell using the same frame, and I can see it update periodically. How do I update a frame within a grid? I can already animate my Kino.VegaLite plots and Kino.DataTable tables, but not my Mermaid diagrams. Any advice?

1 Like

Are you trying to render the new diagram directly into the frame? By the looks of it, you might need to do a new markdown Kino from the new diagram then render that markdown kino.

If you post more of the code it’ll be easier to diagnose

Thanks for looking!

I figured it out a few minutes ago. It was a coding error.

-bt

1 Like