{"id":15009744,"url":"https://github.com/upsetjs/upsetjs_jupyter_widget","last_synced_at":"2025-04-09T17:51:55.927Z","repository":{"id":54416413,"uuid":"254381740","full_name":"upsetjs/upsetjs_jupyter_widget","owner":"upsetjs","description":"😠 Jupyter Widget bindings for UpSet.js for rendering UpSet plots, Euler, and Venn Diagrams","archived":false,"fork":false,"pushed_at":"2021-12-24T01:20:37.000Z","size":2990,"stargazers_count":14,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T19:51:31.221Z","etag":null,"topics":["euler","euler-diagram","jupyter","jupyter-lab","jupyter-widget","jupyterlab","py","pyupset","upset","upsetjs","upsetr","venn","venn-diagram","widget"],"latest_commit_sha":null,"homepage":"https://upset.js.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/upsetjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-09T13:40:09.000Z","updated_at":"2024-10-12T23:02:19.000Z","dependencies_parsed_at":"2022-08-13T15:00:48.681Z","dependency_job_id":null,"html_url":"https://github.com/upsetjs/upsetjs_jupyter_widget","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsetjs%2Fupsetjs_jupyter_widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsetjs%2Fupsetjs_jupyter_widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsetjs%2Fupsetjs_jupyter_widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsetjs%2Fupsetjs_jupyter_widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/upsetjs","download_url":"https://codeload.github.com/upsetjs/upsetjs_jupyter_widget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247596330,"owners_count":20964078,"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":["euler","euler-diagram","jupyter","jupyter-lab","jupyter-widget","jupyterlab","py","pyupset","upset","upsetjs","upsetr","venn","venn-diagram","widget"],"created_at":"2024-09-24T19:28:11.569Z","updated_at":"2025-04-09T17:51:55.895Z","avatar_url":"https://github.com/upsetjs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UpSet.js Jupyter Widget\n\n[![NPM Package][npm-image]][npm-url] [![Github Actions][github-actions-image]][github-actions-url] [![Open in NBViewer][nbviewer]][nbviewer-url] [![Open in Binder][binder]][binder-j-url] [![Open API Docs][docs]][docs-j-url] [![Open Example][example]][example-j-url]\n\nA Jupyter Widget Library around [UpSet.js](https://github.com/upsetjs/upsetjs).\n\nThis package is part of the UpSet.js ecosystem located at the main [Github Monorepo](https://github.com/upsetjs/upsetjs).\n\n## Installation\n\nYou can install using `pip`:\n\n```bash\n# some ipywidget 8.x.x alpha vesion\npip install ipywidgets upsetjs_jupyter_widget\n# for notebooks\njupyter nbextension enable --sys-prefix --py upsetjs_jupyter_widget\n# for lab\njupyter labextension install @jupyter-widgets/jupyterlab-manager upsetjs_jupyter_widget\n```\n\n## Usage\n\n```python\nfrom ipywidgets import interact\nfrom upsetjs_jupyter_widget import UpSetJSWidget\nimport pandas as pd\n```\n\n```python\nw = UpSetJSWidget[str]()\n```\n\n```python\nw.from_dict(dict(one = ['a', 'b', 'c', 'e', 'g', 'h', 'k', 'l', 'm'], two = ['a', 'b', 'd', 'e', 'j'], three = ['a', 'e', 'f', 'g', 'h', 'i', 'j', 'l', 'm']))\nw\n```\n\n![upset_from_dict](https://user-images.githubusercontent.com/4129778/79368564-e4715d00-7f4f-11ea-92f5-23ee89b5332f.png)\n\n```python\ndf = pd.DataFrame(dict(\n    one=[1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1],\n    two=[1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0],\n    three=[1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1]\n), index=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm'])\nw.from_dataframe(df)\nw\n```\n\n![upset_from_dataframe](https://user-images.githubusercontent.com/4129778/79368563-e3d8c680-7f4f-11ea-92d2-db0c7af2882e.png)\n\nit support the `ipywidget` interact method to get notified about the user input\n\n```python\ndef selection_changed(s):\n    return s.name if s else None\ninteract(selection_changed, s=w)\n```\n\nsee also [introduction.ipynb](./master/examples/introduction.ipynb)\n\nsee also [![Open in NBViewer][nbviewer]][nbviewer-url] [![Open in Binder][binder]][binder-j-url]\n\n## Documentation\n\nthe package documentation is located at [![Open API Docs][docs]][docs-j-url]. An introduction Jupyter Notebooks is at [![Open Example][example]][example-j-url].\n\n## Venn Diagram\n\nBesides the main UpSet.js plot also Venn Diagrams for up to five sets are supported. It uses the same input formats and has similar functionality in terms of interaction.\n\n```python\nfrom upsetjs_jupyter_widget import UpSetJSVennDiagramWidget\nv = UpSetJSVennDiagramWidget[str]()\nv.from_dict(dict(one = ['a', 'b', 'c', 'e', 'g', 'h', 'k', 'l', 'm'], two = ['a', 'b', 'd', 'e', 'j'], three = ['a', 'e', 'f', 'g', 'h', 'i', 'j', 'l', 'm']))\nv\n```\n\n![image](https://user-images.githubusercontent.com/4129778/84817608-8a574b80-b015-11ea-91b8-2ff17bb533e4.png)\n\nsee also [venn.ipynb](https://upset.js.org/integrations/jupyter/venn.html)\n\n## Karnaugh Map\n\nBesides the main UpSet.js plot also a variant of a Karnaugh Map. It uses the same input formats and has similar functionality in terms of interaction.\n\n```python\nfrom upsetjs_jupyter_widget import UpSetJSKarnaughMapWidget\nv = UpSetJSKarnaughMapWidget[str]()\nv.from_dict(dict(one = ['a', 'b', 'c', 'e', 'g', 'h', 'k', 'l', 'm'], two = ['a', 'b', 'd', 'e', 'j'], three = ['a', 'e', 'f', 'g', 'h', 'i', 'j', 'l', 'm']))\nv\n```\n\n![image](https://user-images.githubusercontent.com/4129778/86368718-c9c0a180-bc7d-11ea-99c3-2086e6ec1422.png)\n\nsee also [kmap.ipynb](https://upset.js.org/integrations/jupyter/kmap.html)\n\n## Dev Environment\n\n```sh\nnpm i -g yarn\nyarn set version berry\nyarn\nyarn pnpify --sdk vscode\nconda create -f environment.yml\n```\n\n```sh\nconda activate upsetjs_jupyter_widget\npip install -e .\njupyter nbextension install --sys-prefix --overwrite --py upsetjs_jupyter_widget\njupyter nbextension enable --sys-prefix --py upsetjs_jupyter_widget\njupyter labextension install @jupyter-widgets/jupyterlab-manager .\n```\n\n### Commands\n\n```sh\nyarn test\nyarn lint\nyarn build  !! within the pipenv\n```\n\n## Privacy Policy\n\nUpSet.js is a client only library. The library or any of its integrations doesn't track you or transfers your data to any server. The uploaded data in the app are stored in your browser only using IndexedDB. The Tableau extension can run in a sandbox environment prohibiting any server requests. However, as soon as you export your session within the app to an external service (e.g., Codepen.io) your data will be transferred.\n\n## License / Terms of Service\n\n### Commercial license\n\nIf you want to use Upset.js for a commercial application the commercial license is the appropriate license. Contact [@sgratzl](mailto:sam@sgratzl.com) for details.\n\n### Open-source license\n\nThis library is released under the `GNU AGPLv3` version to be used for private and academic purposes. In case of a commercial use, please get in touch regarding a commercial license.\n\n[npm-image]: https://badge.fury.io/js/%40upsetjs%2Fjupyter_widget.svg\n[npm-url]: https://npmjs.org/package/@upsetjs/jupyter_widget\n[github-actions-image]: https://github.com/upsetjs/upsetjs_jupyter_widget/workflows/ci/badge.svg\n[github-actions-url]: https://github.com/upsetjs/upsetjs_jupyter_widget/actions\n[codepen]: https://img.shields.io/badge/CodePen-open-blue?logo=codepen\n[nbviewer]: https://img.shields.io/badge/NBViewer-open-blue?logo=jupyter\n[nbviewer-url]: https://nbviewer.jupyter.org/github/upsetjs/upsetjs_jupyter_widget/blob/master/examples/introduction.ipynb\n[binder]: https://mybinder.org/badge_logo.svg\n[binder-j-url]: https://mybinder.org/v2/gh/upsetjs/upsetjs_jupyter_widget/master?urlpath=lab/tree/examples/introduction.ipynb\n[docs]: https://img.shields.io/badge/API-open-blue\n[docs-j-url]: https://upset.js.org/api/jupyter\n[example]: https://img.shields.io/badge/Example-open-red\n[example-j-url]: https://upset.js.org/integrations/jupyter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupsetjs%2Fupsetjs_jupyter_widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupsetjs%2Fupsetjs_jupyter_widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupsetjs%2Fupsetjs_jupyter_widget/lists"}