Skip to content

Commit 5c0a16a

Browse files
author
minjk-bl
committed
Edit Plotly, WordCloud app not to auto-import on loading preview
1 parent afbbfb8 commit 5c0a16a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

js/m_visualize/Plotly.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,11 @@ define([
549549
// let height = $(this.wrapSelector('#vp_ptPreview')).height();
550550
// console.log(width, height);
551551
etcOptionCode.push(com_util.formatString('width={0}, height={1}', width, height));
552+
553+
// no auto-import for preview
554+
this.config.checkModules = [];
555+
} else {
556+
this.config.checkModules = ['px'];
552557
}
553558

554559
let generatedCode = com_generator.vp_codeGenerator(this, config, this.state

js/m_visualize/WordCloud.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,16 @@ define([
304304
let code = new com_String();
305305

306306
// preview option
307-
if (preview) {
307+
if (preview === true) {
308308
// Ignore warning
309309
code.appendLine('import warnings');
310310
code.appendLine('with warnings.catch_warnings():');
311311
code.appendLine(" warnings.simplefilter('ignore')");
312+
313+
// no auto-import for preview
314+
this.config.checkModules = [];
315+
} else {
316+
this.config.checkModules = ['Counter', 'plt', 'WordCloud'];
312317
}
313318

314319
// counter for top limit

0 commit comments

Comments
 (0)