@@ -402,9 +402,8 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
402
402
this . customSelectedSearchByMetadataOption =
403
403
this . searchByMetadataOptions [ Math . max ( 0 , searchByMetadataIndex ) ] ;
404
404
}
405
- public showTab ( id : ProjectionType ) {
406
- this . currentProjection = id ;
407
- const tab = this . $$ ( '.ink-tab[data-tab="' + id + '"]' ) as HTMLElement ;
405
+ public showTab ( projection : ProjectionType ) {
406
+ const tab = this . $$ ( '.ink-tab[data-tab="' + projection + '"]' ) as HTMLElement ;
408
407
const allTabs = this . root ?. querySelectorAll ( '.ink-tab' ) ;
409
408
if ( allTabs ) {
410
409
for ( let i = 0 ; i < allTabs . length ; i ++ ) {
@@ -419,7 +418,7 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
419
418
}
420
419
}
421
420
util . classed (
422
- this . $$ ( '.ink-panel-content[data-panel="' + id + '"]' ) as HTMLElement ,
421
+ this . $$ ( '.ink-panel-content[data-panel="' + projection + '"]' ) as HTMLElement ,
423
422
'active' ,
424
423
true
425
424
) ;
@@ -432,25 +431,29 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
432
431
this . style . height = main . clientHeight + 'px' ;
433
432
} ) ;
434
433
}
435
- this . beginProjection ( id ) ;
434
+ this . beginProjection ( projection ) ;
436
435
}
437
436
private beginProjection ( projection : ProjectionType ) {
438
437
if ( this . polymerChangesTriggerReprojection === false ) {
439
438
return ;
440
439
}
441
- if ( projection === 'pca' ) {
440
+ if ( this . currentProjection !== projection ) {
441
+ this . currentProjection = projection ;
442
442
if ( this . dataSet != null ) {
443
- this . dataSet . stopTSNE ( ) ;
443
+ if ( projection === 'tsne' ) {
444
+ this . dataSet . tSNEShouldPause = false ;
445
+ } else {
446
+ this . dataSet . tSNEShouldPause = true ;
447
+ }
444
448
}
449
+ }
450
+ if ( projection === 'pca' ) {
445
451
this . showPCA ( ) ;
446
452
} else if ( projection === 'tsne' ) {
447
453
this . showTSNE ( ) ;
448
454
} else if ( projection === 'umap' ) {
449
455
this . showUmap ( ) ;
450
456
} else if ( projection === 'custom' ) {
451
- if ( this . dataSet != null ) {
452
- this . dataSet . stopTSNE ( ) ;
453
- }
454
457
this . computeAllCentroids ( ) ;
455
458
this . reprojectCustom ( ) ;
456
459
}
@@ -493,6 +496,7 @@ class ProjectionsPanel extends LegacyElementMixin(PolymerElement) {
493
496
( iteration : number ) => {
494
497
if ( iteration != null ) {
495
498
this . runTsneButton . disabled = false ;
499
+ this . pauseTsneButton . innerText = 'Pause' ;
496
500
this . pauseTsneButton . disabled = false ;
497
501
this . iterationLabelTsne . innerText = '' + iteration ;
498
502
this . projector . notifyProjectionPositionsUpdated ( ) ;
0 commit comments