---
description: '-- by Xun Li, Luc Anselin'
---

# jsGeoDa (beta)

## _Spatial data analysis in browser!!_&#x20;

jsgeoda is the first javascript library for spatial data analysis with functionalities of choropleth mapping, spatial weights, local indicators of spatial association,  spatial clustering, and cluster analysis. With a few lines of code, you can run spatial data analysis in a web browser or in Node.js:

```javascript
import jsgeoda from 'jsgeoda';

const geoda = await jsgeoda.New();

// get geojson 
const response = await fetch('./natregimes.geojson');
const ab = response.arrayBuffer();

// read geojson in jsgeoda
const nat = geoda.readGeoJSON(ab);

// create Queen contiguity weights
const w = geoda.getQueenWeights(nat);

// get values of variable "HR60"
const hr60 = geoda.getColumn('HR60');

// apply local Moran statistics on variable "HR60"
const lm = geoda.localMoran(w, hr60);

```

jsgeoda can be easily integrated with your web application. [the US Covid Altas](https://theuscovidatlas.org) is the first web application that integrates jsgeoda to run high power spatial analytics in the browser without server needed:

![theuscovidatlas.org](https://3583754133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MMxWNyMbqx5YG1sT6E6%2F-MMx_GQ3-gh60wSM07In%2F-MMxbKEqj8yTUBRq7oVM%2Fdashboard2.png?alt=media\&token=2a320c1a-2f3c-424d-8434-20e610687707)

## Hands-On Tutorials:

![](https://3583754133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MMxWNyMbqx5YG1sT6E6%2F-MbTjHyVo53-xm01YxSN%2F-MbTjL-sLNcPihx8_IbV%2FScreen%20Shot%202021-06-05%20at%205.33.17%20PM.png?alt=media\&token=3d0934a8-fd16-455c-a09b-e8a403f6e5ce)

###

### 1.Hello jsgeoda!

[https://codesandbox.io/s/1-hello-jsgeoda-foq4j](https://codesandbox.io/s/1-hello-jsgeoda-foq4j)

### 2. Load spatial data

[https://codesandbox.io/s/2-load-spatial-data-dgcux](https://codesandbox.io/s/2-load-spatial-data-dgcux)

### 3. Choropleth Mapping

[https://codesandbox.io/s/3basicmapping-lcguj](https://codesandbox.io/s/3basicmapping-lcguj)

### 4. Spatial Weights

[https://codesandbox.io/s/4spatial-weights-owi84](https://codesandbox.io/s/4spatial-weights-owi84)

### 5. Univariate LISA

[https://codesandbox.io/s/5lisaunivariate-zhhop](https://codesandbox.io/s/5lisaunivariate-zhhop)

### 6. Multivariate LISA

[https://codesandbox.io/s/6lisamultivariate-4w3hk](https://codesandbox.io/s/6lisamultivariate-4w3hk)

### 7. Spatial Clustering

[https://codesandbox.io/s/7spatialclustering-uvz12](https://codesandbox.io/s/7spatialclustering-uvz12)



