@@ -4,7 +4,7 @@ import { DocumentWidget } from '@jupyterlab/docregistry';
44import { IObservableMap , ObservableMap } from '@jupyterlab/observables' ;
55import { JSONValue } from '@lumino/coreutils' ;
66import { ISignal , Signal } from '@lumino/signaling' ;
7- import { SplitPanel } from '@lumino/widgets' ;
7+ import { SplitPanel , Widget } from '@lumino/widgets' ;
88import {
99 IJupyterGISModel ,
1010 IJupyterGISWidgetContext ,
@@ -15,6 +15,9 @@ import {
1515import { JupyterGISMainViewPanel } from './mainview' ;
1616import { MainViewModel } from './mainview/mainviewmodel' ;
1717import { ConsoleView } from './console' ;
18+ import { MessageLoop } from '@lumino/messaging' ;
19+
20+ const CELL_OUTPUT_WIDGET_CLASS = 'jgis-cell-output-widget' ;
1821
1922export class JupyterGISWidget
2023 extends DocumentWidget < JupyterGISPanel , IJupyterGISModel >
@@ -49,7 +52,17 @@ export class JupyterGISOutputWidget
4952{
5053 constructor ( options : JupyterGISOutputWidget . IOptions ) {
5154 super ( options ) ;
55+ this . addClass ( CELL_OUTPUT_WIDGET_CLASS ) ;
5256 this . context = options . context ;
57+
58+ const resizeObserver = new ResizeObserver ( ( ) => {
59+ // Send a resize message to the widget, to update the child size.
60+ MessageLoop . sendMessage (
61+ this ,
62+ Widget . ResizeMessage . UnknownSize
63+ ) ;
64+ } ) ;
65+ resizeObserver . observe ( this . node ) ;
5366 }
5467
5568 readonly context : IJupyterGISWidgetContext ;
0 commit comments