def test_designer(show=False): """Run this with `python`, `panel serve --dev` or the integrated python runner or debugger in your editor or IDE. Args: show (bool, optional): [description]. Defaults to False. Change to True if you want to use with Pytest. """ designer = Designer(reload_services=RELOAD_SERVICES) if show: designer.show()
def test_show(): source = "https://github.com/MarcSkovMadsen/awesome-panel/blob/master/app.py" thumbnail = ( "https://raw.githubusercontent.com/MarcSkovMadsen/awesome-panel/master/" "assets/images/thumbnails/awesome-panel-org.png") author = Author( name="panel", url="https://panel.pyviz.org/", github_url="https://github.com/holoviz/", github_avatar_url="https://avatars2.githubusercontent.com/u/51678735", ) home_page_main = pn.pane.Markdown(name="Home") tags = [Tag(name="awesome")] home_page = Page( name="Home", author=author, description="The main page of the application", tags=tags, source_code_url=source, thumbnail_png_url=thumbnail, component=home_page_main, ) reload_services = [ ReloadService(component=GalleryPageComponent, component_parameters={"page": home_page}), ReloadService( component=GalleryComponent, component_parameters={"pages": [home_page for i in range(0, 6)]}, ), ] Designer(reload_services=reload_services).view.show()
def view() -> pn.Column: """The Designer with the Material Components Returns: pn.Column: A Column with the Designer and the Material Components """ button_service = ReloadService(component=material.MWCButton, component_parameters={"name": "Click Me"}) select_service = ReloadService( component=material.MWCSelect, component_parameters={ "name": "Select Me", "options": { "a": "aaa", "b": "bbb", "c": "ccc" } }, ) reload_services = [select_service, button_service] designer = Designer(reload_services=reload_services) pn.config.js_files["mwc"] = material.MWC_JS return pn.Column( designer.view, material.fonts_pane, sizing_mode="stretch_both", )
def show(): pandas_profiling_app = ReloadService(PandasProfilingApp) reload_services = [pandas_profiling_app] Designer(reload_services=reload_services).show()
def designer(reload_services): return Designer(reload_services=reload_services)
yy0, xx1, yy1, opacity=0.7, group=label, name=label, color=COLORS[class_id], showlegend=showlegend, text=text, ) existing_classes.add(label) # endregion plotly.py helper functions if __name__.startswith("bokeh"): # Run using python -m panel serve 'application\pages\detr\detr.py' --dev --show # To get livereloda pn.config.sizing_mode = "stretch_width" view().servable() if __name__.startswith("__main__"): # Run using python 'application\pages\detr\detr.py' # to edit using the Awesome Panel Designer from awesome_panel.designer import Designer, ReloadService pn.config.sizing_mode = "stretch_width" RELOADSERVICES = [ReloadService(component=DETRApp)] Designer(reload_services=RELOADSERVICES).view.show(port=5006)