@@ -399,7 +399,6 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
399
399
this . searchByMetadataOptions [ Math . max ( 0 , searchByMetadataIndex ) ] ;
400
400
}
401
401
public showTab ( id : ProjectionType ) {
402
- this . currentProjection = id ;
403
402
const tab = this . $$ ( '.ink-tab[data-tab="' + id + '"]' ) as HTMLElement ;
404
403
const allTabs = this . root ?. querySelectorAll ( '.ink-tab' ) ;
405
404
if ( allTabs ) {
@@ -434,19 +433,23 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
434
433
if ( this . polymerChangesTriggerReprojection === false ) {
435
434
return ;
436
435
}
437
- if ( projection === 'pca' ) {
436
+ if ( this . currentProjection !== projection ) {
437
+ this . currentProjection = projection ;
438
438
if ( this . dataSet != null ) {
439
- this . dataSet . stopTSNE ( ) ;
439
+ if ( projection === 'tsne' ) {
440
+ this . dataSet . tSNEShouldPause = false ;
441
+ } else {
442
+ this . dataSet . tSNEShouldPause = true ;
443
+ }
440
444
}
445
+ }
446
+ if ( projection === 'pca' ) {
441
447
this . showPCA ( ) ;
442
448
} else if ( projection === 'tsne' ) {
443
449
this . showTSNE ( ) ;
444
450
} else if ( projection === 'umap' ) {
445
451
this . showUmap ( ) ;
446
452
} else if ( projection === 'custom' ) {
447
- if ( this . dataSet != null ) {
448
- this . dataSet . stopTSNE ( ) ;
449
- }
450
453
this . computeAllCentroids ( ) ;
451
454
this . reprojectCustom ( ) ;
452
455
}
@@ -489,6 +492,7 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
489
492
( iteration : number ) => {
490
493
if ( iteration != null ) {
491
494
this . runTsneButton . disabled = false ;
495
+ this . pauseTsneButton . innerText = 'Pause' ;
492
496
this . pauseTsneButton . disabled = false ;
493
497
this . iterationLabelTsne . innerText = '' + iteration ;
494
498
this . projector . notifyProjectionPositionsUpdated ( ) ;
0 commit comments