本文整理汇总了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;未经允许,请勿转载。 |
请发表评论