Giter Club home page Giter Club logo

iinkjs's Introduction

iinkJS is no longer maintained, you must now use iink-ts

npm version Examples Documentation

The fastest way to integrate rich handwriting features in your webapp.

iinkJS is a JavaScript library that can be used in every web application to bring handwriting recognition.

It integrates all you need:

  • Signal capture for all devices,
  • Digital ink rendering,
  • Link to MyScript Cloud to bring handwriting recognition.

Table of contents

Examples

Discover Interactive Ink with iinkJS and its major features with our text demo and tutorial.

Try our two basic examples featuring the text recognition and the math recognition.

All our examples with the source codes in this directory.

We also provide examples of integration with the major JavaScript frameworks:

Framework Link
Example of React integration
Example of Angular integration
Example of Vue integration

Features

  • Text and Math support,
  • Easy to integrate,
  • Digital ink capture and rendering,
  • Rich editing gestures,
  • Import and export content,
  • Styling,
  • Typeset support,
  • More than 200 mathematical symbols supported,
  • 65 supported languages.

You can discover all the features on our Developer website for Text and Math.

Requirements

  1. Have npm, yarn.
  2. Have a MyScript developer account. You can create one here.
  3. Get your keys and the free monthly quota to access MyScript Cloud at developer.myscript.com

Installation

iinkJS can be installed with the well known package managers npm, yarn.

If you want to use npm or yarn you first have to init a project (or use an existing one).

npm init
OR
yarn init 

You can then install iinkJS and use it as showed in the Usage section.

npm install iink-js
OR
yarn add iink-js

Usage

  1. Create an index.html file in the same directory.

  2. Add the following lines in the head section of your file to use iinkJS and the css. We use PEP to ensure better browsers compatibilities. Note that you can also use it using dependencies from node_modules:

<script src="node_modules/iink-js/dist/iink.min.js"></script>
<script src="https://code.jquery.com/pep/0.4.3/pep.js"></script>
  1. Still in the head section, add a style and specify the height and the width of your editor:
<style>
    #editor {
        width: 100%;
        height: 100%;
    }
</style>
  1. In the body tag, create a div tag that will contain the editing area:
    <div id="editor"></div>
  1. In JavaScript and within a <script> tag placed before the closing tag </body>, create the editor using the register function, your editor html element and a simple configuration:
  const editorElement = document.getElementById('editor');

  iink.register(editorElement, {
    recognitionParams: {
      type: 'TEXT',
      server: {
        applicationKey: '#YOUR MYSCRIPT DEVELOPER APPLICATION KEY#',
        hmacKey: '#YOUR MYSCRIPT DEVELOPER HMAC KEY#'
      }
    }
  });
  1. Your index.html file should look like this:
<html>
    <head>
        <script src="node_modules/iink-js/dist/iink.min.js"></script>
        <script src="https://code.jquery.com/pep/0.4.3/pep.js"></script>
        <style>
            #editor {
                width: 100%;
                height: 100%;
            }
        </style>
    </head>
    <body>
        <div id="editor" touch-action="none"></div>
    <script>
        const editorElement = document.getElementById('editor');

        iink.register(editorElement, {
            recognitionParams: {
                type: 'TEXT',
                server: {
                    applicationKey: '#YOUR MYSCRIPT DEVELOPER APPLICATION KEY#',
                    hmacKey: '#YOUR MYSCRIPT DEVELOPER HMAC KEY#'
                }
            }
        });
    </script>
    </body>
</html>
  1. Open index.html in your browser or serve your folder content using any web server.

You can find this guide, and a more complete example on the MyScript Developer website.

Documentation

You can find a complete documentation with the following sections on our Developer website:

As well as a global Configuration page.

We also provide a complete API Reference.

Development

Instructions to help you build the project and develop are available in the SETUP.md file.

Getting support

You can get support and ask your questions on the dedicated section of MyScript Developer website.

Sharing your feedback ?

Made a cool app with iinkJS? We would love to hear about you! We’re planning to showcase apps using it so let us know by sending a quick mail to [email protected].

Contributing

We welcome your contributions: if you would like to extend iinkJS for your needs, feel free to fork it!

Please take a look at our contributing guidelines before submitting your pull request.

License

This library is licensed under the Apache 2.0.

iinkjs's People

Contributors

