> For the complete documentation index, see [llms.txt](https://xunli.gitbook.io/jsgeoda/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xunli.gitbook.io/jsgeoda/master.md).

# 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](/files/-MMxbKEqj8yTUBRq7oVM)

## Hands-On Tutorials:

![](/files/-MbTjL-sLNcPihx8_IbV)

###

### 1.Hello jsgeoda!

<https://codesandbox.io/s/1-hello-jsgeoda-foq4j>

### 2. Load spatial data

<https://codesandbox.io/s/2-load-spatial-data-dgcux>

### 3. Choropleth Mapping

<https://codesandbox.io/s/3basicmapping-lcguj>

### 4. Spatial Weights

<https://codesandbox.io/s/4spatial-weights-owi84>

### 5. Univariate LISA

<https://codesandbox.io/s/5lisaunivariate-zhhop>

### 6. Multivariate LISA

<https://codesandbox.io/s/6lisamultivariate-4w3hk>

### 7. Spatial Clustering

<https://codesandbox.io/s/7spatialclustering-uvz12>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://xunli.gitbook.io/jsgeoda/master.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
