G2Plot-QRCode

基于 G2Plot 的强大二维码渲染库
授权协议 MIT
开发语言 JavaScript
所属分类 程序开发、 条形码/二维码
软件类型 开源软件
地区 国产
投 递 者 丌官信厚
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

G2Plot-QRCode 是一个基于 G2Plot 的强大二维码渲染库。LIVE DEMOCodeSandbox.

安装

$ npm i --save g2plot-qrcode

使用

渲染

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();

更新

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

配置项

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;
}

功能

  1. 常规二维码库能力都支持,支持宽高 padding 等基础配置
  2. 支持自定义前景背景
  3. 支持自定义 detection position 的样式(颜色、描边、渐变等)
  4. 支持 icon 以及大小
  5. 交互事件(二维码不再是静态图)
  • import os import time import sys from pystrich.code128 import Code128Encoder from pystrich.ean13 import EAN13Encoder from pystrich.qrcode import QRCodeEncoder def code128(): code=input("输入条码code1

  • Py之qrcode:调用python的qrcode库两种方式生成二维码、带logo的二维码       目录 python编程实现生成二维码 1、第一种方式—纯文本 2、第二种方式—带logo

  • 当时为了这个生成二维码,踩了各种坑,搞了一晚上才搞出来,综合网上各位大神,写下笔记以备下次使用 头部use use qrcode\qrcode; header('content-type:image/png'); //设置gif Image ob_clean(); $url = urldecode("您的链接"); $qrcode = new QRcode(); $png = QRcode::p

  • 安装qrcode相关模块: pip install qrcode pip install Image 生成二维码的Python实现: import qrcode def qrCodeGenerator(data, qrcode_file): qr = qrcode.QRCode( version=1, error_correction=qrcode.constants.ER

  • new Pie(el.value, { appendPadding: 10, data, width:600, height:400, angleField: "value", colorField:

 相关资料
  • 一套简单、易用、并具备一定扩展能力和组合能力的统计图表库,基于图形语法理论搭建而成,『G2Plot』中的 G2 即意指图形语法 (the Grammar of Graphics),同时也致敬了 ggplot2。我们想做的事有三件:(1)使用户不用成为可视化专家也能够轻松制作出优雅美观的图表 (2)保证图表能够经受得起业务的检验,在真实的场景中易用、好用 (3)探索统计图表的更多可能性,使统计图表变

  • import { Qrcode } from 'feui'; components: { [Qrcode.name]: Qrcode } 代码演示 基础用法 <fe-qrcode value="https://feui.gitee.io"></fe-qrcode> 二维码尺寸 200px <fe-qrcode value="https://feui.gitee.io" :size

  • 使用指南 组件介绍 长按可识别,可以自定义大小和颜色 引入方式 import { Qrcode } from 'feart'; components: { 'fe-qrcode': Qrcode } 代码演示 基础用法 默认类型为 img ,可长按识别。类型为 canvas 时,仅展示使用。 <fe-qrcode value="https://nuofe.nntest.cn/fear

  • 本文向大家介绍Java 二维码,QR码,J4L-QRCode 的资料整理,包括了Java 二维码,QR码,J4L-QRCode 的资料整理的使用技巧和注意事项,需要的朋友参考一下   开源码 Java 解码器 (编码解码)下载:http://sourceforge.jp/projects/qrcode/downloads/28391/qrcode.zip Java QR Code Open Sou

  • 二维码大师 是一个可以把当前页面生成二维码的Chrome插件。  同时还支持 知乎的问题和答案、水木社区的帖子和回复 生成二维码。 计划将来支持更多地网站。 通过二维码,用户可以拿手机扫描,把当前页面分享给好友,或者分享到朋友圈,省去了输入连接的麻烦。 安装地址 https://chrome.google.com/webstore/detail//eandllggnghikbggfgifghhbh

  • WebKit是一个渲染引擎,而不是一个浏览器,它专注于网页内容展示,其中渲染是其中核心的部分之一。本章着重于对渲染部分的基础进行一定程度的了解和认识,主要理解基于DOM树来介绍Render树和RenderLayer树的构建由来和方式。 那么什么是DOM?简单来说,DOM是对HTML或者XML等文档的一种结构化表示方法,通过这种方式,用户可以通过提供标准的接口来访问HTML页面中的任何元素的相关属性