Skip to content

Commit

Permalink
fix: add Voila >= 0.2.8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mariobuikhuizen committed May 3, 2021
1 parent 9c0ead3 commit 7f2948d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions bqplot_vuetify_example.ipynb
Expand Up @@ -201,6 +201,9 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
},
"voila": {
"template": "vuetify-default"
}
},
"nbformat": 4,
Expand Down
23 changes: 21 additions & 2 deletions share/jupyter/nbconvert/templates/vuetify-base/util.js
Expand Up @@ -79,6 +79,24 @@ function getWidgetManager(voila, kernel) {
saveState: {
connect: () => {}
},
/* voila >= 0.2.8 */
sessionContext: {
session: {
kernel
},
kernelChanged: {
connect: () => {
}
},
statusChanged: {
connect: () => {
}
},
connectionStatusChanged: {
connect: () => {
}
},
},
};

const settings = {
Expand Down Expand Up @@ -138,8 +156,9 @@ window.init = async (voila) => {
const widgetManager = getWidgetManager(voila, kernel);

if (!window.enable_nbextensions) {
const originalLoader = widgetManager.loader;
widgetManager.loader = (moduleName, moduleVersion) => {
const loaderName = widgetManager.loader ? 'loader' : '_loader';
const originalLoader = widgetManager[loaderName];
widgetManager[loaderName] = (moduleName, moduleVersion) => {
if (moduleName === 'jupyter-vuetify' || moduleName === 'jupyter-vue') {
requirejs.config({
paths: {
Expand Down

0 comments on commit 7f2948d

Please sign in to comment.