-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/network graph #597
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
Draft
aswallace
wants to merge
18
commits into
main
Choose a base branch
from
feature/network-graph
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.
Draft
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
541b5fe
Create a network graph component with reactflow and dagre
aswallace 585678c
Set up database service to be able to process provenance source
aswallace cec133c
Install reactflow and dagre
aswallace ac942af
Create provenance state branch
aswallace 7869372
Add a full-screen modal for the network graph
aswallace e384897
Modify the data source modal to upload provenance data
aswallace 8e1d536
Update description for provenance modal
aswallace 25f2312
Include provenance source in search params
aswallace 8201b51
Fix broken searchparams unit tests
aswallace 964f165
Add comments to custom graph edge
aswallace 45315a6
Remove unnecessary undefined row check
aswallace 79303c5
Make full screen modal take up more vertical space
aswallace 65e3885
Use uid instead of optional id
aswallace 3941d4f
Move graph construction step to load later
aswallace 673320f
Merge branch 'main' of github.com:AllenInstitute/biofile-finder into …
aswallace 4d0de23
Add custom file nodes
aswallace 2adb818
Allow markdown rendering in graph edges
aswallace 7836f08
Merge branch 'main' of github.com:AllenInstitute/biofile-finder into …
aswallace 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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 |
|---|---|---|
|
|
@@ -8,14 +8,15 @@ import FileAnnotationList from "./FileAnnotationList"; | |
| import Pagination from "./Pagination"; | ||
| import useFileDetails from "./useFileDetails"; | ||
| import { PrimaryButton } from "../Buttons"; | ||
| import { ModalType } from "../Modal"; | ||
| import Tooltip from "../Tooltip"; | ||
| import { ROOT_ELEMENT_ID } from "../../App"; | ||
| import FileThumbnail from "../../components/FileThumbnail"; | ||
| import AnnotationName from "../../entity/Annotation/AnnotationName"; | ||
| import annotationFormatterFactory, { AnnotationType } from "../../entity/AnnotationFormatter"; | ||
| import useOpenWithMenuItems from "../../hooks/useOpenWithMenuItems"; | ||
| import { MAX_DOWNLOAD_SIZE_WEB } from "../../services/FileDownloadService"; | ||
| import { interaction } from "../../state"; | ||
| import { interaction, provenance } from "../../state"; | ||
|
|
||
| import styles from "./FileDetails.module.css"; | ||
|
|
||
|
|
@@ -127,7 +128,7 @@ export default function FileDetails(props: Props) { | |
| } | ||
| } | ||
| } | ||
| }, [fileDetails, fileDownloadService, isOnWeb, isZarr]); | ||
| }, [dispatch, fileDetails, fileDownloadService, isOnWeb, isZarr]); | ||
|
|
||
| const processStatuses = useSelector(interaction.selectors.getProcessStatuses); | ||
| const openWithMenuItems = useOpenWithMenuItems(fileDetails || undefined); | ||
|
|
@@ -184,6 +185,15 @@ export default function FileDetails(props: Props) { | |
| }, 1000); // 1s, in ms (arbitrary) | ||
| }, [dispatch, fileDetails, fileDownloadService.isFileSystemAccessible]); | ||
|
|
||
| const onClickProvenance = React.useCallback(async () => { | ||
| if (!fileDetails) { | ||
| return; | ||
| } | ||
| // Start generating nodes and edges for selected file | ||
| dispatch(provenance.actions.constructProvenanceGraph(fileDetails)); | ||
| dispatch(interaction.actions.setVisibleModal(ModalType.Provenance)); | ||
| }, [dispatch, fileDetails]); | ||
|
|
||
| return ( | ||
| <div | ||
| className={classNames(styles.root, styles.expandableTransition, props.className)} | ||
|
|
@@ -237,6 +247,15 @@ export default function FileDetails(props: Props) { | |
| menuItems={openWithMenuItems} | ||
| /> | ||
| </StackItem> | ||
| <StackItem> | ||
| <PrimaryButton | ||
| className={styles.primaryButton} | ||
| text="Provenance" | ||
| title="Temporary button to display provenance graph" | ||
| onClick={onClickProvenance} | ||
| // to do: disable if no provenance source | ||
|
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. Check with UX, but if the button is still there just disabled (which might not be the best move - unsure) there should be some way to get "Help" for what that button would do |
||
| /> | ||
| </StackItem> | ||
| </Stack> | ||
| <p className={styles.fileName}>{fileDetails?.name}</p> | ||
| <h4>Information</h4> | ||
|
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Added this in for now so that I can re-use the data source prompt to upload just a provenance file on its own