You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/09/09 21:57:54 UTC

[GitHub] [beam] KevinGG commented on a change in pull request #12770: [BEAM-10545] Assembled the extension with components

KevinGG commented on a change in pull request #12770:
URL: https://github.com/apache/beam/pull/12770#discussion_r485945032



##########
File path: sdks/python/apache_beam/runners/interactive/extensions/apache-beam-jupyterlab-sidepanel/src/SidePanel.ts
##########
@@ -0,0 +1,120 @@
+// Licensed under the Apache License, Version 2.0 (the 'License'); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+import {
+  SessionContext,
+  ISessionContext,
+  sessionContextDialogs
+} from '@jupyterlab/apputils';
+import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
+import { ServiceManager } from '@jupyterlab/services';
+import { Message } from '@lumino/messaging';
+import { BoxPanel } from '@lumino/widgets';
+
+// prettier-ignore
+import {
+  InteractiveInspectorWidget
+} from './inspector/InteractiveInspectorWidget';
+
+/**
+ * The side panel: main user interface of the extension.
+ *
+ * Multiple instances of the side panel can be opened at the same time. They
+ * can be operated independently but sharing the same kernel state if connected
+ * to the same notebook session model or running kernel instance.
+ */
+export class SidePanel extends BoxPanel {
+  constructor(
+    manager: ServiceManager.IManager,
+    rendermime: IRenderMimeRegistry
+  ) {
+    super({
+      direction: 'top-to-bottom',
+      alignment: 'end'
+    });
+    this.id = 'apache-beam-jupyterlab-sidepanel';
+    this.title.label = 'Interactive Beam Inspector';
+    this.title.closable = true;
+
+    this._sessionContext = new SessionContext({
+      sessionManager: manager.sessions,
+      specsManager: manager.kernelspecs,
+      name: 'Interactive Beam Inspector Session'
+    });
+
+    this._inspector = new InteractiveInspectorWidget(this._sessionContext);
+    this.addWidget(this._inspector);
+
+    void this._sessionContext

Review comment:
       Thanks! Used async/wait syntax throughly.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org