embedding a mutable cell shows cell name and value

When I embed a mutable cell such as mutable type = "sharks" I only want sharks returned and not the whole string of type = sharks, but that is what happens.

In Observable I can enter type in a new cell to have sharks returned, but I cannot embed that cell, since it’s not named. Any solution to this?

It should be possible to write a custom inspector that outputs whatever you want given the cell. There’s some advice on it in this tutorial (looks like it’s been renamed to “Advanced” at some point…):

If you can say more about what you’re trying to do or provide an example notebook, it’ll be easier to give more targeted advice or even code.

Great, I’ll check that out. I’m sure it’s possible, just not sure how to customize the outputs once imported.

For an example, if you look in this notebook at the viewof rects cell, when you click on an image, the mutable type cell above it shows the output. I’ll then use this to filter on a chart shown. Hope that is useful :slight_smile:

Here’s a very minimal embedding that shows the type above the image cells in a JSFiddle:


For the custom inspector, all I did was copy the second example from the Observable Runtime README into the default embedding code.


Oh great, thank you! I was trying the same code but not having success .