Skip to content

Commit 6688e46

Browse files
committed
use entitycore for meshes and point cloud
1 parent 00cc267 commit 6688e46

File tree

41 files changed

+539
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+539
-290
lines changed

.deployment-envs/.env.staging-next

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ NEXT_PUBLIC_ENTITY_CORE_PUBLIC_PROJECT_ID="0dbced5f-cc3d-488a-8c7f-cfb8ea039dc6"
2828

2929
NEXT_PUBLIC_DEFAULT_BRAIN_REGION_HIERARCHY_ID="e3e70682-c209-4cac-a29f-6fbed82c07cd"
3030
NEXT_PUBLIC_DEFAULT_SELECTED_BRAIN_REGION_ID="4642cddb-4fbe-4aae-bbf7-0946d6ada066"
31-
NEXT_PUBLIC_DEFAULT_ROOT_BRAIN_REGION_ANNOTATION_VALUE=8
31+
BASIC_CELL_GROUPS_AND_REGIONS_BRAIN_REGION_ANNOTATION_VALUE=8
32+
NEXT_PUBLIC_ROOT_BRAIN_REGION_ANNOTATION_VALUE=997
33+
NEXT_PUBLIC_ROOT_BRAIN_REGION_ID="f728b4fa-4248-4e3a-8a5d-2f346baa9455"

.env.development

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ NEXT_PUBLIC_AI_AGENT_URL="https://staging.openbraininstitute.org/api/agent/"
2424

2525
NEXT_PUBLIC_DEFAULT_BRAIN_REGION_HIERARCHY_ID="e3e70682-c209-4cac-a29f-6fbed82c07cd"
2626
NEXT_PUBLIC_DEFAULT_SELECTED_BRAIN_REGION_ID="4642cddb-4fbe-4aae-bbf7-0946d6ada066"
27-
NEXT_PUBLIC_DEFAULT_ROOT_BRAIN_REGION_ANNOTATION_VALUE=8
28-
NEXT_PUBLIC_DEFAULT_BRAIN_ATLAS_ID="a25231be-54c0-4a14-a89a-a1b1c7bd5837"
27+
NEXT_PUBLIC_BASIC_CELL_GROUPS_AND_REGIONS_BRAIN_REGION_ANNOTATION_VALUE=8
28+
NEXT_PUBLIC_DEFAULT_BRAIN_ATLAS_ID="a25231be-54c0-4a14-a89a-a1b1c7bd5837"
29+
NEXT_PUBLIC_ROOT_BRAIN_REGION_ID="f728b4fa-4248-4e3a-8a5d-2f346baa9455"
30+
NEXT_PUBLIC_ROOT_BRAIN_REGION_ANNOTATION_VALUE=997

.env.development-next

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ NEXT_PUBLIC_ENTITY_CORE_PUBLIC_PROJECT_ID="0dbced5f-cc3d-488a-8c7f-cfb8ea039dc6"
3131

3232
NEXT_PUBLIC_DEFAULT_BRAIN_REGION_HIERARCHY_ID="e3e70682-c209-4cac-a29f-6fbed82c07cd"
3333
NEXT_PUBLIC_DEFAULT_SELECTED_BRAIN_REGION_ID="4642cddb-4fbe-4aae-bbf7-0946d6ada066"
34-
NEXT_PUBLIC_DEFAULT_ROOT_BRAIN_REGION_ANNOTATION_VALUE=8
34+
NEXT_PUBLIC_BASIC_CELL_GROUPS_AND_REGIONS_BRAIN_REGION_ANNOTATION_VALUE=8
35+
NEXT_PUBLIC_ROOT_BRAIN_REGION_ID="f728b4fa-4248-4e3a-8a5d-2f346baa9455"
36+
NEXT_PUBLIC_ROOT_BRAIN_REGION_ANNOTATION_VALUE=997

