How to use the signature_pad function in signature_pad

To help you get started, we’ve selected a few signature_pad examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enketo / enketo-core / src / widget / draw / draw-widget.js View on Github external
.then( () => {
                that.pad = new SignaturePad( canvas, {
                    onEnd: () => {
                        // keep replacing this timer so continuous drawing
                        // doesn't update the value after every stroke.
                        clearTimeout( that._updateWithDelay );
                        that._updateWithDelay = setTimeout( that._updateValue.bind( that ), DELAY );
                    },
                    penColor: that.props.colors[ 0 ] || 'black'
                } );
                that.pad.off();
                if ( existingFilename ) {
                    that.element.value = existingFilename;
                    return that._loadFileIntoPad( existingFilename )
                        .then( that._updateDownloadLink.bind( that ) );
                }
                return true;
            } );
github Tangerine-Community / tangy-form / input / tangy-signature.js View on Github external
ready() {
   super.ready();
   this.t = {
     accept: t('accept'),
     clear: t('clear')
   }
   const canvas = this.shadowRoot.querySelector("#signature-pad-canvas");
   this.signaturePad = new SignaturePad(canvas, {
     backgroundColor: 'rgb(255, 255, 255)'
   });
   this.shadowRoot.querySelector('.hint-text').innerHTML = this.hasAttribute('hint-text') 
    ? this.getAttribute('hint-text')
    : ''
  }
github michaeldzjap / react-signature-pad-wrapper / src / SignaturePad.js View on Github external
componentDidMount() {
        if (this._canvas) {
            if (!this.props.width || !this.props.height) {
                this._canvas.style.width = '100%';
            }
            this.scaleCanvas();

            if (!this.props.width || !this.props.height) {
                window.addEventListener('resize', this._callResizeHandler);
            }

            this._signaturePad = new SigPad(this._canvas, this.props.options);
        }
    }
github surveyjs / widgets / src / signature_pad.js View on Github external
afterRender: function(question, el) {
      var rootWidget = this;
      var canvas = el.getElementsByTagName("canvas")[0];
      var buttonEl = el.getElementsByTagName("button")[0];
      var signaturePad = new SignaturePad(canvas);
      if (question.isReadOnly) {
        signaturePad.off();
      }

      buttonEl.onclick = function() {
        question.value = undefined;
      };

      question.readOnlyChangedCallback = function() {
        if (!question.allowClear || question.isReadOnly) {
          signaturePad.off();
          buttonEl.style.display = "none";
        } else {
          signaturePad.on();
          buttonEl.style.display = "block";
        }

signature_pad

Library for drawing smooth signatures.

MIT
Latest version published 1 month ago

Package Health Score

85 / 100
Full package analysis

Similar packages