{"id":19094850,"url":"https://github.com/widgetti/ipypopout","last_synced_at":"2025-04-30T13:52:56.707Z","repository":{"id":62571605,"uuid":"433410469","full_name":"widgetti/ipypopout","owner":"widgetti","description":"Display parts of your ipywidgets or solara app in separate browser windows","archived":false,"fork":false,"pushed_at":"2024-10-15T09:42:07.000Z","size":55,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T03:33:38.753Z","etag":null,"topics":["ipywidgets","jupyter","solara"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/widgetti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-30T11:48:17.000Z","updated_at":"2024-11-21T20:06:00.000Z","dependencies_parsed_at":"2024-08-19T14:54:36.874Z","dependency_job_id":"29f7ccec-c6cd-4028-b725-d9fedc43675b","html_url":"https://github.com/widgetti/ipypopout","commit_stats":null,"previous_names":["widgetti/ipypopout","mariobuikhuizen/ipypopout"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/widgetti%2Fipypopout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/widgetti%2Fipypopout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/widgetti%2Fipypopout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/widgetti%2Fipypopout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/widgetti","download_url":"https://codeload.github.com/widgetti/ipypopout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251714991,"owners_count":21631813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ipywidgets","jupyter","solara"],"created_at":"2024-11-09T03:31:48.042Z","updated_at":"2025-04-30T13:52:56.677Z","avatar_url":"https://github.com/widgetti.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ipypopout\n\n[![Version](https://img.shields.io/pypi/v/ipypopout.svg)](https://pypi.python.org/project/ipypopout)\n\nUse Ipypopout to display parts of your ipywidgets or solara app in separate browser windows.\nThis is especially useful for those working with multiple screens.\n\nWorks with:\n\n   * Jupyter notebook\n   * Jupyter lab\n   * Voila (`version\u003c0.5` only when running standalone)\n   * [Solara](https://github.com/widgetti/solara/) (`version\u003e=1.22`)\n\nIn the Jupyter notebook and Jupyter lab environments, ipypopout will use either Solara or Voila to create the popout window. The exist\n\n## Installation\n\n### To use the Solara backend\n\n```\n$ pip install \"ipypopout[solara]\"\n```\n\n### To use the Voila backend\n\n```\n$ pip install \"ipypopout[voila]\"\n```\n\n*Note: ipypopout is not compatible with Voila \u003e= 0.5 standalone (e.g. running as `voila mynotebook.ipynb`). If you use Voila \u003e=0.5 as a Jupyter server extension, such as when running Jupyter Lab, ipypopout can only use solara and therefore you need to `pip install ipypopout[solara]`.*\n\n## Usage\n\n### With ipywidgets\n\n```python\nimport ipywidgets as widgets\nfrom ipypopout import PopoutButton\n\nmain = widgets.VBox()\n\n# see https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features\n# for window_features\npopout_button = PopoutButton(main, window_features='popup,width=400,height=600')\n\nslider1 = widgets.IntSlider(value=1)\nslider2 = widgets.IntSlider(value=2)\nresult = widgets.Label()\ndef update_result(_ignore=None):\n    result.value = value=f\"Sum of {slider1.value} and {slider2.value} = {slider1.value + slider2.value}\"\nupdate_result()\n\nmain.children = (slider1, slider2, result, popout_button)\nslider1.observe(update_result, \"value\")\nslider2.observe(update_result, \"value\")\n\ndisplay(main)\n```\n\nhttps://github.com/widgetti/ipypopout/assets/1765949/61091b71-309c-472f-8814-184ea2012b82\n\n\n### With Solara\n\n```python\nimport solara\nimport plotly.express as px\nimport numpy as np\nfrom ipypopout import PopoutButton\n\n\nfreq = solara.reactive(1)\ndamping = solara.reactive(0.5)\n\nt = np.arange(0, 100, 0.1)/10\n\n@solara.component\ndef Page():\n    target_model_id = solara.use_reactive(\"\")\n\n    y = np.sin(t * 2 * np.pi * freq.value) * np.exp(-t*damping.value)\n\n    with solara.Column():\n        with solara.Card(\"Controls\") as control:\n            solara.SliderFloat(\"Freq\", value=freq, min=1, max=10)\n            solara.SliderFloat(\"zeta\", value=damping, min=0, max=2)\n            if target_model_id.value:\n                PopoutButton.element(target_model_id=target_model_id.value, window_features='popup,width=400,height=300')\n        fig = px.line(x=t, y=y)\n        solara.FigurePlotly(fig)\n    # with solara we have to use use_effect + get_widget to get the widget id\n    solara.use_effect(lambda: target_model_id.set(solara.get_widget(control)._model_id))\ndisplay(Page())\n```\n\nBecause Solara creates elements instead of widgets, we have to use the `use_effect`/`get_widget` trick to feed the widget ID to the PopoutButton.\n\n\nhttps://github.com/widgetti/ipypopout/assets/1765949/430cae12-2527-404b-9861-610565ac1471\n\n\n\n## API\n\n * PopoutButton\n   * constructor arguments:\n     * `target - ipywidgets.Widget | None`: The widget that will be shown in the popout window.\n     * `target_model_id - str`: The widget id (defaults to `target._model_id`)\n     * `window_name - str`: If a window with the same name is available it will be reused, otherwise a new window is created (defaults to `target_model_id`).\n        See [https://developer.mozilla.org/en-US/docs/Web/API/Window/open](https://developer.mozilla.org/en-US/docs/Web/API/Window/open) for more details.\n     * `window_features - str`: See: [https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features)\n\n### Which backend to use\n\nNote that ipypopout will automatically detect if it can use Solara, and use it if available, otherwise it will use Voila. If you want to force the use of Voila, you can set the environment variable `IPYPOPOUT_USE_BACKEND=voila`, the other options are `auto` (the default) and `solara` (in case our auto detect fails).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwidgetti%2Fipypopout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwidgetti%2Fipypopout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwidgetti%2Fipypopout/lists"}