@@ -66,6 +66,8 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
6666 umapIs3d : boolean = true ;
6767 @property ( { type : Number } )
6868 umapNeighbors : number = 15 ;
69+ @property ( { type : Number } )
70+ umapMinDist : number = 0.1 ;
6971 // PCA projection.
7072 @property ( { type : Array } )
7173 pcaComponents : Array < {
@@ -262,6 +264,7 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
262264 // UMAP
263265 this . umapIs3d = bookmark . umapIs3d ;
264266 this . umapNeighbors = bookmark . umapNeighbors ;
267+ this . umapMinDist = bookmark . umapMinDist ;
265268 // custom
266269 this . customSelectedSearchByMetadataOption =
267270 bookmark . customSelectedSearchByMetadataOption ;
@@ -319,6 +322,7 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
319322 // UMAP
320323 bookmark . umapIs3d = this . umapIs3d ;
321324 bookmark . umapNeighbors = this . umapNeighbors ;
325+ bookmark . umapMinDist = this . umapMinDist ;
322326 // custom
323327 bookmark . customSelectedSearchByMetadataOption =
324328 this . customSelectedSearchByMetadataOption ;
@@ -542,20 +546,26 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
542546 this . runUmapButton . disabled = true ;
543547 const nComponents = this . umapIs3d ? 3 : 2 ;
544548 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 ;
550565 this . projector . onProjectionChanged ( ) ;
551- projectionChangeNotified = true ;
552566 }
553- } else {
554- this . runUmapButton . innerText = 'Re-run' ;
555- this . runUmapButton . disabled = false ;
556- this . projector . onProjectionChanged ( ) ;
557567 }
558- } ) ;
568+ ) ;
559569 }
560570 @observe ( 'pcaX' , 'pcaY' , 'pcaZ' )
561571 private showPCAIfEnabled ( ) {
0 commit comments