# Analytics

In this component we used a data driven elements library  [react-vis](https://uber.github.io/react-vis/)  to help us showing the providers the statistics of there newspaper in our application. we need to install the library first.

```bash
npm install react-vis
```

The  [react-vis](https://uber.github.io/react-vis/) library has many options to visualize the data coming from the back-end server.&#x20;

In this component we used the `window.obj` to pass the information to the front-end.&#x20;

in the following code you can find an example of test object containing the names used in the back-end object to enable any future changes&#x20;

```javascript
 const TestObj = {
  "name": "Hesari",
  "revenue": 0.5,
  "payment_percent": {
    "monthly": 0.6,
    "package": 0.3,
    "single": 0.1
  },
	"articles": [
	    {
	      "name": "article_name_1",
	      "hits" : 270
	    },
	    {
	      "name": "article_name_2",
	      "hits" : 210
	    },
	    {
	      "name": "article_name_3",
	      "hits" : 150
	    },
	    {
	      "name": "article_name_4",
	      "hits" : 80
	    }
	 ]
};
```
