@@ -66,6 +66,8 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
66
66
umapIs3d : boolean = true ;
67
67
@property ( { type : Number } )
68
68
umapNeighbors : number = 15 ;
69
+ @property ( { type : Number } )
70
+ umapMinDist : number = 0.1 ;
69
71
// PCA projection.
70
72
@property ( { type : Array } )
71
73
pcaComponents : Array < {
@@ -262,6 +264,7 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
262
264
// UMAP
263
265
this . umapIs3d = bookmark . umapIs3d ;
264
266
this . umapNeighbors = bookmark . umapNeighbors ;
267
+ this . umapMinDist = bookmark . umapMinDist ;
265
268
// custom
266
269
this . customSelectedSearchByMetadataOption =
267
270
bookmark . customSelectedSearchByMetadataOption ;
@@ -319,6 +322,7 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
319
322
// UMAP
320
323
bookmark . umapIs3d = this . umapIs3d ;
321
324
bookmark . umapNeighbors = this . umapNeighbors ;
325
+ bookmark . umapMinDist = this . umapMinDist ;
322
326
// custom
323
327
bookmark . customSelectedSearchByMetadataOption =
324
328
this . customSelectedSearchByMetadataOption ;
@@ -542,20 +546,26 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
542
546
this . runUmapButton . disabled = true ;
543
547
const nComponents = this . umapIs3d ? 3 : 2 ;
544
548
const nNeighbors = this . umapNeighbors ;
545
- this . dataSet . projectUmap ( nComponents , nNeighbors , ( iteration : number ) => {
546
- if ( iteration != null ) {
547
- this . runUmapButton . disabled = false ;
548
- this . projector . notifyProjectionPositionsUpdated ( ) ;
549
- if ( ! projectionChangeNotified && this . dataSet . projections [ 'umap' ] ) {
549
+ const minDist = this . umapMinDist ;
550
+ this . dataSet . projectUmap (
551
+ nComponents ,
552
+ nNeighbors ,
553
+ minDist ,
554
+ ( iteration : number ) => {
555
+ if ( iteration != null ) {
556
+ this . runUmapButton . disabled = false ;
557
+ this . projector . notifyProjectionPositionsUpdated ( ) ;
558
+ if ( ! projectionChangeNotified && this . dataSet . projections [ 'umap' ] ) {
559
+ this . projector . onProjectionChanged ( ) ;
560
+ projectionChangeNotified = true ;
561
+ }
562
+ } else {
563
+ this . runUmapButton . innerText = 'Re-run' ;
564
+ this . runUmapButton . disabled = false ;
550
565
this . projector . onProjectionChanged ( ) ;
551
- projectionChangeNotified = true ;
552
566
}
553
- } else {
554
- this . runUmapButton . innerText = 'Re-run' ;
555
- this . runUmapButton . disabled = false ;
556
- this . projector . onProjectionChanged ( ) ;
557
567
}
558
- } ) ;
568
+ ) ;
559
569
}
560
570
@observe ( 'pcaX' , 'pcaY' , 'pcaZ' )
561
571
private showPCAIfEnabled ( ) {
0 commit comments