By adding a signal to listen to changes of https://vega.github.io/vega/docs/expressions/#containerSize or (probably better) use `autosize: 'fit'`.