Socket
Socket
Sign inDemoInstall

react-tradingview-wrapper

Package Overview
Dependencies
8
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.8 to 1.0.9

2

dist/index.js

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-tradingview-wrapper"]=t():e["react-tradingview-wrapper"]=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpreact_tradingview_wrapper([1],[,function(e,t,n){"use strict";function o(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"IntervalTypes",function(){return d}),n.d(t,"Themes",function(){return f}),n.d(t,"BarStyles",function(){return g});var p=n(2),l=n.n(p),s=n(6),u=n.n(s),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d={D:"D",W:"W"},f={LIGHT:"Light",DARK:"Dark"},g={BARS:"0",CANDLES:"1",HOLLOW_CANDLES:"9",HEIKIN_ASHI:"8",LINE:"2",AREA:"3",RENKO:"4",LINE_BREAK:"7",KAGI:"5",POINT_AND_FIGURE:"6"},h="tradingview-widget-script",y="tradingview-widget",b=function(e){function t(){var e,n,a,p;r(this,t);for(var s=arguments.length,u=Array(s),d=0;d<s;d++)u[d]=arguments[d];return n=a=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.state={containerStyle:{}},a.componentDidMount=function(){return a.appendScript(a.initWidget)},a.componentDidUpdate=function(){a.cleanWidget(),a.initWidget()},a.appendScript=function(e){if(a.scriptExists())return void e();var t=document.createElement("script");t.id=h,t.type="text/javascript",t.async=!0,t.src="https://s3.tradingview.com/tv.js",t.onload=e,document.getElementsByTagName("head")[0].appendChild(t)},a.scriptExists=function(){return null!==document.getElementById(h)},a.initWidget=function(){var e=a.props,t=e.widgetType,n=o(e,["widgetType"]),r=c({},n,{container_id:y});if(r.autosize){delete r.width,delete r.height;var i=document.getElementById(y);i.style.width="100%",i.style.height="100%"}"number"==typeof r.interval&&(r.interval=r.interval.toString()),r.popup_width&&"number"==typeof r.popup_width&&(r.popup_width=r.popup_width.toString()),r.popup_height&&"number"==typeof r.popup_height&&(r.popup_height=r.popup_height.toString()),new TradingView[t](r)},a.cleanWidget=function(){document.getElementById(y).innerHTML=""},a.render=function(){return l.a.createElement("article",{id:y})},p=n,i(a,p)}return a(t,e),t}(p.PureComponent);b.propTypes={widgetType:u.a.string,width:u.a.number,height:u.a.number,autosize:u.a.bool,symbol:u.a.string.isRequired,interval:u.a.oneOf([1,3,5,15,30,60,120,180,"1","3","5","15","30","60","120","180",d.D,d.W]),timezone:u.a.string,theme:u.a.oneOf([f.LIGHT,f.DARK]),style:u.a.oneOf([g.BARS,g.CANDLES,g.HOLLOW_CANDLES,g.HEIKIN_ASHI,g.LINE,g.AREA,g.RENKO,g.LINE_BREAK,g.KAGI,g.POINT_AND_FIGURE]),locale:u.a.string,toolbar_bg:u.a.string,enable_publishing:u.a.bool,allow_symbol_change:u.a.bool,withdateranges:u.a.bool,hide_side_toolbar:u.a.bool,hideideas:u.a.bool,watchlist:u.a.arrayOf(u.a.string),details:u.a.bool,hotlist:u.a.bool,calendar:u.a.bool,news:u.a.arrayOf(u.a.string),studies:u.a.arrayOf(u.a.string),show_popup_button:u.a.bool,popup_width:u.a.oneOfType([u.a.number,u.a.string]),popup_height:u.a.oneOfType([u.a.number,u.a.string]),no_referral_id:u.a.bool,referral_id:u.a.string},b.defaultProps={widgetType:"widget",width:980,height:610,autosize:!1,interval:d.D,timezone:"Etc/UTC",theme:f.LIGHT,style:g.CANDLES,locale:"en",toolbar_bg:"#F1F3F6",enable_publishing:!1,allow_symbol_change:!0,hideideas:!0},t.default=b}],[1])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-tradingview-wrapper"]=t():e["react-tradingview-wrapper"]=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpreact_tradingview_wrapper([1],[,function(e,t,n){"use strict";function o(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"IntervalTypes",function(){return d}),n.d(t,"Themes",function(){return f}),n.d(t,"BarStyles",function(){return g});var p=n(2),l=n.n(p),s=n(6),u=n.n(s),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d={D:"D",W:"W"},f={LIGHT:"Light",DARK:"Dark"},g={BARS:"0",CANDLES:"1",HOLLOW_CANDLES:"9",HEIKIN_ASHI:"8",LINE:"2",AREA:"3",RENKO:"4",LINE_BREAK:"7",KAGI:"5",POINT_AND_FIGURE:"6"},h="tradingview-widget-script",y="tradingview-widget",b=function(e){function t(){var e,n,a,p;r(this,t);for(var s=arguments.length,u=Array(s),d=0;d<s;d++)u[d]=arguments[d];return n=a=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.state={containerStyle:{}},a.componentDidMount=function(){return a.appendScript(a.initWidget)},a.componentDidUpdate=function(){a.cleanWidget(),a.initWidget()},a.appendScript=function(e){if(a.scriptExists())return void e();var t=document.createElement("script");t.id=h,t.type="text/javascript",t.async=!0,t.src=a.props.url||"https://s3.tradingview.com/tv.js",t.onload=e,document.getElementsByTagName("head")[0].appendChild(t)},a.scriptExists=function(){return null!==document.getElementById(h)},a.initWidget=function(){var e=a.props,t=e.widgetType,n=o(e,["widgetType"]),r=c({},n,{container_id:y});if(r.autosize){delete r.width,delete r.height;var i=document.getElementById(y);i.style.width="100%",i.style.height="100%"}"number"==typeof r.interval&&(r.interval=r.interval.toString()),r.popup_width&&"number"==typeof r.popup_width&&(r.popup_width=r.popup_width.toString()),r.popup_height&&"number"==typeof r.popup_height&&(r.popup_height=r.popup_height.toString()),new TradingView[t](r)},a.cleanWidget=function(){document.getElementById(y).innerHTML=""},a.render=function(){return l.a.createElement("article",{id:y})},p=n,i(a,p)}return a(t,e),t}(p.PureComponent);b.propTypes={url:u.a.string,widgetType:u.a.string,width:u.a.number,height:u.a.number,autosize:u.a.bool,symbol:u.a.string.isRequired,interval:u.a.oneOf([1,3,5,15,30,60,120,180,"1","3","5","15","30","60","120","180",d.D,d.W]),timezone:u.a.string,theme:u.a.oneOf([f.LIGHT,f.DARK]),style:u.a.oneOf([g.BARS,g.CANDLES,g.HOLLOW_CANDLES,g.HEIKIN_ASHI,g.LINE,g.AREA,g.RENKO,g.LINE_BREAK,g.KAGI,g.POINT_AND_FIGURE]),locale:u.a.string,toolbar_bg:u.a.string,enable_publishing:u.a.bool,allow_symbol_change:u.a.bool,withdateranges:u.a.bool,hide_side_toolbar:u.a.bool,hideideas:u.a.bool,watchlist:u.a.arrayOf(u.a.string),details:u.a.bool,hotlist:u.a.bool,calendar:u.a.bool,news:u.a.arrayOf(u.a.string),studies:u.a.arrayOf(u.a.string),show_popup_button:u.a.bool,popup_width:u.a.oneOfType([u.a.number,u.a.string]),popup_height:u.a.oneOfType([u.a.number,u.a.string]),no_referral_id:u.a.bool,referral_id:u.a.string},b.defaultProps={widgetType:"widget",width:980,height:610,autosize:!1,interval:d.D,timezone:"Etc/UTC",theme:f.LIGHT,style:g.CANDLES,locale:"en",toolbar_bg:"#F1F3F6",enable_publishing:!1,allow_symbol_change:!0,hideideas:!0},t.default=b}],[1])});
{
"name": "react-tradingview-wrapper",
"version": "1.0.8",
"version": "1.0.9",
"description": "React component for rendering the TradingView Advanced Real-Time Chart Widget",

@@ -21,2 +21,3 @@ "repository": {

"release": "webpack --p --config webpack.config.babel.js",
"deploy": "npm run release && npm publish",
"test": "jest",

@@ -23,0 +24,0 @@ "coverage": "jest --coverage",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc