{"id":21228834,"url":"https://github.com/anras5/hasse-diagram","last_synced_at":"2025-09-04T12:46:43.427Z","repository":{"id":245024432,"uuid":"816983191","full_name":"anras5/hasse-diagram","owner":"anras5","description":"Plot Finite Partially Ordered Sets in Python","archived":false,"fork":false,"pushed_at":"2025-05-11T17:50:27.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-11T18:35:04.761Z","etag":null,"topics":["algorithms","graphs","mcda","pypi","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/hasse-diagram/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anras5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-06-18T19:21:29.000Z","updated_at":"2025-05-11T17:50:26.000Z","dependencies_parsed_at":"2024-07-05T22:59:38.696Z","dependency_job_id":null,"html_url":"https://github.com/anras5/hasse-diagram","commit_stats":null,"previous_names":["anras5/hasse-diagram"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anras5/hasse-diagram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2Fhasse-diagram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2Fhasse-diagram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2Fhasse-diagram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2Fhasse-diagram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anras5","download_url":"https://codeload.github.com/anras5/hasse-diagram/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anras5%2Fhasse-diagram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273611763,"owners_count":25136977,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["algorithms","graphs","mcda","pypi","python"],"created_at":"2024-11-20T23:22:28.166Z","updated_at":"2025-09-04T12:46:41.430Z","avatar_url":"https://github.com/anras5.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hasse Diagram\n\nThis small package helps with plotting Hasse Diagrams and is very useful when presenting results for the MCDA methods.\n\n## Installation\n\n```\npip install hasse-diagram\n```\n\n## Example usage\n\n### Networkx\n\n```python\nimport numpy as np\nfrom hassediagram import plot_hasse\n\ndata = np.array([\n    [0, 1, 1, 1, 1],\n    [0, 0, 1, 0, 1],\n    [0, 1, 0, 0, 1],\n    [0, 0, 0, 0, 0],\n    [0, 0, 0, 0, 0]\n])\nlabels = [\"node a\", \"node b\", \"node c\", \"node d\", \"node e\"]\nplot_hasse(data, labels)\n```\n\nResult:\n\n![img.png](./images/example_plot1.png)\n\n- ### Graphviz dotstring\n\n```python\nimport numpy as np\nfrom hassediagram import hasse_graphviz\n\ndata = np.array([\n    [0, 1, 1, 1, 1],\n    [0, 0, 1, 0, 1],\n    [0, 1, 0, 0, 1],\n    [0, 0, 0, 0, 0],\n    [0, 0, 0, 0, 0]\n])\nlabels = [\"node a\", \"node b\", \"node c\", \"node d\", \"node e\"]\nprint(hasse_graphviz(data, labels))\n```\n\nResult:\n\n```\ndigraph {\n\tgraph [bgcolor=\"#FFFFFF\"]\n\tnode [color=\"#E2E8F0\" fontname=\"Segoe UI\" fontsize=\"15 pt\" style=filled]\n\tedge [arrowhead=vee color=black]\n\tcompound=true\n\tnode1 [label=\"node a\"]\n\tnode2 [label=\"node b, node c\"]\n\tnode3 [label=\"node d\"]\n\tnode4 [label=\"node e\"]\n\tnode1 -\u003e node2\n\tnode1 -\u003e node3\n\tnode2 -\u003e node4\n\tsubgraph cluster_1 {\n\t\trank=same\n\t\tperipheries=0\n\t}\n\tsubgraph cluster_2 {\n\t\trank=same\n\t\tnode1\n\t\tperipheries=0\n\t}\n\tsubgraph cluster_3 {\n\t\trank=same\n\t\tnode2\n\t\tnode3\n\t\tperipheries=0\n\t}\n\tsubgraph cluster_4 {\n\t\trank=same\n\t\tnode4\n\t\tperipheries=0\n\t}\n}\n```\n\nYou can optionally turn off the transitive reduction and change the color of nodes and edges.\n\n## Testing\n\n```\npytest --cov=src --cov-report=term-missing\n```\n\nThis package is inspired by a similar one for R: [hasseDiagram](https://github.com/kciomek/hasseDiagram)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanras5%2Fhasse-diagram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanras5%2Fhasse-diagram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanras5%2Fhasse-diagram/lists"}