Socket
Socket
Sign inDemoInstall

react-tradingview-widget

Package Overview
Dependencies
8
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.5 to 1.3.0

7

CHANGELOG.md

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

# Version 1.3.0
Released 2018-09-10
- Added prop-types for newly added props
- Added `RangeTypes` constants
- Reordered props
# Version 1.2.5

@@ -2,0 +9,0 @@ Released 2018-04-16

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-widget"]=t():e["react-tradingview-widget"]=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpreact_tradingview_widget([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 i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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 s}),n.d(t,"Themes",function(){return f}),n.d(t,"BarStyles",function(){return g});var p=n(2),d=n.n(p),u=n(6),c=n.n(u),l=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},s={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",w=function(e){function t(){var e,n,a,p;i(this,t);for(var u=arguments.length,c=Array(u),s=0;s<u;s++)c[s]=arguments[s];return n=a=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),a.containerId=y+"-"+Math.random(),a.componentDidMount=function(){return a.appendScript(a.initWidget)},a.componentDidUpdate=function(){a.cleanWidget(),a.initWidget()},a.canUseDOM=function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)},a.appendScript=function(e){if(!a.canUseDOM())return void e();if(a.scriptExists())return"undefined"==typeof TradingView?void a.updateOnloadListener(e):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.getScriptElement=function(){return document.getElementById(h)},a.scriptExists=function(){return null!==a.getScriptElement()},a.updateOnloadListener=function(e){var t=a.getScriptElement(),n=t.onload;return t.onload=function(){n(),e()}},a.initWidget=function(){if("undefined"!=typeof TradingView){var e=a.props,t=e.widgetType,n=o(e,["widgetType"]),i=l({},n,{container_id:a.containerId});i.autosize&&(delete i.width,delete i.height),"number"==typeof i.interval&&(i.interval=i.interval.toString()),i.popup_width&&"number"==typeof i.popup_width&&(i.popup_width=i.popup_width.toString()),i.popup_height&&"number"==typeof i.popup_height&&(i.popup_height=i.popup_height.toString()),new TradingView[t](i)}},a.cleanWidget=function(){a.canUseDOM()&&(document.getElementById(a.containerId).innerHTML="")},a.getStyle=function(){return a.props.autosize?{width:"100%",height:"100%"}:{}},a.render=function(){return d.a.createElement("article",{id:a.containerId,style:a.getStyle()})},p=n,r(a,p)}return a(t,e),t}(p.PureComponent);w.propTypes={widgetType:c.a.string,width:c.a.number,height:c.a.number,autosize:c.a.bool,symbol:c.a.string.isRequired,interval:c.a.oneOf([1,3,5,15,30,60,120,180,"1","3","5","15","30","60","120","180",s.D,s.W]),timezone:c.a.string,theme:c.a.oneOf([f.LIGHT,f.DARK]),style:c.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:c.a.string,toolbar_bg:c.a.string,enable_publishing:c.a.bool,allow_symbol_change:c.a.bool,withdateranges:c.a.bool,hide_side_toolbar:c.a.bool,hideideas:c.a.bool,watchlist:c.a.arrayOf(c.a.string),details:c.a.bool,hotlist:c.a.bool,calendar:c.a.bool,news:c.a.arrayOf(c.a.string),studies:c.a.arrayOf(c.a.string),show_popup_button:c.a.bool,popup_width:c.a.oneOfType([c.a.number,c.a.string]),popup_height:c.a.oneOfType([c.a.number,c.a.string]),no_referral_id:c.a.bool,referral_id:c.a.string},w.defaultProps={widgetType:"widget",width:980,height:610,autosize:!1,interval:s.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=w}],[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-widget"]=t():e["react-tradingview-widget"]=t()}("undefined"!=typeof self?self:this,function(){return webpackJsonpreact_tradingview_widget([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 i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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,"BarStyles",function(){return s}),n.d(t,"IntervalTypes",function(){return f}),n.d(t,"RangeTypes",function(){return g}),n.d(t,"Themes",function(){return h});var p=n(2),d=n.n(p),l=n(6),u=n.n(l),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},s={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"},f={D:"D",W:"W"},g={YTD:"ytd",ALL:"all"},h={LIGHT:"Light",DARK:"Dark"},_="tradingview-widget-script",b="tradingview-widget",y=function(e){function t(){var e,n,a,p;i(this,t);for(var l=arguments.length,u=Array(l),s=0;s<l;s++)u[s]=arguments[s];return n=a=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),a.containerId=b+"-"+Math.random(),a.componentDidMount=function(){return a.appendScript(a.initWidget)},a.componentDidUpdate=function(){a.cleanWidget(),a.initWidget()},a.canUseDOM=function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)},a.appendScript=function(e){if(!a.canUseDOM())return void e();if(a.scriptExists())return"undefined"==typeof TradingView?void a.updateOnloadListener(e):void e();var t=document.createElement("script");t.id=_,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.getScriptElement=function(){return document.getElementById(_)},a.scriptExists=function(){return null!==a.getScriptElement()},a.updateOnloadListener=function(e){var t=a.getScriptElement(),n=t.onload;return t.onload=function(){n(),e()}},a.initWidget=function(){if("undefined"!=typeof TradingView){var e=a.props,t=e.widgetType,n=o(e,["widgetType"]),i=c({},n,{container_id:a.containerId});i.autosize&&(delete i.width,delete i.height),"number"==typeof i.interval&&(i.interval=i.interval.toString()),i.popup_width&&"number"==typeof i.popup_width&&(i.popup_width=i.popup_width.toString()),i.popup_height&&"number"==typeof i.popup_height&&(i.popup_height=i.popup_height.toString()),new TradingView[t](i)}},a.cleanWidget=function(){a.canUseDOM()&&(document.getElementById(a.containerId).innerHTML="")},a.getStyle=function(){return a.props.autosize?{width:"100%",height:"100%"}:{}},a.render=function(){return d.a.createElement("article",{id:a.containerId,style:a.getStyle()})},p=n,r(a,p)}return a(t,e),t}(p.PureComponent);y.propTypes={allow_symbol_change:u.a.bool,autosize:u.a.bool,calendar:u.a.bool,details:u.a.bool,enable_publishing:u.a.bool,height:u.a.number,hideideas:u.a.bool,hide_legend:u.a.bool,hide_side_toolbar:u.a.bool,hide_top_toolbar:u.a.bool,hotlist:u.a.bool,interval:u.a.oneOf([1,3,5,15,30,60,120,180,"1","3","5","15","30","60","120","180",f.D,f.W]),locale:u.a.string,news:u.a.arrayOf(u.a.string),no_referral_id:u.a.bool,popup_height:u.a.oneOfType([u.a.number,u.a.string]),popup_width:u.a.oneOfType([u.a.number,u.a.string]),range:u.a.oneOf(["1d","5d","1m","3m","6m",g.YTD,"12m","60m",g.ALL]),referral_id:u.a.string,save_image:u.a.bool,show_popup_button:u.a.bool,studies:u.a.arrayOf(u.a.string),style:u.a.oneOf([s.BARS,s.CANDLES,s.HOLLOW_CANDLES,s.HEIKIN_ASHI,s.LINE,s.AREA,s.RENKO,s.LINE_BREAK,s.KAGI,s.POINT_AND_FIGURE]),symbol:u.a.string.isRequired,theme:u.a.oneOf([h.LIGHT,h.DARK]),timezone:u.a.string,toolbar_bg:u.a.string,watchlist:u.a.arrayOf(u.a.string),widgetType:u.a.string,width:u.a.number,withdateranges:u.a.bool},y.defaultProps={allow_symbol_change:!0,autosize:!1,enable_publishing:!1,height:610,hideideas:!0,hide_legend:!1,hide_side_toolbar:!0,hide_top_toolbar:!1,interval:f.D,locale:"en",save_image:!0,show_popup_button:!1,style:s.CANDLES,theme:h.LIGHT,timezone:"Etc/UTC",toolbar_bg:"#F1F3F6",widgetType:"widget",width:980,withdateranges:!1},t.default=y}],[1])});
{
"name": "react-tradingview-widget",
"version": "1.2.5",
"version": "1.3.0",
"description": "React component for rendering the TradingView Advanced Real-Time Chart Widget",

@@ -5,0 +5,0 @@ "repository": {

@@ -38,2 +38,3 @@ # react-tradingview-widget

- Interval types: `IntervalTypes.D` and `IntervalTypes.W`
- Range types (for the `range` prop): `RangeTypes.YTD` and `RangeTypes.ALL`
- Themes: `Themes.LIGHT` and `Themes.DARK`

@@ -40,0 +41,0 @@ - BarStyles:

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