def display_in_browser(self, ip='127.0.0.1', port=7655, n_retries=50, js_source='web', menu='all', scroll_behavior='pan', enable_editing=True, enable_keys=True, minified_js=True, never_ask_before_quit=False): """Launch a web browser to view the map. :param ip: The IP address to serve the map on. :param port: The port to serve the map on. If specified the port is occupied, then a random free port will be used. :param int n_retries: The number of times the server will try to find a port before quitting. :param string js_source: Can be one of the following: - *web* (Default) - Use JavaScript files from escher.github.io. - *local* - Use compiled JavaScript files in the local Escher installation. Works offline. - *dev* - No longer necessary with source maps. This now gives the same behavior as 'local'. :param string menu: Menu bar options include: - *none* - No menu or buttons. - *zoom* - Just zoom buttons. - *all* (Default) - Menu and button bar (requires Bootstrap). :param string scroll_behavior: Scroll behavior options: - *pan* - Pan the map. - *zoom* - Zoom the map. - *none* (Default) - No scroll events. :param Boolean enable_editing: Enable the map editing modes. :param Boolean enable_keys: Enable keyboard shortcuts. :param Boolean minified_js: If True, use the minified version of JavaScript and CSS files. :param Boolean never_ask_before_quit: Never display an alert asking if you want to leave the page. By default, this message is displayed if enable_editing is True. """ html = self._get_html(js_source=js_source, menu=menu, scroll_behavior=scroll_behavior, html_wrapper=True, enable_editing=enable_editing, enable_keys=enable_keys, minified_js=minified_js, fill_screen=True, height="100%", never_ask_before_quit=never_ask_before_quit) serve_and_open(html, ip=ip, port=port, n_retries=n_retries)
def display_in_browser(self, ip='127.0.0.1', port=7655, n_retries=50, js_source='web', menu='all', scroll_behavior='pan', enable_editing=True, enable_keys=True, minified_js=True, auto_set_data_domain=True, never_ask_before_quit=False): """Launch a web browser to view the map. Arguments -------- js_source: Can be one of the following: 'web' - use js files from zakandrewking.github.io/escher. 'local' - use compiled js files in the local escher installation. Works offline. 'dev' - use the local, uncompiled development files. Works offline. menu: Menu bar options include: 'none' - No menu or buttons. 'zoom' - Just zoom buttons (does not require bootstrap). 'all' - Menu and button bar (requires bootstrap). scroll_behavior: Scroll behavior options: 'pan' - (Default) Pan the map. 'zoom' - Zoom the map. 'none' - No scroll events. enable_editing: Enable the editing modes (build, rotate, etc.). enable_keys: Enable keyboard shortcuts. minified_js: If True, use the minified version of js files. If js_source is 'dev', then this option is ignored. height: Height of the HTML container. auto_set_data_domain: Automatically adjust the color and size scale domains as new data is applied. never_ask_before_quit: Never display an alert asking if you want to leave the page. By default, this message is displayed if enable_editing is True. """ html = self._get_html(js_source=js_source, menu=menu, scroll_behavior=scroll_behavior, html_wrapper=True, enable_editing=enable_editing, enable_keys=enable_keys, minified_js=minified_js, fill_screen=True, height="100%", auto_set_data_domain=auto_set_data_domain, never_ask_before_quit=never_ask_before_quit) serve_and_open(html, ip=ip, port=port, n_retries=n_retries)