{"id":16927809,"url":"https://github.com/lessmost/svg2marker","last_synced_at":"2025-03-21T02:41:18.595Z","repository":{"id":57375651,"uuid":"219914150","full_name":"lessmost/svg2marker","owner":"lessmost","description":"Convert SVG icon to G/Marker register","archived":false,"fork":false,"pushed_at":"2019-11-06T05:03:06.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T09:48:12.284Z","etag":null,"topics":["antvis"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/lessmost.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":"2019-11-06T04:49:02.000Z","updated_at":"2023-03-10T08:47:04.000Z","dependencies_parsed_at":"2022-09-07T13:40:19.198Z","dependency_job_id":null,"html_url":"https://github.com/lessmost/svg2marker","commit_stats":null,"previous_names":["zqlu/svg2marker"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lessmost%2Fsvg2marker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lessmost%2Fsvg2marker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lessmost%2Fsvg2marker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lessmost%2Fsvg2marker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lessmost","download_url":"https://codeload.github.com/lessmost/svg2marker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244728187,"owners_count":20500023,"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":["antvis"],"created_at":"2024-10-13T20:35:10.803Z","updated_at":"2025-03-21T02:41:18.561Z","avatar_url":"https://github.com/lessmost.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svg2marker\n\nConvert SVG icon to G/Marker register\n\n## Usage\n\n### 对g2 3.x开源版本\n\n```js\nimport { G } from '@antv/g2';\nimport svg2marker from '@alipay/svg2marker';\nimport plus from './icons/plus.svg'\n\n// 注册 plus symbol\nG.Marker.Symbols['plus'] = svg2marker(plus);\n\n// 绘制 svg\ncontainer.addShape('Marker', {\n    attrs: {\n        symbol: 'plus',\n        x: 10,\n        y: 10,\n        r: 10\n    }\n});\n```\n\n### 对g2 4.x TS版本\n\n```js\nimport { G } from '@antv/g2';\nimport svg2marker from '@alipay/svg2marker';\nimport plus from './icons/plus.svg';\n\n// 注册 plus symbol\nG.Marker.symbolsFactory.register('rise', svg2marker(plus));\n\n// 绘制 svg\ncontainer.addShape('Marker', {\n    attrs: {\n        symbol: 'plus',\n        x: 10,\n        y: 10,\n        r: 10\n    }\n});\n```\n\n## FAQ\n- 为什么报错`${symbol} marker is not supported.`？\n\n因为注册的G和绘图的G不一致导致的，应该改为同一个G引用\n```js\n import { G } from '@antv/g6';\n import { G } from '@antv/g2';\n \n```\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessmost%2Fsvg2marker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flessmost%2Fsvg2marker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessmost%2Fsvg2marker/lists"}