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

Redesign Home Interaction #555

Merged
merged 26 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0985748
First draft of home page redesign
garrettmflynn Dec 28, 2023
998f1ed
Add group labels to sidebar
garrettmflynn Dec 28, 2023
f56c373
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 28, 2023
4b1b8c8
Hide home button
garrettmflynn Dec 28, 2023
a495cfe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 28, 2023
5323f30
Update nav.css
garrettmflynn Dec 28, 2023
96153f0
Update nav.css
garrettmflynn Dec 28, 2023
1231391
Merge branch 'sidebar-labels' of https://github.com/NeurodataWithoutB…
garrettmflynn Dec 28, 2023
69830fb
Merge branch 'sidebar-labels' into home-redesign
garrettmflynn Dec 28, 2023
b350655
Style and text changes to front page
rly Jan 3, 2024
869f7c6
Merge branch 'main' into home-redesign
garrettmflynn Jan 8, 2024
e660269
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 8, 2024
f7d8119
Link to documentation page and update docs. Rename sidebar items
garrettmflynn Jan 8, 2024
bf5caf3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 8, 2024
4598e9d
Merge branch 'main' into home-redesign
CodyCBakerPhD Jan 9, 2024
893a6c6
Merge branch 'main' into home-redesign
CodyCBakerPhD Jan 10, 2024
c5210b0
Adjust resume function
garrettmflynn Jan 10, 2024
656c8cb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 10, 2024
2a1891d
Update stories
garrettmflynn Jan 10, 2024
422f909
Fix source data story
garrettmflynn Jan 10, 2024
86d7990
Update src/renderer/src/stories/pages/guided-mode/GuidedHome.js
garrettmflynn Jan 10, 2024
4d55f24
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 10, 2024
534d2a1
Update GuidedHome.js
garrettmflynn Jan 10, 2024
eed0b17
Update GuidedHome.js
garrettmflynn Jan 10, 2024
09a7ccc
Merge branch 'home-redesign' of https://github.com/NeurodataWithoutBo…
garrettmflynn Jan 10, 2024
577a5d4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 10, 2024
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
6 changes: 3 additions & 3 deletions src/renderer/assets/css/guided.css
Original file line number Diff line number Diff line change
Expand Up @@ -807,17 +807,17 @@ h1.guided--text-sub-step {
display: flex;
flex-direction: column;
}
.container--dashed {
.create-button {
cursor: pointer;
display: flex;
justify-content: center;
flex-wrap: wrap;
padding: 20px 10px;
margin: 5px;
border: 1px dashed #ccc;
border-radius: 5px;
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
}
.container--dashed:hover {
.create-button:hover {
background-color: whitesmoke;
}
.remove-left-border {
Expand Down
11 changes: 9 additions & 2 deletions src/renderer/assets/css/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,24 @@ a[data-toggle="collapse"] {
display: flex;
flex-direction: column;
justify-content: space-between;
overflow-y: hidden;
overflow-y: auto;
margin-top: 15px;
flex-grow: 1;
border-top: 1px solid #8f8f8f;
}

#main-nav .sidebar-body > *:last-child {
border-top: 1px solid #8f8f8f;
padding-top: 10px;
position: sticky;
bottom: 0;
background: var(--color-sidebar);
}

#main-nav ul.components {
background: var(--color-sidebar);
padding: 3px;
padding-top: 8px;
border-top: 1px solid #8f8f8f;
}

#main-nav .sidebar-body > *:last-child h4 {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/assets/css/section.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ nwb-main h1 {

nwb-main h3 {
padding-bottom: 30px;
font-size: 16px;
font-size: 18px;
}
40 changes: 7 additions & 33 deletions src/renderer/src/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ dashboard.renderNameInSidebar = false;

const resourcesGroup = "Resources";

const overviewIcon = `
<svg
style="margin-right: 30px; margin-bottom: -5px"
width="20px"
height="20px"
viewBox="0 0 16 16"
class="bi bi-caret-right-square-fill"
fill="white"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5.5 10a.5.5 0 0 0 .832.374l4.5-4a.5.5 0 0 0 0-.748l-4.5-4A.5.5 0 0 0 5.5 4v8z"
></path>
</svg>
`;

const guidedIcon = `
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -99,15 +82,9 @@ style="margin-right: 30px; margin-bottom: -5px"
`;

const pages = {
"/": new GettingStartedPage({
label: "Home",
icon: overviewIcon,
hidden: true,
}),
conversion: new GuidedHomePage({
label: "Conversions",
"/": new GuidedHomePage({
label: "Convert",
icon: guidedIcon,
group: "Workflows",
pages: {
start: new GuidedStartPage({
label: "Start",
Expand Down Expand Up @@ -177,20 +154,17 @@ const pages = {
}),
},
}),
inspect: new InspectPage({
label: "Inspect",
validate: new InspectPage({
label: "Validate",
icon: inspectIcon,
group: "Workflows",
}),
preview: new PreviewPage({
label: "Neurosift",
explore: new PreviewPage({
label: "Explore",
icon: neurosiftIcon,
group: "Workflows",
}),
uploads: new UploadsPage({
label: "Uploads",
label: "Upload",
icon: uploadIcon,
group: "Workflows",
}),
tutorial: new TutorialPage({
label: "Tutorial",
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/src/progress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,16 @@ export const get = (name) => {
return exists ? JSON.parse(fs ? fs.readFileSync(progressFilePath) : localStorage.getItem(progressFilePath)) : {};
};

const oldConversionsPath = "conversion";
export function resume(name) {
const global = this ? this.load(name) : get(name);

const commandToResume = global["page-before-exit"] || "conversion/start";
let commandToResume = global["page-before-exit"] || "//start";
updateURLParams({ project: name });

if (commandToResume.slice(0, oldConversionsPath.length) === oldConversionsPath)
commandToResume = `/${commandToResume.slice(oldConversionsPath.length)}`;

if (this) this.onTransition(commandToResume);

return commandToResume;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/stories/pages/contact-us/Contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class ContactPage extends Page {
}

updated() {
let contact_lottie_container = (this ?? this.shadowRoot).querySelector("#contact-us-lottie");
let contact_lottie_container = (this.shadowRoot ?? this).querySelector("#contact-us-lottie");
startLottie(contact_lottie_container, contact_lottie);
}

Expand Down
159 changes: 100 additions & 59 deletions src/renderer/src/stories/pages/documentation/Documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,71 +17,112 @@ export class DocumentationPage extends Page {
}

updated() {
let doc_lottie = (this ?? this.shadowRoot).querySelector("#documentation-lottie");
let doc_lottie = (this.shadowRoot ?? this).querySelector("#documentation-lottie");

startLottie(doc_lottie, docu_lottie);
const svg = doc_lottie.querySelector("svg");
console.log(svg);
svg.setAttribute("viewBox", "50 100 300 200");

doc_lottie.style.marginBottom = "20px";

const container = (this.shadowRoot ?? this).querySelector(".document-content");
container.style.height = "200px";
}

render() {
return html`
<div class="documentation_container">
<div class="document_container">
<div class="doc_container">
<div class="dc_con">
<div class="document-content">
<div id="documentation-lottie" class="documentation-lottie_style"></div>
${new Button({
label: "NWB GUIDE Documentation",
onClick: () => {
window.open("https://nwb-guide.readthedocs.io/en/latest/");
},
})}
</div>
<div class="docu-content-container">
<h3 style="padding: 0; margin-top: 25px;">Additional Resources</h3>
<p>
Conversion to NWB is powered by
<a target="_blank" href="https://neuroconv.readthedocs.io/">NeuroConv</a>.
</p>
<p>
Inspection of NWB files is powered by
<a target="_blank" href="https://nwbinspector.readthedocs.io/">NWB Inspector</a>.
</p>
<p>
<a target="_blank" href="https://github.com/flatironinstitute/neurosift"
>Neurosift</a
>
is an interactive data visualization tool created by Jeremy Magland at the Flatiron
Institute.
</p>
<p>
For help on creating a Dandiset and uploading to DANDI, please see the
<a target="_blank" href="https://www.dandiarchive.org/handbook/13_upload/"
>DANDI Documentation</a
>.
</p>
<p>
To learn more about NWB, please see the
<a target="_blank" href="https://nwb-overview.readthedocs.io/"
>NWB Overview Documentation</a
>.
</p>

<h3 style="padding: 0; margin-top: 25px;">Acknowledgments</h3>
<p>
<small>
NWB GUIDE is an open-source project developed by CatalystNeuro (Cody Baker,
Garrett Flynn, Ben Dichter) and Lawrence Berkeley National Laboratory (Ryan Ly,
Oliver Ruebel) and generously supported by
<a target="_blank" href="https://www.kavlifoundation.org/"
>The Kavli Foundation</a
>.
</small>
</p>
</div>
</div>
</div>
</div>
<p>
The NWB GUIDE walks users step-by-step through all the requirements for converting their data to the NWB
format and uploading datasets to the DANDI Archive. Each stage is designed to conveniently guide users
through the conversion process and include all necessary information such that no prior knowledge of the
NWB data standard is required.
</p>

<div class="document-content">
<div id="documentation-lottie" class="documentation-lottie_style"></div>
${new Button({
label: "NWB GUIDE Official Documentation",
onClick: () => {
window.open("https://nwb-guide.readthedocs.io/en/latest/");
},
})}
</div>

<h3 style="padding: 0; margin-top: 25px;">Getting Started</h3>
<h4 style="margin-top: 0;">Converting your data</h4>
<p>Most users will want to start with the <a @click=${(ev) => {
ev.preventDefault();
this.to("tutorial");
}}>Tutorial</a> to learn how to use the NWB GUIDE.</p>
<p>If you'd like to jump right in, head to the <a @click=${(ev) => {
ev.preventDefault();
this.to("/");
}}>Convert</a> page and click "Create a new conversion pipeline" to begin your own custom conversion.</p>

<h4>Standalone Utilities</h4>
<p>For users who are already familiar with the NWB format, the NWB GUIDE also provides standalone utilities for validating, exploring, and uploading existing NWB files.</p>

<h5>Validating your data</h5>
<p>Visit the <a @click=${(ev) => {
ev.preventDefault();
this.to("validate");
}}>Validate</a> page to validate your NWB files against Best Practices.</p>

<h5>Exploring your data</h5>
<p>Visit the <a @click=${(ev) => {
ev.preventDefault();
this.to("explore");
}}>Explore</a> page to explore your NWB files and view their contents using Neurosift.</p>

<h5>Uploading your data</h5>
<p>Visit the <a @click=${(ev) => {
ev.preventDefault();
this.to("dandiset");
}}>Upload</a> page to create dandisets and share your files on the DANDI Archive</p>


<h3 style="padding: 0; margin-top: 25px;">Additional Resources</h3>
<p>
Conversion to NWB is powered by
<a target="_blank" href="https://neuroconv.readthedocs.io/">NeuroConv</a>.
</p>
<p>
Inspection of NWB files is powered by
<a target="_blank" href="https://nwbinspector.readthedocs.io/">NWB Inspector</a>.
</p>
<p>
<a target="_blank" href="https://github.com/flatironinstitute/neurosift"
>Neurosift</a
>
is an interactive data visualization tool created by Jeremy Magland at the Flatiron
Institute.
</p>
<p>
For help on creating a Dandiset and uploading to DANDI, please see the
<a target="_blank" href="https://www.dandiarchive.org/handbook/13_upload/"
>DANDI Documentation</a
>.
</p>
<p>
To learn more about NWB, please see the
<a target="_blank" href="https://nwb-overview.readthedocs.io/"
>NWB Overview Documentation</a
>.
</p>

<h3 style="padding: 0; margin-top: 25px;">Acknowledgments</h3>
<p>
<small>
NWB GUIDE is an open-source project developed by CatalystNeuro (Cody Baker,
Garrett Flynn, Ben Dichter) and Lawrence Berkeley National Laboratory (Ryan Ly,
Oliver Ruebel) and generously supported by
<a target="_blank" href="https://www.kavlifoundation.org/"
>The Kavli Foundation</a
>.
</small>
</p>
<br>
</div>
`;
}
Expand Down
31 changes: 18 additions & 13 deletions src/renderer/src/stories/pages/guided-mode/GuidedHome.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import * as progress from "../../../progress/index.js";
import { newDataset } from "../../../../assets/lotties/index.js";

export class GuidedHomePage extends Page {
header = {
title: "Your Conversions",
subtitle: "Start new conversions and resume existing ones.",
};

constructor(...args) {
super(...args);
}
Expand Down Expand Up @@ -183,14 +178,24 @@ export class GuidedHomePage extends Page {
render() {
return html`
<div id="curate-new-home" style="display:flex; flex-direction:column; align-items: center">
<p>
The NWB GUIDE walks users step-by-step through all the requirements for converting their data to the
NWB format and uploading datasets to the DANDI Archive. Each stage is designed to conveniently guide
users through the conversion process and include all necessary information such that no prior
knowledge of the NWB data standard is required.
</p>

<div class="container--dashed" @click="${() => this.to(1)}">
<div style="padding-bottom: 20px;">
<h3 style="margin-bottom: 0; padding-bottom: 0;">
Your one-stop tool for converting data to NWB and uploading it to the DANDI Archive.
</h3>
<small
>Don't know where to go next? Learn more about the NWB GUIDE
<a
href=""
@click="${(clickEvent) => {
clickEvent.preventDefault();
this.to("docs");
}}"
>here</a
>.</small
garrettmflynn marked this conversation as resolved.
Show resolved Hide resolved
>
</div>

<div class="create-button" @click="${() => this.to(1)}">
<div id="new-dataset-lottie-container" style="height: 150px; width: 150px"></div>
<h2 class="guided--text-sub-step" style="width: 100%;">Create a new conversion pipeline</h2>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/stories/pages/inspect/InspectPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class InspectPage extends Page {
}

header = {
title: "NWB Inspector Report",
subtitle: "This page allows you to inspect NWB files using the NWB Inspector.",
title: "NWB File Validation",
subtitle: "Inspect NWB files using the NWB Inspector.",
};

showReport = async (value) => {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/stories/pages/preview/PreviewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { baseUrl } from "../../../server/globals";

export class PreviewPage extends Page {
header = {
title: "Neurosift File Visualization",
subtitle: "Explore your NWB file using Neurosift.",
title: "NWB File Exploration",
subtitle: "Visualize your NWB file using Neurosift.",
};

constructor(...args) {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/stories/pages/uploads/UploadsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ export async function uploadToDandi(info, type = "project" in info ? "project" :

export class UploadsPage extends Page {
header = {
title: "DANDI Uploads",
subtitle: "This page allows you to upload folders with NWB files to the DANDI Archive.",
title: "NWB File Uploads",
subtitle: "Upload folders and individual NWB files to the DANDI Archive.",
controls: [
new Button({
icon: keyIcon,
Expand Down
Loading
Loading