{"id":24019811,"url":"https://github.com/carlolepelaars/fh-plotly","last_synced_at":"2025-04-15T19:52:45.817Z","repository":{"id":251661059,"uuid":"838046086","full_name":"CarloLepelaars/fh-plotly","owner":"CarloLepelaars","description":"Plotly in FastHTML","archived":false,"fork":false,"pushed_at":"2025-03-11T17:54:55.000Z","size":326,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T00:33:23.739Z","etag":null,"topics":["fasthtml","plotly","visualization","web","web-application"],"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/CarloLepelaars.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":"2024-08-04T19:27:09.000Z","updated_at":"2025-03-24T21:15:02.000Z","dependencies_parsed_at":"2024-08-04T22:14:56.000Z","dependency_job_id":"219b87c2-f7b6-479d-80b7-b7648254fe85","html_url":"https://github.com/CarloLepelaars/fh-plotly","commit_stats":null,"previous_names":["carlolepelaars/fh-plotly"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarloLepelaars%2Ffh-plotly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarloLepelaars%2Ffh-plotly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarloLepelaars%2Ffh-plotly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarloLepelaars%2Ffh-plotly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarloLepelaars","download_url":"https://codeload.github.com/CarloLepelaars/fh-plotly/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249144903,"owners_count":21219966,"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":["fasthtml","plotly","visualization","web","web-application"],"created_at":"2025-01-08T11:53:12.563Z","updated_at":"2025-04-15T19:52:45.797Z","avatar_url":"https://github.com/CarloLepelaars.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fh-plotly\n\n![Downloads](https://img.shields.io/pypi/dm/fh-plotly)\n![Python](https://img.shields.io/badge/python-3.10%2B-blue)\n[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\nUse Plotly charts with [FastHTML](https://github.com/AnswerDotAI/fasthtml).\n\n\n## Installation\n\n```bash\npip install fh-plotly\n```\n\nMake sure to add the right headers to your FastHTML app:\n\n```python\nfrom fasthtml.common import fast_app\nfrom fh_plotly import plotly_headers\n\napp, rt = fast_app(hdrs=plotly_headers)\n```\n\nThis ensures that the required javascript and css files are always loaded.\n\n## Examples\n\nRun `examples/test_app.py` to see some basic plots.\n\n```bash\npython examples/test_app.py\n```\n\nThe gist of conversion to Plotly is the `plotly2fasthtml` function.\n\n```python\nfrom fh_plotly import plotly2fasthtml\n\ndef generate_line_chart():\n    df = pd.DataFrame({'y': [1, 2, 3, 2], 'x': [3, 1, 2, 4]})\n    fig = px.line(df, x='x', y='y')\n    return plotly2fasthtml(fig)\n```\n\n## Contributing\n\nFeel free to open an issue or a pull request. \nMake sure to do an editable install with dev dependencies when working on contributions.\n\n```bash\npip install uv\nuv sync\n```\n\nTo run tests:\n\n```bash\npytest -s\n```\n\nThe goal is to keep `fh-plotly` lightweight and compatible with Python 3.10+.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlolepelaars%2Ffh-plotly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlolepelaars%2Ffh-plotly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlolepelaars%2Ffh-plotly/lists"}