CanvasXpress React
==================
Node program to use CanvasXpress with React
Installation
----------------------
```bash
npm install canvasxpress-react --save
```
Step-By-Step instructions
-------------------------
1- Create a React App
Refer to documentation on Creating a New React App for more info.
2- Install canvasxpress-react
See the above [Installation](https://github.com/neuhausi/canvasxpress-react/edit/master/README.md#installation) section!
3- Import CanvasXpress React Component
Add the following code to your app eg, `index.js`.
```bash
import React from 'react';
import ReactDOM from 'react-dom';
import CanvasXpressReact from 'canvasxpress-react';
class Bar extends React.Component {
render() {
var target = "canvas";
var data = {
"y" : {
"vars" : ["Variable1"],
"smps" : ["Sample1", "Sample2", "Sample3"],
"data" : [[33, 48, 55]]
}
};
var config = {
"graphOrientation": "vertical",
"graphType": "Bar",
"theme": "CanvasXpress",
"title": "Simple Bar graph"
};
return (
)
}
}
var reactapp = document.createElement("div");
document.body.appendChild(reactapp);
ReactDOM.render(, reactapp)
```
Notes
-----------------
- Requires **React 16.8+** (the component is implemented with hooks).
- `target` is **optional** — the component renders through an internal ref, so you
no longer need to supply a globally unique DOM id. If you do pass `target`, it is
applied as the `