{"id":16231580,"url":"https://github.com/hustcc/g2plot-qrcode","last_synced_at":"2025-03-19T14:30:46.486Z","repository":{"id":66093472,"uuid":"292785527","full_name":"hustcc/G2Plot-QRCode","owner":"hustcc","description":"Draw a QRCode with G2Plot.","archived":false,"fork":false,"pushed_at":"2020-12-25T01:56:23.000Z","size":32,"stargazers_count":33,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T19:11:58.626Z","etag":null,"topics":["antv","g2plot","g2plot-qrcode","qrcode"],"latest_commit_sha":null,"homepage":"https://git.hust.cc/G2Plot-QRCode/","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/hustcc.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":"2020-09-04T07:52:38.000Z","updated_at":"2023-03-19T02:56:21.000Z","dependencies_parsed_at":"2023-03-10T23:36:54.191Z","dependency_job_id":null,"html_url":"https://github.com/hustcc/G2Plot-QRCode","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"056a4ecef428fef44a69a2f5dd2c6b7cd59351ee"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2FG2Plot-QRCode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2FG2Plot-QRCode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2FG2Plot-QRCode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2FG2Plot-QRCode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustcc","download_url":"https://codeload.github.com/hustcc/G2Plot-QRCode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997041,"owners_count":20380980,"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":["antv","g2plot","g2plot-qrcode","qrcode"],"created_at":"2024-10-10T13:06:09.629Z","updated_at":"2025-03-19T14:30:46.481Z","avatar_url":"https://github.com/hustcc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# G2Plot-QRCode\n\n\u003e G2Plot-QRCode: plugin based on G2Plot v2. [LIVE DEMO](https://git.hust.cc/G2Plot-QRCode/), [CodeSandbox](https://codesandbox.io/s/g2plot-qrcode-sf6rv).\n\n[![npm Version](https://img.shields.io/npm/v/g2plot-qrcode.svg)](https://www.npmjs.com/package/g2plot-qrcode)\n[![npm License](https://img.shields.io/npm/l/g2plot-qrcode.svg)](https://www.npmjs.com/package/g2plot-qrcode)\n\n\n![image](https://user-images.githubusercontent.com/7856674/103057591-e0b3d100-45da-11eb-8806-9c654bb84615.png)\n\n\n## Install\n\n```bash\n$ npm i --save g2plot-qrcode\n```\n\n\n## Usage\n\n - render\n\n```ts\nimport { G2Plot } from '@antv/g2plot';\nimport { adaptor, defaultOptions } from 'g2plot-qrcode';\n\nconst qr = new G2Plot('container', {\n  // 二维码文本\n  data: 'Hello, g2plot qrcode!',\n  // 间距\n  padding: 8,\n  // 宽高\n  width: 120,\n  height: 120,\n  // 背景前景颜色\n  backgroundColor: 'white',\n  foregroundColor: 'black',\n  typeNumber: 0,\n  correctLevel: 'H', // L M H Q\n  // 样式自定义\n  pixelStyle: (pixelData) =\u003e ({}),\n}, adaptor, defaultOptions);\n\nqr.render();\n```\n\n - update\n\n```ts\nqr.update({\n  data: 'hello world!',\n});\n```\n\n## Configure\n\n```ts\nexport interface QRCodeOptions {\n  /** qrcode 的内容文本 */\n  readonly data: string;\n  /** 边框间距，默认 8px */\n  readonly padding?: number;\n  /** 二维码大小宽高，默认都是 120px */\n  readonly width: string;\n  readonly height: string;\n  /** 二维码 correctLevel，默认 H */\n  readonly correctLevel?: 'L' | 'M' | 'Q' | 'H';\n  /** 二维码 typeNumber，默认 0 */\n  readonly typeNumber?: any;\n  // readonly effect?: 'fusion' | 'round' | 'rect';\n  /** 二维码前景色，默认 black */\n  readonly foregroundColor?: string;\n  /** 二维码背景色，默认 white */\n  readonly backgroundColor?: string;\n  /** 二维码的 icon 中心图标，默认无 */\n  readonly icon?: {\n    readonly image: string; // 图片\n    readonly width?: number; // 图片宽高\n    readonly height?: number;\n  };\n  /** 单元格样式，默认无 */\n  readonly pixelStyle?: (pixelData: PixelData) =\u003e object;\n}\n```\n\n\n## License\n\nMIT@[hustcc](https://github.com/hustcc).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Fg2plot-qrcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustcc%2Fg2plot-qrcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Fg2plot-qrcode/lists"}