-
Notifications
You must be signed in to change notification settings - Fork 2
Update README.md #6
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
Open
a-shilin
wants to merge
1
commit into
MaayanLab:main
Choose a base branch
from
a-shilin:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,28 +1,133 @@ | ||||||||||||||
| # CFDE Navigation Wheel | ||||||||||||||
|
|
||||||||||||||
| The **CFDE Navigation Wheel** is a reusable UI component that renders an interactive navigation wheel for the *Common Fund Data Ecosystem (CFDE)*, allowing users to visually explore CFDE portal links and resources. | ||||||||||||||
|
|
||||||||||||||
| This package adds the CFDE Navigation Wheel to your site: | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
| ## Features | ||||||||||||||
|
|
||||||||||||||
| - Embeddable React/JavaScript component | ||||||||||||||
| - Designed to integrate seamlessly into modern web apps | ||||||||||||||
| - Provides visual navigation consistent with CFDE branding | ||||||||||||||
| - Includes Storybook for local development and preview | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Installation | ||||||||||||||
|
|
||||||||||||||
| ### Prerequisites | ||||||||||||||
|
|
||||||||||||||
| Before installing, ensure you have: | ||||||||||||||
|
|
||||||||||||||
| - **Node.js ≥ 14** | ||||||||||||||
| - **npm** or **yarn** | ||||||||||||||
| - A project that supports npm modules (e.g. React, Next.js) | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ### Install from GitHub | ||||||||||||||
|
|
||||||||||||||
| This package is **not published to npm**. Install it directly from GitHub. | ||||||||||||||
|
|
||||||||||||||
| Using SSH: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| npm install git+ssh://github.com/MaayanLab/cfde-wheel.git | ||||||||||||||
| ``` | ||||||||||||||
| npm install git+ssh://github.com/MaayanLab/cfde-wheel | ||||||||||||||
|
|
||||||||||||||
| Using HTTPS: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| npm install https://github.com/MaayanLab/cfde-wheel.git | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| > This package is written in TypeScript. Make sure your build setup supports TypeScript dependencies. | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Usage | ||||||||||||||
|
|
||||||||||||||
| ### React / Next.js | ||||||||||||||
|
|
||||||||||||||
| ```jsx | ||||||||||||||
| import CFDEWheel from "cfde-wheel"; | ||||||||||||||
|
|
||||||||||||||
| export default function MyApp() { | ||||||||||||||
| return <CFDEWheel />; | ||||||||||||||
| } | ||||||||||||||
| ``` | ||||||||||||||
| import CFDEWheel from 'cfde-wheel' | ||||||||||||||
|
|
||||||||||||||
| export const MyComponent = () => { | ||||||||||||||
| return <CFDEWheel/> | ||||||||||||||
| ### Next.js (App Router) Notes | ||||||||||||||
|
|
||||||||||||||
| If you are using **Next.js with the App Router**, mark the component as a client component: | ||||||||||||||
|
|
||||||||||||||
| ```jsx | ||||||||||||||
| 'use client'; | ||||||||||||||
|
|
||||||||||||||
| import CFDEWheel from "cfde-wheel"; | ||||||||||||||
|
|
||||||||||||||
| export default function Home() { | ||||||||||||||
| return <CFDEWheel />; | ||||||||||||||
| } | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| Note for Next.js: This is a client component so you need to add `'use client'` in the file. | ||||||||||||||
| This component relies on browser APIs and must be rendered on the client. | ||||||||||||||
|
|
||||||||||||||
| ## Run Storybook | ||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Development | ||||||||||||||
|
|
||||||||||||||
| To work on the component locally: | ||||||||||||||
|
|
||||||||||||||
| ### Install Dependencies | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| npm install | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| ### Run Storybook | ||||||||||||||
|
|
||||||||||||||
| Storybook is included for local development and UI preview: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| npm run storybook | ||||||||||||||
| ``` | ||||||||||||||
| This should open `http://localhost:6006/` where you can view the component. | ||||||||||||||
|
|
||||||||||||||
| This will start Storybook (usually at `http://localhost:6006`) where you can view and interact with the navigation wheel in isolation. | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Build | ||||||||||||||
|
|
||||||||||||||
| To build the component: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| npm run build | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| This will generate the production build output (typically in a `dist/` directory). | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Alternative: Browser Embed | ||||||||||||||
|
|
||||||||||||||
| If you need a **browser-ready, non-React embed**, see the related repository: | ||||||||||||||
|
|
||||||||||||||
| - https://github.com/TACC/cfde-wheel-embed | ||||||||||||||
|
Comment on lines
+115
to
+117
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the mention. Technically, TACC/cfde-wheel-embed uses React; but embeds it so end user need not.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| That project provides a bundled version of the wheel that can be embedded via a `<script>` tag. | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Example Layout Usage | ||||||||||||||
|
|
||||||||||||||
| ```jsx | ||||||||||||||
| function Sidebar() { | ||||||||||||||
| return ( | ||||||||||||||
| <aside> | ||||||||||||||
| <CFDEWheel /> | ||||||||||||||
| </aside> | ||||||||||||||
|
Comment on lines
+128
to
+130
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good choice of element ( |
||||||||||||||
| ); | ||||||||||||||
| } | ||||||||||||||
| ``` | ||||||||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Opinion) These
---seem superfluous, and add extra space noticeable by users with small screens or resolutions. I propose relying on the headers alone to signal a new section, not adding---.