Hello jsgeoda!

This chapter shows how to load jsgeoda library in Node.js, pure js(html page) and React. The jsgeoda_tutorial repository https://github.com/lixun910/jsgeoda_tutorial contains all the sample codes. You can clone the repository and run the examples locally.

git clone git@githbu.com:lixun910/jsgeoda_tutorial.git

Node.js

const jsgeoda = require('jsgeoda');

// create jsgeoda instance
const geoda = await jsgeoda.New();

// print out "Hello jsgeoda 0.0.8"
console.log("Hello jsgeoda", geoda.version);

Pure js

<html>
<head>
</head>
<body>
<script type="module">
import jsgeoda from 'https://cdn.skypack.dev/-/jsgeoda@v0.2.2-Lc34LnJ0L2k7CJpnhQri/dist=es2020,mode=imports/optimized/jsgeoda.js';
jsgeoda.New().then((geoda)=> {
    console.log('Hello jsgeoda', geoda.version);
});
</body>
</html>

React

Try it yourself in the playground

Last updated

Was this helpful?