From a678d304956e0fc09c3ad7a0bc5597390a0f5b04 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Wed, 30 Oct 2024 09:10:52 -0700 Subject: [PATCH 01/36] remove pauseOn property (#425) --- README.md | 3 +-- examples/src/Viewer.tsx | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 79ce22f4..0e4a020a 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,7 @@ class Viewer extends React.Component { this.viewerRef = React.createRef(); this.state = { - highlightId: -1, - pauseOn: -1, + highlightId: -1, particleTypeIds: [], currentFrame: 0, currentTime: 0, diff --git a/examples/src/Viewer.tsx b/examples/src/Viewer.tsx index e40b65c6..2f5f9d6e 100644 --- a/examples/src/Viewer.tsx +++ b/examples/src/Viewer.tsx @@ -84,7 +84,6 @@ const agentColors = [ interface ViewerState { renderStyle: RenderStyle; - pauseOn: number; particleTypeNames: string[]; particleTypeTags: string[]; currentFrame: number; @@ -149,7 +148,6 @@ let currentTime = 0; const initialState: ViewerState = { renderStyle: RenderStyle.WEBGL2_PREFERRED, - pauseOn: -1, particleTypeNames: [], particleTypeTags: [], currentFrame: 0, @@ -429,9 +427,8 @@ class Viewer extends React.Component { this.setState({ initialPlay: false, firstFrameTime: currentTime }); } this.setState({ currentFrame, currentTime }); - if (this.state.pauseOn === currentFrame) { + if (currentFrame < 0) { simulariumController.pause(); - this.setState({ pauseOn: -1 }); } } From 3f344f8e6d16ee09147bfefd155574fd36a40eb4 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Thu, 7 Nov 2024 10:30:45 -0800 Subject: [PATCH 02/36] fix test bed download button (#427) * use arrow function to maintain state context for download function in test bed * use explicit binding of this, instead of arrow function in downloadFile --- examples/src/Viewer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/src/Viewer.tsx b/examples/src/Viewer.tsx index 2f5f9d6e..3f10b358 100644 --- a/examples/src/Viewer.tsx +++ b/examples/src/Viewer.tsx @@ -942,7 +942,7 @@ class Viewer extends React.Component { > Get available metrics - +