#NEWLINE# def cell_processing( self , dummy = None ) : #NEWLINE# #INDENT# '\n        %%processing - run the cell in the language Processing\n\n        This cell magic will execute the contents of the cell as a\n        Processing program. This uses the Java-based Processing\n        language.\n        \n        Example:\n\n            %%processing\n            setup() {\n            }\n            draw() {\n            }\n        ' #NEWLINE# self . canvas_id += 1 #NEWLINE# '%%processing - run contents of cell as a Processing script' #NEWLINE# repr_code = repr ( self . code ) #NEWLINE# if repr_code . startswith ( 'u' ) : #NEWLINE# #INDENT# repr_code = repr_code [ 1 : ] #NEWLINE# #UNINDENT# env = { #NEWLINE# #INDENT# 'code' : repr_code , #NEWLINE# 'id' : self . canvas_id , #NEWLINE# #UNINDENT# } #NEWLINE# code = ( '\n<canvas id="canvas_%(id)s"></canvas>\n<script>\nrequire([window.location.protocol + "//calysto.github.io/javascripts/processing/processing.js"], function () {\n    var processingCode = %(code)s;\n    var cc = Processing.compile(processingCode);\n    var processingInstance = new Processing("canvas_%(id)s", cc);\n});\n</script>\n' % env ) #NEWLINE# html = HTML ( repr_code ) #NEWLINE# self . kernel . Display ( html ) #NEWLINE# self . evaluate = False