Skip to content

Commit 0b392b2

Browse files
committed
Fix plotly label bug
1 parent 25f8106 commit 0b392b2

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

ForInstalledPython/glow.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ide/ide.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ $(function () {
14101410

14111411
pageBody.html(page)
14121412

1413-
// I decided to process shortcuts myself instead of relying on ACE, because
1413+
// I (David Scherer) decided to process shortcuts myself instead of relying on ACE, because
14141414
// ACE might not always have focus
14151415
$(document).keydown( shortcutKey )
14161416
onNavigate.on( function(cb) { $(document).off("keydown", shortcutKey); cb() } )
@@ -1424,7 +1424,7 @@ $(function () {
14241424
}
14251425
if (ev.ctrlKey && ev.keyCode == "2".charCodeAt(0)) {
14261426
ev.preventDefault()
1427-
// If I don't pass anything for features, I get a new tab instead
1427+
// If I don't pass anything for features, I get a new tab instead of a separate window
14281428
var features = "titlebar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes"
14291429
window.open("/#/", "GlowScriptRun", features)
14301430
window.open(run_link, "GlowScriptRun", features)

lib/compiling/GScompiler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,8 @@ where compile() was called, in untrusted/run.js.
12601260
// console.log('classmethods', classmethods)
12611261
// console.log('============================================================================')
12621262
// let i = program.search('"2";')
1263-
let i = program.search('async function __main__')
1264-
console.log(program.slice(i))
1263+
// let i = program.search('async function __main__')
1264+
// console.log(program.slice(i))
12651265
// console.log(program)
12661266
return program
12671267
} // end of compile function

lib/glow/graph.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,15 @@
981981
}
982982
*/
983983
this.__graph.add_to_graph(this) // this sets this.__id
984+
985+
// If fast == False we invoke plotly, and plotly doesn't display a label
986+
// if there is only one active object in the graph. The following code
987+
// adds a gcurve to the first object and plots at (0,0), which has the
988+
// effect of forcing display of the label of the first object.
989+
if (!this.__graph.fast && this.__graph.graph_series.length == 1) {
990+
let gc = gcurve()
991+
gc.plot(0,0)
992+
}
984993

985994
this.remove = function() { // JavaScript forbids anything.delete(), so in preprocessing we change .delete to .remove
986995
this.data = []

package/glow.3.2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)