src/api/apiClient.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,12 @@ class ApiClient {
337337
});
338338
return runRequest();
339339
}
340-
if (env.NEXT_PUBLIC_DEPLOYMENT_ENV !== 'production') {
341-
log('error', 'Request failed', {
342-
status: response.status,
343-
message:
344-
(responseData as any).message || `Request failed with status ${response.status}`,
345-
data: responseData,
346-
});
347-
}
340+
log('error', 'Request failed', {
341+
url: url.toString(),
342+
status: response.status,
343+
message: (responseData as any).message || `Request failed with status ${response.status}`,
344+
data: responseData,
345+
});
348346
throw Error(`Request ${request.url} failed `, {
349347
cause: {
350348
status: response.status,

src/api/entitycore/queries/general/brain-atlas.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,20 @@ export async function getBrainAtlasRegions({
104104
* @returns A promise that resolves to the brain atlas region data wrapped in an EntityCoreResponse.
105105
*/
106106
export async function getBrainAtlasRegion({
107-
id,
107+
atlasRegionId,
108108
atlasId,
109109
context,
110110
}: {
111-
id: string;
111+
atlasRegionId: string;
112112
atlasId: string;
113113
context?: WorkspaceContext | null;
114114
}) {
115115
const api = await entityCoreApi();
116-
return await api.get<EntityCoreResponse<IBrainAtlasRegion>>(
117-
`${baseUri}/${atlasId}/regions/${id}`,
118-
{
119-
headers: {
120-
accept: 'application/json',
121-
'content-type': 'application/json',
122-
...getEntityCoreContext(context).headers,
123-
},
124-
}
125-
);
116+
return await api.get<IBrainAtlasRegion>(`${baseUri}/${atlasId}/regions/${atlasRegionId}`, {
117+
headers: {
118+
accept: 'application/json',
119+
'content-type': 'application/json',
120+
...getEntityCoreContext(context).headers,
121+
},
122+
});
126123
}

src/api/entitycore/types/entities/brain-atlas.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type {
22
EntityCoreIdentifiable,
33
Timestamps,
44
ISpecies,
5+
IAsset,
56
} from '@/api/entitycore/types/shared/global';
67
import {
78
PaginationFilter,
@@ -28,6 +29,7 @@ export interface BrainAtlasRegionBase {
2829

2930
export interface IBrainAtlasRegion extends BrainAtlasRegionBase, Timestamps {
3031
id: string;
32+
assets: Array<IAsset>;
3133
}
3234

3335
export interface IBrainAtlasFilter

src/app/app/build/(main)/cell-composition/interactive/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import useLiteratureCleanNavigate from '@/components/explore-section/Literature/useLiteratureCleanNavigate';
4-
import ThreeDeeBrain from '@/components/ThreeDeeBrain';
4+
import ThreeDeeBrain from '@/features/brain-atlas-viewer';
55

66
export default function InteractiveView() {
77
useLiteratureCleanNavigate();

src/app/app/virtual-lab/lab/[virtualLabId]/project/[projectId]/(secondary)/build/me-model/new/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { unwrap } from 'jotai/utils';
88
import { useAtomValue } from 'jotai';
99

1010
import {
11-
brainRegionHierarchyAtom,
11+
brainRegionBasicCellGroupsRegionsHierarchyAtom,
1212
DEFAULT_BRAIN_REGION_ANNOTATION_FIELD,
1313
DEFAULT_BRAIN_REGION_QUERY_ID,
1414
useBrainRegionHierarchy,
@@ -41,7 +41,9 @@ export default function NewMEModelPage(props: Params) {
4141
virtualLabId,
4242
projectId,
4343
});
44-
const brainRegionHierarchy = useAtomValue(useMemo(() => unwrap(brainRegionHierarchyAtom), []));
44+
const brainRegionHierarchy = useAtomValue(
45+
useMemo(() => unwrap(brainRegionBasicCellGroupsRegionsHierarchyAtom), [])
46+
);
4547
const contributors = useAtomValue(virtualLabProjectUsersAtomFamily({ projectId, virtualLabId }))
4648
?.data?.users;
4749

src/app/app/virtual-lab/lab/[virtualLabId]/project/[projectId]/explore/interactive/layout.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ import { useSetAtom } from 'jotai';
66
import dynamic from 'next/dynamic';
77

88
import SimpleErrorComponent from '@/components/GenericErrorFallback';
9-
import SideMenu from '@/components/SideMenu';
109

1110
import { Label, Content, LinkItemKey } from '@/constants/virtual-labs/sidemenu';
1211
import { idAtom as brainModelConfigIdAtom } from '@/state/brain-model-config';
1312
import { useSetBrainRegionFromQuery } from '@/hooks/brain-region-panel';
13+
import { Container as SideMenuContainer } from '@/components/SideMenu';
1414
import { generateLabUrl } from '@/util/virtual-lab/urls';
1515
import { resolveDataKey } from '@/utils/key-builder';
1616
import { defaultModelRelease } from '@/config';
1717

1818
import type { ServerSideComponentProp, WorkspaceContext } from '@/types/common';
1919

20+
const SideMenu = dynamic(() => import('@/components/SideMenu'), {
21+
ssr: false,
22+
loading: () => <SideMenuContainer />,
23+
});
24+
2025
type Props = ServerSideComponentProp<WorkspaceContext, null> & {
2126
children: React.ReactNode;
2227
};
@@ -71,7 +76,6 @@ export default function Layout(props: Props) {
7176
/>
7277
</div>
7378
</ErrorBoundary>
74-
{/* <BrainRegionsTree /> */}
7579
<ErrorBoundary FallbackComponent={SimpleErrorComponent}>
7680
<Suspense
7781
fallback={

src/components/SideMenu/index.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
} from '@ant-design/icons';
1212
import Link from 'next/link';
1313

14+
import { ReactNode } from 'react';
1415
import HelpMenu from '@/components/HelpMenu';
1516
import UserMenu from '@/components/user-menu';
1617
import { LabItem, LinkItem, ProjectItem } from '@/components/VerticalLinks';
@@ -54,15 +55,23 @@ function ProjectLink({ project, lab }: { project: ProjectItem; lab: LabItem }) {
5455
);
5556
}
5657

57-
export default function SideMenu({ lab, project, links }: SideMenuProps) {
58-
const result = useAtomValue(unwrap(virtualLabDetailAtomFamily(lab.id)));
58+
export function Container({ children }: { children?: ReactNode }) {
5959
return (
6060
<div
6161
className={classNames(
6262
'border-primary-7 bg-primary-9 text-light sticky top-0 flex h-screen w-[45px]',
6363
'flex-col items-center justify-center gap-2 border-r-[1px] transition-transform ease-in-out will-change-auto'
6464
)}
6565
>
66+
{children}
67+
</div>
68+
);
69+
}
70+
71+
export default function SideMenu({ lab, project, links }: SideMenuProps) {
72+
const result = useAtomValue(unwrap(virtualLabDetailAtomFamily(lab.id)));
73+
return (
74+
<Container>
6675
<div className="flex w-[45px] grow flex-col items-center justify-between overflow-hidden">
6776
<div className="mt-4 flex w-full flex-col items-center gap-2 overflow-hidden">
6877
{links
@@ -119,6 +128,6 @@ export default function SideMenu({ lab, project, links }: SideMenuProps) {
119128
</Link>
120129
</div>
121130
</div>
122-
</div>
131+
</Container>
123132
);
124133
}

0 commit comments

Comments
 (0)