Skip to content

Commit fcd69a3

Browse files
authored
Create README.md
1 parent 6ee4626 commit fcd69a3

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Polyglot Data Analysis and Visualization API using METACALL
2+
3+
In this example we show how to use Numpy and Matplotlib (Python) from an WebSocket server (NodeJS) in order to build a **Polyglot Data Analysis and Visualization API**.
4+
5+
## Install
6+
7+
Clone the repository:
8+
9+
```sh
10+
git clone https://github.com/pawxnsingh/numpy-matplotlib-websocket-node-example
11+
```
12+
13+
Install MetaCall CLI:
14+
15+
```sh
16+
curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh
17+
```
18+
19+
Navigate to the directory:
20+
21+
```sh
22+
cd numpy-matplotlib-websocket-node-example
23+
```
24+
25+
Install application dependencies:
26+
27+
```sh
28+
metacall pip3 install -r requirements.txt
29+
metacall npm install
30+
```
31+
32+
## Run the Application
33+
34+
```sh
35+
metacall index.js
36+
```
37+
38+
For testing it, in another terminal, let's visualize this data calculating the mean, median, standard deviation of this array
39+
[10, 12, 14, 15, 10, 11, 150] (you can change the values and size for experimenting)
40+
41+
```sh
42+
use postman/hoppscotch(web)
43+
44+
URL: ws://localhost:8080
45+
Message: {"numbers": [10, 12, 14, 15, 10, 11, 150]}
46+
```
47+
48+
It should output something like:
49+
50+
```
51+
output: look for the output folder for the visualized view
52+
```
53+
54+
## Docker
55+
56+
An alternative version with Docker and automated testing is provided.
57+
58+
```sh
59+
docker build -t metacall/numpy-matplotlib-websocket-node-example .
60+
docker run --rm -v $(pwd)/output:/metacall/output -p 8080:8080 -it metacall/numpy-matplotlib-websocket-node-example
61+
```
62+

0 commit comments

Comments
 (0)