Ejemplo n.º 1
0
def MplJs():
    """
    Serves the generated matplotlib javascript file.  The content
    is dynamically generated based on which toolbar functions the
    user has defined.  Call `FigureManagerWebAgg` to get its
    content.
    """
    js_content = FigureManagerWebAgg.get_javascript()
    resp = make_response(js_content, 200)
    resp.headers['Content-Type'] = 'application/javascript'
    return resp
        def get(self):
            self.set_header('Content-Type', 'application/javascript')
            js_content = FigureManagerWebAgg.get_javascript()

            self.write(js_content)
Ejemplo n.º 3
0
 def get(self):
     self.set_header('Content-Type', 'application/javascript')
     js_content = FigureManagerWebAgg.get_javascript()
     with open('static/mpl.js', 'r') as fh:
         local_content = fh.read()
     self.write(local_content)
        def get(self):
            self.set_header('Content-Type', 'application/javascript')
            js_content = FigureManagerWebAgg.get_javascript()

            self.write(js_content)