@ea-lab/reactive-json-chartjs
v1.0.0
Published
This is an extension lib for Reactive-JSON that enables ChartJS support.
Maintainers
Readme
ChartJS for Reactive-JSON
This is an extension lib for Reactive-JSON that enables ChartJS support.
Installation
Install this library in your main application.
npm install @ea-lab/reactive-json-chartjsThen where <ReactiveJsonRoot> is located in your React app, do the following:
import {ReactiveJsonRoot} from "@ea-lab/reactive-json";
import {mergeComponentCollections} from "@ea-lab/reactive-json";
import {chartjsComponents} from "@ea-lab/reactive-json-chartjs";
export const YourApp = ({reactiveJsonProps}) => {
const additionalProps = {};
// mergeComponentCollections will prepare the "plugins" property
// of ReactiveJsonRoot.
additionalProps.plugins = mergeComponentCollections([
chartjsComponents,
/* Insert here any other component collection plugins. */
]);
const finalProps = {...reactiveJsonProps, ...additionalProps};
return <ReactiveJsonRoot {...finalProps}/>
}This library components will then be available for use in the build JSON/YAML.
