當前位置: 首頁>>代碼示例>>Python>>正文


Python backend_webagg_core.FigureManagerWebAgg類代碼示例

本文整理匯總了Python中matplotlib.backends.backend_webagg_core.FigureManagerWebAgg的典型用法代碼示例。如果您正苦於以下問題:Python FigureManagerWebAgg類的具體用法?Python FigureManagerWebAgg怎麽用?Python FigureManagerWebAgg使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FigureManagerWebAgg類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

 def __init__(self, canvas, num):
     FigureManagerWebAgg.__init__(self, canvas, num)
     toolitems = []
     for name, tooltip, image, method in self.ToolbarCls.toolitems:
         if name is None:
             toolitems.append(['', '', '', ''])
         else:
             toolitems.append([name, tooltip, image, method])
     canvas._toolbar_items = toolitems
     self.web_sockets = [self.canvas]
開發者ID:stonebig,項目名稱:jupyter-matplotlib,代碼行數:10,代碼來源:backend_nbagg.py

示例2: __init__

    def __init__(self):

        super(MyApplication, self).__init__([
            # Static files for the CSS and JS
            (r'/_static/(.*)',
            #(r'/(.*)',
             tornado.web.StaticFileHandler,
             {'path': FigureManagerWebAgg.get_static_file_path()}),

            (r'/', MainPage),

            # The pages that contain the plot (or maybe the plots)
            (r'/DataFrame\d', PlotPage),

            (r'/mpl.js', self.MplJs),

            # Sends images and events to the browser, and receives
            # events from the browser
            (r'/([0-9]+)/ws', self.WebSocket),

            # Handles the downloading (i.e., saving) of static images
            (r'/download.([a-z0-9.]+)', self.Download),

            ],
            static_path='static',
            template_path='templates',
            debug=True
            )
開發者ID:bmu,項目名稱:webagg_examples,代碼行數:28,代碼來源:plot_server.py

示例3: __init__

    def __init__(self, stop_callback=None):
        super(MyApplication, self).__init__([
            # Static files for the CSS and JS
            (r'/_static/(.*)',
             tornado.web.StaticFileHandler,
             {'path': FigureManagerWebAgg.get_static_file_path()}),

            # The page that contains all of the pieces
            ('/', self.MainPage),

            ('/mpl.js', self.MplJs),

            # Sends images and events to the browser, and receives
            # events from the browser
            ('/ws', self.WebSocket),

            # Handles the downloading (i.e., saving) of static images
            (r'/download.([a-z0-9.]+)', self.Download),
        ])

        figure = Figure()

        self.manager = new_figure_manager_given_figure(
            id(figure), figure)

        ax = figure.add_subplot(1, 1, 1)

        def callback(event):
            '''Sends event to front end'''
            event.info.pop('caller', None)  # HACK: popping caller b/c it's not JSONizable.
            self.manager._send_event(event.type, **event.info)

        self.fc_manager = fc_widget.FCGateManager(ax, callback_list=callback)
        self.stop_callback = stop_callback
開發者ID:eyurtsev,項目名稱:FlowCytometryTools,代碼行數:34,代碼來源:gui.py

示例4: create_application

