Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Stories with layers exposed as controls will crash if layers are instantiated with new (as opposed to json) #1895 #1896

Merged
merged 8 commits into from
Feb 2, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ export const SyncedSubsurfaceViewers: StoryObj<
};

const zoomBox3D: BoundingBox3D = [-325, -450, -25, 125, 150, 125];
//const zoomBox3D: BoundingBox3D = [-100, -100, -100, 100, 100, 100];

const AutoZoomToBox = (args: SubsurfaceViewerProps) => {
const [rotX, setRotX] = React.useState(0);
Expand All @@ -248,6 +247,26 @@ const AutoZoomToBox = (args: SubsurfaceViewerProps) => {

const props = {
...args,
layers: [
new AxesLayer({
id: "axes",
bounds: zoomBox3D,
ZIncreasingDownwards: false,
}),
new SimpleMeshLayer({
id: "sphere",
data: [{}],
mesh: new SphereGeometry({
nlat: 100,
nlong: 100,
radius: 30,
}),
wireframe: false,
getPosition: [0, 0, 0],
getColor: [255, 255, 255],
material: true,
}),
],
cameraPosition,
};

Expand Down Expand Up @@ -284,28 +303,6 @@ const AutoZoomToBox = (args: SubsurfaceViewerProps) => {

export const AutoZoomToBoxStory: StoryObj<typeof SubsurfaceViewer> = {
args: {
id: "DeckGL-Map",
layers: [
new AxesLayer({
id: "polyhedral-cells-axes",
bounds: zoomBox3D,
ZIncreasingDownwards: false,
}),
// unfortunately, SimpleMeshLayer can not be specified as a Record<string, any> :(
new SimpleMeshLayer({
id: "sphere",
data: [{}],
mesh: new SphereGeometry({
nlat: 100,
nlong: 100,
radius: 30,
}),
wireframe: false,
getPosition: [0, 0, 0],
getColor: [255, 255, 255],
material: true,
}),
],
views: default3DViews,
},
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const volveWellsWithLogsLayer = {
logrunName: "BLOCKING",
logName: "ZONELOG",
logColor: "Stratigraphy",
ZIncreasingDownwards: false,
w1nklr marked this conversation as resolved.
Show resolved Hide resolved
};

// Examples using "Map" layers.
Expand Down
Loading