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