File tree Expand file tree Collapse file tree 5 files changed +42
-16
lines changed
packages/perspective-jupyterlab/src Expand file tree Collapse file tree 5 files changed +42
-16
lines changed Original file line number Diff line number Diff line change
1
+ // ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
2
+ // ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
3
+ // ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
4
+ // ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
5
+ // ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
6
+ // ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
7
+ // ┃ Copyright (c) 2017, the Perspective Authors. ┃
8
+ // ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
9
+ // ┃ This file is part of the Perspective library, distributed under the terms ┃
10
+ // ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
11
+ // ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12
+
13
+ import THEMES from "../../../dist/css/perspective-jupyterlab.css" ;
14
+
15
+ // Export the required load_ipython_extension
16
+ exports . load_css = ( ) => {
17
+ const style = document . createElement ( "style" ) ;
18
+ style . textContent = THEMES ;
19
+ document . head . appendChild ( style ) ;
20
+ } ;
Original file line number Diff line number Diff line change 11
11
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
12
12
13
13
/* eslint-disable no-underscore-dangle */
14
+ import { load_css } from "./css" ;
14
15
15
16
// This file contains the javascript that is run when the notebook is loaded.
16
17
// It contains some requirejs configuration and the `load_ipython_extension`
17
18
// which is required for any notebook extension.
18
- //
19
- // Some static assets may be required by the custom widget javascript. The base
20
- // url for the notebook is not known at build time and is therefore computed
21
- // dynamically.
22
-
23
- import THEMES from "../../../dist/css/perspective-jupyterlab.css" ;
24
-
25
19
if ( window . require ) {
26
20
window . require . config ( {
27
21
map : {
@@ -33,9 +27,6 @@ if (window.require) {
33
27
} ) ;
34
28
}
35
29
36
- // Export the required load_ipython_extension
37
30
exports . load_ipython_extension = ( ) => {
38
- const style = document . createElement ( "style" ) ;
39
- style . textContent = THEMES ;
40
- document . head . appendChild ( style ) ;
31
+ load_css ( ) ;
41
32
} ;
Original file line number Diff line number Diff line change @@ -14,8 +14,14 @@ import "@finos/perspective-viewer-datagrid";
14
14
import "@finos/perspective-viewer-d3fc" ;
15
15
import "@finos/perspective-viewer-openlayers" ;
16
16
17
+ import { load_css } from "./css" ;
17
18
import { PerspectiveView } from "../view" ;
18
19
import { PerspectiveModel } from "../model" ;
19
20
20
21
exports . PerspectiveModel = PerspectiveModel ;
21
22
exports . PerspectiveView = PerspectiveView ;
23
+
24
+ // Run if in vs-code
25
+ if ( window . vscIPyWidgets ) {
26
+ load_css ( ) ;
27
+ }
Original file line number Diff line number Diff line change @@ -404,10 +404,16 @@ export class PerspectiveView extends DOMWidgetView {
404
404
table . update ( updated . delta ) ;
405
405
}
406
406
407
- this . _client_view . on_update (
408
- ( updated ) => this . _client_view_update_callback ( updated ) ,
409
- { mode : "row" }
410
- ) ;
407
+ if ( this . _client_view ) {
408
+ // NOTE: if `plugin_config_changed` called before
409
+ // `_handle_load_message`, this will be undefined
410
+ // Ignore, as `_handle_load_message` is sure to
411
+ // follow.
412
+ this . _client_view . on_update (
413
+ ( updated ) => this . _client_view_update_callback ( updated ) ,
414
+ { mode : "row" }
415
+ ) ;
416
+ }
411
417
412
418
this . _kernel_view . on_update (
413
419
( updated ) => this . _kernel_view_update_callback ( updated ) ,
Original file line number Diff line number Diff line change @@ -36,8 +36,11 @@ div.PSPContainer {
36
36
}
37
37
38
38
// Widget height for Voila
39
- body [data- voila= " voila" ] .jp-OutputArea-output div .PSPContainer {
39
+ // Widget height for VS Code
40
+ body [data- voila= " voila" ] .jp-OutputArea-output div .PSPContainer ,
41
+ body [data- vscode- theme- id] .cell-output-ipywidget-background div .PSPContainer {
40
42
min-height : 520px ;
43
+ height : 520px ;
41
44
}
42
45
43
46
div .PSPContainer perspective- viewer[theme= " Pro Light" ] {
You can’t perform that action at this time.
0 commit comments