GeoJSON to TopoJSON in Observable

I haven’t been able to figure out how to do GeoJSON to TopoJSON in @observablehq. What I want is to do the equivalent of geo2topo, but in the browser.

Here is as close as I have got:

But if you uncomment that first cell and load a big (200MB) GeoJSON (e.g. https://geoportal.dane.gov.co/descargas/CNPV2018/Geojson/GeoJsonMGN_AMN_MPIOS.rar) in the input it seems to crash the notebook.

Testing geo2topo works, and I also made it work in HTML: https://codepen.io/duto_guerra/pen/jOqQYwV

My guess is that since topojson.topology modifies the original object, it might be messing with the reactivity. Not sure if this is the right place to post, but anyhow…