@@ -27,16 +27,13 @@ export default {factoryDef, TYPE_ID};
27
27
28
28
var idCnt = 0 ;
29
29
30
- function * regionsRemoveSaga ( { id, plotId, drawLayer } , dispatch , getState ) {
30
+ function * regionsRemoveSaga ( { id, plotId} , dispatch , getState ) {
31
31
while ( true ) {
32
32
var action = yield take ( [ DrawLayerCntlr . REGION_REMOVE_ENTRY ,
33
33
DrawLayerCntlr . REGION_DELETE_LAYER ,
34
34
DrawLayerCntlr . DETACH_LAYER_FROM_PLOT ] ) ;
35
35
36
36
if ( action . payload . drawLayerId === id ) {
37
- console . log ( 'payload id = ' + action . payload . drawLayerId + ' id = ' + id ) ;
38
- console . log ( 'DrawLayerCntlr.REGION_REMOVE_ENTRY = ' + DrawLayerCntlr . REGION_REMOVE_ENTRY ) ;
39
- console . log ( 'action.type = DrawLayerCntlr.REGION_REMOVE_ENTRY: ' + DrawLayerCntlr . REGION_REMOVE_ENTRY === action . type ) ;
40
37
switch ( action . type ) {
41
38
case DrawLayerCntlr . REGION_REMOVE_ENTRY :
42
39
var dl = getDrawLayerById ( getState ( ) [ DRAWING_LAYER_KEY ] , id ) ;
@@ -68,7 +65,6 @@ function creator(initPayload) {
68
65
var drawingDef = makeDrawingDef ( 'green' ) ;
69
66
var pairs = {
70
67
[ MouseState . DOWN . key ] : highlightChange
71
- //[MouseState.DOWN.key]: removeRegionDescription
72
68
} ;
73
69
74
70
idCnt ++ ;
@@ -84,15 +80,15 @@ function creator(initPayload) {
84
80
var actionTypes = [ DrawLayerCntlr . REGION_ADD_ENTRY ,
85
81
DrawLayerCntlr . REGION_REMOVE_ENTRY ] ;
86
82
87
- var id = get ( initPayload , 'drawLayerId' , `${ ID } -${ idCnt } ` ) ;
88
- var dl = DrawLayer . makeDrawLayer ( id , TYPE_ID , get ( initPayload , 'title' , 'Region Plot' ) ,
83
+ const id = get ( initPayload , 'drawLayerId' , `${ ID } -${ idCnt } ` ) ;
84
+ var dl = DrawLayer . makeDrawLayer ( id , TYPE_ID , get ( initPayload , 'title' , 'Region Plot' ) ,
89
85
options , drawingDef , actionTypes , pairs ) ;
90
86
91
87
dl . regionAry = get ( initPayload , 'regionAry' , null ) ;
92
88
dl . dataFrom = get ( initPayload , 'dataFrom' , 'ds9' ) ;
93
89
dl . highlightedRegion = get ( initPayload , 'highlightedRegion' , null ) ;
94
90
95
- dispatchAddSaga ( regionsRemoveSaga , { id, drawLayer : dl , plotId : get ( initPayload , 'plotId' ) } ) ;
91
+ dispatchAddSaga ( regionsRemoveSaga , { id, plotId : get ( initPayload , 'plotId' ) } ) ;
96
92
idCnt ++ ;
97
93
return dl ;
98
94
}
@@ -220,14 +216,12 @@ function getLayerChanges(drawLayer, action) {
220
216
221
217
function getDrawData ( dataType , plotId , drawLayer , action , lastDataRet ) {
222
218
const { highlightedRegion, drawObjAry} = drawLayer ;
223
- var preData = get ( lastDataRet , plotId , null ) || lastDataRet ;
224
219
225
220
switch ( dataType ) {
226
221
case DataTypes . DATA :
227
- //return drawObjAry || plotAllRegions(drawLayer) || preData;
228
- return isEmpty ( preData ) ? drawObjAry || plotAllRegions ( drawLayer ) : preData ;
222
+ return isEmpty ( lastDataRet ) ? drawObjAry || plotAllRegions ( drawLayer ) : lastDataRet ;
229
223
case DataTypes . HIGHLIGHT_DATA :
230
- return isEmpty ( preData ) ? plotHighlightRegion ( highlightedRegion , plotId ) : preData ;
224
+ return isEmpty ( lastDataRet ) ? plotHighlightRegion ( highlightedRegion , plotId ) : lastDataRet ;
231
225
}
232
226
return null ;
233
227
}
0 commit comments