GithubHelp home page GithubHelp logo

myscript / myscriptjs Goto Github PK

View Code? Open in Web Editor NEW
353.0 31.0 63.0 71.66 MB

:pencil2: :cloud: MyScriptJS is the fastest way to integrate rich handwriting recognition features in your webapp.

Home Page: https://developer.myscript.com

License: Other

Makefile 2.17% JavaScript 94.47% CSS 1.98% Shell 1.23% HTML 0.05% Dockerfile 0.10%
handwriting handwriting-recognition vanillajs interactive-ink iink javascript cloud

myscriptjs's Introduction

MyScriptJS

npm version Examples Documentation

⚠️ This repository is archived ⚠️

iinkJS grants you high integration flexibility by letting you choose your favorite framework or components. For this reason, we have decided to focus on iinkJS and to discontinue our ready-to-use Web components.

For more information, please see documentation.

We also provide an example to integrate iinkJS as webcomponent: link.

🚧

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

MyScriptJS 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 MyScriptJS 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 or bower installed.
  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

MyScriptJS can be installed with the well known package managers npm, yarn and bower.

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 MyScriptJS and use it as showed in the Usage section.

npm install myscript
OR
yarn add myscript

You can also install MyScriptJS using bower (with or without an existing project) and use it as showed in the Usage section replacing node_modules by bower_components.

bower install myscript

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 MyScriptJS and the css. We use PEP to ensure better browsers compatibilities. Note that you can also use it using dependencies from node_modules or bower_components:

<link rel="stylesheet" href="node_modules/myscript/dist/myscript.min.css"/>
<script src="node_modules/myscript/dist/myscript.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');

  MyScript.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>
        <link rel="stylesheet" href="node_modules/myscript/dist/myscript.min.css"/>
        <script src="node_modules/myscript/dist/myscript.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');

        MyScript.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 MyScriptJS? 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 MyScriptJS 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.

myscriptjs's People

Contributors

f2x avatar mathieuruellanmyscript avatar padewitte avatar romaincscn 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  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

myscriptjs's Issues

Issue writing on iPad and Chrome Device Emulator

MyScriptJS Version: v4.0.0

I'm running into an issue on my iPad and the chrome device emulator where when I start to write something the pointer shoots to the upper left hand portion of the screen and ends the writing abruptly. The writing area works fine outside of the device emulator using a mouse.

Screenshot

ETA for Typesetting

I'm interested in this feature, is there a planned release date for it? Is there anything that can be done to help with this feature?

Some questions about WebSoctet V4

I encountered a problem while checking the API. I am using V4, but I want to use some methods that were earlier but not available in V4, such as editor.close() and editor.reset(). . Or how do I manually close WebSoctet using V4? If I can't manually close it, how can myscript instance get back to normal without reloading the page when myscript in the page behaves abnormally. Thank you

the problem about handwritten math formula recognition and export latex

I am very excited to have such a good handwritten formula recognition tool, which has helped me a lot.
I found several problems in using it.
Next I'll list some ambiguities and the latex code I expect to produce

state:occasionally recognition errors
write:△ABC
expect:\\triangle ABC
actual:\\Delta ABC
state:hard to recognize correctly
write:ac // df
expect:ac\\parallel df
actual:ac\\left| \\right| df
state:Incorrect recognition
write:3′ 45″
expect:3′ 45″
actual:3^{1}45^{11}
state:Incorrect recognition
write:20℃
expect:20℃
actual:20^{0}C
state:Incorrect recognition
write:⏥abcd
result:Incorrect recognition

Base example does not work on Firefox mobile

The touch-action="none" property of the #editor element is not present in the most basic example (the one presented in the README) meaning the canvas can be dragged, breaking this example.

Offline version

Is there an offline version that can be integrated into an app that could still work when the connection is offline?

Dirac Bracket is not recognized

screenshot

This will be considered as

\hat H\left|\Psi \rangle = E\left|\Psi\rangle
The desired result should
\hat H\left|\Psi \right\rangle = E\left|\Psi\right\rangle if without the physics package.
\hat H\ket{\Psi} = E\ket{\Psi} if with the physics package

Questions about some errors that cannot be caught

I am listening for an ‘error’ event to catch an error. ( vue App )
this.$refs.editor.addEventListener('error', (evt: any) => { console.log(evt, "evt") });
But there are some errors of type="error" that are not captured, such as
message:"Session is too old. Max Session Duration Reached" type:"error"
I want to be able to catch all the type="error" errors to do some processing.
help

MyScript is undefined

I get a undefinded error on line 58 of myscript.js, when requiring it in a javascript file

XMLHttpRequest is undefined using MyScript in a node application

When attempting to import "myscript"; to use in a REST API the XMLHttpRequest instance in undefined.

Assumption was made:

// We are writing some browser module here so the no import found should be ignored
// eslint-disable-next-line no-undef
var request = new XMLHttpRequest();

In order to fix this the dependencies needs to be introduced.

var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;

Can I config the post suffix url?

Can I config the post suffixurl (e.g. '/api/v4.0/iink/batch') when I need recognize? Because it's different in V3 and V4, but we used a same MyScript Server.

Docs are broken

When opening docs/index.html in the browser, I'm just getting a directory listing. Also, docs/api/index.html is at least partly broken, since all the dynamic stuff isn't loading. And then there is the docs/components folder, which is basically just a copy of the bower_components.

Not sure if some setup steps are required? I did a bower install, a npm install, and a gulp, to no avail.

Fade out strokes in superimposed mode

The API is currently missing a way to make strokes gradually disappear when in "superimposed" mode. As in the official superimposed demo, after a few characters it quickly becomes a mess.

It's possible to do paper.getRenderer().clear(), but that's a bit too ambitious, leaving the user without feedback. So a more gradual fading out of strokes would be appreciated, either based on time or on result event.

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.