Skip to content

Commit

Permalink
Merge branch 'main' into fix/bump-three
Browse files Browse the repository at this point in the history
  • Loading branch information
frasercl committed Dec 10, 2024
2 parents a57a7b1 + 5c6deca commit ef00ef1
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 39 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,29 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v3.9.0](https://github.com/simularium/simularium-viewer/compare/v3.8.4...v3.9.0)

- Bounding box toggle in tweakpane [`#434`](https://github.com/simularium/simularium-viewer/pull/434)
- testbed file organization [`#429`](https://github.com/simularium/simularium-viewer/pull/429)
- fix test bed download button [`#427`](https://github.com/simularium/simularium-viewer/pull/427)
- remove pauseOn property [`#425`](https://github.com/simularium/simularium-viewer/pull/425)
- Caching: remove vis data workers [`#420`](https://github.com/simularium/simularium-viewer/pull/420)
- Caching: refactor, memory improvements, trimming [`#411`](https://github.com/simularium/simularium-viewer/pull/411)
- Bump webpack from 5.90.3 to 5.95.0 in /examples [`#418`](https://github.com/simularium/simularium-viewer/pull/418)
- Bump cookie and express in /examples [`#421`](https://github.com/simularium/simularium-viewer/pull/421)
- Bump webpack from 5.90.3 to 5.94.0 [`#408`](https://github.com/simularium/simularium-viewer/pull/408)
- update dependencies: typescript, three, jest [`#416`](https://github.com/simularium/simularium-viewer/pull/416)
- Bump express from 4.19.2 to 4.21.0 in /examples [`#414`](https://github.com/simularium/simularium-viewer/pull/414)
- remove unused references to colorchange interface [`#410`](https://github.com/simularium/simularium-viewer/pull/410)
- code cleanup: dragAndDrop and JSON caching code [`#409`](https://github.com/simularium/simularium-viewer/pull/409)
- npm won't install anything until I bump ts-jest [`19fa8f6`](https://github.com/simularium/simularium-viewer/commit/19fa8f6ffdb2ad56fbcee70649098ef54ada4476)
- more package wrangling to fix tests (where was lodash?!) [`efa53fc`](https://github.com/simularium/simularium-viewer/commit/efa53fcf64e770c38fb036b1d5561c62450c8284)
- bump rimraf too, since it was complaining [`bce9f7e`](https://github.com/simularium/simularium-viewer/commit/bce9f7edc9762c10e9c321709d1751e871bf12e7)

#### [v3.8.4](https://github.com/simularium/simularium-viewer/compare/v3.8.3...v3.8.4)

> 22 August 2024
- Feature/session colors [`#400`](https://github.com/simularium/simularium-viewer/pull/400)
- export AgentData type properly from /types and / simularium [`#401`](https://github.com/simularium/simularium-viewer/pull/401)
- Bump ws from 7.5.9 to 7.5.10 [`#399`](https://github.com/simularium/simularium-viewer/pull/399)
Expand Down
39 changes: 18 additions & 21 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
module.exports = (api) => {
const isTest = api.env("test");
return {
plugins: [
"@babel/plugin-transform-class-properties",
"const-enum",
"@babel/plugin-transform-runtime",
],
presets: [
["@babel/preset-env", { modules: false }],
"@babel/preset-typescript",
"@babel/preset-react",
],
env: {
es: {
presets: [["@babel/preset-env", { modules: false }]],
},
test: {
presets: [["@babel/preset-env", { modules: "auto" }]],
},
module.exports = {
plugins: [
"@babel/plugin-transform-class-properties",
"const-enum",
"@babel/plugin-transform-runtime",
],
presets: [
["@babel/preset-env", { modules: false }],
"@babel/preset-typescript",
"@babel/preset-react",
],
env: {
es: {
presets: [["@babel/preset-env", { modules: false }]],
},
};
test: {
presets: [["@babel/preset-env", { modules: "auto" }]],
},
},
};
4 changes: 2 additions & 2 deletions examples/src/Components/AgentMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ const AgentMetadata = ({ agentData }: AgentMetadataProps): JSX.Element => {
<div> uniqueID: {agentData.instanceId}</div>
<div> agentType: {agentData.type}</div>
<div>
position: x = {agentData.x}, y = {agentData.y}, z ={agentData.z}
position: x = {agentData.x}, y = {agentData.y}, z = {agentData.z}
</div>
<div>
rotation: x = {agentData.xrot}, y = {agentData.yrot}, z =
rotation: x = {agentData.xrot}, y = {agentData.yrot}, z ={" "}
{agentData.zrot}
</div>
<div> radius: {agentData.cr}</div>
Expand Down
4 changes: 2 additions & 2 deletions examples/src/Components/ConversionForm/InputSwitch.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { map } from "lodash";
import React from "react";
import BaseInput from "./BaseInput"
import CollectionInput from "./CollectionInput"
import BaseInput from "./BaseInput";
import CollectionInput from "./CollectionInput";

interface InputSwitchProps {
handler: (path: string[], key: string, value: any) => void;
Expand Down
2 changes: 1 addition & 1 deletion examples/src/Components/ConversionForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { map } from "lodash";
import React from "react";
import InputSwitch from "./InputSwitch"
import InputSwitch from "./InputSwitch";

interface InputFormProps {
template: { [key: string]: any };
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aics/simularium-viewer",
"version": "3.8.4",
"version": "3.9.0",
"description": "An npm package to view simulations.",
"main": "es/index.js",
"type": "module",
Expand Down
1 change: 1 addition & 0 deletions src/test/DummyRemoteSimulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export class DummyRemoteSimulator extends RemoteSimulator {
this.frameCounter = frameNumber;

const msg: NetMessage = JSON.parse(this.getDataBundle(frameNumber));
this.frameCounter++;
this.onJsonIdVisDataArrive(msg);
}, this.commandLatencyMS);
}
Expand Down
21 changes: 11 additions & 10 deletions src/visGeometry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class VisGeometry {
public hemiLight: HemisphereLight;
public boundingBox!: Box3;
public boundingBoxMesh!: Box3Helper;
public showBounds: boolean;
public tickMarksMesh!: LineSegments;
public tickIntervalLength: number;
// front and back of transformed bounds in camera space
Expand Down Expand Up @@ -227,6 +228,7 @@ class VisGeometry {
this.instancedMeshGroup.name = "instanced meshes for agents";
this.scene.add(this.instancedMeshGroup);

this.showBounds = true;
this.resetBounds(DEFAULT_VOLUME_DIMENSIONS);

this.dl = new DirectionalLight(0xffffff, 0.6);
Expand Down Expand Up @@ -439,6 +441,7 @@ class VisGeometry {
g: this.backgroundColor.g * 255,
b: this.backgroundColor.b * 255,
},
showBounds: true,
};

this.gui.addInput(settings, "bgcolor").on("change", (event) => {
Expand All @@ -448,6 +451,9 @@ class VisGeometry {
event.value.b / 255.0,
]);
});
this.gui.addInput(settings, "showBounds").on("change", (event) => {
this.setShowBounds(event.value);
});
this.gui.addButton({ title: "Capture Frame" }).on("click", () => {
this.render(0);
const dataUrl =
Expand Down Expand Up @@ -1064,8 +1070,8 @@ class VisGeometry {
);

// final pass, add extra stuff on top: bounding box and line paths
this.boundingBoxMesh.visible = true;
this.tickMarksMesh.visible = true;
this.boundingBoxMesh.visible = this.showBounds;
this.tickMarksMesh.visible = this.showBounds;
this.agentPathGroup.visible = true;

this.threejsrenderer.autoClear = false;
Expand Down Expand Up @@ -1241,7 +1247,6 @@ class VisGeometry {
boundsAsTuple: Bounds
): void {
const [minX, minY, minZ, maxX, maxY, maxZ] = boundsAsTuple;
const visible = this.tickMarksMesh ? this.tickMarksMesh.visible : true;

const longestEdgeLength = Math.max(...volumeDimensions);
// Use the length of the longest bounding box edge to determine the tick interval (scale bar) length
Expand Down Expand Up @@ -1371,14 +1376,11 @@ class VisGeometry {
color: BOUNDING_BOX_COLOR,
});
this.tickMarksMesh = new LineSegments(lineGeometry, lineMaterial);
this.tickMarksMesh.visible = visible;
this.tickMarksMesh.visible = this.showBounds;
}

public createBoundingBox(boundsAsTuple: Bounds): void {
const [minX, minY, minZ, maxX, maxY, maxZ] = boundsAsTuple;
const visible = this.boundingBoxMesh
? this.boundingBoxMesh.visible
: true;
this.boundingBox = new Box3(
new Vector3(minX, minY, minZ),
new Vector3(maxX, maxY, maxZ)
Expand All @@ -1387,7 +1389,7 @@ class VisGeometry {
this.boundingBox,
BOUNDING_BOX_COLOR
);
this.boundingBoxMesh.visible = visible;
this.boundingBoxMesh.visible = this.showBounds;
}

public resetBounds(volumeDimensions?: number[]): void {
Expand Down Expand Up @@ -1873,8 +1875,7 @@ class VisGeometry {
}

public setShowBounds(showBounds: boolean): void {
this.boundingBoxMesh.visible = showBounds;
this.tickMarksMesh.visible = showBounds;
this.showBounds = showBounds;
}

public showPathForAgent(id: number, visible: boolean): void {
Expand Down

0 comments on commit ef00ef1

Please sign in to comment.