Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ag-charts-react

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ag-charts-react - npm Package Compare versions

Comparing version 9.1.1 to 9.2.0

dist/package/index.cjs.js

344

dist/umd/ag-charts-react.js

@@ -24,181 +24,193 @@ (function (g, f) {

"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// packages/ag-charts-react/dist/index.cjs
Object.defineProperty(exports, "__esModule", { value: true });
var react = require("react");
var agChartsCommunity = require("ag-charts-community");
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
// node_modules/prop-types/lib/ReactPropTypesSecret.js
var require_ReactPropTypesSecret = __commonJS({
"node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module2) {
"use strict";
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
module2.exports = ReactPropTypesSecret;
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
});
// node_modules/prop-types/factoryWithThrowingShims.js
var require_factoryWithThrowingShims = __commonJS({
"node_modules/prop-types/factoryWithThrowingShims.js"(exports, module2) {
"use strict";
var ReactPropTypesSecret = require_ReactPropTypesSecret();
function emptyFunction() {
}
function emptyFunctionWithReset() {
}
emptyFunctionWithReset.resetWarningCache = emptyFunction;
module2.exports = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret) {
return;
}
var err = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
);
err.name = "Invariant Violation";
throw err;
}
;
shim.isRequired = shim;
function getShim() {
return shim;
}
;
var ReactPropTypes = {
array: shim,
bigint: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
elementType: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim,
checkPropTypes: emptyFunctionWithReset,
resetWarningCache: emptyFunction
};
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties(Constructor, staticProps);
return Constructor;
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf(o, p);
}
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
});
// node_modules/prop-types/index.js
var require_prop_types = __commonJS({
"node_modules/prop-types/index.js"(exports, module2) {
"use strict";
if (false) {
ReactIs = null;
throwOnDirectAccess = true;
module2.exports = null(ReactIs.isElement, throwOnDirectAccess);
} else {
module2.exports = require_factoryWithThrowingShims()();
}
var ReactIs;
var throwOnDirectAccess;
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
});
// packages/ag-charts-react/dist/package/index.esm.mjs
var index_esm_exports = {};
__export(index_esm_exports, {
AgChartsReact: () => AgChartsReact
});
module.exports = __toCommonJS(index_esm_exports);
var PropTypes = __toESM(require_prop_types(), 1);
var import_react = require("react");
var import_ag_charts_community = require("ag-charts-community");
var __defProp2 = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp2.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
});
if (superClass)
_setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
return o2.__proto__ || Object.getPrototypeOf(o2);
};
return _getPrototypeOf(o);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function() {
}));
return true;
} catch (e) {
return false;
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var AgChartsReact = class extends import_react.Component {
constructor(props) {
super(props);
this.props = props;
this.chartRef = (0, import_react.createRef)();
}
}
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function _typeof2(obj2) {
return typeof obj2;
};
} else {
_typeof = function _typeof2(obj2) {
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
};
render() {
return (0, import_react.createElement)("div", {
style: this.createStyleForDiv(),
ref: this.chartRef
});
}
return _typeof(obj);
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
createStyleForDiv() {
return __spreadValues({
height: "100%"
}, this.props.containerStyle);
}
return self;
}
function _possibleConstructorReturn(self, call) {
if (call && (_typeof(call) === "object" || typeof call === "function")) {
return call;
componentDidMount() {
const options = this.applyContainerIfNotSet(this.props.options);
const chart = import_ag_charts_community.AgCharts.create(options);
this.chart = chart;
chart.chart.waitForUpdate().then(() => {
var _a, _b;
return (_b = (_a = this.props).onChartReady) == null ? void 0 : _b.call(_a, chart);
});
}
return _assertThisInitialized(self);
}
function _createSuper(Derived) {
return function() {
var Super = _getPrototypeOf(Derived), result;
if (_isNativeReflectConstruct()) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
applyContainerIfNotSet(propsOptions) {
if (propsOptions.container) {
return propsOptions;
}
return _possibleConstructorReturn(this, result);
};
}
var AgChartsReact = /* @__PURE__ */ function(_Component) {
_inherits(AgChartsReact2, _Component);
var _super = _createSuper(AgChartsReact2);
function AgChartsReact2(props) {
var _this;
_classCallCheck(this, AgChartsReact2);
_this = _super.call(this, props);
_this.props = props;
_this.chartRef = react.createRef();
return _this;
return __spreadProps(__spreadValues({}, propsOptions), { container: this.chartRef.current });
}
_createClass(AgChartsReact2, [{
key: "render",
value: function render() {
return react.createElement("div", {
style: this.createStyleForDiv(),
ref: this.chartRef
});
shouldComponentUpdate(nextProps) {
this.processPropsChanges(this.props, nextProps);
return false;
}
processPropsChanges(prevProps, nextProps) {
if (this.chart) {
import_ag_charts_community.AgCharts.update(this.chart, this.applyContainerIfNotSet(nextProps.options));
}
}, {
key: "createStyleForDiv",
value: function createStyleForDiv() {
return Object.assign({
height: "100%"
}, this.props.containerStyle);
}
componentWillUnmount() {
if (this.chart) {
this.chart.destroy();
this.chart = void 0;
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
var options = this.applyContainerIfNotSet(this.props.options);
var chart = agChartsCommunity.AgCharts.create(options);
this.chart = chart;
chart.chart.waitForUpdate().then(function() {
var _a, _b;
return (_b = (_a = _this2.props).onChartReady) === null || _b === void 0 ? void 0 : _b.call(_a, chart);
});
}
}, {
key: "applyContainerIfNotSet",
value: function applyContainerIfNotSet(propsOptions) {
if (propsOptions.container) {
return propsOptions;
}
return Object.assign(Object.assign({}, propsOptions), {
container: this.chartRef.current
});
}
}, {
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(nextProps) {
this.processPropsChanges(this.props, nextProps);
return false;
}
}, {
key: "processPropsChanges",
value: function processPropsChanges(prevProps, nextProps) {
if (this.chart) {
agChartsCommunity.AgCharts.update(this.chart, this.applyContainerIfNotSet(nextProps.options));
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
if (this.chart) {
this.chart.destroy();
this.chart = void 0;
}
}
}]);
return AgChartsReact2;
}(react.Component);
exports.AgChartsReact = AgChartsReact;
}
};
AgChartsReact.propTypes = {
options: PropTypes.object
};
if (typeof module.exports == "object" && typeof exports == "object") {

@@ -205,0 +217,0 @@ var __cp = (to, from, except, desc) => {

@@ -1,1 +0,1 @@

(function(i,a){typeof exports=="object"&&typeof module=="object"?module.exports=a(require("ag-charts-community"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define("AgChartsReact",["ag-charts-community","react","react-dom"],a):typeof exports=="object"?exports.AgChartsReact=a(require("ag-charts-community"),require("react"),require("react-dom")):i.AgChartsReact=a(i.agCharts,i.React,i.ReactDOM)})(this,(i,a,_)=>{var c={},u={exports:c};if(typeof y>"u")var y=function(t){if(t==="ag-charts-community")return i;if(t==="react")return a;if(t==="react-dom")return _;throw new Error("Unknown module: "+t)};Object.defineProperty(c,"__esModule",{value:!0});var p=y("react"),v=y("ag-charts-community");function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function R(e,t,r){return t&&d(e.prototype,t),r&&d(e,r),e}function l(e,t){return l=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},l(e,t)}function C(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},f(e)}function j(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function s(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s=function(r){return typeof r}:s=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},s(e)}function P(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e,t){return t&&(s(t)==="object"||typeof t=="function")?t:P(e)}function w(e){return function(){var t=f(e),r;if(j()){var n=f(this).constructor;r=Reflect.construct(t,arguments,n)}else r=t.apply(this,arguments);return S(this,r)}}var k=function(e){C(r,e);var t=w(r);function r(n){var o;return O(this,r),o=t.call(this,n),o.props=n,o.chartRef=p.createRef(),o}return R(r,[{key:"render",value:function(){return p.createElement("div",{style:this.createStyleForDiv(),ref:this.chartRef})}},{key:"createStyleForDiv",value:function(){return Object.assign({height:"100%"},this.props.containerStyle)}},{key:"componentDidMount",value:function(){var o=this,h=this.applyContainerIfNotSet(this.props.options),m=v.AgCharts.create(h);this.chart=m,m.chart.waitForUpdate().then(function(){var g,b;return(b=(g=o.props).onChartReady)===null||b===void 0?void 0:b.call(g,m)})}},{key:"applyContainerIfNotSet",value:function(o){return o.container?o:Object.assign(Object.assign({},o),{container:this.chartRef.current})}},{key:"shouldComponentUpdate",value:function(o){return this.processPropsChanges(this.props,o),!1}},{key:"processPropsChanges",value:function(o,h){this.chart&&v.AgCharts.update(this.chart,this.applyContainerIfNotSet(h.options))}},{key:"componentWillUnmount",value:function(){this.chart&&(this.chart.destroy(),this.chart=void 0)}}]),r}(p.Component);if(c.AgChartsReact=k,typeof u.exports=="object"&&typeof c=="object"){var x=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Object.getOwnPropertyNames(t))!Object.prototype.hasOwnProperty.call(e,o)&&o!==r&&Object.defineProperty(e,o,{get:()=>t[o],enumerable:!(n=Object.getOwnPropertyDescriptor(t,o))||n.enumerable});return e};u.exports=x(u.exports,c)}return u.exports});
(function(p,c){typeof exports=="object"&&typeof module=="object"?module.exports=c(require("ag-charts-community"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define("AgChartsReact",["ag-charts-community","react","react-dom"],c):typeof exports=="object"?exports.AgChartsReact=c(require("ag-charts-community"),require("react"),require("react-dom")):p.AgChartsReact=c(p.agCharts,p.React,p.ReactDOM)})(this,(p,c,x)=>{var h={},i={exports:h};if(typeof f>"u")var f=function(e){if(e==="ag-charts-community")return p;if(e==="react")return c;if(e==="react-dom")return x;throw new Error("Unknown module: "+e)};var R=Object.create,u=Object.defineProperty,S=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,C=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,l=(r,e)=>function(){return e||(0,r[m(r)[0]])((e={exports:{}}).exports,e),e.exports},D=(r,e)=>{for(var t in e)u(r,t,{get:e[t],enumerable:!0})},v=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of m(e))!T.call(r,a)&&a!==t&&u(r,a,{get:()=>e[a],enumerable:!(s=S(e,a))||s.enumerable});return r},q=(r,e,t)=>(t=r!=null?R(C(r)):{},v(e||!r||!r.__esModule?u(t,"default",{value:r,enumerable:!0}):t,r)),I=r=>v(u({},"__esModule",{value:!0}),r),A=l({"node_modules/prop-types/lib/ReactPropTypesSecret.js"(r,e){"use strict";var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=t}}),E=l({"node_modules/prop-types/factoryWithThrowingShims.js"(r,e){"use strict";var t=A();function s(){}function a(){}a.resetWarningCache=s,e.exports=function(){function o(H,Y,z,G,K,B){if(B!==t){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}}o.isRequired=o;function n(){return o}var _={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:n,element:o,elementType:o,instanceOf:n,node:o,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:a,resetWarningCache:s};return _.PropTypes=_,_}}}),N=l({"node_modules/prop-types/index.js"(r,e){"use strict";e.exports=E()();var t,s}}),d={};D(d,{AgChartsReact:()=>j}),i.exports=I(d);var F=q(N(),1),y=f("react"),O=f("ag-charts-community"),W=Object.defineProperty,U=Object.defineProperties,k=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,b=(r,e,t)=>e in r?W(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,g=(r,e)=>{for(var t in e||(e={}))M.call(e,t)&&b(r,t,e[t]);if(P)for(var t of P(e))J.call(e,t)&&b(r,t,e[t]);return r},L=(r,e)=>U(r,k(e)),j=class extends y.Component{constructor(r){super(r),this.props=r,this.chartRef=(0,y.createRef)()}render(){return(0,y.createElement)("div",{style:this.createStyleForDiv(),ref:this.chartRef})}createStyleForDiv(){return g({height:"100%"},this.props.containerStyle)}componentDidMount(){const r=this.applyContainerIfNotSet(this.props.options),e=O.AgCharts.create(r);this.chart=e,e.chart.waitForUpdate().then(()=>{var t,s;return(s=(t=this.props).onChartReady)==null?void 0:s.call(t,e)})}applyContainerIfNotSet(r){return r.container?r:L(g({},r),{container:this.chartRef.current})}shouldComponentUpdate(r){return this.processPropsChanges(this.props,r),!1}processPropsChanges(r,e){this.chart&&O.AgCharts.update(this.chart,this.applyContainerIfNotSet(e.options))}componentWillUnmount(){this.chart&&(this.chart.destroy(),this.chart=void 0)}};if(j.propTypes={options:F.object},typeof i.exports=="object"&&typeof h=="object"){var V=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Object.getOwnPropertyNames(e))!Object.prototype.hasOwnProperty.call(r,a)&&a!==t&&Object.defineProperty(r,a,{get:()=>e[a],enumerable:!(s=Object.getOwnPropertyDescriptor(e,a))||s.enumerable});return r};i.exports=V(i.exports,h)}return i.exports});
{
"name": "ag-charts-react",
"version": "9.1.1",
"version": "9.2.0",
"description": "AG Charts React Component",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"main": "./dist/package/index.cjs.js",
"module": "./dist/package/index.esm.mjs",
"type": "module",
"types": "./dist/index.d.ts",
"types": "./dist/types/src/index.d.ts",
"repository": {

@@ -30,3 +30,3 @@ "type": "git",

"devDependencies": {
"ag-charts-community": "9.1.1",
"ag-charts-community": "9.2.0",
"@types/react": "^18",

@@ -47,3 +47,3 @@ "@types/react-dom": "^18",

"peerDependencies": {
"ag-charts-community": "9.1.1",
"ag-charts-community": "9.2.0",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",

@@ -50,0 +50,0 @@ "react-dom": "^16.3.0 || ^17.0.0 || ^18.0.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc