Skip to content

Commit

Permalink
Clean up Node module documentation, also package the module in a easy…
Browse files Browse the repository at this point in the history
… to upload manner
  • Loading branch information
ankitrohatgi committed Apr 7, 2019
1 parent b6f88c1 commit 45388dc
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 18 deletions.
9 changes: 9 additions & 0 deletions app/build_node_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ printf "\nlet Module = require(\"./wasm.js\");\n" >> wpd_node.js
# Export Module
printf "\nmodule.exports = { wpd: wpd };\n" >> wpd_node.js

# Package Module

VERSION=4.2
mkdir -p wpd-$VERSION/
cp wpd_node.js wpd-$VERSION/
cp wasm.js wpd-$VERSION/
cp wasm.wasm wpd-$VERSION/
tar -czf wpd-$VERSION.tar.gz wpd-$VERSION

4 changes: 2 additions & 2 deletions app/locale/de_DE/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2019-03-20 21:07-0700\n"
"POT-Creation-Date: 2019-04-06 20:17-0700\n"
"PO-Revision-Date: 2019-02-24 00:40-0800\n"
"Last-Translator: \n"
"Language: de_DE\n"
Expand All @@ -16,7 +16,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
"Generated-By: Babel 2.4.0\n"

#: templates/_base.html:27
msgid "Web based tool to extract numerical data from plots and graph images."
Expand Down
4 changes: 2 additions & 2 deletions app/locale/en_US/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2019-03-20 21:07-0700\n"
"POT-Creation-Date: 2019-04-06 20:17-0700\n"
"PO-Revision-Date: 2016-12-12 23:09-0600\n"
"Last-Translator: \n"
"Language: en_US\n"
Expand All @@ -16,7 +16,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
"Generated-By: Babel 2.4.0\n"

#: templates/_base.html:27
msgid "Web based tool to extract numerical data from plots and graph images."
Expand Down
4 changes: 2 additions & 2 deletions app/locale/fr_FR/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2019-03-20 21:07-0700\n"
"POT-Creation-Date: 2019-04-06 20:17-0700\n"
"PO-Revision-Date: 2017-11-01 23:56-0500\n"
"Last-Translator: \n"
"Language: fr_FR\n"
Expand All @@ -16,7 +16,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
"Generated-By: Babel 2.4.0\n"

#: templates/_base.html:27
msgid "Web based tool to extract numerical data from plots and graph images."
Expand Down
4 changes: 2 additions & 2 deletions app/locale/ja/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2019-03-20 21:07-0700\n"
"POT-Creation-Date: 2019-04-06 20:17-0700\n"
"PO-Revision-Date: 2016-12-18 10:38-0600\n"
"Last-Translator: \n"
"Language: ja\n"
Expand All @@ -16,7 +16,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
"Generated-By: Babel 2.4.0\n"

#: templates/_base.html:27
msgid "Web based tool to extract numerical data from plots and graph images."
Expand Down
4 changes: 2 additions & 2 deletions app/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2019-03-20 21:07-0700\n"
"POT-Creation-Date: 2019-04-06 20:17-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
"Generated-By: Babel 2.4.0\n"

#: templates/_base.html:27
msgid "Web based tool to extract numerical data from plots and graph images."
Expand Down
4 changes: 2 additions & 2 deletions app/locale/ru/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2019-03-20 21:07-0700\n"
"POT-Creation-Date: 2019-04-06 20:17-0700\n"
"PO-Revision-Date: 2016-12-18 10:38-0600\n"
"Last-Translator: \n"
"Language: ru\n"
Expand All @@ -17,7 +17,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
"Generated-By: Babel 2.4.0\n"

#: templates/_base.html:27
msgid "Web based tool to extract numerical data from plots and graph images."
Expand Down
4 changes: 2 additions & 2 deletions app/locale/zh_CN/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WebPlotDigitizer\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2019-03-20 21:07-0700\n"
"POT-Creation-Date: 2019-04-06 20:17-0700\n"
"PO-Revision-Date: 2018-02-21 00:47-0600\n"
"Last-Translator: RGXGR <[email protected]>\n"
"Language: zh_Hans_CN\n"
Expand All @@ -16,7 +16,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.6.0\n"
"Generated-By: Babel 2.4.0\n"

#: templates/_base.html:27
msgid "Web based tool to extract numerical data from plots and graph images."
Expand Down
14 changes: 10 additions & 4 deletions node_examples/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
NOTE: This document is a work in progress

# Calling WebPlotDigitizer algos from NodeJS

## Purpose
Expand All @@ -10,7 +8,7 @@ To make this possible, the core functions of WebPlotDigitizer have been packaged

## Current State

The current module is the first attempt at providing a "library" for users. In the future, the API and capabilities are likely to change quite a bit.
The current module is the first attempt at providing a WebPlotDigitizer "library". The API is not very developer friendly and using this module requires familiarity with Javascript and NodeJS. These things will change in the future as the API is cleaned up and packaging is improved. You should watch out for breaking changes that may happen from version to version. I am also considering publishing non-Javascript versions of the library in the future (most likely in C with wrappers for Python etc.).

## Pre-Requisites

Expand All @@ -20,7 +18,15 @@ On Linux, you should be able to use the package manager. On other operating syst

### Build or Download WebPlotDigitizer NodeJS Module

WIP
The module has not been submitted to the NPM registry yet, so just download the necessary module files from the downloads page: https://automeris.io/WebPlotDigitizer/download.html

To build the module from source, follow the relevant information in the [developer guidelines](../DEVELOPER_GUIDELINES.md) (Linux is preferred).

After downloading or building the NodeJS package, use the module with `require` as:

const wpd = require("./path/to/wpd-4.2/wpd_node.js").wpd

In the examples here, the path is assumed to be `../app/wpd_node.js` which is likely the case if you build the package from source.

### Install other dependencies

Expand Down

0 comments on commit 45388dc

Please sign in to comment.