Skip to content

Commit daaaaee

Browse files
Add panels to notebook view
1 parent 3b584bf commit daaaaee

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

python/jupytergis_lab/src/notebookrenderer.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import {
1111
IJupyterGISDoc,
1212
IJupyterGISDocTracker,
1313
JupyterGISModel,
14+
IJGISFormSchemaRegistry,
15+
IAnnotationModel,
16+
IJGISFormSchemaRegistryToken,
17+
IAnnotationToken,
1418
} from '@jupytergis/schema';
1519
import {
1620
JupyterFrontEnd,
@@ -21,6 +25,7 @@ import { ConsolePanel } from '@jupyterlab/console';
2125
import { PathExt } from '@jupyterlab/coreutils';
2226
import { NotebookPanel } from '@jupyterlab/notebook';
2327
import { Contents } from '@jupyterlab/services';
28+
import { IStateDB } from '@jupyterlab/statedb';
2429
import { Toolbar } from '@jupyterlab/ui-components';
2530
import { CommandRegistry } from '@lumino/commands';
2631
import { MessageLoop } from '@lumino/messaging';
@@ -80,10 +85,21 @@ export class YJupyterGISLuminoWidget extends Panel {
8085
* @param options
8186
*/
8287
private _buildWidget = (options: IOptions) => {
83-
const { commands, model, externalCommands, tracker } = options;
88+
const {
89+
commands,
90+
model,
91+
externalCommands,
92+
tracker,
93+
formSchemaRegistry,
94+
state,
95+
annotationModel,
96+
} = options;
8497
const content = new JupyterGISPanel({
8598
model,
8699
commandRegistry: commands,
100+
formSchemaRegistry,
101+
state,
102+
annotationModel,
87103
});
88104
let toolbar: Toolbar | undefined = undefined;
89105
if (model.filePath) {
@@ -110,6 +126,9 @@ interface IOptions {
110126
model: JupyterGISModel;
111127
externalCommands?: IJGISExternalCommandRegistry;
112128
tracker?: JupyterGISTracker;
129+
formSchemaRegistry?: IJGISFormSchemaRegistry;
130+
state?: IStateDB;
131+
annotationModel?: IAnnotationModel;
113132
}
114133

115134
export const notebookRendererPlugin: JupyterFrontEndPlugin<void> = {
@@ -120,13 +139,19 @@ export const notebookRendererPlugin: JupyterFrontEndPlugin<void> = {
120139
IJupyterGISDocTracker,
121140
IJupyterYWidgetManager,
122141
ICollaborativeDrive,
142+
IStateDB,
143+
IJGISFormSchemaRegistryToken,
144+
IAnnotationToken,
123145
],
124146
activate: (
125147
app: JupyterFrontEnd,
126148
externalCommandRegistry?: IJGISExternalCommandRegistry,
127149
jgisTracker?: JupyterGISTracker,
128150
yWidgetManager?: IJupyterYWidgetManager,
129151
drive?: ICollaborativeDrive,
152+
formSchemaRegistry?: IJGISFormSchemaRegistry,
153+
state?: IStateDB,
154+
annotationModel?: IAnnotationModel,
130155
): void => {
131156
if (!yWidgetManager) {
132157
console.error('Missing IJupyterYWidgetManager token!');
@@ -207,7 +232,11 @@ export const notebookRendererPlugin: JupyterFrontEndPlugin<void> = {
207232
commands: app.commands,
208233
model: yModel.jupyterGISModel,
209234
externalCommands: externalCommandRegistry,
235+
210236
tracker: jgisTracker,
237+
annotationModel,
238+
state,
239+
formSchemaRegistry,
211240
});
212241
this._jgisWidget = widget.jgisWidget;
213242

0 commit comments

Comments
 (0)