Skip to content

Commit 0b89623

Browse files
committed
Minor cleanups
1 parent cc6c8df commit 0b89623

5 files changed

Lines changed: 11 additions & 13 deletions

File tree

docs/GlowScriptDocs/local.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ <h1 class="Heading-1"> <font color="#0000A0">Running locally</font></h1>
3737
</div>
3838
<div class="Normal">
3939
<p class="Normal">When internet access is missing or poor, you may find it useful to run locally, independent of the internet. Here are the steps required.</p>
40-
<p class="Normal"><strong>* Install Python 2.7 (python.org).</strong></p>
40+
<p class="Normal"><strong>* Install Python 2.7 (python.org).</strong> Google App Engine requires Python 2.7</p>
4141
<p class="Normal"><strong>* Install the Google App Engine SDK for Python.</strong><br />
42-
At <a href="http://developers.google.com/appengine/downloads" target="_blank">developers.google.com/appengine/downloads</a>, download the package for your platform. If using Linux, unpack to a folder whose name will probably be google_appengine.</p>
42+
At <a href="http://developers.google.com/appengine/downloads" target="_blank">developers.google.com/appengine/downloads</a>, download the package for your platform. Chose Standard environment Python, then scroll down and click &quot;Download and install the original App Engine SDK for Python&quot;. If using Linux, unpack to a folder whose name will probably be google_appengine. </p>
4343
<p class="Normal"><strong>* Download the GlowScript source files.</strong><br />
4444
At <a href="https://github.com/BruceSherwood/glowscript" target="_blank">github.com/BruceSherwood/glowscript</a>, click on &quot;Download ZIP&quot;. After the download, unpack the zip file into a new folder named glowscript. On Linux, place this folder parallel to the google_appengine folder.</p>
4545
<p class="Normal"><strong>* On Windows and Mac</strong>, the Google App Engine installer includes an app &quot;Google APP Engine Launcher&quot; which simplifies launching GlowScript.<br />

docs/GlowScriptDocs/vector.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ <h1 class="Heading-1"> <font color="#0000a0">The vector object</font></h1>
5353
class="attribute">v2.y</span> is 20, <span class="attribute">v2.z</span> is 30 </p>
5454
<p class="Normal"> It is okay to make a vector from a vector: <span
5555
class="attribute">vec(v2)</span> is still <span class="attribute">vec(10,20,30)</span>. This is a convenient way to make a separate copy of a vector.</p>
56-
<p class="Normal">Currently it is not possible to use <span class="attribute"><strong>+=</strong></span>,<strong> <span class="attribute">-=</span></strong>, <span class="attribute"><strong>*=</strong></span><strong>, </strong>or <strong><span class="attribute">/=</span></strong> with vectors.</p>
57-
<p class="Normal"><strong><font color="#0000a0">Vector functions</font></strong></p>
56+
<p class="Normal"><strong><font color="#0000a0">Vector functions</font></strong></p>
5857
<p class="Normal">The following functions are available for working with vectors: </p>
5958
<p class="Normal"><strong>mag(A) = A.mag</strong> = |A|, the magnitude of a vector<br />
6059
<br />

docs/VPythonDocs/vector.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ <h1 class="Heading-1"> <font color="#0000a0">The vector Object</font></h1>
6060
class="attribute">v2.y</span> is 20, <span class="attribute">v2.z</span> is 30</p>
6161
<p class="Normal"> It is okay to make a vector from a vector: <span
6262
class="attribute">vector(v2)</span> is still <span class="attribute">vector(10,20,30)</span>. This is a convenient way to make a separate copy of a vector.</p>
63-
<p class="Normal">Currently it is not possible to use <span class="attribute"><strong>+=</strong></span>,<strong> <span class="attribute">-=</span></strong>, <span class="attribute"><strong>*=</strong></span><strong>, </strong>or <strong><span class="attribute">/=</span></strong> with vectors.</p>
6463
<p class="Normal"><strong><font color="#0000a0">Vector functions</font></strong></p>
6564
<p class="Normal">The following functions are available for working with vectors: </p>
6665
<p class="Normal"><strong>mag(A) = A.mag</strong> = |A|, the magnitude of a vector<br />
@@ -71,6 +70,8 @@ <h1 class="Heading-1"> <font color="#0000a0">The vector Object</font></h1>
7170
<br />
7271
<strong>hat(A) = A.hat</strong> =
7372
A/|A|, a unit vector in the direction of the vector; an alternative to A.norm(), based on the fact that unit vectors are customarily written in the form <strong>ĉ</strong>, with a &quot;hat&quot; over the vector<br />
73+
<br />
74+
For convenience, <span class="attribute">norm(vec(0,0,0))</span> or<span class="attribute"> vec(0,0,0).hat</span> is calculated to be <span class="attribute">vec(0,0,0)</span>. <span class="attribute"></span><br />
7475
<br />
7576
<strong>dot(A,B) = A.dot(B)</strong> = A dot B, the scalar dot product between two vectors<br />
7677
<br />
@@ -104,7 +105,7 @@ <h1 class="Heading-1"> <font color="#0000a0">The vector Object</font></h1>
104105
<p class="program">norm(A) # A/|A|, normalized; magnitude of 1<br />
105106
norm(vector(1,1,1)) = vector(1,1,1)/sqrt(3)</p>
106107
<p class="Normal">You can also write <span class="attribute">v1.norm()</span><span
107-
class="attribute"></span> or <span class="attribute">v1.hat</span>. For convenience, <span class="attribute">norm(vec(0,0,0))</span> is calculated to be <span class="attribute">vec(0,0,0)</span>. <span class="attribute"></span></p>
108+
class="attribute"></span> or <span class="attribute">v1.hat</span>. </p>
108109
<p class="Normal">You can change the direction of a vector without changing its magnitude:</p>
109110
<p class="program"> v2.hat = v1 # changes the direction of v2 to that of v1<br />
110111
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# but not the magnitude of v2</p>

lib/glow/graph.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757

5858
var fontsize = 16
5959
var graphid = 0
60-
var graphs = []
6160

6261
function graph(options) {
6362

@@ -87,9 +86,9 @@
8786

8887
this.__id = "graph"+graphid
8988
graphid++
90-
graphs.push(this)
9189
this.container = $('<div id="'+this.__id+'"></div>')
9290
this.__activated = false // don't create the graph until/unless there are objects to put in it
91+
this.__deleted = false // this is set to true if a graph is deleted
9392
this.graph_series = [] // series added to graph, in time order of creation of a series
9493
graph.__selected = this
9594
this.__width = 640
@@ -256,10 +255,9 @@
256255
},
257256
__changed: false,
258257
remove: function() { // JavaScript forbids anything.delete(), so in preprocessing we change .delete to .remove
259-
var n = int(this.__id.slice(5))
260-
graphs[n] = null // so update won't look at its objects
261258
if (this.__activated) {
262-
Plotly.purge(this.__id) // delete the graph
259+
if (!this.fast) Plotly.purge(this.__id) // delete the graph
260+
this.__deleted = true // signal to update to ignore this deleted graph
263261
this.container.remove() // delete its container
264262
}
265263
},
@@ -502,7 +500,7 @@
502500
this.__activated = true
503501
},
504502
__update: function() { // called once by plot function, if graph not yet activated
505-
if (!this.__changed) return
503+
if (!this.__changed || this.__deleted) return
506504
if (this.__lock) return
507505
var activated = this.__activated
508506

package/glow.2.7.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)