From 773c7dc1e90cb98eeaf032ad7540db0e15d57644 Mon Sep 17 00:00:00 2001 From: Denys Kozak Date: Thu, 27 May 2021 17:55:50 +0300 Subject: [PATCH] #17 update docs --- README.md | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 9db45c2c..77132012 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ npm install qr-code-styling const qrCode = new QRCodeStyling({ width: 300, height: 300, + type: "svg", data: "https://www.facebook.com/", image: "https://upload.wikimedia.org/wikipedia/commons/5/51/Facebook_f_logo_%282019%29.svg", dotsOptions: { @@ -52,6 +53,7 @@ npm install qr-code-styling }); qrCode.append(document.getElementById("canvas")); + qrCode.download({ name: "qr", extension: "svg" }); @@ -70,19 +72,20 @@ options|object|Init object `options` structure -Property |Type |Default Value|Description ------------------------|------|-------------|----------------------------------------------------- -width |number|`300` |Size of canvas -height |number|`300` |Size of canvas -data |string| |The date will be encoded to the QR code -image |string| |The image will be copied to the center of the QR code -margin |number|`0` |Margin around canvas -qrOptions |object| |Options will be passed to `qrcode-generator` lib -imageOptions |object| |Specific image options, details see below -dotsOptions |object| |Dots styling options -cornersSquareOptions |object| |Square in the corners styling options -cornersDotOptionsHelper|object| |Dots in the corners styling options -backgroundOptions |object| |QR background styling options +Property |Type |Default Value|Description +-----------------------|-------------------------|-------------|----------------------------------------------------- +width |number |`300` |Size of canvas +height |number |`300` |Size of canvas +type |string (`'canvas' 'svg'`)|`canvas` |The type of the element that will be rendered +data |string | |The date will be encoded to the QR code +image |string | |The image will be copied to the center of the QR code +margin |number |`0` |Margin around canvas +qrOptions |object | |Options will be passed to `qrcode-generator` lib +imageOptions |object | |Specific image options, details see below +dotsOptions |object | |Dots styling options +cornersSquareOptions |object | |Square in the corners styling options +cornersDotOptionsHelper|object | |Dots in the corners styling options +backgroundOptions |object | |QR background styling options `options.qrOptions` structure @@ -184,10 +187,10 @@ downloadOptions|object|Options with extension and name of file (not required) `downloadOptions` structure -Property |Type |Default Value|Description ----------|------------------------------|-------------|----------------------------------------------------- -name |string |`'qr'` |Name of the downloaded file -extension|string (`'png' 'jpeg' 'webp'`)|`'png'` |File extension +Property |Type |Default Value|Description +---------|------------------------------------|-------------|----------------------------------------------------- +name |string |`'qr'` |Name of the downloaded file +extension|string (`'png' 'jpeg' 'webp' 'svg'`)|`'png'` |File extension ### License