@@ -55,6 +55,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5555*/
5656
5757
58+ var svgArrowPolygon = '0,3 12,3 12,0 18,5 12,10 12,7 0,7' ;
59+
5860var curVisualizerID = 1 ; // global to uniquely identify each ExecutionVisualizer instance
5961
6062// domRootID is the string ID of the root element where to render this instance
@@ -211,15 +213,19 @@ ExecutionVisualizer.prototype.render = function() {
211213 </table>' ) ;
212214
213215
214- this . domRoot
215- . find ( '#legendDiv' )
216- . append ( arrowHTML + ' line that has just executed' )
217- . find ( '.arrow:last' )
218- . css ( 'color' , lightArrowColor )
219- . end ( )
220- . append ( '<p style="margin-top:-6px">' + arrowHTML + ' next line to be executed</p>' )
221- . find ( '.arrow:last' )
222- . css ( 'color' , darkArrowColor ) ;
216+ this . domRoot . find ( '#legendDiv' )
217+ . append ( '<svg id="prevLegendArrowSVG"/> line that has just executed' )
218+ . append ( '<p style="margin-top: 3px"><svg id="curLegendArrowSVG"/> next line to be executed</p>' ) ;
219+
220+ myViz . domRootD3 . select ( 'svg#prevLegendArrowSVG' )
221+ . append ( 'polygon' )
222+ . attr ( 'points' , svgArrowPolygon )
223+ . attr ( 'fill' , lightArrowColor ) ;
224+
225+ myViz . domRootD3 . select ( 'svg#curLegendArrowSVG' )
226+ . append ( 'polygon' )
227+ . attr ( 'points' , svgArrowPolygon )
228+ . attr ( 'fill' , darkArrowColor ) ;
223229
224230
225231 if ( this . params . editCodeBaseURL ) {
@@ -675,13 +681,13 @@ ExecutionVisualizer.prototype.renderPyCodeOutput = function() {
675681 myViz . domRootD3 . select ( 'svg#leftCodeGutterSVG' )
676682 . append ( 'polygon' )
677683 . attr ( 'id' , 'prevLineArrow' )
678- . attr ( 'points' , '0,3 12,3 12,0 18,5 12,10 12,7 0,7' )
684+ . attr ( 'points' , svgArrowPolygon )
679685 . attr ( 'fill' , 'white' ) ;
680686
681687 myViz . domRootD3 . select ( 'svg#leftCodeGutterSVG' )
682688 . append ( 'polygon' )
683689 . attr ( 'id' , 'curLineArrow' )
684- . attr ( 'points' , '0,3 12,3 12,0 18,5 12,10 12,7 0,7' )
690+ . attr ( 'points' , svgArrowPolygon )
685691 . attr ( 'fill' , 'white' ) ;
686692
687693
0 commit comments