npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

g2plot-qrcode

v1.1.0

Published

Generate QRCode based on AntV/G2Plot.

Downloads

19

Readme

G2Plot-QRCode

G2Plot-QRCode: plugin based on G2Plot v2. LIVE DEMO

npm Version npm License

image

Install

$ npm i --save g2plot-qrcode

Usage

  • render
import { G2Plot } from '@antv/g2plot';
import { adaptor, defaultOptions } from 'g2plot-qrcode';

const qr = new G2Plot('container', {
  // 二维码文本
  data: 'Hello, g2plot qrcode!',
  // 间距
  padding: 8,
  // 宽高
  width: 120,
  height: 120,
  // 背景前景颜色
  backgroundColor: 'white',
  foregroundColor: 'black',
  typeNumber: 0,
  correctLevel: 'H', // L M H Q
  // 样式自定义
  pixelStyle: (pixelData) => ({}),
}, adaptor, defaultOptions);

qr.render();
  • update
qr.update({
  data: 'hello world!',
});

Configure

export interface QRCodeOptions {
  /** qrcode 的内容文本 */
  readonly data: string;
  /** 边框间距,默认 8px */
  readonly padding?: number;
  /** 二维码大小宽高,默认都是 120px */
  readonly width: string;
  readonly height: string;
  /** 二维码 correctLevel,默认 H */
  readonly correctLevel?: 'L' | 'M' | 'Q' | 'H';
  /** 二维码 typeNumber,默认 0 */
  readonly typeNumber?: any;
  // readonly effect?: 'fusion' | 'round' | 'rect';
  /** 二维码前景色,默认 black */
  readonly foregroundColor?: string;
  /** 二维码背景色,默认 white */
  readonly backgroundColor?: string;
  /** 二维码的 icon 中心图标,默认无 */
  readonly icon?: {
    readonly image: string; // 图片
    readonly width?: number; // 图片宽高
    readonly height?: number;
  };
  /** 单元格样式,默认无 */
  readonly pixelStyle?: (pixelData: PixelData) => object;
}

## License

MIT@[hustcc](https://github.com/hustcc).