robservable
robservable copied to clipboard
Problem with cell number in presence of `viewof` cell
It seems that the presence of a viewof
cell breaks the cells numbering used to display unnamed cells.
For example in the following test notebook :
https://observablehq.com/d/9351a542d6f01f6d
The cell "second unnamed cell" should be number 3, but to display it we have to pass 4 to include :
robservable(
"https://observablehq.com/d/9351a542d6f01f6d",
include = 4
)
I think that's because a viewof
cell is exported as two cells : one for the input and one for the value, thus breaking the cell counter.
On Twitter I called this technique clever and I stand by that, but it's also not guaranteed by the API that cells will be rendered in this specific order. Including unnamed cells is really cool though, if we get to this we might give them more stable and visible identifiers than order on the page.
To give credit where it is due, the clever part is from @timelyportfolio :-)
I agree that having a way, via the API, to identify unnamed cell would indeed be great !