Skip to content

We like to share the macro functions we are using to process PhotosynQ IoT data.

License

Notifications You must be signed in to change notification settings

Photosynq/helpers

Repository files navigation

PhotosynQ Helper Functions

These preset functions allow PhotosynQ Users to develop new Macros for evaluating their measurements easier and faster. This not only includes function to perform standard calculations like mean or find the maximum or minimum, but linear and non-linear regressions and functions to transform arrays.

The documentation is available as part of the PhotosynQ documentation https://help.photosynq.com/macros/provided-functions or in the docs folder of this repo.

Install

If you want to build the functions yourself, make sure you have node.js and npm installed before you run the command below.

npm install

How to Use

In the Browser

The functions can be used in the browser by simply including the file in the header of the HTML document using math.js or the minified version math.min.js.

<!doctype html>
<html>
    <head>
        <script src="../path/to/file" type="javascript/text"></script>
    </head>
    <body>
        <!-- Page Content -->
    <body>
</html>

With node.js

To use the functions, you have to require the package.

// Specific functions
const { functions, you, need} = require('photosynq-helpers');

// All functions
const pq = require('photosynq-helpers');

// All functions as globals
require('photosynq-helpers/inlcude')();

Files

The distribution folder holds a set of files, that can be used in the browser or with node.js (in case you don't want to include the package)

├── src                 // Source Folder
├── docs                // Documentation
├── dist                // Distribution files
│   ├── math.js         // Math functions for the browser
│   ├── math.min.js     // Math functions minified for the browser
│   └── math.node.js    // Math functions for node.js to be used without package
└── tests               // Automated tests for functions

Build

Use the following gulp task to build distribution files. The documentation files are not generated.

# Using gulp
gulp build
# or via npm
npm run build

To build the complete set of files, distribution files and documentation, run the gulp task below.

# Using gulp
gulp
# or via npm
npm run release

Generate Documentation

The documentation can be build using the following gulp task. The task doesn't require distribution files.

# Using gulp
gulp docs
# or via npm
npm run docs

Test Functions

You can test the by simply running the following gulp task.

# Using gulp
gulp test
# or via npm
npm run test

About

We like to share the macro functions we are using to process PhotosynQ IoT data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published