@@ -17,12 +17,7 @@ import {PolymerElement} from '@polymer/polymer';
17
17
import '../../../components/polymer/irons_and_papers' ;
18
18
import { LegacyElementMixin } from '../../../components/polymer/legacy_element_mixin' ;
19
19
import * as d3 from '../../../webapp/third_party/d3' ;
20
- import {
21
- ColorOption ,
22
- ColumnStats ,
23
- Projection ,
24
- SpriteAndMetadataInfo ,
25
- } from './data' ;
20
+ import { ColorOption , ColumnStats , SpriteAndMetadataInfo } from './data' ;
26
21
import {
27
22
DataProvider ,
28
23
EmbeddingInfo ,
@@ -63,22 +58,13 @@ class DataPanel extends LegacyElementMixin(PolymerElement) {
63
58
metadataEditorColumn : string ;
64
59
@property ( { type : Boolean } )
65
60
metadataEditorButtonDisabled : boolean ;
66
- @property ( { type : String } )
67
- superviseInput : string ;
68
- @property ( { type : String } )
69
- superviseInputLabel : string = 'Ignored label' ;
70
- @property ( { type : String } )
71
- superviseColumn : string ;
72
- @property ( { type : Boolean } )
73
- showSuperviseSettings : boolean = false ;
74
61
75
62
@property ( { type : String } )
76
63
readonly _wordDelimiter = '[/=_,-]' ;
77
64
78
65
private labelOptions : string [ ] ;
79
66
private colorOptions : ColorOption [ ] ;
80
67
forceCategoricalColoring : boolean = false ;
81
- private superviseInputSelected : string ;
82
68
private selectedPointIndices : number [ ] ;
83
69
private neighborsOfFirstPoint : knn . NearestEntry [ ] ;
84
70
private dataProvider : DataProvider ;
@@ -97,7 +83,6 @@ class DataPanel extends LegacyElementMixin(PolymerElement) {
97
83
ready ( ) {
98
84
super . ready ( ) ;
99
85
this . normalizeData = true ;
100
- this . superviseInputSelected = '' ;
101
86
}
102
87
initialize ( projector : any , dp : DataProvider ) {
103
88
this . projector = projector ;
@@ -180,27 +165,6 @@ class DataPanel extends LegacyElementMixin(PolymerElement) {
180
165
// Make the default label the first non-numeric column.
181
166
this . metadataEditorColumn = this . metadataFields [ Math . max ( 0 , labelIndex ) ] ;
182
167
}
183
- if (
184
- this . superviseColumn == null ||
185
- this . metadataFields . filter ( ( name ) => name === this . superviseColumn )
186
- . length === 0
187
- ) {
188
- // Make the default supervise class the first non-numeric column.
189
- this . superviseColumn = this . metadataFields [ Math . max ( 0 , labelIndex ) ] ;
190
- this . superviseInput = '' ;
191
- }
192
- this . superviseInputChange ( ) ;
193
- }
194
- projectionChanged ( projection : Projection ) {
195
- if ( projection ) {
196
- switch ( projection . projectionType ) {
197
- case 'tsne' :
198
- this . set ( 'showSuperviseSettings' , true ) ;
199
- break ;
200
- default :
201
- this . set ( 'showSuperviseSettings' , false ) ;
202
- }
203
- }
204
168
}
205
169
onProjectorSelectionChanged (
206
170
selectedPointIndices : number [ ] ,
@@ -381,59 +345,6 @@ class DataPanel extends LegacyElementMixin(PolymerElement) {
381
345
anyDownloadMetadataLink . click ( ) ;
382
346
}
383
347
}
384
- private superviseInputTyping ( ) {
385
- let value = this . superviseInput . trim ( ) ;
386
- if ( value == null || value . trim ( ) === '' ) {
387
- if ( this . superviseInputSelected === '' ) {
388
- this . superviseInputLabel = 'No ignored label' ;
389
- } else {
390
- this . superviseInputLabel = `Supervising without '${ this . superviseInputSelected } '` ;
391
- }
392
- return ;
393
- }
394
- if ( this . projector && this . projector . dataSet ) {
395
- let numMatches = this . projector . dataSet . points . filter (
396
- ( p ) => p . metadata [ this . superviseColumn ] . toString ( ) . trim ( ) === value
397
- ) . length ;
398
- if ( numMatches === 0 ) {
399
- this . superviseInputLabel = 'Label not found' ;
400
- } else {
401
- if ( this . projector . dataSet . superviseInput != value ) {
402
- this . superviseInputLabel = `Supervise without '${ value } ' [${ numMatches } points]` ;
403
- }
404
- }
405
- }
406
- }
407
- private superviseInputChange ( ) {
408
- let value = this . superviseInput . trim ( ) ;
409
- if ( value == null || value . trim ( ) === '' ) {
410
- this . superviseInputSelected = '' ;
411
- this . superviseInputLabel = 'No ignored label' ;
412
- this . setSupervision ( this . superviseColumn , '' ) ;
413
- return ;
414
- }
415
- if ( this . projector && this . projector . dataSet ) {
416
- let numMatches = this . projector . dataSet . points . filter (
417
- ( p ) => p . metadata [ this . superviseColumn ] . toString ( ) . trim ( ) === value
418
- ) . length ;
419
- if ( numMatches === 0 ) {
420
- this . superviseInputLabel = `Supervising without '${ this . superviseInputSelected } '` ;
421
- } else {
422
- this . superviseInputSelected = value ;
423
- this . superviseInputLabel = `Supervising without '${ value } ' [${ numMatches } points]` ;
424
- this . setSupervision ( this . superviseColumn , value ) ;
425
- }
426
- }
427
- }
428
- private superviseColumnChanged ( ) {
429
- this . superviseInput = '' ;
430
- this . superviseInputChange ( ) ;
431
- }
432
- private setSupervision ( superviseColumn : string , superviseInput : string ) {
433
- if ( this . projector && this . projector . dataSet ) {
434
- this . projector . dataSet . setSupervision ( superviseColumn , superviseInput ) ;
435
- }
436
- }
437
348
setNormalizeData ( normalizeData : boolean ) {
438
349
this . normalizeData = normalizeData ;
439
350
}
0 commit comments