dependabot[bot] avatar f2x avatar lejsboureau avatar mathieuruellanmyscript avatar mhaddadi-myscript avatar padewitte avatar romaincscn avatar srobert-myscript avatar torebo avatar ystreibel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

iinkjs's Issues

what i missing here?

apt update
apt upgrade
shutdown -r now

apt install git python3-pip
sudo apt install curl
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn


apt install npm
git clone https://github.com/MyScript/iinkJS.git
cd iinkJS
npm install
npm audit fix

npm run build
npm run dev

and logs show this

http://localhost:8080 -> /root/iinkJS
LiveReload enabled
(!) Circular dependencies
node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/select.js -> node_modules/d3-selection/src/selection/index.js
node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/selectAll.js -> node_modules/d3-selection/src/selection/index.js
node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/filter.js -> node_modules/d3-selection/src/selection/index.js
...and 9 more
created dist/iink.min.js in 6.2s
bundles src/iink.js → dist/iink.esm.js...
(!) Circular dependencies
node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/select.js -> node_modules/d3-selection/src/selection/index.js
node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/selectAll.js -> node_modules/d3-selection/src/selection/index.js
node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/filter.js -> node_modules/d3-selection/src/selection/index.js
...and 9 more
created dist/iink.esm.js in 5.1s

[2021-06-16 20:47:33] waiting for changes...

How can deploy in public ip?

Undo function not working as expected

While using the iinkJS with Math recognition and image/png in the mime type, the undo functionality does not work as expected.

Steps to replicate the issue:

  1. Open the myScript editor
  2. Draw a number
  3. Click on undo button
  4. Redo button is still disabled.

Issue

When the first drawn element is removed using the undo button, the redo button is still in the disabled mode. Additionally, the result content is not cleared from the UI.

Reference code is taken from - https://github.com/MyScript/iinkJS/blob/master/examples/v4/websocket_math_iink.html
Demo link - https://codesandbox.io/s/myscript-image-issue-demo-7vh21l
Note: replace the server keys with the actual ones to view this behavior on the demo link (https://codesandbox.io/s/myscript-image-issue-demo-7vh21l?file=/index.html:197968-198084)

Screen recording

myScript.issue.mov

I use iinkJS write Chinese, but it return data is not good

i download iinkJS, run the examples, websocket_text_iink.html; at first,i write chinese,it run good,return i need chinese,for example: i write 王, it return 王;applicationKey,hmacKey I have change my own, I run the example, the UI is change, and I write 王, it return "-X-", it not return chinese;
so how I do can use iinkJS, it can let me write chinese ,return i need chinese?

LOST CONNECTION

Screenshot 2022-12-09 at 3 22 53 AM

How do I get rid of this erros and also the controls does not quite work when working with maths. ` This is my code let editor = editorRef.current;
editor = iink.register(editorRef.current, {
  recognitionParams: {
    type: 'MATH',
    protocol: 'WEBSOCKET',
    apiVersion: 'V4',
    server: {
      scheme: 'https',
      host: 'webdemoapi.myscript.com',
      applicationKey: '515131ab-35fa-411c-bb4d-3917e00faf60',
      hmacKey: '54b2ca8a-6752-469d-87dd-553bb450e9ad',
    },
    iink: {
      math: {
        mimeTypes: [
          'application/x-latex',
          'application/vnd.myscript.jiix',
          'application/mathml+xml',
        ],
      },
      export: {
        jiix: {
          strokes: true,
        },
      },
    },
  },
});

`

Web Handwriting Recognition API

Hello,

We (Chrome and Chrome OS) are working on a standardized Web API for handwriting recognition. The proposal is here: explainer.

The API would allow websites to access handwriting recognizers that's locally available on device (instead of sending the requests to cloud servers). It's currently implemented on Chrome OS (backed by the same technology in Google Cloud Vision API).

There's an article explaining its usage here: https://web.dev/handwriting-recognition/

Does the API interest you? We'd also like to hear your feedback on the API design.

Feature Request: MathML import for Math blocks

Dear team,

no issue to raise. I am impressed with the progress on iinkJS and I am planning to implement it into my own webapp. I was wondering if you are planning to make MathML an available import feature for Math blocks in the foreseeable future.

Best,

J&B

Is there a way to specify text encoding? (Web API)

Hello,
Is there a way to specify text encoding?

I have input Korean as shown below, the characters are rendered in a empty boxed state.
ex) editor.import('가나다', 'text/plain')

  • I have used Interactive Ink SDK Web API version 1.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.