Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot load JSON file on top of sample data #347

Closed
ugurdogrusoz opened this issue Feb 3, 2021 · 7 comments
Closed

Cannot load JSON file on top of sample data #347

ugurdogrusoz opened this issue Feb 3, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@ugurdogrusoz
Copy link
Owner

  • Start Visuall with default values
  • Load Sample data
  • Then load this file:
    visuall.json.txt
    We get "Cannot process provided JSON file!". If we load it before loading Sample data it loads fine!
@ugurdogrusoz ugurdogrusoz added the bug Something isn't working label Feb 3, 2021
@canbax
Copy link
Collaborator

canbax commented Feb 3, 2021

When I load the file attached I see this
image

I think this file is from hydra.

Here when we load a JSON file, we don't delete the existing graph. So the JSON content will be added to current graph. If the existing graph contains the ones in the JSON file, we show an error. I think this could be changed.

We can skip adding the already existing elements. Or we can delete the existing graph before loading.

@ugurdogrusoz
Copy link
Owner Author

How about we ask the user if they would like to replace the existing map or merge into it? So, the dialog should contain three choices / buttons: Replace, Merge, Cancel. When merging we should skip existing ones.

@canbax
Copy link
Collaborator

canbax commented Feb 3, 2021

I think replacing the whole graph is unnecessary. The user can clear all data and then load JSON file. Here we could always merge and ask user about already existing elements. Whether we should override the existing elements or skip them.

@ugurdogrusoz
Copy link
Owner Author

I think it'd be good for convenience though. Almost all tools support this. Besides, I am not sure Data menu should be in the release.

@canbax
Copy link
Collaborator

canbax commented Feb 3, 2021

I think these buttons could be shown "Replace, Merge, Cancel" but how we are going to merge is not clear.
We can make them 4 "Replace, Merge (Skip existing), Merge (Override existing), Cancel"

@ugurdogrusoz
Copy link
Owner Author

Let's implement a checkbox "Replace existing map on merge" (true by default). If unchecked, we should merge what's in the file with what's in the canvas. When an existing element is also in the file, we should overwrite it.
The dialog could ask "Would you like to replace the existing map or merge with it?" with buttons "Replace", "Merge" and "Cancel".

canbax added a commit to iVis-at-Bilkent/cytoscape.js-expand-collapse that referenced this issue Feb 5, 2021
canbax added a commit that referenced this issue Feb 5, 2021
canbax added a commit to iVis-at-Bilkent/cytoscape.js-expand-collapse that referenced this issue Feb 5, 2021
canbax added a commit that referenced this issue Feb 5, 2021
@canbax
Copy link
Collaborator

canbax commented Feb 5, 2021

I think merging graphs with JSON (overriding existing elements or skipping) could be easy.

Inside expand-collapse extension, I tried to skip or override node or edge when it is added to cytoscape.js with function cy.add. It worked for basic graphs but when there are collapsed nodes or edges, I see some errors. I couldn't solve them.

So instead of merging here we only provided to replace the existing graph.

@canbax canbax assigned ugurdogrusoz and unassigned canbax Feb 5, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants