{"id":16919225,"url":"https://github.com/lvisei/pyl7plot","last_synced_at":"2025-04-11T16:38:54.648Z","repository":{"id":42656683,"uuid":"466366737","full_name":"lvisei/PyL7Plot","owner":"lvisei","description":"🌍 Python3 binding for @AntV/L7Plot Plotting Library","archived":false,"fork":false,"pushed_at":"2022-03-29T17:33:36.000Z","size":13,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T12:50:52.474Z","etag":null,"topics":["geospatial-visualization","python","visualization"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyl7plot/","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/lvisei.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}},"created_at":"2022-03-05T06:10:23.000Z","updated_at":"2022-08-10T03:29:42.000Z","dependencies_parsed_at":"2022-09-23T19:51:58.973Z","dependency_job_id":null,"html_url":"https://github.com/lvisei/PyL7Plot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvisei%2FPyL7Plot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvisei%2FPyL7Plot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvisei%2FPyL7Plot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvisei%2FPyL7Plot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lvisei","download_url":"https://codeload.github.com/lvisei/PyL7Plot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248441885,"owners_count":21104094,"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":["geospatial-visualization","python","visualization"],"created_at":"2024-10-13T19:43:34.527Z","updated_at":"2025-04-11T16:38:54.624Z","avatar_url":"https://github.com/lvisei.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg\" width=\"18\"\u003e English | [简体中文](./README.zh-CN.md)\n\n# PyL7Plot\n\n🌍 Python3 binding for [`@AntV/L7Plot`](https://github.com/antvis/L7Plot) Plotting Library. Geospatial Visualization Chart Library Based on `@AntV/L7`. Inspired by `PyG2Plot`.\n\n[![Latest Stable Version](https://img.shields.io/pypi/v/pyl7plot.svg)](https://pypi.python.org/pypi/pyl7plot)\n[![build Status](https://github.com/lvisei/pyl7plot/workflows/build/badge.svg?branch=main)](https://github.com/lvisei/pyl7plot/actions?query=workflow%3Abuild)\n[![Pypi Download](https://img.shields.io/pypi/dm/pyl7plot)](https://pypi.python.org/pypi/pyl7plot)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/26923747/160286530-aec01c97-a56b-4ea9-9fc6-f245d8f7b871.png\" width=\"800\"\u003e\n\u003c/div\u003e\n\n## Installation\n\n```bash\n$ pip install pyl7plot\n```\n\n## Usage\n\n#### **Render to HTML**\n\n```py\nfrom pyl7plot import Plot\n\ndot = Plot(\"Dot\")\n\ndot.set_options({\n  \"map\": {\n    \"type\": \"mapbox\",\n    \"style\": \"light\",\n    \"center\": [103.447303, 31.753574],\n    \"zoom\": 7,\n  },\n  \"autoFit\": True,\n  \"source\": {\n    \"data\": [\n       { \"lng\": 103.715, \"lat\": 31.211, \"depth\": 10, \"mag\": 5.8, \"title\": \"M 5.8 - eastern Sichuan, China\" },\n       { \"lng\": 104.682, \"lat\": 31.342, \"depth\": 10, \"mag\": 5.7, \"title\": \"M 5.7 - eastern Sichuan, China\" },\n       # ...\n    ],\n    \"parser\": { \"type\": \"json\", \"x\": \"lng\", \"y\": \"lat\" },\n  },\n  \"color\": {\n    \"field\": \"mag\",\n    \"value\": [\"#82cf9c\", \"#10b3b0\", \"#2033ab\"],\n    \"scale\": { \"type\": \"quantize\" },\n  },\n  \"size\": {\n    \"field\": \"mag\",\n  },\n  \"state\": { \"active\": True },\n  \"scale\": { \"position\": \"bottomright\" },\n  \"legend\": { \"position\": \"bottomleft\" },\n  \"tooltip\": {\n    \"items\": [\"title\", \"mag\", \"depth\"],\n  },\n})\n\n# Render html file\ndot.render(\"dot.html\")\n\n# Or render html string\n# dot.render_html()\n```\n\n![image](https://gw.alipayobjects.com/zos/antfincdn/Yn%24QslMAWP/20220326145659.jpg)\n\n#### **Render in Jupyter**\n\n```py\nfrom pyl7plot import Plot, JS\n\ndot = Plot(\"Dot\")\n\ndot.set_options({\n  \"map\": {\n    \"type\": \"mapbox\",\n    \"style\": \"light\",\n    \"center\": [103.447303, 31.753574],\n    \"zoom\": 7,\n  },\n  \"autoFit\": True,\n  \"height\": 400, # set a default height in jupyter preview\n  \"source\": {\n    \"data\": [\n       { \"lng\": 103.715, \"lat\": 31.211, \"depth\": 10, \"mag\": 5.8, \"title\": \"M 5.8 - eastern Sichuan, China\" },\n       { \"lng\": 104.682, \"lat\": 31.342, \"depth\": 10, \"mag\": 5.7, \"title\": \"M 5.7 - eastern Sichuan, China\" },\n       # ...\n    ],\n    \"parser\": { \"type\": \"json\", \"x\": \"lng\", \"y\": \"lat\" },\n  },\n  \"color\": {\n    \"field\": \"mag\",\n    \"value\": [\"#82cf9c\", \"#10b3b0\", \"#2033ab\"],\n    \"scale\": { \"type\": \"quantize\" },\n  },\n  \"size\": {\n    \"field\": \"mag\",\n    # Use JS API, you can use JavaScript syntax for callback.\n    \"value\": JS('''function({ mag }) {\n        return (mag - 4.3) * 10;\n      }''')\n  },\n  \"state\": { \"active\": True },\n  \"scale\": { \"position\": \"bottomright\" },\n  \"legend\": { \"position\": \"bottomleft\" },\n  \"tooltip\": {\n    \"items\": [\"title\", \"mag\", \"depth\"],\n  },\n})\n\n# Render in notebook\ndot.render_notebook()\n\n# Or render in jupyter lab\n# dot.render_jupyter_lab()\n```\n\n\u003e More Online Examples PyL7plot in [Jupyter Lab](https://colab.research.google.com/drive/11gTHsZ5Xg31jjJUJWEt5PkZv0VE9qyAG?usp=sharing).\n\n## API\n\n- **Plot**\n\n1. _Plot(plot_type: str)_: get an instance of `Plot` class.\n\n2. _plot.set_options(options: object)_: set the options of [L7Plot](https://l7plot.antv.vision/) into instance.\n\n3. _plot.render(path, env, \\*\\*kwargs)_: render out html file by setting the path, jinja2 env and kwargs.\n\n4. _plot.render_notebook(env, \\*\\*kwargs)_: render plot on jupyter preview.\n\n5. _plot.render_jupyter_lab(env, \\*\\*kwargs)_: render plot on jupyter lab preview.\n\n6. _plot.render_html(env, \\*\\*kwargs)_: render out html string by setting jinja2 env and kwargs.\n\n## 协议\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvisei%2Fpyl7plot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flvisei%2Fpyl7plot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvisei%2Fpyl7plot/lists"}