https://github.com/vargalaszlo87/draw-correlation-matrix
Draw correlation matrix in pure JavaScript
https://github.com/vargalaszlo87/draw-correlation-matrix
chart correlation correlation-chart correlation-matrix correlation-matrix-chart matrix pure-javascript
Last synced: about 1 year ago
JSON representation
Draw correlation matrix in pure JavaScript
- Host: GitHub
- URL: https://github.com/vargalaszlo87/draw-correlation-matrix
- Owner: vargalaszlo87
- Created: 2024-11-01T07:21:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-12T13:54:07.000Z (over 1 year ago)
- Last Synced: 2025-03-12T14:45:52.425Z (over 1 year ago)
- Topics: chart, correlation, correlation-chart, correlation-matrix, correlation-matrix-chart, matrix, pure-javascript
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# draw-correlation-matrix
Draw correlation matrix in pure JavaScript. This is an easy way you can show your correlation matrix in a web app.

## π Features
**`_canvasName_`**
- You can set the proper name of canvas for HTML tag.
**`N`**
- You can give the size of quadratic-matrix from 3 to n.
**`__labelsVector__`**
- You can give the name vector for "legends".
**`__correlationMatrix__`**
- Here can you push the data in 2D array for showing.
## π§± Project structure
```properties
β
|
βββ tests/
β βββ draw-correlation-matrix.test.js
|
βββ draw-correlation-matrix.js
βββ example.html
βββ package.json
βββ README.md
```
## β¨Getting started / Usage
#### Clone source
```
git clone https://github.com/vargalaszlo87/draw-correlation-matrix.git
```
#### Usage
This solution is simple, you can use it easily.
1. Copy the **draw-correlation.matrix.js** to you directory where you would like use it.
2. Add a **canvas** into your HTML (or other) code.
3. Add **the size of quadratic-matrix**.
4. Add the **labels** vector.
5. Finally, add the 2D **correlation matrix** for the method.
**`example.html`**
```html
Draw Correlation Matrix
// add the datas
const corrMatrix = [
[1.00,-0.85,-0.78,0.68,-0.87,0.42],
[-0.85,1.00,0.79,-0.71,0.89,-0.43],
[-0.78,0.79,1.00,-0.45,0.66,-0.71],
[0.68,-0.71,-0.45,1.00,-0.71,0.09],
[-0.87,0.89,0.66,-0.71,1.00,-0.17],
[0.42,-0.43,-0.71,0.09,-0.17,1.00]
];
const labels = ["Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta"];
// call the funcion
drawCorrelationMatrix.chart("matrixCanvas", 6, labels, corrMatrix);
```
## π¨ββοΈ License
Distributed under the [MIT](https://choosealicense.com/licenses/mit/) License. See `LICENSE.txt` for more information.
## π¬ Contact
Varga Laszlo - https://vargalaszlo.com - mail@vargalaszlo.com
Project Link: https://github.com/vargalaszlo87/pid-c
[](http://vargalaszlo.com)