Release v20.032 (from ad2f4a55)
Fixes tradingview/charting_library#5396 Fixes tradingview/charting_library#6001
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -569,9 +569,9 @@ w.subscribe(e=>d(e)&&P.setValue(e),{callWithLast:!0}),P.subscribe(e=>{e&&h.setVa
|
||||
;function l(e){return e.offsetWidth+a<e.scrollWidth}Object(o.a)(()=>{document.addEventListener("mouseenter",e=>{const t=e.target;var i;t instanceof HTMLElement&&t.matches(".apply-overflow-title")&&((i=t).getAttribute("title")||i.offsetWidth+a>=i.scrollWidth||i.setAttribute("title",i.textContent||""))},!0),document.addEventListener("mouseenter",e=>{const t=e.target;if(t instanceof HTMLElement&&t.matches(".apply-overflow-tooltip")){if(t.matches(".apply-overflow-tooltip--check-children")){let e=!1;const i=t.children;for(let t=0;t<i.length;t++){const s=i[t];if(s instanceof HTMLElement&&l(s)){e=!0;break}}if(!e)return}else if(!l(t))return;let e="";e=t.matches&&t.matches(".apply-overflow-tooltip--allow-text")?t.textContent||"":Array.from(t.childNodes).reduce((e,t)=>(t.nodeType===Node.TEXT_NODE&&e.push(t.textContent||""),e),[]).join("").trim(),Object(n.showOnElement)(t,{text:e});const i=()=>{Object(n.hide)(),["mouseleave","mousedown"].forEach(e=>t.removeEventListener(e,i))};["mouseleave","mousedown"].forEach(e=>t.addEventListener(e,i))}},!0)});var c=i("aIyQ"),h=i.n(c),u=i("VVxS"),d=i("FIi8");i("ULlu");let p;function _(e){window.iframeAuthWidget&&!1===window.user.profile_data_filled&&(window.iframeAuthWidget.preventClose=!0);const t=window.user.available_offers||{};window.TVSettings&&window.TVSettings.sync(window.user.settings),window.is_authenticated?!1===window.user.profile_data_filled&&(Object(r.trackEvent)("Conversion","First login"),delete window.user.profile_data_filled):(Object.keys(t).forEach(e=>{const i=e;t[i].available_for_anons||delete t[i]}),window.user={username:"Guest",following:"0",followers:"0",ignore_list:{},available_offers:t},u.TVLocalStorage.removeItem("trial_availiable"))}p=window.loginStateChange?window.loginStateChange:window.loginStateChange=new h.a,p.subscribe(null,_),s.TVXWindowEvents.on("loginStateChange",e=>{const t=JSON.parse(e);window.user=t.user,window.is_authenticated=!!t.is_authenticated,p.fire()}),s.TVXWindowEvents.on("signOut",()=>{!function(){if(window.initData.lfs){const e=document.getElementsByClassName("js-admin-warning")[0];document.body.removeChild(e)}let e=!0;[/^\/chart\//,/^\/share-your-love\//].forEach(t=>{t.test(window.location.pathname)&&(e=!1)}),e&&window.location.reload()}()}),(()=>{const e={};window.crossTabSyncUserAttr=e=>{const t={};e instanceof Array?e.forEach(e=>{t[e]=window.user[e]}):t[e]=window.user[e],s.TVXWindowEvents.emit("user-obj-changed",JSON.stringify(t))},s.TVXWindowEvents.on("user-obj-changed",t=>{const i=JSON.parse(t);let s;for(s in i)if(i.hasOwnProperty(s)){window.user[s]=i[s];(e[s]||[]).forEach(e=>{e.fire(i[s])})}})})(),window.TradingView.changeLoginState=e=>{window.is_authenticated=!!e,s.TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:window.is_authenticated,user:window.user})),p.fire()},window.loginUser=function(e,t){window.TVDialogs&&window.TVDialogs.signModal&&window.TVDialogs.signModal.close(),window.user=Object(d.deepExtend)({},e),window.TradingView.changeLoginState(!0),
|
||||
"function"==typeof t&&window.TVDialogs&&window.TVDialogs.signModal?window.TVDialogs.signModal.on("signinSuccess",()=>{t()}):"function"==typeof t&&t()},window.loginRequiredDelegate=new h.a,window.runOrSignIn=(e,t)=>{t||(t={}),e()},window.onLoginStateChange=_,window.TradingView.setTrialAvailiable=e=>{u.TVLocalStorage.setItem("trial_availiable",e?"1":"0")},window.TradingView.notificationsChanged=new h.a},me8f:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolBalloon",(function(){return h}));var s=i("YFKU"),r=i("Ocx9"),n=i("Ss5c"),o=i("tc+8"),a=i.n(o),l=i("j3hX");const c=Object(s.t)("Comment");class h extends n.LineDataSource{constructor(e,t){const s=t||h.createProperties();super(e,s),i.e("lt-pane-views").then(i.bind(null,"Hyqq")).then(t=>{this._setPaneViews([new t.BalloonPaneView(this,e)])})}pointsCount(){return 1}name(){return"Balloon"}properties(){return super.properties()}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e){const t=new r.DefaultProperty("linetoolballoon",e);return h._configureProperties(t),t}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"RhWr")).then(e=>e.BalloonDefinitionsViewModel)}static _configureProperties(e){n.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new a.a(c)),e.addExclusion("text"),e.addChild("linesColors",new l.LineToolColorsProperty([e.childs().borderColor])),e.addChild("textsColors",new l.LineToolColorsProperty([e.childs().color]))}}},mf9N:function(e,t,i){"use strict";i.r(t);var s=i("Eyy1"),r=i("GD+X"),n=i("96Yh"),o=i("ogJP"),a=i("RDU5");class l extends a.UndoCommand{constructor(e,t,i){super("Change Pane Height"),this._model=e,this._paneIndex=t,this._paneHeight=i,this._prevStretchFactors=this._model.panes().map(e=>e.stretchFactor())}redo(){this._model.changePanesHeight(this._paneIndex,this._paneHeight)}undo(){const e=this._model.panes();for(let t=0;t<e.length;++t)e[t].setStretchFactor(Object(s.ensureDefined)(this._prevStretchFactors[t]));this._model.fullUpdate()}}i.d(t,"PaneApi",(function(){return c}));class c{constructor(e,t){this._priceScales=new WeakMap,this._pane=e,this._chartWidget=t}hasMainSeries(){return this._pane.containsMainSeries()}getLeftPriceScales(){return this._pane.leftPriceScales().map(this._getPriceScaleApi,this)}getRightPriceScales(){return this._pane.rightPriceScales().map(this._getPriceScaleApi,this)}getMainSourcePriceScale(){const e=this._pane.mainDataSource();if(null===e)return null;const t=e.priceScale();return null===t||this._pane.isOverlay(e)?null:this._getPriceScaleApi(t)}setMaximized(e){if(this._pane.isMaximized()!==e)for(const t of this._chartWidget.paneWidgets())if(t.state()===this._pane){this._chartWidget.toggleMaximizePane(t);break}}legendLoaded(){const e=this._chartWidget.paneByState(this._pane);return Boolean(e&&e.statusWidget())}getAllEntities(){const e=this._pane.model()
|
||||
;return this._pane.sourcesByGroup().allIncludingHidden().map(t=>Object(n.entityForDataSource)(e,t)).filter(o.notNull).filter(e=>null!==e.name)}getHeight(){return this._pane.height()}setHeight(e){const t=this._chartWidget.model().model(),i=t.panes();Object(s.assert)(i.length>1,"Unable to change pane's height if there is only one pane");const r=i.indexOf(this._pane);Object(s.assert)(-1!==r,"Invalid pane index");const n=new l(t,r,e);this._chartWidget.model().undoHistory().pushUndoCommand(n)}moveTo(e){const t=this.paneIndex();t!==e&&(Object(s.assert)(e>=0&&e<this._chartWidget.paneWidgets().length,"Invalid pane index"),this._chartWidget.model().movePane(t,e))}paneIndex(){return this._chartWidget.model().model().panes().indexOf(this._pane)}_getPriceScaleApi(e){let t=this._priceScales.get(e);return void 0===t&&(t=new r.a(this._chartWidget.model(),e),this._priceScales.set(e,t)),t}}},mkn5:function(e,t,i){"use strict";(function(t,s){i("AE9l"),i("YFKU");var r=i("UCjq").PaneWidgetBase,n=i("1IXQ").scaleRatioForContextMenuTransformer(7),o=i("CW80").isLineToolName,a=i("YmeR").ActionBinder,l=i("7KDR"),c=l.Action,h=l.Separator,u=i("mMWL"),d=i("FQhm"),p=i("S8xo").MouseEventHandler,_=i("+6II");e.exports.PaneWidget=class extends r{constructor(e,i,s,r){super(e,i,s,r),this.setCursorForTool(),this._mouseEventHandler=new p(this._topCanvasBinding.canvas,this,{treatVertTouchDragAsPageScroll:!this._options.handleScroll.vertTouchDrag,treatHorzTouchDragAsPageScroll:!this._options.handleScroll.horzTouchDrag}),this.actions=[],this.readonlyActions=[],this._prevHoveredHittest=null,this._chart.withModel(this,(function(){var e=this._chartUndoModel();e.onSimpleZoomIn().subscribe(this,this._updateCrosshairOnZoom),e.onSimpleZoomOut().subscribe(this,this._updateCrosshairOnZoom)})),this._highlightedPriceAxis=new t({owner:"",axis:null}),this._highlightedPriceAxis.subscribe(function(e){this._highlightPriceAxisByLabel(e.axis)}.bind(this)),this._prevPinchScale=0,this._isDestroyed=!1}destroy(){for(var e in super.destroy(),this._prevHoveredHittest=null,this._mouseEventHandler.destroy(),this._rowElement.parentElement.removeChild(this._rowElement),this)delete this[e];this._isDestroyed=!0}_highlightPriceAxisByLabel(e){this._lhsPriceAxisesContainer.highlightPriceAxisByLabel(e),this._rhsPriceAxisesContainer.highlightPriceAxisByLabel(e)}chart(){return this._chart}stretchFactor(){return this._state?this._state._stretchFactor:0}setStretchFactor(e){this.hasState()&&(this._state._stretchFactor=e)}hideInplaceEditor(){return!!this._inplaceEditor&&(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0)}drawRightThere(e){if(o(e)){var t=this._chartUndoModel(),i=t.crossHairSource(),s=t.model().magnet().align(i.price,i.index,this._state);t.createLineTool(this.state(),{index:i.index,price:s},e)}}_updateCommonTooltip(e){var t=this._lastCommonTooltipData,i=null;if(e&&e.hittest){var s=e.hittest.data();s&&(i=s.tooltip||null)}if(null!=t||null!=i){if(null==i||""===i.text)return this._lastCommonTooltipData=null,void _.hide()
|
||||
;if(!t||i.text!==t.text||i.rect.x!==t.rect.x||i.rect.y!==t.rect.y||i.rect.w!==t.rect.w||i.rect.h!==t.rect.h){this._lastCommonTooltipData=i;var r=TradingView.clone(i),n=this._paneCell.getBoundingClientRect();r.rect.x+=n.left,r.rect.y+=n.top,_.show(r)}}}createRemoveMenu(){var e=this._chart.actions();return new c({label:window.t("Remove"),statName:"Remove",subItems:[e.paneRemoveAllStudies,e.paneRemoveAllDrawingTools,e.paneRemoveAllStudiesDrawingTools]})}_customActions(){var e={top:[],bottom:[],remove:[]},t=this._chartUndoModel().timeScale(),i=this._state&&this._state.defaultPriceScale();if(!s.enabled("custom_items_in_context_menu"))return e;var r,n=t.isEmpty()?void 0:t.indexToUserTime(t.coordinateToIndex(this._contextMenuX));if(i&&!i.isEmpty()){var o=this._state.mainDataSource().firstValue();r=i.coordinateToPrice(this._contextMenuY,o)}return d.emit("onContextMenu",{unixtime:n?n/1e3:void 0,price:r,callback:function(t){[].concat(t).forEach((function(t){var i;t.text&&(t.text.length>1&&"-"===t.text[0]?e.remove.push(t.text.slice(1)):(i="-"===t.text?new h:new c({label:t.text,onExecute:t.click}),t.position&&"top"===t.position?e.top.push(i):e.bottom.push(i)))}))}}),e}update(){this._lhsPriceAxisesContainer.update(),this._rhsPriceAxisesContainer.update(),null!==this._legendWidget&&this._legendWidget.update(),this.updateControls()}createActionLockScale(e){if(!(e instanceof TradingView.Series))return null;var t=n(e.priceScale(),this._chartUndoModel().model().mainSeriesScaleRatio()),i=new c({checkable:e.priceScale().isLockScale(),label:window.t("Lock Scale")+" "+t,statName:"LockScale"});return i._binding=new a(i,e.priceScale().properties().lockScale,this._chartUndoModel(),"Lock Scale",(function(){var t={lockScale:this.value()};this._undoModel.setPriceScaleMode(t,e.priceScale(),this._undoText)})),i}_updateCrosshairOnZoom(){if(u.lockTimeAxis().value()){var e=this._chartUndoModel().crossHairSource();e.setPosition(e.index,e.price,this.state())}}highlightedPriceAxis(){return this._highlightedPriceAxis}}}).call(this,i("hY0g"),i("Kxc7"))},n0Bl:function(e,t,i){"use strict";i.r(t),i.d(t,"migrateShortcut",(function(){return r}));var s=i("/3z9");function r(e){const t=e.split("+");let i=t.pop().toUpperCase().charCodeAt(0);for(let r=0;r<t.length;r++){const e=t[r].toLowerCase();"ctrl"===e?i|=s.Modifiers.Control:"shift"===e?i|=s.Modifiers.Shift:"alt"===e&&(i|=s.Modifiers.Alt)}return i}},n40Z:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolVertLine",(function(){return h}));var s=i("Eyy1"),r=i("aO4+"),n=i("Ocx9"),o=i("tc+8"),a=i.n(o),l=i("Ss5c"),c=i("GmZZ");class h extends l.LineDataSource{constructor(e,t){const s=t||h.createProperties();super(e,s),this._timeAxisView=new c.a(this),this._paneViewFactory=null,this.properties().childs().extendLine.subscribe(this,()=>e.lightUpdate()),i.e("lt-pane-views").then(i.bind(null,"BSCN")).then(t=>{this._paneViewFactory=i=>new t.VertLinePaneView(this,e,i)})}destroy(){this.properties().childs().extendLine.unsubscribeAll(this),super.destroy()}pointsCount(){return 1}properties(){return super.properties()}name(){
|
||||
return"Vertical Line"}timeAxisViews(){return this.isSourceHidden()?null:this.properties().childs().showTime.value()?[this._timeAxisView]:null}updateAllViews(){super.updateAllViews(),this._timeAxisView.update()}canHasAlert(){return!0}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}isMultiPaneAvailable(){return!0}isMultiPaneEnabled(){return this.properties().childs().extendLine.value()}paneViews(e){return e=Object(s.ensureDefined)(e),this.isMultiPaneEnabled()||this._model.paneForSource(this)===e?(null===this._getPaneViews(e)&&null!==this._paneViewFactory&&this._setPaneViews([this._paneViewFactory(e)],e,!0),super.paneViews(e)):null}priceAxisViews(){return null}priceAxisPoints(){return[]}pointToScreenPoint(e){const t=this._model.timeScale();if(t.isEmpty())return[new r.Point(0,0),new r.Point(0,0)];const i=t.indexToCoordinate(e.index),s=new r.Point(i,0);return[s,s]}convertYCoordinateToPriceForMoving(e){return 0}static createProperties(e){null!=e&&(void 0===e.textOrientation&&(e.textOrientation="horizontal"),void 0===e.extendLine&&(e.extendLine=!1));const t=new n.DefaultProperty("linetoolvertline",e);return h._configureProperties(t),t}_getAlertPlots(){const e=this._points[0],t={index:e.index,price:e.price+1};return[this._linePointsToAlertPlot([e,t],null,!0,!0)]}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"FkpW")).then(e=>e.VerticalLineDefinitionsViewModel)}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}static _configureProperties(e){l.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new a.a("")),e.addExclusion("text")}}},n5al:function(e,t,i){"use strict";i.r(t),i.d(t,"isRequiringRestartSeriesStyles",(function(){return p})),i.d(t,"isRangeBasedStyle",(function(){return _})),i.d(t,"isRangeStyle",(function(){return m})),i.d(t,"isTimeBasedStyle",(function(){return f})),i.d(t,"isValidStyle",(function(){return g})),i.d(t,"setLastUsedStyle",(function(){return v})),i.d(t,"getLastUsedStyle",(function(){return b})),i.d(t,"getDefaultStyle",(function(){return S})),i.d(t,"getChartStyleByResolution",(function(){return y})),i.d(t,"chartStyleStudyId",(function(){return w})),i.d(t,"preparePriceAxisProperties",(function(){return C})),i.d(t,"hasProjection",(function(){return x})),i.d(t,"isPriceSourceStyle",(function(){return T})),i.d(t,"getSeriesPriceFormattingState",(function(){return M})),i.d(t,"createSeriesFormatter",(function(){return I})),i.d(t,"symbolCurrencyConvertible",(function(){return L})),i.d(t,"symbolCurrency",(function(){return O})),i.d(t,"symbolOriginalCurrency",(function(){return A})),i.d(t,"symbolBaseCurrency",(function(){return E})),i.d(t,"isConvertedToOtherCurrency",(function(){return k})),i.d(t,"symbolUnitConvertible",(function(){return D})),i.d(t,"symbolUnit",(function(){return V})),i.d(t,"symbolOriginalUnit",(function(){return B})),i.d(t,"isConvertedToOtherUnit",(function(){return R})),
|
||||
i.d(t,"symbolUnitConvertibleGroupsIfExist",(function(){return N})),i.d(t,"symbolCurrentContract",(function(){return j})),i.d(t,"extractSymbolNameFromSymbolInfo",(function(){return F})),i.d(t,"symbolTitle",(function(){return W}));var s=i("Vdly"),r=i("dfhE"),n=i("LxhU"),o=i("kcTO"),a=i("Kxc7"),l=i("nEwK");const c=[4,5,6,7,8],h=[4,5,6,7,8,11],u=[0,1,9,2,3,10],d=[2,10,3];function p(e){return-1!==c.indexOf(e)}function _(e){return-1!==h.indexOf(e)}function m(e){return 11===e}function f(e){return-1!==u.indexOf(e)}function g(e){return _(e)||f(e)}function v(e){g(e)&&11!==e&&s.setValue("chart.lastUsedStyle",e)}function b(){const e=s.getInt("chart.lastUsedStyle");return void 0===e?1:e}function S(e){return e?11:1}function y(e,t){const i=m(t),s=n.Interval.isRange(e);return!i&&s?S(!0):i&&!s?S(!1):t}function w(e,t){const i=r.SYMBOL_STRING_DATA[e];return void 0===i?null:t?`${i.type}-${i.basicStudyVersion}`:i.type}function C(e){const t=e.priceAxisProperties,i=t.lockScale.value(),s=6===e.style.value();(s||i)&&(t.log.setValue(!1),t.percentage.setValue(!1)),t.logDisabled.setValue(!(!s&&!i)),t.percentageDisabled.setValue(!(!s&&!i))}const P=[4,7,5,6];function x(e){return-1!==P.indexOf(e)}function T(e){return d.includes(e)}function M(e,t="default",i=!1){let s,r,n=100,o=1;if("default"===t)null!=e&&(n=e.pricescale,o=e.minmov,s=e.fractional,r=e.minmove2);else{let e=t.split(",");3!==e.length&&(e=["100","1","false"]),n=parseInt(e[0]),o=parseInt(e[1]),s="true"===e[2]}return i&&(o=1),{priceScale:n,minMove:o,fractional:s,minMove2:r}}function I(e,t,i=!1){if("default"===t&&null!=e&&("volume"===e.formatter||"volume"===e.format))return new l.VolumeFormatter(2);const{priceScale:s,minMove:r,fractional:n,minMove2:a}=M(e,t,i);return new o.PriceFormatter(s,r,n,a)}function L(e){return null!==e&&"spread"!==e.type}function O(e,t,i){if(null===e)return null;const s=!t||i?e.currency_id:e.currency_code;return void 0===s||""===s?null:s}function A(e,t){return(t?e.original_currency_code:e.original_currency_id)||O(e,t)}function E(e){return e.base_currency_id||null}function k(e){return!(null===e||!L(e))&&(void 0!==e.original_currency_id&&e.original_currency_id!==e.currency_id)}function D(e){return null!==e&&"spread"!==e.type}function V(e){if(null===e)return null;const t=e.unit_id;return void 0===t||""===t?null:t}function B(e){return e.original_unit_id||V(e)}function R(e){return!(null===e||!D(e))&&(void 0!==e.original_unit_id&&e.original_unit_id!==e.unit_id)}function N(e){return null!==e&&D(e)?e.unit_conversion_types||null:[]}function j(e){return"futures"===e.type&&e.front_contract||null}function F(e,t){let i=e&&(e.pro_name||e.full_name||e.name);return a.enabled("charting_library_single_symbol_request")&&t?i=t:a.enabled("use_ticker_on_symbol_info_update")&&e&&e.ticker&&(i=e.ticker),i}function W(e,t){return t?e.name:`${e.name}, ${e.exchange}`}},nBJD:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s{constructor(e){this._text="",this._color="",this._size="13px",this._bold=!1,this._statusProvider=e}text(){return this._text}getSplitTitle(){
|
||||
;if(!t||i.text!==t.text||i.rect.x!==t.rect.x||i.rect.y!==t.rect.y||i.rect.w!==t.rect.w||i.rect.h!==t.rect.h){this._lastCommonTooltipData=i;var r=TradingView.clone(i),n=this._paneCell.getBoundingClientRect();r.rect.x+=n.left,r.rect.y+=n.top,_.show(r)}}}createRemoveMenu(){var e=this._chart.actions();return new c({label:window.t("Remove"),statName:"Remove",subItems:[e.paneRemoveAllStudies,e.paneRemoveAllDrawingTools,e.paneRemoveAllStudiesDrawingTools]})}_customActions(){var e={top:[],bottom:[],remove:[]},t=this._chartUndoModel().timeScale(),i=this._state&&this._state.defaultPriceScale();if(!s.enabled("custom_items_in_context_menu"))return e;var r,n=t.isEmpty()?void 0:t.indexToUserTime(t.coordinateToIndex(this._contextMenuX));if(i&&!i.isEmpty()){var o=this._state.mainDataSource().firstValue();r=i.coordinateToPrice(this._contextMenuY,o)}return d.emit("onContextMenu",{unixtime:n?n/1e3:void 0,price:r,callback:function(t){[].concat(t).forEach((function(t){var i;t.text&&(t.text.length>1&&"-"===t.text[0]?e.remove.push(t.text.slice(1)):(i="-"===t.text?new h:new c({label:t.text,onExecute:t.click}),t.position&&"top"===t.position?e.top.push(i):e.bottom.push(i)))}))}}),e}update(){this._lhsPriceAxisesContainer.update(),this._rhsPriceAxisesContainer.update(),null!==this._legendWidget&&this._legendWidget.update(),this.updateControls()}createActionLockScale(e){if(!(e instanceof TradingView.Series))return null;var t=n(e.priceScale(),this._chartUndoModel().model().mainSeriesScaleRatio()),i=new c({checkable:e.priceScale().isLockScale(),label:window.t("Lock Scale")+" "+t,statName:"LockScale"});return i._binding=new a(i,e.priceScale().properties().lockScale,this._chartUndoModel(),"Lock Scale",(function(){var t={lockScale:this.value()};this._undoModel.setPriceScaleMode(t,e.priceScale(),this._undoText)})),i}_updateCrosshairOnZoom(){if(u.lockTimeAxis().value()){var e=this._chartUndoModel().crossHairSource();e.setPosition(e.index,e.price,this.state())}}highlightedPriceAxis(){return this._highlightedPriceAxis}}}).call(this,i("hY0g"),i("Kxc7"))},n0Bl:function(e,t,i){"use strict";i.r(t),i.d(t,"migrateShortcut",(function(){return r}));var s=i("/3z9");function r(e){const t=e.split("+");let i=t.pop().toUpperCase().charCodeAt(0);for(let r=0;r<t.length;r++){const e=t[r].toLowerCase();"ctrl"===e?i|=s.Modifiers.Control:"shift"===e?i|=s.Modifiers.Shift:"alt"===e&&(i|=s.Modifiers.Alt)}return i}},n40Z:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolVertLine",(function(){return h}));var s=i("Eyy1"),r=i("aO4+"),n=i("Ocx9"),o=i("tc+8"),a=i.n(o),l=i("Ss5c"),c=i("GmZZ");class h extends l.LineDataSource{constructor(e,t){const s=t||h.createProperties();super(e,s),this._timeAxisView=new c.a(this),this._paneViewFactory=null,this.properties().childs().extendLine.subscribe(this,()=>e.lightUpdate()),i.e("lt-pane-views").then(i.bind(null,"BSCN")).then(t=>{this._paneViewFactory=i=>new t.VertLinePaneView(this,e,i),this._model.lightUpdate()})}destroy(){this.properties().childs().extendLine.unsubscribeAll(this),super.destroy()}pointsCount(){return 1}properties(){
|
||||
return super.properties()}name(){return"Vertical Line"}timeAxisViews(){return this.isSourceHidden()?null:this.properties().childs().showTime.value()?[this._timeAxisView]:null}updateAllViews(){super.updateAllViews(),this._timeAxisView.update()}canHasAlert(){return!0}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}isMultiPaneAvailable(){return!0}isMultiPaneEnabled(){return this.properties().childs().extendLine.value()}paneViews(e){return e=Object(s.ensureDefined)(e),this.isMultiPaneEnabled()||this._model.paneForSource(this)===e?(null===this._getPaneViews(e)&&null!==this._paneViewFactory&&this._setPaneViews([this._paneViewFactory(e)],e,!0),super.paneViews(e)):null}priceAxisViews(){return null}priceAxisPoints(){return[]}pointToScreenPoint(e){const t=this._model.timeScale();if(t.isEmpty())return[new r.Point(0,0),new r.Point(0,0)];const i=t.indexToCoordinate(e.index),s=new r.Point(i,0);return[s,s]}convertYCoordinateToPriceForMoving(e){return 0}static createProperties(e){null!=e&&(void 0===e.textOrientation&&(e.textOrientation="horizontal"),void 0===e.extendLine&&(e.extendLine=!1));const t=new n.DefaultProperty("linetoolvertline",e);return h._configureProperties(t),t}_getAlertPlots(){const e=this._points[0],t={index:e.index,price:e.price+1};return[this._linePointsToAlertPlot([e,t],null,!0,!0)]}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"FkpW")).then(e=>e.VerticalLineDefinitionsViewModel)}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}static _configureProperties(e){l.LineDataSource._configureProperties(e),e.hasChild("text")||e.addChild("text",new a.a("")),e.addExclusion("text")}}},n5al:function(e,t,i){"use strict";i.r(t),i.d(t,"isRequiringRestartSeriesStyles",(function(){return p})),i.d(t,"isRangeBasedStyle",(function(){return _})),i.d(t,"isRangeStyle",(function(){return m})),i.d(t,"isTimeBasedStyle",(function(){return f})),i.d(t,"isValidStyle",(function(){return g})),i.d(t,"setLastUsedStyle",(function(){return v})),i.d(t,"getLastUsedStyle",(function(){return b})),i.d(t,"getDefaultStyle",(function(){return S})),i.d(t,"getChartStyleByResolution",(function(){return y})),i.d(t,"chartStyleStudyId",(function(){return w})),i.d(t,"preparePriceAxisProperties",(function(){return C})),i.d(t,"hasProjection",(function(){return x})),i.d(t,"isPriceSourceStyle",(function(){return T})),i.d(t,"getSeriesPriceFormattingState",(function(){return M})),i.d(t,"createSeriesFormatter",(function(){return I})),i.d(t,"symbolCurrencyConvertible",(function(){return L})),i.d(t,"symbolCurrency",(function(){return O})),i.d(t,"symbolOriginalCurrency",(function(){return A})),i.d(t,"symbolBaseCurrency",(function(){return E})),i.d(t,"isConvertedToOtherCurrency",(function(){return k})),i.d(t,"symbolUnitConvertible",(function(){return D})),i.d(t,"symbolUnit",(function(){return V})),i.d(t,"symbolOriginalUnit",(function(){return B})),i.d(t,"isConvertedToOtherUnit",(function(){
|
||||
return R})),i.d(t,"symbolUnitConvertibleGroupsIfExist",(function(){return N})),i.d(t,"symbolCurrentContract",(function(){return j})),i.d(t,"extractSymbolNameFromSymbolInfo",(function(){return F})),i.d(t,"symbolTitle",(function(){return W}));var s=i("Vdly"),r=i("dfhE"),n=i("LxhU"),o=i("kcTO"),a=i("Kxc7"),l=i("nEwK");const c=[4,5,6,7,8],h=[4,5,6,7,8,11],u=[0,1,9,2,3,10],d=[2,10,3];function p(e){return-1!==c.indexOf(e)}function _(e){return-1!==h.indexOf(e)}function m(e){return 11===e}function f(e){return-1!==u.indexOf(e)}function g(e){return _(e)||f(e)}function v(e){g(e)&&11!==e&&s.setValue("chart.lastUsedStyle",e)}function b(){const e=s.getInt("chart.lastUsedStyle");return void 0===e?1:e}function S(e){return e?11:1}function y(e,t){const i=m(t),s=n.Interval.isRange(e);return!i&&s?S(!0):i&&!s?S(!1):t}function w(e,t){const i=r.SYMBOL_STRING_DATA[e];return void 0===i?null:t?`${i.type}-${i.basicStudyVersion}`:i.type}function C(e){const t=e.priceAxisProperties,i=t.lockScale.value(),s=6===e.style.value();(s||i)&&(t.log.setValue(!1),t.percentage.setValue(!1)),t.logDisabled.setValue(!(!s&&!i)),t.percentageDisabled.setValue(!(!s&&!i))}const P=[4,7,5,6];function x(e){return-1!==P.indexOf(e)}function T(e){return d.includes(e)}function M(e,t="default",i=!1){let s,r,n=100,o=1;if("default"===t)null!=e&&(n=e.pricescale,o=e.minmov,s=e.fractional,r=e.minmove2);else{let e=t.split(",");3!==e.length&&(e=["100","1","false"]),n=parseInt(e[0]),o=parseInt(e[1]),s="true"===e[2]}return i&&(o=1),{priceScale:n,minMove:o,fractional:s,minMove2:r}}function I(e,t,i=!1){if("default"===t&&null!=e&&("volume"===e.formatter||"volume"===e.format))return new l.VolumeFormatter(2);const{priceScale:s,minMove:r,fractional:n,minMove2:a}=M(e,t,i);return new o.PriceFormatter(s,r,n,a)}function L(e){return null!==e&&"spread"!==e.type}function O(e,t,i){if(null===e)return null;const s=!t||i?e.currency_id:e.currency_code;return void 0===s||""===s?null:s}function A(e,t){return(t?e.original_currency_code:e.original_currency_id)||O(e,t)}function E(e){return e.base_currency_id||null}function k(e){return!(null===e||!L(e))&&(void 0!==e.original_currency_id&&e.original_currency_id!==e.currency_id)}function D(e){return null!==e&&"spread"!==e.type}function V(e){if(null===e)return null;const t=e.unit_id;return void 0===t||""===t?null:t}function B(e){return e.original_unit_id||V(e)}function R(e){return!(null===e||!D(e))&&(void 0!==e.original_unit_id&&e.original_unit_id!==e.unit_id)}function N(e){return null!==e&&D(e)?e.unit_conversion_types||null:[]}function j(e){return"futures"===e.type&&e.front_contract||null}function F(e,t){let i=e&&(e.pro_name||e.full_name||e.name);return a.enabled("charting_library_single_symbol_request")&&t?i=t:a.enabled("use_ticker_on_symbol_info_update")&&e&&e.ticker&&(i=e.ticker),i}function W(e,t){return t?e.name:`${e.name}, ${e.exchange}`}},nBJD:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s{constructor(e){this._text="",this._color="",this._size="13px",this._bold=!1,this._statusProvider=e}text(){return this._text}getSplitTitle(){
|
||||
return[this._text]}color(){return this._statusProvider.color()}bold(){return this._bold}size(){return this._size}}},nEwK:function(e,t,i){"use strict";i.r(t),i.d(t,"PLACE_HOLDER",(function(){return a})),i.d(t,"VolumeFormatter",(function(){return l}));var s=i("YFKU"),r=i("zXvd"),n=i("ogJP"),o=i("ivNn");const a="---";class l{constructor(e){this.type="volume",this._numericFormatter=new r.NumericFormatter,this._fractionalValues=void 0!==e&&e>0,this._precision=e}state(){return{precision:this._precision}}format(e){if(!Object(n.isNumber)(e))return a;let t="";return e<0&&(t="-",e=-e),e>=1e100?Object(s.t)("N/A"):(!this._fractionalValues||e>=995?e=Math.round(e):this._fractionalValues&&(e=+e.toFixed(this._precision)),e<995?t+this._formatNumber(e):e<999995?t+this._formatNumber(e/1e3)+"K":e<999999995?(e=1e3*Math.round(e/1e3),t+this._formatNumber(e/1e6)+"M"):e<999999999995?(e=1e6*Math.round(e/1e6),t+this._formatNumber(e/1e9)+"B"):(e=1e9*Math.round(e/1e9),t+this._formatNumber(e/1e12)+"T"))}parse(e){if("---"===e)return{error:"not a number",res:!1,value:NaN};const t={K:1e3,M:1e6,B:1e9},i=e.slice(-1);if(t.hasOwnProperty(i)){const s=this._numericFormatter.parse(e.slice(0,-1));return Object(n.isNumber)(s)?{res:!0,value:s*t[i]}:{error:"not a number",res:!1,value:NaN}}{const t=this._numericFormatter.parse(e);return Object(n.isNumber)(t)?{res:!0,value:t}:{error:"not a number",res:!1,value:NaN}}}static serialize(e){return e.state()}static deserialize(e){return new l(e.precision)}_formatNumber(e){return this._fractionalValues&&(e=Object(o.fixComputationError)(e)),this._numericFormatter.format(e).replace(/(\.[1-9]*)0+$/,(e,t)=>t)}}},nW7S:function(e,t,i){"use strict";(function(e){var s=i("aO4+").Point,r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty;class o extends e{constructor(e){super(),this._lineSource=e}value(){var e=180*this._lineSource._angle/Math.PI;return Math.round(e)}setValue(e){var t=e*Math.PI/180;this._lineSource._angle=t;var i=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],r=Math.cos(this._lineSource._angle),n=-Math.sin(this._lineSource._angle),o=new s(r,n),a=i.addScaled(o,this._lineSource._distance),l=this._lineSource.screenPointToPoint(a);this._lineSource._points[1]=l,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)}}class a extends r{constructor(e,t){super(e,t||a.createProperties()),this._properties.addChild("angle",new o(this)),i.e("lt-pane-views").then(i.t.bind(null,"XHET",7)).then(({TrendAnglePaneView:e})=>{this._setPaneViews([new e(this,this._model)])})}isSynchronizable(){return!1}pointsCount(){return 2}name(){return"Trend Angle"}_calculateAngle(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e);i.length()>0?(i=i.normalized(),this._angle=Math.acos(i.x),i.y>0&&(this._angle=-this._angle),this._distance=t.subtract(e).length()):delete this._angle,
|
||||
this.properties().hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)}addPoint(e,t){var i=r.prototype.addPoint.call(this,e,t);return i&&this._calculateAngle(),i}setLastPoint(e,t){super.setLastPoint(e,t),this.points().length>1&&this._calculateAngle()}axisPoints(){if(this.points().length<2)return[];var e=[this.points()[0]],t=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,r=-Math.sin(this._angle)*this._distance,n=t.add(new s(i,r)),o=this.screenPointToPoint(n);return e.push(o),e}setPoint(e,t,i){super.setPoint(e,t,i),this.points().length>1&&1===e&&this._calculateAngle()}restoreData(e){this._angle=e.angle,this._distance=e.distance}state(e){var t=r.prototype.state.call(this,e);return t.angle=this._angle,t.distance=this._distance,t}cloneData(e){this._angle=e._angle,this._distance=e._distance}canHasAlert(){return!0}_getAlertPlots(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"o1gc"))).TrendAngleDefinitionsViewModel}static createProperties(e){var t=new n("linetooltrendangle",e);return a._configureProperties(t),t}static _configureProperties(e){r._configureProperties(e)}}t.LineToolTrendAngle=a}).call(this,i("tc+8"))},"nd9+":function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolGannComplex",(function(){return h}));var s=i("aO4+"),r=i("Eyy1"),n=i("T6Of"),o=i("Ss5c"),a=i("FaJS"),l=i("LAp3"),c=i("j3hX");class h extends o.LineDataSource{constructor(e,t){super(e,t||h.createProperties()),this.version=2,this._scaleRatioFormatter=new n.LimitedPrecisionNumericFormatter(7),i.e("lt-pane-views").then(i.bind(null,"X4Cb")).then(({GannComplexPaneView:e})=>{this._setPaneViews([new e(this,this.model())])});const s=this.properties();this._adjustScaleRatio(s),s.subscribe(this,this._adjustScaleRatio),s.childs().scaleRatio.subscribe(this,this._correctFirstPoint),this._syncStateExclusions=["scaleRatio"],s.addExclusion("scaleRatio"),this.properties().onRestoreFactoryDefaults().subscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.subscribe(this,this._handleTemplateApplying),this._onTemplateApplied.subscribe(this,this._correctFirstPoint)}properties(){return super.properties()}migrateVersion(e,t,i){1===e&&(this._points.length>=this.pointsCount()?setTimeout(()=>this._migratePoint()):this._timePoint.length>=this.pointsCount()&&this._pointAdded.subscribe(this,this._migratePoint))}destroy(){const e=this.properties();e.unsubscribe(this,this._adjustScaleRatio),e.childs().scaleRatio.unsubscribe(this,this._correctFirstPoint),this.properties().onRestoreFactoryDefaults().unsubscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.unsubscribe(this,this._handleTemplateApplying),this._onTemplateApplied.unsubscribe(this,this._correctFirstPoint),super.destroy()}pointsCount(){return 2}name(){return"Gann Square"}addPoint(e,t,i){
|
||||
this._points.length>1&&this._points.pop();const s=super.addPoint(e,t,i),n=this.priceScale();return!Object(r.ensureNotNull)(n).isLog()&&s&&this._correctFirstPoint(),s}setPoint(e,t,i){super.setPoint(e,t,i),void 0!==i&&i.shift()?this._correctPoint(e):this._correctScaleRatio()}setLastPoint(e,t){const i=this.priceScale();Object(r.ensureNotNull)(i).isLog()||(this._points[1]=e,this._correctPoint(1)),super.setLastPoint(e,t)}isReversed(){return this.properties().childs().reverse.value()}levelsCount(){return this.properties().childs().levels.childCount()}levels(){const e=[],t=this.properties().childs(),i=t.levels.childCount();for(let s=0;s<i;s++){const i=t.levels.childs()[s].childs();e.push({index:s,visible:i.visible.value(),color:i.color.value(),width:i.width.value()})}return e}fanLinesCount(){return this.properties().childs().fanlines.childCount()}fanLines(){const e=[],t=this.properties().childs(),i=t.fanlines.childCount();for(let s=0;s<i;s++){const i=t.fanlines.childs()[s].childs();e.push({index:s,visible:i.visible.value(),x:i.x.value(),y:i.y.value(),color:i.color.value(),width:i.width.value()})}return e}arcsCount(){return this.properties().childs().arcs.childCount()}arcs(){const e=[],t=this.properties().childs(),i=t.arcs.childCount();for(let s=0;s<i;s++){const i=t.arcs.childs()[s].childs();e.push({index:s,visible:i.visible.value(),x:i.x.value(),y:i.y.value(),color:i.color.value(),width:i.width.value()})}return e}arcsBackgroundTransparency(){return this.properties().childs().arcsBackground.childs().transparency.value()}isArcsBackgroundFilled(){return this.properties().childs().arcsBackground.childs().fillBackground.value()}isLabelsVisible(){return this.properties().childs().showLabels.value()}getLabelsStyle(){const e=this.properties().childs(),{font:t,fontSize:i,bold:s,italic:r}=e.labelsStyle.childs(),n=e.levels.childCount();return{textColor:e.levels.childs()[n-1].childs().color.value(),font:t.value(),fontSize:i.value(),bold:s.value(),italic:r.value()}}getScaleRatioStep(){return 1e-7}getScaleRatioFormatter(){return this._scaleRatioFormatter}getPriceDiff(){const e=this.points();if(e.length<2)return null;const[t,i]=e;return i.price-t.price}getIndexDiff(){const e=this.points();if(e.length<2)return null;const[t,i]=e;return i.index-t.index}getScaleRatio(){const e=this.getPriceDiff(),t=this.getIndexDiff();return null!==e&&null!==t&&0!==t?Math.abs(e/t):null}static createProperties(e){const t=Object(l.a)("linetoolganncomplex",e);return h._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(33),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"WfUZ")).then(e=>e.GannComplexAndFixedDefinitionsViewModel)}static _configureProperties(e){o.LineDataSource._configureProperties(e);const t=[],i=[],s=e.childs();{const e=s.levels.childCount();for(let r=0;r<e;r++){const e=s.levels.childs()[r].childs();t.push(e.width),i.push(e.color)}}{const e=s.fanlines.childCount();for(let r=0;r<e;r++){const e=s.fanlines.childs()[r].childs();t.push(e.width),i.push(e.color)}}{const e=s.arcs.childCount()
|
||||
File diff suppressed because one or more lines are too long
2
charting_library/charting_library.d.ts
vendored
2
charting_library/charting_library.d.ts
vendored
@@ -146,7 +146,7 @@ export declare type HistoryCallback = (bars: Bar[], meta?: HistoryMetadata) => v
|
||||
export declare type IBasicDataFeed = IDatafeedChartApi & IExternalDatafeed;
|
||||
export declare type InputFieldValidator = (value: any) => InputFieldValidatorResult;
|
||||
export declare type InputFieldValidatorResult = PositiveBaseInputFieldValidatorResult | NegativeBaseInputFieldValidatorResult;
|
||||
export declare type LanguageCode = "ar" | "zh" | "cs" | "da_DK" | "nl_NL" | "en" | "et_EE" | "fr" | "de" | "el" | "he_IL" | "hu_HU" | "id_ID" | "it" | "ja" | "ko" | "fa" | "pl" | "pt" | "ro" | "ru" | "sk_SK" | "es" | "sv" | "th" | "tr" | "vi";
|
||||
export declare type LanguageCode = "ar" | "zh" | "cs" | "da_DK" | "nl_NL" | "en" | "et_EE" | "fr" | "de" | "el" | "he_IL" | "hu_HU" | "id_ID" | "it" | "ja" | "ko" | "fa" | "pl" | "pt" | "ro" | "ru" | "sk_SK" | "es" | "sv" | "th" | "tr" | "vi" | "no" | "ms_MY" | "zh_TW";
|
||||
export declare type LayoutType = SingleChartLayoutType | MultipleChartsLayoutType;
|
||||
export declare type LegendMode = "horizontal" | "vertical";
|
||||
export declare type MarkConstColors = "red" | "green" | "blue" | "yellow";
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"description": "CL v20.031 (internal id a88da32b @ 2021-10-11T10:22:03.968Z)",
|
||||
"description": "CL v20.032 (internal id ad2f4a55 @ 2021-10-28T12:29:15.152Z)",
|
||||
"type": "module",
|
||||
"main": "charting_library.cjs.js",
|
||||
"module": "charting_library.esm.js",
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user