{"id":15672621,"url":"https://github.com/dylanwal/plotly_gif","last_synced_at":"2025-05-06T21:47:39.424Z","repository":{"id":57453520,"uuid":"444990442","full_name":"dylanwal/plotly_gif","owner":"dylanwal","description":"Generate .gif from your Plotly figures","archived":false,"fork":false,"pushed_at":"2023-04-10T12:38:56.000Z","size":2385,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T03:15:11.670Z","etag":null,"topics":["gif","gifs","plotly","plotting","plotting-in-python","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dylanwal.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-01-06T00:27:14.000Z","updated_at":"2025-03-10T12:56:48.000Z","dependencies_parsed_at":"2023-12-17T09:44:51.582Z","dependency_job_id":null,"html_url":"https://github.com/dylanwal/plotly_gif","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"53c0fbabccf8bc7db54ae61b24c9fea6c7f12569"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanwal%2Fplotly_gif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanwal%2Fplotly_gif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanwal%2Fplotly_gif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylanwal%2Fplotly_gif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dylanwal","download_url":"https://codeload.github.com/dylanwal/plotly_gif/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248914193,"owners_count":21182377,"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":["gif","gifs","plotly","plotting","plotting-in-python","python"],"created_at":"2024-10-03T15:29:00.146Z","updated_at":"2025-04-19T10:30:48.459Z","avatar_url":"https://github.com/dylanwal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plotly-gif \n\n---\n---\n![PyPI](https://img.shields.io/pypi/v/plotly_gif)\n![downloads](https://img.shields.io/pypi/dm/plotly_gif)\n![license](https://img.shields.io/github/license/dylanwal/plotly_gif)\n\nA simple python package to generate .gif from your plotly figures. It works for both 2D and 3D figures. It can even \ncreate_gif motion for you in 3D plots. \n\n## Installation\n\n```\npip install plotly-gif\n```\n\n### Dependencies\n\nIf you are already using plotly, then you should be good. But, just in case, these are the dependencies:\n* [plotly](https://github.com/plotly/plotly.py) (5.9.0)\n  * Plots molecules\n* [kaleido](https://github.com/plotly/Kaleido)  (0.1.0post1)\n  * Converts plotly graphs to images (png, svg, etc.)\n  * I am not using the most recent version of kaleido as it does not play nice with my computer. Try the newest \n    version, but if you are having issues install this specific version.\n* [Pillow](https://github.com/python-pillow/Pillow) (9.2.0)\n  * Used to convert png to gif.\n* [numpy](https://github.com/numpy/numpy) (1.23.1)\n  * Used for math\n  \n    \n---\n## Usage\n\nThere are three common methods:\n\n### Built-in Functions/ Macros\nCurrently, we have the follow:\n* two_d_time_series\n* three_d_scatter_rotate\n* more to come... or submit your own\n\n```python\nimport plotly.graph_objs as go\nfrom plotly_gif import GIF, two_d_time_series\n\nfig = go.Figure()\n# add your traces()\n# add your formatting()\n\ngif = GIF()\ntwo_d_time_series(gif, fig)\n\n```\n\n\n\n\n### Decorator\n\nIf you have a function that is changing the `go.Figure' with each loop, you can add the decorator to the func.\n\n```python\nimport plotly.graph_objs as go\nfrom plotly_gif import GIF, capture\n\ngif = GIF()\n\n@capture(gif)\ndef plot_(x_, y_):\n    fig = go.Figure()\n    # add your traces()\n    # add your formatting()\n    \n    return fig\n\ngif.create_gif() # generate gif\n```\n\n### In-Line\nThis very similar to the decorator option, but you can call the image capture function directly.\n\n```python\nimport plotly.graph_objs as go\nfrom plotly_gif import GIF, capture\n\ngif = GIF()\n\ndef plot_(x_, y_):\n    fig = go.Figure()\n    # add your traces()\n    # add your formatting()\n    \n    gif.create_image(fig)  # create_gif image for gif\n    \n    return fig\n\ngif.create_gif() # generate gif\n```\n\n---\n## Examples\nSee examples folder\n\n![2d gif](https://github.com/dylanwal/plotly_gif/blob/master/examples/gifs/example_1.gif)\n\n\n![3d gif](https://github.com/dylanwal/plotly_gif/blob/master/examples/gifs/example_3.gif)\n\n\n\n### Time to generate gif (60 images per gif)\n* Simple 2D plots with small data sets (100 pts): ~10 sec\n* Simple 3D plots with small data sets (100 pts): ~1.5 min\n\n\n## Warning\n\n* If your code 'hangs' or 'gets stuck and doesn't complete' try changing kaleido versions `pip install kaleido==0.1.0post1`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanwal%2Fplotly_gif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylanwal%2Fplotly_gif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylanwal%2Fplotly_gif/lists"}