def create_application():
    application = Application([
        ('/_static/(.*)', StaticFileHandler, {'path': FigureManagerWebAgg.get_static_file_path()}),
        ('/mpl.js', MplJavaScriptHandler),

        (url_pattern('/mpl/download/{{base_dir}}/{{figure_id}}/{{format_name}}'), MplDownloadHandler),
        (url_pattern('/mpl/figures/{{base_dir}}/{{figure_id}}'), MplWebSocketHandler),

        (url_pattern('/'), WebAPIVersionHandler),
        (url_pattern('/exit'), WebAPIExitHandler),
        (url_pattern('/api'), JsonRpcWebSocketHandler, dict(
            service_factory=service_factory,
            validation_exception_class=ValidationError,
            report_defer_period=WEBAPI_PROGRESS_DEFER_PERIOD)
         ),
        (url_pattern('/ws/res/plot/{{base_dir}}/{{res_name}}'), ResourcePlotHandler),
        (url_pattern('/ws/res/geojson/{{base_dir}}/{{res_id}}'), ResFeatureCollectionHandler),
        (url_pattern('/ws/res/geojson/{{base_dir}}/{{res_id}}/{{feature_index}}'), ResFeatureHandler),
        (url_pattern('/ws/res/csv/{{base_dir}}/{{res_id}}'), ResVarCsvHandler),
        (url_pattern('/ws/res/html/{{base_dir}}/{{res_id}}'), ResVarHtmlHandler),
        (url_pattern('/ws/res/tile/{{base_dir}}/{{res_id}}/{{z}}/{{y}}/{{x}}.png'), ResVarTileHandler),
        (url_pattern('/ws/ne2/tile/{{z}}/{{y}}/{{x}}.jpg'), NE2Handler),
        (url_pattern('/ws/countries'), CountriesGeoJSONHandler),
    ])
    application.workspace_manager = FSWorkspaceManager()
    return application
開發者ID:CCI-Tools,項目名稱:ect-core,代碼行數:26,代碼來源:start.py

示例5: __init__

 def __init__(self, routes, **kwargs):
   # routes common to all webagg servers
   mplweb_routes = [
       (r'/([0-9]+)/download.([a-z0-9.]+)', DownloadHandler),
       (r'/([0-9a-f]+)/([0-9]+)/ws', WebSocketHandler),
       (r'/mpl.js', MplJsHandler),
       (r'/_static/(.*)', tornado.web.StaticFileHandler,
        dict(path=FigureManagerWebAgg.get_static_file_path())),
   ]
   tornado.web.Application.__init__(self, routes + mplweb_routes, **kwargs)
   self.prog_states = {}  # uid -> ProgramState
   self.fig_managers = {}  # fignum -> manager
   # hack in a mock manager for keep-alive sockets
   self.fig_managers['0'] = _MockFigureManager()
開發者ID:asudhakar-umass,項目名稱:HappyHapke,代碼行數:14,代碼來源:mplweb.py

示例6: __init__

    def __init__(self, figure):
        self.figure = figure
        self.manager = new_figure_manager_given_figure(id(figure), figure)

        super().__init__([
            # Static files for the CSS and JS
            (r'/_static/(.*)',
             tornado.web.StaticFileHandler,
             {'path': FigureManagerWebAgg.get_static_file_path()}),

            # The page that contains all of the pieces
            ('/', self.MainPage),

            ('/mpl.js', self.MplJs),

            # Sends images and events to the browser, and receives
            # events from the browser
            ('/ws', self.WebSocket),

            # Handles the downloading (i.e., saving) of static images
            (r'/download.([a-z0-9.]+)', self.Download),
        ])
開發者ID:NelleV,項目名稱:matplotlib,代碼行數:22,代碼來源:embedding_webagg_sgskip.py

示例7: __init__

 def __init__(self, canvas, num):
     self._shown = False
     FigureManagerWebAgg.__init__(self, canvas, num)
開發者ID:ADSA-UIUC,項目名稱:workshop-twitter-bot,代碼行數:3,代碼來源:backend_nbagg.py

示例8: get

 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)
開發者ID:bmu,項目名稱:webagg_examples,代碼行數:6,代碼來源:plot_server.py

示例9: get

        def get(self):
            self.set_header('Content-Type', 'application/javascript')
            js_content = FigureManagerWebAgg.get_javascript()

            self.write(js_content)
開發者ID:HDembinski,項目名稱:matplotlib,代碼行數:5,代碼來源:embedding_webagg_sgskip.py


注:本文中的matplotlib.backends.backend_webagg_core.FigureManagerWebAgg類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。