A collection of different JavaScript functions (and helper functions) that are useful for exploratory spatial data analysis (ESDA) in a web application. This project is a work-in-progress. The long-term goal is to turn this into a functional module.
This module was inspired by the fact that many simple spatial analyses would otherwise require the use of middleware or would have to be precalculated and stored server side. The idea is to write a set of useful functions in JavaScript that can be executed quickly on-the-fly. One limitation of this approach is that computationally intensive functions (such as spatial randomization) may be too time consuming for large data sets on devices with limited computational power.
At the present time, the following functions are available:
An asterisk * indicates versions of functions that have been rewritten to account for null values. Two versions are being maintained (for the present time) because the functions that do not handle nulls are more concise, and may execute slighltly faster if you do not require null value handling.
- adjusted.js
- adjusted2.js*
Dependencies: math.js
Create bivariate classes (based on tertiles) to support a 3 x 3 color scheme for a bivariate choropleth map:
- bchTerts.js
- bchTerts2.js*
Dependencies: simple-statistics
- cosSim.js
Dependencies: math.js
- distEuclidean.js
Dependencies: none
- EucDistMatrix.js
Dependencies: math.js
- GetisOrdG_helpers.js
- GetisOrdG_testdata.js
- GetisOrdGi.js
- GetisOrdGiStar.js
- GetisOrdGiStarZ.js
- GetisOrdGiZ.js
- permuteGetisOrdGiStar.js
Dependencies: math.js
- localMoranI_helpers.js
- localMoranI_testdata.js
- localMoranI.js
- localMoranI_nulls.js
- localMoranIZ.js
Dependecies: None.
- Mahalanobis_helpers.js
- Mahalanobis_testdata.js
- Mahalanobis1.js
- Mahalanobis2.js
Dependencies: math.js
- minMaxScaler.js
Dependencies: none.
- percentileRank.js
- percentileRank2.js
Dependencies: none
Other files:
- testData.js contains test code and example calls for each function.
- test.js contains a JSON object with county level SVI 2018 data (as percent ranks) for five indicators plus diabetes percentage.
- data/diabetes_indicators.csv is a comma delimited file containing the same data as test.js
Maintainer/Developer: Corey Devin Anderson ([email protected])