ag-charts-react
Advanced tools
Comparing version 7.0.0 to 7.1.0
@@ -1,6 +0,8 @@ | ||
// ag-charts-react v7.0.0 | ||
// ag-charts-react v7.1.0 | ||
import { Component, RefObject } from "react"; | ||
import { AgChartOptions } from "ag-charts-community"; | ||
import { AgChartInstance, AgChartOptions } from "ag-charts-community"; | ||
export interface AgChartProps { | ||
options: AgChartOptions; | ||
onChartReady?: (chart: AgChartInstance) => void; | ||
containerStyle?: any; | ||
} | ||
@@ -10,9 +12,11 @@ interface AgChartState { | ||
export declare class AgChartsReact extends Component<AgChartProps, AgChartState> { | ||
props: any; | ||
state: any; | ||
props: AgChartProps; | ||
static propTypes: any; | ||
private chart; | ||
chart: AgChartInstance; | ||
protected chartRef: RefObject<HTMLElement>; | ||
constructor(props: any, state: any); | ||
render(): import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, string | any | (new (props: any) => Component<any, any, any>)>) | (new (props: any) => Component<any, any, any>)>; | ||
constructor(props: AgChartProps); | ||
render(): import("react").DetailedReactHTMLElement<{ | ||
style: any; | ||
ref: RefObject<HTMLElement>; | ||
}, HTMLElement>; | ||
createStyleForDiv(): any; | ||
@@ -19,0 +23,0 @@ componentDidMount(): void; |
@@ -1,2 +0,2 @@ | ||
// ag-charts-react v7.0.0 | ||
// ag-charts-react v7.1.0 | ||
"use strict"; | ||
@@ -9,6 +9,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
class AgChartsReact extends react_1.Component { | ||
constructor(props, state) { | ||
super(props, state); | ||
constructor(props) { | ||
super(props); | ||
this.props = props; | ||
this.state = state; | ||
this.chartRef = react_1.createRef(); | ||
@@ -23,7 +22,11 @@ } | ||
createStyleForDiv() { | ||
return Object.assign({ height: "100%" }, this.props.containerStyle); | ||
var _a; | ||
return Object.assign({ height: "100%" }, ((_a = this.props.containerStyle) !== null && _a !== void 0 ? _a : {})); | ||
} | ||
componentDidMount() { | ||
const options = this.applyContainerIfNotSet(this.props.options); | ||
this.chart = ag_charts_community_1.AgChart.create(options); | ||
const chart = ag_charts_community_1.AgChart.create(options); | ||
this.chart = chart; | ||
chart.chart.waitForUpdate() | ||
.then(() => { var _a, _b; return (_b = (_a = this.props).onChartReady) === null || _b === void 0 ? void 0 : _b.call(_a, chart); }); | ||
} | ||
@@ -44,3 +47,5 @@ applyContainerIfNotSet(propsOptions) { | ||
processPropsChanges(prevProps, nextProps) { | ||
ag_charts_community_1.AgChart.update(this.chart, this.applyContainerIfNotSet(nextProps.options)); | ||
if (this.chart) { | ||
ag_charts_community_1.AgChart.update(this.chart, this.applyContainerIfNotSet(nextProps.options)); | ||
} | ||
} | ||
@@ -50,2 +55,3 @@ componentWillUnmount() { | ||
this.chart.destroy(); | ||
this.chart = undefined; | ||
} | ||
@@ -52,0 +58,0 @@ } |
@@ -1,2 +0,2 @@ | ||
// ag-charts-react v7.0.0 | ||
// ag-charts-react v7.1.0 | ||
export * from './agChartsReact'; |
@@ -1,2 +0,2 @@ | ||
// ag-charts-react v7.0.0 | ||
// ag-charts-react v7.1.0 | ||
"use strict"; | ||
@@ -3,0 +3,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
{ | ||
"name": "ag-charts-react", | ||
"version": "7.0.0", | ||
"version": "7.1.0", | ||
"description": "AG Charts React Component", | ||
@@ -36,3 +36,3 @@ "main": "main.js", | ||
"devDependencies": { | ||
"ag-charts-community": "~7.0.0", | ||
"ag-charts-community": "~7.1.0", | ||
"@types/jest": "^25.2.1", | ||
@@ -69,3 +69,3 @@ "@types/react": "16.9.2", | ||
"peerDependencies": { | ||
"ag-charts-community": "~7.0.0", | ||
"ag-charts-community": "~7.1.0", | ||
"react": "^16.3.0 || ^17.0.0 || ^18.0.0", | ||
@@ -72,0 +72,0 @@ "react-dom": "^16.3.0 || ^17.0.0 || ^18.0.0" |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("ag-charts-community")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","ag-charts-community"],e):e(t.AgChartsReact={},t.React,t.PropTypes,t.agCharts)}(this,function(t,r,e,s){"use strict";class o extends r.Component{constructor(t,e){super(t,e),this.props=t,this.state=e,this.chartRef=r.createRef()}render(){return r.createElement("div",{style:this.createStyleForDiv(),ref:this.chartRef})}createStyleForDiv(){return Object.assign({height:"100%"},this.props.containerStyle)}componentDidMount(){var t=this.applyContainerIfNotSet(this.props.options);this.chart=s.AgChart.create(t)}applyContainerIfNotSet(t){return t.container?t:Object.assign(Object.assign({},t),{container:this.chartRef.current})}shouldComponentUpdate(t){return this.processPropsChanges(this.props,t),!1}processPropsChanges(t,e){s.AgChart.update(this.chart,this.applyContainerIfNotSet(e.options))}componentWillUnmount(){this.chart&&this.chart.destroy()}}o.propTypes={options:e.object},t.AgChartsReact=o,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("ag-charts-community")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","ag-charts-community"],e):e(t.AgChartsReact={},t.React,t.PropTypes,t.agCharts)}(this,function(t,e,r,o){"use strict";class s extends e.Component{constructor(t){super(t),this.props=t,this.chartRef=e.createRef()}render(){return e.createElement("div",{style:this.createStyleForDiv(),ref:this.chartRef})}createStyleForDiv(){var t;return Object.assign({height:"100%"},null!=(t=this.props.containerStyle)?t:{})}componentDidMount(){var t=this.applyContainerIfNotSet(this.props.options);const r=o.AgChart.create(t);(this.chart=r).chart.waitForUpdate().then(()=>{var t,e;return null==(e=(t=this.props).onChartReady)?void 0:e.call(t,r)})}applyContainerIfNotSet(t){return t.container?t:Object.assign(Object.assign({},t),{container:this.chartRef.current})}shouldComponentUpdate(t){return this.processPropsChanges(this.props,t),!1}processPropsChanges(t,e){this.chart&&o.AgChart.update(this.chart,this.applyContainerIfNotSet(e.options))}componentWillUnmount(){this.chart&&(this.chart.destroy(),this.chart=void 0)}}s.propTypes={options:r.object},t.AgChartsReact=s,Object.defineProperty(t,"__esModule",{value:!0})}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15298
111