Skip to content

Commit 90d84a6

Browse files
feat: show widget loading stage in the loader
1 parent 6f16bde commit 90d84a6

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

ManyWidgets.ipynb

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import ipywidgets as widgets\n",
10+
"import ipyvuetify as v"
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": null,
16+
"metadata": {},
17+
"outputs": [],
18+
"source": [
19+
"buttons = [widgets.Button(description=f'button {i}') for i in range(1000)]"
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": null,
25+
"metadata": {},
26+
"outputs": [],
27+
"source": [
28+
"v.Row(_metadata={'mount_id': 'content'}, children=buttons)"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": null,
34+
"metadata": {},
35+
"outputs": [],
36+
"source": []
37+
}
38+
],
39+
"metadata": {
40+
"kernelspec": {
41+
"display_name": "Python 3",
42+
"language": "python",
43+
"name": "python3"
44+
},
45+
"language_info": {
46+
"codemirror_mode": {
47+
"name": "ipython",
48+
"version": 3
49+
},
50+
"file_extension": ".py",
51+
"mimetype": "text/x-python",
52+
"name": "python",
53+
"nbconvert_exporter": "python",
54+
"pygments_lexer": "ipython3",
55+
"version": "3.8.3"
56+
}
57+
},
58+
"nbformat": 4,
59+
"nbformat_minor": 4
60+
}

share/jupyter/voila/templates/vuetify-base/nbconvert_templates/util.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ window.init = async (voila) => {
144144
};
145145
}
146146

147+
app.$data.loadingPercentage = -1;
148+
app.$data.loading_text = 'Loading widgets';
149+
147150
await widgetManager.build_widgets();
148151

149152
Object.values(widgetManager._models)
@@ -161,6 +164,8 @@ window.init = async (voila) => {
161164
}
162165
});
163166

167+
app.$data.loadingPercentage = 0;
168+
app.$data.loading_text = 'Done';
164169
app.$data.loading = false;
165170
removeInterferingStyleTags();
166171
};

0 commit comments

Comments
 (0)