diff --git a/.gitignore b/.gitignore
index 396b0deb..8eaa6c8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,8 @@
dist/
jupyterlab/_output
-jupyterlab/.jupyterlite.doit.db
+jupyterlab/.jupyterlite.doit*
jupyterlab/lib/visualpython
jupyternotebook/visualpython
colab/visualpython
test/
.gitignore
-visualpython/js/com/com_Config.js
diff --git a/jupyterlab/dev-build.jupyterlab.sh b/jupyterlab/dev-build.jupyterlab.sh
index 29c2f980..7ebac489 100755
--- a/jupyterlab/dev-build.jupyterlab.sh
+++ b/jupyterlab/dev-build.jupyterlab.sh
@@ -50,4 +50,7 @@ jlpm run build
# jupyter lite build
# Run jupyterlite server
-# jupyter lite serve
\ No newline at end of file
+# jupyter lite serve # init + build + serve
+
+# If something went wrong, remove _output/extensions folder and run command below
+# jupyter lite init
\ No newline at end of file
diff --git a/visualpython/css/mainFrame.css b/visualpython/css/mainFrame.css
index 1efd12b7..c22373d5 100644
--- a/visualpython/css/mainFrame.css
+++ b/visualpython/css/mainFrame.css
@@ -59,6 +59,43 @@ div#vp_wrapper.colab * {
#vp_wrapper.lab *, #vp_wrapper.lite * {
box-sizing: border-box !important;
}
+/* LITE: show protector */
+#vp_wrapper.lab .vp-protector,
+#vp_wrapper.lite .vp-protector {
+ background-color: rgb(33 33 33 / 77%);
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ z-index: 100;
+}
+#vp_wrapper.lab .vp-protector-info,
+#vp_wrapper.lite .vp-protector-info {
+ background-color: var(--vp-background-color);
+ width: 250px;
+ height: 170px;
+ padding: 10px;
+ margin: auto;
+ top: calc(50% - 80px);
+ position: relative;
+ display: grid;
+ grid-template-rows: 20px 100px 30px;
+}
+#vp_wrapper.lab .vp-protector-title,
+#vp_wrapper.lite .vp-protector-title {
+ font-weight: bold;
+ color: var(--vp-font-highlight);
+}
+#vp_wrapper.lab .vp-protector-content,
+#vp_wrapper.lite .vp-protector-content {
+ border: 0.25px solid var(--vp-border-gray-color);
+ border-radius: 10px;
+ padding: 10px;
+ margin: 5px 0;
+}
+#vp_wrapper.lab .vp-protector-footer,
+#vp_wrapper.lite .vp-protector-footer {
+ text-align: right;
+}
/* resizing handle */
#vp_wrapper > .ui-resizable-handle {
diff --git a/visualpython/css/root.css b/visualpython/css/root.css
index 1ad1ec16..55a7a79f 100644
--- a/visualpython/css/root.css
+++ b/visualpython/css/root.css
@@ -378,6 +378,22 @@ button.vp-button {
background: #C4C4C4;
}
+/* Scrollbar vertical only */
+.vp-scrollbar-vertical {
+ overflow-x: hidden;
+ overflow-y: auto;
+ white-space: nowrap;
+ --webkit-mask-position: left top;
+}
+.vp-scrollbar-vertical::-webkit-scrollbar {
+ width: 5px;
+ height: 5px;
+}
+.vp-scrollbar-vertical::-webkit-scrollbar-thumb {
+ border: 0.3px solid #C4C4C4;
+ background: #C4C4C4;
+}
+
/* Scrollbar horizontal */
.vp-scrollbar-horizontal {
overflow-x: auto;
diff --git a/visualpython/data/m_library/pandasLibrary.js b/visualpython/data/m_library/pandasLibrary.js
index 488f9ef5..0646205b 100644
--- a/visualpython/data/m_library/pandasLibrary.js
+++ b/visualpython/data/m_library/pandasLibrary.js
@@ -44,7 +44,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -79,7 +79,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -110,7 +110,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -178,8 +178,9 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
- ]
+ "input"
+ ],
+ "value": "vp_df"
},
{
"name": "encoding",
@@ -348,7 +349,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -418,7 +419,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -487,7 +488,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -558,7 +559,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -647,7 +648,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -703,7 +704,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -777,7 +778,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -841,7 +842,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -920,7 +921,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -962,7 +963,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1004,7 +1005,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1056,7 +1057,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1108,7 +1109,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1160,7 +1161,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1222,7 +1223,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1281,7 +1282,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1340,7 +1341,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1399,7 +1400,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1458,7 +1459,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1517,7 +1518,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1593,7 +1594,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1669,7 +1670,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1765,7 +1766,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1797,7 +1798,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1880,7 +1881,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -1964,7 +1965,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -1992,7 +1993,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2021,7 +2022,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2048,7 +2049,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2076,7 +2077,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2105,7 +2106,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2132,7 +2133,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2165,7 +2166,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2198,7 +2199,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2226,7 +2227,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2253,7 +2254,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2281,7 +2282,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2309,7 +2310,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2336,7 +2337,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2365,7 +2366,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2393,7 +2394,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2417,7 +2418,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2444,7 +2445,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -2480,7 +2481,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -2534,7 +2535,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -2600,7 +2601,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -2666,7 +2667,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -2732,7 +2733,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -2785,7 +2786,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -2901,7 +2902,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -2930,7 +2931,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3003,7 +3004,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3063,7 +3064,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3145,7 +3146,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3179,7 +3180,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3219,7 +3220,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3264,7 +3265,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -3290,7 +3291,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -3316,7 +3317,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -3342,7 +3343,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -3368,7 +3369,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -3394,7 +3395,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -3420,7 +3421,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -3462,7 +3463,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -3491,7 +3492,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3525,8 +3526,9 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
- ]
+ "input"
+ ],
+ "value": "vp_df"
},
{
"name": "typ",
@@ -3608,7 +3610,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3682,8 +3684,9 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
- ]
+ "input"
+ ],
+ "value": "vp_df"
}
]
},
@@ -3722,7 +3725,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -3749,7 +3752,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3792,7 +3795,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3831,7 +3834,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3874,7 +3877,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3927,7 +3930,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -3979,7 +3982,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4059,7 +4062,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -4091,7 +4094,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4144,7 +4147,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4183,7 +4186,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4260,7 +4263,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4322,7 +4325,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -4353,7 +4356,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4437,7 +4440,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4526,7 +4529,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -4560,7 +4563,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -4603,7 +4606,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4661,7 +4664,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4705,7 +4708,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4795,7 +4798,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4889,7 +4892,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -4957,7 +4960,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -5012,7 +5015,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -5062,7 +5065,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
],
"var_type": [
"Series"
@@ -5136,7 +5139,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
],
"var_type": [
"Series",
@@ -5221,7 +5224,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -5259,7 +5262,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
],
"var_type": [
"Series",
@@ -5335,7 +5338,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
],
"var_type": [
"Series",
@@ -5386,7 +5389,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -5450,7 +5453,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -5520,7 +5523,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
],
"var_type": [
"Series",
@@ -5582,7 +5585,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -5670,7 +5673,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -5757,7 +5760,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -5883,7 +5886,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -5963,7 +5966,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -6058,7 +6061,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -6145,7 +6148,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -6204,7 +6207,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -6273,7 +6276,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
},
{
@@ -6535,8 +6538,9 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
- ]
+ "input"
+ ],
+ "value": "vp_df"
},
{
"name": "sheet_name",
@@ -6613,7 +6617,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -6640,7 +6644,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -6669,7 +6673,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -6696,7 +6700,7 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
+ "input"
]
}
]
@@ -6721,8 +6725,9 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
- ]
+ "input"
+ ],
+ "value": "vp_df"
},
{
"name": "format",
@@ -6766,8 +6771,9 @@ define([
"label": "Allocate to",
"output": true,
"component": [
- "data_select"
- ]
+ "input"
+ ],
+ "value": "vp_df"
},
{
"name": "usecols",
diff --git a/visualpython/html/m_apps/file.html b/visualpython/html/m_apps/file.html
index a72000de..c1117704 100644
--- a/visualpython/html/m_apps/file.html
+++ b/visualpython/html/m_apps/file.html
@@ -75,7 +75,7 @@
|
- |
+ |
diff --git a/visualpython/html/m_apps/sweetviz.html b/visualpython/html/m_apps/sweetviz.html
index 4769125a..0f059235 100644
--- a/visualpython/html/m_apps/sweetviz.html
+++ b/visualpython/html/m_apps/sweetviz.html
@@ -21,7 +21,7 @@
-
+
diff --git a/visualpython/js/MainFrame.js b/visualpython/js/MainFrame.js
index 551e0a2f..9031433c 100644
--- a/visualpython/js/MainFrame.js
+++ b/visualpython/js/MainFrame.js
@@ -88,6 +88,11 @@ define([
top: colabHeaderHeight + 'px'
});
});
+ } else if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') {
+ $('#vp_protectorShowWithoutKernel').click(function(evt) {
+ // just hide protector
+ vpConfig.hideProtector();
+ });
}
window.vpEvent = new com_Event(this);
@@ -250,6 +255,19 @@ define([
{ vp_note_display: vp_note_display, vp_note_width: vp_note_width },
{ parent: this }
);
+
+ // load protector for jupyterlite
+ if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') {
+ $('#vp_wrapper').append(`
+
+
No kernel
+
You have to open the notebook or console to use Visual Python.
+
+
+
`)
+ }
// consider height and width
this._resizeWindow();
diff --git a/visualpython/js/com/com_Config.js b/visualpython/js/com/com_Config.js
index 09825978..a82c078b 100644
--- a/visualpython/js/com/com_Config.js
+++ b/visualpython/js/com/com_Config.js
@@ -52,7 +52,7 @@ define([
*/
constructor(extensionType='notebook', initialData={}) {
// initial mode
- this.isReady = false;
+ this._isReady = { 'default': false };
this.extensionType = extensionType;
this.parentSelector = 'body';
if (extensionType === 'notebook') {
@@ -216,6 +216,41 @@ define([
}
+ get isReady() {
+ let sessionId = 'default';
+ if (this.extensionType === 'lab' || this.extensionType === 'lite') {
+ let panelId = vpKernel.getLabPanelId();
+ if (panelId) {
+ sessionId = panelId;
+ }
+ }
+ if (sessionId in this._isReady) {
+ return this._isReady[sessionId];
+ }
+ return false;
+ }
+
+ set isReady(ready) {
+ let sessionId = 'default';
+ if (this.extensionType === 'lab' || this.extensionType === 'lite') {
+ let panelId = vpKernel.getLabPanelId();
+ if (panelId) {
+ sessionId = panelId;
+ }
+ }
+ this._isReady[sessionId] = ready;
+ }
+
+ showProtector(title='No kernel', content='You have to open the notebook or console to use Visual Python.') {
+ $('#vp_protector .vp-protector-title').text(title);
+ $('#vp_protector .vp-protector-content').text(content);
+ $('#vp_protector').show();
+ }
+
+ hideProtector() {
+ $('#vp_protector').hide();
+ }
+
/**
* Read dejault config
*/
@@ -299,6 +334,9 @@ define([
let that = this;
// CHROME: change method to load py files ($.get -> require)
return new Promise(function(resolve, reject) {
+ // if (that.extensionType === 'lite') {
+ // that.showProtector('Kernel loading', 'Required inner function is loading now...');
+ // }
var libraryList = [
printCommand, fileNaviCommand, pandasCommand, variableCommand, visualizationCommand
];
@@ -344,6 +382,9 @@ define([
console.log('visualpython - failed to load library', resultObj);
// TODO: show to restart kernel
}).finally(function() {
+ // if (that.extensionType === 'lite') {
+ // that.hideProtector();
+ // }
if (!failed) {
console.log('visualpython - loaded libraries', libraryList);
resolve(true);
@@ -1005,8 +1046,8 @@ define([
/**
* FIXME: before release, change it to _MODE_TYPE.RELEASE
*/
- // Config.serverMode = _MODE_TYPE.DEVELOP;
- Config.serverMode = _MODE_TYPE.RELEASE;
+ Config.serverMode = _MODE_TYPE.DEVELOP;
+ // Config.serverMode = _MODE_TYPE.RELEASE;
/**
* Version
diff --git a/visualpython/js/com/com_Kernel.js b/visualpython/js/com/com_Kernel.js
index ec01e35a..4282c1ad 100644
--- a/visualpython/js/com/com_Kernel.js
+++ b/visualpython/js/com/com_Kernel.js
@@ -44,6 +44,9 @@ define([
},
'vpimport': {
+ },
+ 'vppackman': {
+
}
}
}
@@ -381,6 +384,8 @@ define([
}
var future;
if (vpConfig.isReady === false) {
+ vpConfig.isReady = true;
+ vpConfig.hideProtector();
vpConfig.readKernelFunction().then(function() {
future = kernelConnection.requestExecute(codeObj);
future.onIOPub = onIOPub;
@@ -695,6 +700,9 @@ define([
case 'vpimport':
configFile = 'import';
break;
+ case 'vppackman':
+ configFile = 'packman';
+ break;
}
var cmd = com_util.formatString("print(_vp_get_colab_vpcfg('{0}'))", configFile);
return new Promise(function(resolve, reject) {
@@ -727,6 +735,9 @@ define([
case 'vpimport':
configFile = 'import';
break;
+ case 'vppackman':
+ configFile = 'packman';
+ break;
}
// write file
var sbfileSaveCmd = new com_String();
@@ -761,6 +772,9 @@ define([
case 'vpimport':
configFile = 'import';
break;
+ case 'vppackman':
+ configFile = 'packman';
+ break;
}
var cmd = com_util.formatString("print(_vp_get_lab_vpcfg('{0}'))", configFile);
return new Promise(function(resolve, reject) {
@@ -793,6 +807,9 @@ define([
case 'vpimport':
configFile = 'import';
break;
+ case 'vppackman':
+ configFile = 'packman';
+ break;
}
// write file
var sbfileSaveCmd = new com_String();
diff --git a/visualpython/js/com/com_interface.js b/visualpython/js/com/com_interface.js
index 5a80ca98..4c12f1e5 100644
--- a/visualpython/js/com/com_interface.js
+++ b/visualpython/js/com/com_interface.js
@@ -111,6 +111,13 @@ define([
if (notebookPanel && notebookPanel.sessionContext){
var sessionContext = notebookPanel.sessionContext;
let sessionType = sessionContext.type;
+ if (vpConfig.extensionType === 'lite') {
+ // check one more time for jupyter lite
+ // - it returns 'notebook' when it's console
+ if (notebookPanel.console !== undefined) {
+ sessionType = 'console';
+ }
+ }
if (sessionType === 'notebook') {
var notebook = notebookPanel.content;
var notebookModel = notebook.model;
@@ -244,6 +251,13 @@ define([
if (notebookPanel && notebookPanel.sessionContext){
var sessionContext = notebookPanel.sessionContext;
let sessionType = sessionContext.type;
+ if (vpConfig.extensionType === 'lite') {
+ // check one more time for jupyter lite
+ // - it returns 'notebook' when it's console
+ if (notebookPanel.console !== undefined) {
+ sessionType = 'console';
+ }
+ }
if (sessionType === 'notebook') {
var notebook = notebookPanel.content;
var notebookModel = notebook.model;
diff --git a/visualpython/js/com/component/DataSelector.js b/visualpython/js/com/component/DataSelector.js
index ca520774..d6d34108 100644
--- a/visualpython/js/com/component/DataSelector.js
+++ b/visualpython/js/com/component/DataSelector.js
@@ -230,6 +230,8 @@ define([
$(this).select();
$(this).autocomplete('search', $(this).val());
}).autocomplete('instance')._renderItem = function(ul, item) {
+ $(ul).addClass('vp-scrollbar-vertical');
+ $(ul).css('max-height', '250px');
return $('
').attr('data-value', item.value)
.append(`${item.label}
`)
.appendTo(ul);
diff --git a/visualpython/js/com/component/FileNavigation.js b/visualpython/js/com/component/FileNavigation.js
index d10de03b..603ff8a0 100644
--- a/visualpython/js/com/component/FileNavigation.js
+++ b/visualpython/js/com/component/FileNavigation.js
@@ -259,6 +259,7 @@ define([
if (allowExtensionList.length > 0 && !allowExtensionList.includes(extension)) {
// TODO: alert
//vpCommon.renderAlertModal('Not supported file type');
+ vpLog.display(VP_LOG_TYPE.ERROR, 'Not supported file type: ' + extension);
return;
}
diff --git a/visualpython/js/com/component/PackageManager.js b/visualpython/js/com/component/PackageManager.js
index 95b7cb5f..350e9093 100644
--- a/visualpython/js/com/component/PackageManager.js
+++ b/visualpython/js/com/component/PackageManager.js
@@ -18,8 +18,9 @@ define([
'vp_base/js/com/com_Const',
'vp_base/js/com/com_String',
'vp_base/js/com/component/PopupComponent',
- 'vp_base/js/com/component/FileNavigation'
-], function(ifHtml, ifCss, com_util, com_Const, com_String, PopupComponent, FileNavigation) {
+ 'vp_base/js/com/component/FileNavigation',
+ 'vp_base/js/com/component/LoadingSpinner'
+], function(ifHtml, ifCss, com_util, com_Const, com_String, PopupComponent, FileNavigation, LoadingSpinner) {
/**
* PackageManager
@@ -324,6 +325,7 @@ define([
super.render();
let that = this;
+ let loadingSpinner = new LoadingSpinner($(this.wrapSelector('.vp-popup-body')));
vpConfig.getData('', 'vppackman').then(function(savedData) {
// Reset abnormal data
if (savedData == undefined || savedData.packageList === undefined) {
@@ -334,7 +336,7 @@ define([
that.packageLib = {
...savedData.packageList
};
-
+ loadingSpinner.remove();
// load package list
that.loadPackageList();
}).catch(function(err) {
@@ -343,7 +345,7 @@ define([
that.packageLib = {
...that.packageLibTemplate
};
-
+ loadingSpinner.remove();
// load package list
that.loadPackageList();
});
@@ -399,6 +401,7 @@ define([
$(this.wrapSelector('.vp-pm-table')).html('');
let packageList = Object.keys(this.packageLib);
+ let loadingSpinner = new LoadingSpinner($(this.wrapSelector('.vp-popup-body')));
vpKernel.getPackageList(packageList).then(function(resultObj) {
let { result } = resultObj;
let packageInfo = JSON.parse(result);
@@ -418,6 +421,8 @@ define([
that.bindItemEvent();
}).catch(function() {
+ }).finally(function() {
+ loadingSpinner.remove();
});
}
diff --git a/visualpython/js/com/component/SuggestInput.js b/visualpython/js/com/component/SuggestInput.js
index a0ae45f8..2c7fa96e 100644
--- a/visualpython/js/com/component/SuggestInput.js
+++ b/visualpython/js/com/component/SuggestInput.js
@@ -168,6 +168,8 @@ define([
$(this).select();
$(com_util.formatString(".{0}", that.uuid)).autocomplete('search', $(com_util.formatString(".{0}", that.uuid)).val());
}).autocomplete('instance')._renderItem = function(ul, item) {
+ $(ul).addClass('vp-scrollbar-vertical');
+ $(ul).css('max-height', '250px');
if (item.dtype != undefined) {
return $('').attr('data-value', item.value)
.append(`${item.label}
`)
diff --git a/visualpython/js/loadVisualpython.js b/visualpython/js/loadVisualpython.js
index c279b2c8..d7f57aa5 100644
--- a/visualpython/js/loadVisualpython.js
+++ b/visualpython/js/loadVisualpython.js
@@ -288,24 +288,35 @@ define([
// LAB: if widget is ready or changed, ready for lab kernel connected, and restart vp
vpLab.shell._currentChanged.connect(function(s1, value) {
var { newValue } = value;
+ vpLog.display(VP_LOG_TYPE.DEVELOP, 'jupyterlab shell currently changed', s1, value);
// kernel restart for notebook and console
if (newValue && newValue.sessionContext) {
+ vpConfig.hideProtector();
if (newValue.sessionContext.isReady) {
- vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...');
- vpConfig.isReady = true;
- vpConfig.readKernelFunction();
- vpConfig.checkVersionTimestamp();
- }
- newValue.sessionContext._connectionStatusChanged.connect(function(s2, status) {
- if (status === 'connected') {
+ if (vpConfig.isReady === false) {
vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...');
vpConfig.isReady = true;
vpConfig.readKernelFunction();
vpConfig.checkVersionTimestamp();
}
+ }
+ newValue.sessionContext._connectionStatusChanged.connect(function(s2, status) {
+ if (status === 'connected') {
+ if (vpConfig.isReady === false) {
+ vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...');
+ vpConfig.isReady = true;
+ vpConfig.readKernelFunction();
+ vpConfig.checkVersionTimestamp();
+ }
+ }
});
} else {
vpLog.display(VP_LOG_TYPE.LOG, 'No widget detected...');
+ vpConfig.isReady = false;
+ vpConfig.showProtector();
+ if (vpConfig.extensionType === 'lite') {
+ vpLab.serviceManager.sessions.runningChanged.connect(handleRunningChanged);
+ }
}
});
}
@@ -313,6 +324,22 @@ define([
return vpFrame;
}
+ var handleRunningChanged = function(a, b) {
+ vpLog.display(VP_LOG_TYPE.DEVELOP, 'Current widget:', vpLab.shell.currentWidget);
+ if (vpLab.shell.currentWidget) {
+ vpLab.shell.currentWidget.sessionContext.statusChanged.connect(function(currentWidget, status) {
+ if (status === 'idle' && vpConfig.isReady === false) {
+ vpLog.display(VP_LOG_TYPE.LOG, 'vp operations for kernel ready...');
+ vpConfig.isReady = true;
+ vpConfig.hideProtector();
+ vpConfig.readKernelFunction();
+ vpConfig.checkVersionTimestamp();
+ }
+ });
+ vpLab.serviceManager.sessions.runningChanged.disconnect(handleRunningChanged);
+ }
+ }
+
return { initVisualpython: initVisualpython, readConfig: readConfig };
}); /* function, define */
diff --git a/visualpython/js/m_apps/File.js b/visualpython/js/m_apps/File.js
index 9540c0d1..ce93fc74 100644
--- a/visualpython/js/m_apps/File.js
+++ b/visualpython/js/m_apps/File.js
@@ -177,7 +177,8 @@ define([
"data_select"
],
"output": true,
- "required": true
+ "required": true,
+ "value": 'vp_df'
}
]
}
@@ -235,9 +236,14 @@ define([
type = 'open';
}
+ let extensionList = [];
+ if (that.state.fileExtension !== '') {
+ extensionList = [ that.state.fileExtension ];
+ }
+
let fileNavi = new FileNavigation({
type: type,
- extensions: [ that.state.fileExtension ],
+ extensions: extensionList,
finish: function(filesPath, status, error) {
let {file, path} = filesPath[0];
that.state.selectedFile = file;
@@ -309,10 +315,11 @@ define([
/** Implement generating template */
let page = $(fileHtml);
- let allocateSelector = new DataSelector({
- pageThis: this, id: 'vp_sampleReturn', placeholder: 'Variable name'
- });
- $(page).find('#vp_sampleReturn').replaceWith(allocateSelector.toTagString());
+ // Removed dataselector for Allocation input
+ // let allocateSelector = new DataSelector({
+ // pageThis: this, id: 'vp_sampleReturn', placeholder: 'Variable name', value: 'vp_df'
+ // });
+ // $(page).find('#vp_sampleReturn').replaceWith(allocateSelector.toTagString());
return page;
}
diff --git a/visualpython/js/m_apps/Frame.js b/visualpython/js/m_apps/Frame.js
index a07f7299..a7538a1b 100644
--- a/visualpython/js/m_apps/Frame.js
+++ b/visualpython/js/m_apps/Frame.js
@@ -37,7 +37,7 @@ define([
this.state = {
originObj: '',
tempObj: '_vp',
- returnObj: '_vp',
+ returnObj: 'vp_df',
inplace: false,
menu: '',
menuItem: '',
@@ -176,7 +176,7 @@ define([
// initialize state values
that.state.originObj = origin;
that.state.tempObj = '_vp';
- that.state.returnObj = that.state.tempObj;
+ that.state.returnObj = 'vp_df';
if (that.state.inplace === true) {
that.state.returnObj = origin;
}
@@ -228,7 +228,7 @@ define([
// check/uncheck inplace
$(this.wrapSelector('#inplace')).on('change', function() {
let checked = $(this).prop('checked');
- let returnVariable = '_vp';
+ let returnVariable = 'vp_df';
if (checked === true) {
returnVariable = that.state.originObj;
}
@@ -1121,10 +1121,11 @@ define([
templateForBody() {
let page = $(frameHtml);
- let allocateSelector = new DataSelector({
- pageThis: this, id: 'vp_feReturn', placeholder: 'Variable name', required: true, value: '_vp'
- });
- $(page).find('#vp_feReturn').replaceWith(allocateSelector.toTagString());
+ // Removed dataselector for Allocation input
+ // let allocateSelector = new DataSelector({
+ // pageThis: this, id: 'vp_feReturn', placeholder: 'Variable name', required: true, value: 'vp_df'
+ // });
+ // $(page).find('#vp_feReturn').replaceWith(allocateSelector.toTagString());
return page;
}
diff --git a/visualpython/js/m_apps/Import.js b/visualpython/js/m_apps/Import.js
index 42f85f86..38b6aec6 100644
--- a/visualpython/js/m_apps/Import.js
+++ b/visualpython/js/m_apps/Import.js
@@ -70,10 +70,6 @@ define([
}
this.importTemplatesCopy = JSON.parse(JSON.stringify(importTemplates));
- if (vpConfig.extensionType === 'lite') {
- // for LITE: set default checked state as false on seaborn package
- this.importTemplatesCopy['data-analysis'][3].checked = false;
- }
if (!this.state.importMeta || this.state.importMeta.length <= 0) {
this.state.importMeta = JSON.parse(JSON.stringify(this.importTemplatesCopy[this.state.tabType]));
diff --git a/visualpython/js/m_apps/Instance.js b/visualpython/js/m_apps/Instance.js
index 129162b2..2dda58e9 100644
--- a/visualpython/js/m_apps/Instance.js
+++ b/visualpython/js/m_apps/Instance.js
@@ -208,10 +208,11 @@ define([
});
$(page).find('#vp_instanceTarget').replaceWith(targetSelector.toTagString());
- let allocateSelector = new DataSelector({
- pageThis: this, id: 'vp_instanceAllocate', placeholder: 'Variable name'
- });
- $(page).find('#vp_instanceAllocate').replaceWith(allocateSelector.toTagString());
+ // Removed dataselector for Allocation input
+ // let allocateSelector = new DataSelector({
+ // pageThis: this, id: 'vp_instanceAllocate', placeholder: 'Variable name'
+ // });
+ // $(page).find('#vp_instanceAllocate').replaceWith(allocateSelector.toTagString());
return page;
}
diff --git a/visualpython/js/m_apps/PandasOption.js b/visualpython/js/m_apps/PandasOption.js
index 0d6d1dfd..cb96e92c 100644
--- a/visualpython/js/m_apps/PandasOption.js
+++ b/visualpython/js/m_apps/PandasOption.js
@@ -17,9 +17,8 @@ define([
'vp_base/js/com/com_util',
'vp_base/js/com/com_Const',
'vp_base/js/com/com_String',
- 'vp_base/js/com/component/PopupComponent',
- 'vp_base/js/com/component/DataSelector'
-], function(poHTML, com_util, com_Const, com_String, PopupComponent, DataSelector) {
+ 'vp_base/js/com/component/PopupComponent'
+], function(poHTML, com_util, com_Const, com_String, PopupComponent) {
/**
* PandasOption
diff --git a/visualpython/js/m_apps/Subset.js b/visualpython/js/m_apps/Subset.js
index 835a9196..5c923a62 100644
--- a/visualpython/js/m_apps/Subset.js
+++ b/visualpython/js/m_apps/Subset.js
@@ -168,13 +168,14 @@ define([
let page = $(subsetHtml);
let that = this;
- let allocateSelector = new DataSelector({
- pageThis: this, id: 'allocateTo', classes: VP_DS_ALLOCATE_TO, placeholder: 'New variable name',
- finish: function() {
- that.generateCode();
- }
- });
- $(page).find('.' + VP_DS_ALLOCATE_TO).replaceWith(allocateSelector.toTagString());
+ // Removed dataselector for Allocation input
+ // let allocateSelector = new DataSelector({
+ // pageThis: this, id: 'allocateTo', classes: VP_DS_ALLOCATE_TO, placeholder: 'New variable name',
+ // finish: function() {
+ // that.generateCode();
+ // }
+ // });
+ // $(page).find('.' + VP_DS_ALLOCATE_TO).replaceWith(allocateSelector.toTagString());
return page;
}
diff --git a/visualpython/js/m_stats/Regression.js b/visualpython/js/m_stats/Regression.js
index ab37b76f..0a0896a0 100644
--- a/visualpython/js/m_stats/Regression.js
+++ b/visualpython/js/m_stats/Regression.js
@@ -707,10 +707,8 @@ define([
code.appendLine("from IPython.display import display, Markdown");
code.appendLine("from scipy import stats");
code.appendLine("import statsmodels.api as sm");
- if (testType === 'multiple') {
- if (['stepwise', 'backward', 'forward'].includes(method)) {
- code.appendLine("_predict = _result.predict(sm.add_constant(vp_df[_model.exog_names[1:]]))");
- }
+ if (testType === 'multiple' && ['stepwise', 'backward', 'forward'].includes(method)) {
+ code.appendLine("_predict = _result.predict(sm.add_constant(vp_df[_model.exog_names[1:]]))");
} else {
code.appendLine("_predict = _result.predict(vp_df)");
}