1.0.5 • Published 1 month ago

webdggrid v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

Web Assembly version of DGGRID

A wrapper for DGGRID in Web Assembly. Based on last DGGRID c++ library developed by Dr. Kevin

NPM Version GitHub Actions Workflow Status GitHub Actions Workflow Status npm.io

How to use

Please check tests folder for more examples.

in browser

const WebdggridLocal = await import("../dist/index.js").then(m => m.Webdggrid).catch(console.log);
import { Webdggrid as WebdggridExternal } from "https://cdn.jsdelivr.net/npm/webDggrid/dist/index.js";

const Webdggrid = WebdggridLocal ?? WebdggridExternal;

const webdggrid = await Webdggrid.load();
const seqNum = dggs.geoToSequenceNum([[0, 0]]);

In nodejs

import { Webdggrid } from 'webdggrid'
const dggs = await Webdggrid.load();
const seqNum = dggs.geoToSequenceNum([[0, 0]]);

Supported Functions

Grid Creation

Grid Statistics

Grid Conversions

Changes

Slow development pace.

1.0.5

  • Added support to SeqNumGrid

Development

Make sure to setup emscripten on your machine.

The development process involves modifying the cpp code and use utils/make.js to build the library.

FolderDesc
src-cppThe src file of the DGGRID. It is inspired from DGGRIDR project.
src-tsThe src file js wrapper around the emscripten code to make it easier to interact with library in more js friendly approach.
lib-wasmThe js output that emscripten generates
lib-wasm-pyexperimental python wrapper
testsJS unit tests

To build the entire library simply run yarn build

It will build webassembly file and also builds the typescript wrapper.

Server the emscripten output just for development purpuse

Run the following command. It will open the emscripten's default page to test the wasm file. Just navigate to libdggrid.html yarn serve

you can invoke the functions similar to

Module.DgGEO_to_SEQNUM(0,0,0,4,10,'HEXAGON','ISEA',[0],[0])
``
1.0.5

1 month ago

1.0.4

1 month ago

1.0.3

2 months ago

1.0.2

2 months ago

1.0.1

2 months ago