@@ -19,7 +19,7 @@ var _integration = require("../../helpers/integration");
1919var _multiplicity_calc = require ( "../../helpers/multiplicity_calc" ) ;
2020var _calc = require ( "../../helpers/calc" ) ;
2121/* eslint-disable no-unused-vars, prefer-object-spread, no-mixed-operators,
22- no-unneeded-ternary, arrow-body-style */
22+ no-unneeded-ternary, arrow-body-style, max-len */
2323
2424const d3 = require ( 'd3' ) ;
2525class MultiFocus {
@@ -51,6 +51,8 @@ class MultiFocus {
5151 this . brushX = d3 . brushX ( ) ;
5252 this . axis = null ;
5353 this . path = null ;
54+ this . thresLineUp = null ;
55+ this . thresLineDw = null ;
5456 this . grid = null ;
5557 this . tags = null ;
5658 this . ref = null ;
@@ -79,6 +81,7 @@ class MultiFocus {
7981 this . update = this . update . bind ( this ) ;
8082 this . setConfig = this . setConfig . bind ( this ) ;
8183 this . drawLine = this . drawLine . bind ( this ) ;
84+ this . drawThres = this . drawThres . bind ( this ) ;
8285 this . drawOtherLines = this . drawOtherLines . bind ( this ) ;
8386 this . drawGrid = this . drawGrid . bind ( this ) ;
8487 this . drawPeaks = this . drawPeaks . bind ( this ) ;
@@ -155,8 +158,8 @@ class MultiFocus {
155158 this . tip = ( 0 , _init . InitTip ) ( ) ;
156159 this . root . call ( this . tip ) ;
157160 }
158- setDataParams ( peaks , tTrEndPts , tSfPeaks , layout , cyclicvoltaSt ) {
159- let jcampIdx = arguments . length > 5 && arguments [ 5 ] !== undefined ? arguments [ 5 ] : 0 ;
161+ setDataParams ( filterSeed , peaks , tTrEndPts , tSfPeaks , layout , cyclicvoltaSt ) {
162+ let jcampIdx = arguments . length > 6 && arguments [ 6 ] !== undefined ? arguments [ 6 ] : 0 ;
160163 this . data = [ ] ;
161164 this . otherLineData = [ ] ;
162165 let filterSubLayoutValue = null ;
@@ -167,8 +170,11 @@ class MultiFocus {
167170 color
168171 } = entry ;
169172 const offset = ( 0 , _chem . GetCyclicVoltaPreviousShift ) ( cyclicvoltaSt , jcampIdx ) ;
170- const currData = ( 0 , _chem . convertTopic ) ( topic , layout , feature , offset ) ;
173+ let currData = ( 0 , _chem . convertTopic ) ( topic , layout , feature , offset ) ;
171174 if ( idx === jcampIdx ) {
175+ if ( ! _format . default . isCyclicVoltaLayout ( layout ) ) {
176+ currData = filterSeed ;
177+ }
172178 this . data = [ ...currData ] ;
173179 this . pathColor = color ;
174180 filterSubLayoutValue = _format . default . isSECLayout ( layout ) ? feature . xUnit : feature . yUnit ;
@@ -258,6 +264,23 @@ class MultiFocus {
258264 this . path . attr ( 'marker-mid' , 'url(#arrow-left)' ) ;
259265 }
260266 }
267+ drawThres ( ) {
268+ if ( this . tTrEndPts . length > 0 ) {
269+ this . thresLineUp . attr ( 'd' , this . pathCall ( this . tTrEndPts ) ) ;
270+ this . thresLineUp . attr ( 'visibility' , 'visible' ) ;
271+ const [ left , right ] = this . tTrEndPts ;
272+ const dwMirrorEndPts = [ Object . assign ( { } , left , {
273+ y : - left . y
274+ } ) , Object . assign ( { } , right , {
275+ y : - right . y
276+ } ) ] ;
277+ this . thresLineDw . attr ( 'd' , this . pathCall ( dwMirrorEndPts ) ) ;
278+ this . thresLineDw . attr ( 'visibility' , 'visible' ) ;
279+ } else {
280+ this . thresLineUp . attr ( 'visibility' , 'hidden' ) ;
281+ this . thresLineDw . attr ( 'visibility' , 'hidden' ) ;
282+ }
283+ }
261284 drawOtherLines ( layout ) {
262285 d3 . selectAll ( '.line-clip-compare' ) . remove ( ) ;
263286 if ( ! this . otherLineData ) return null ;
@@ -815,10 +838,11 @@ class MultiFocus {
815838 this . root = d3 . select ( this . rootKlass ) . selectAll ( '.focus-main' ) ;
816839 this . scales = ( 0 , _init . InitScale ) ( this , this . reverseXAxis ( layoutSt ) ) ;
817840 this . setTip ( ) ;
818- this . setDataParams ( filterPeak , tTrEndPts , tSfPeaks , layoutSt , cyclicvoltaSt , jcampIdx ) ;
841+ this . setDataParams ( filterSeed , filterPeak , tTrEndPts , tSfPeaks , layoutSt , cyclicvoltaSt , jcampIdx ) ;
819842 ( 0 , _compass . MountCompass ) ( this ) ;
820843 this . axis = ( 0 , _mount . MountAxis ) ( this ) ;
821844 this . path = ( 0 , _mount . MountPath ) ( this , this . pathColor ) ;
845+ [ this . thresLineUp , this . thresLineDw ] = ( 0 , _mount . MountThresLine ) ( this , 'green' ) ;
822846 this . grid = ( 0 , _mount . MountGrid ) ( this ) ;
823847 this . tags = ( 0 , _mount . MountTags ) ( this ) ;
824848 this . ref = ( 0 , _mount . MountRef ) ( this ) ;
@@ -827,6 +851,7 @@ class MultiFocus {
827851 if ( this . data && this . data . length > 0 ) {
828852 this . setConfig ( sweepExtentSt ) ;
829853 this . drawLine ( ) ;
854+ this . drawThres ( ) ;
830855 this . drawGrid ( ) ;
831856 this . drawOtherLines ( layoutSt ) ;
832857 this . drawPeaks ( editPeakSt ) ;
@@ -863,11 +888,12 @@ class MultiFocus {
863888 const jcampIdx = curveIdx ;
864889 this . isShowAllCurves = isShowAllCurve ;
865890 this . entities = entities ;
866- this . setDataParams ( filterPeak , tTrEndPts , tSfPeaks , layoutSt , cyclicvoltaSt , jcampIdx ) ;
891+ this . setDataParams ( filterSeed , filterPeak , tTrEndPts , tSfPeaks , layoutSt , cyclicvoltaSt , jcampIdx ) ;
867892 if ( this . data && this . data . length > 0 ) {
868893 this . setConfig ( sweepExtentSt ) ;
869894 this . getShouldUpdate ( editPeakSt ) ;
870895 this . drawLine ( ) ;
896+ this . drawThres ( ) ;
871897 this . drawGrid ( ) ;
872898 this . drawOtherLines ( layoutSt ) ;
873899 this . drawPeaks ( editPeakSt ) ;
0 commit comments