Skip to content

Circuit detail view hero image preview section #307

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/circuits/ALL_CIRCUITS.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { CircuitSchemaProps } from '../type';
import HeaderDetailView from './HeaderDetailView';
import Visualiser from './visualisation/Visualiser';

export default function MainDetailViewCore({ content }: { content: CircuitSchemaProps }) {
return (
<div className="relative flex w-full flex-col text-primary-9">
<HeaderDetailView content={content} />
<Visualiser content={content} />
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use client';

import Image from 'next/image';
import { CircuitSchemaProps } from '../../type';
import placeholderImage from './circuit-preview-image_01.jpg';

export default function Visualiser({ content }: { content: CircuitSchemaProps }) {
const imageUrl = content.overview.mainDisplay[0].url;

return (
<div
id="visualiser"
className="relative my-24 flex w-full items-center justify-center overflow-hidden bg-white"
>
<Image
src={imageUrl || placeholderImage}
width={1920}
height={1080}
alt={`Image of the circuit ${content.name}`}
className="relative z-10 select-none transition-all duration-300 ease-out"
priority
/>
</div>
);
}
46 changes: 28 additions & 18 deletions src/components/explore-section/Circuit/type/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export type CircuitSchemaProps = {
key: string;
name: string;
description: string;
parent?: string;
parent?: string | null;
derivedFrom: string[];
hasSubcircuits: boolean;
brainRegion: string;
species: string;
Expand All @@ -38,11 +39,11 @@ export type CircuitSchemaProps = {
numberOfSynapses: number;
metadata: {
contributorSimple?: string;
contributor?: string;
contributor?: string | null;
contributingInstitution?: string;
registrationDate?: string;
revision: number | null;
createdBy: string;
createdBy: string | null;
creationDate: string;
license: {
name: string;
Expand All @@ -55,24 +56,33 @@ export type CircuitSchemaProps = {
key: string;
isAvailable: boolean;
}[];
subcircuits: CircuitSchemaProps[] | null;
subcircuits: CircuitSchemaProps[];

// TO BE REVISED
provenance: {
isASubcircuit: boolean;
subcircuitOf: string | null;
literature: PaperLitteratureProps[];
};
relatedPublications: PaperLitteratureProps[];
images: {
low?: string | null;
normal?: string | null;
high: string | null;
};
overview: {
cellStatistics: GraphDataImageProps[];
networkStatistics: GraphDataImageProps[];
mainDisplay: {
name: string;
url: string;
}[];
cellStatistics: {
name: string;
url: string;
}[];
networkStatistics: {
name: string;
url: string;
}[];
};

literature: {
category: string;
title: string;
authors: string;
doi: string;
url: string;
journal: string;
publicationDate: string;
abstract: string;
}[];
};

export type CircuitCellValue = {
Expand Down
Loading