1 line
2.5 KiB
JavaScript
1 line
2.5 KiB
JavaScript
"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[1662],{87081:(e,t,i)=>{i.d(t,{LineToolHorzLinePriceAxisView:()=>o});var r=i(15269),s=i(82347);class o extends r.PriceAxisView{constructor(e){super(),this._source=e}_updateRendererData(e,t,i){e.visible=!1;const r=this._source.points(),o=this._source.priceScale();if(0===r.length||null===o||o.isEmpty())return;const n=r[0];if(!isFinite(n.price))return;const l=this._source.ownerSource(),c=null!==l?l.firstValue():null;if(null===c)return;const a=(0,s.resetTransparency)(this._source.properties().linecolor.value());i.background=a,i.textColor=this.generateTextColor(a),i.coordinate=o.priceToCoordinate(n.price,c),e.text=o.formatPrice(n.price,c),e.visible=!0,e.selectedMarkColor=this._source.model().selection().isSelected(this._source)?a:void 0}}},6733:(e,t,i)=>{i.r(t),i.d(t,{LineToolHorzRay:()=>a});var r=i(85842),s=i(93445),o=i(22384),n=i(87081),l=i(82014),c=i(33993);class a extends l.LineDataSource{constructor(e,t,r,s){super(e,t??a.createProperties(e.backgroundTheme().spawnOwnership()),r,s),this._priceAxisView=new n.LineToolHorzLinePriceAxisView(this),Promise.all([i.e(8263),i.e(144),i.e(4073),i.e(1912),i.e(1495)]).then(i.bind(i,35173)).then((({HorzRayPaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}pointsCount(){return 1}name(){return"Horizontal Ray"}priceAxisViews(e,t){return this.isSourceHidden()||t!==this.priceScale()||!this._model.selection().isSelected(this)&&!this.properties().childs().showPrice.value()||e!==this._model.paneForSource(this)?null:[this._priceAxisView]}updateAllViews(e){super.updateAllViews(e),this._priceAxisView.update(e)}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}canHasAlert(){return!0}static createProperties(e,t){const i=new s.DefaultProperty({defaultName:"linetoolhorzray",state:t,theme:e});return this._configureProperties(i),i}_getAlertPlots(){const e=this._points[0],t={index:e.index+1,price:e.price},i=this._linePointsToAlertPlot([e,t],null,!1,!0);return null!==i?[i]:[]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(1982),i.e(7686),i.e(2428),i.e(3920),i.e(9328)]).then(i.bind(i,44455))).HorizontalRayDefinitionsViewModel}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.Property("")),e.addExcludedKey("text",1),e.addChild("textsColors",new c.LineToolColorsProperty([(0,r.ensureDefined)(e.child("textcolor"))]))}}}}]); |