ugurdogrusoz / visuall

Visuall: A tool for convenient construction of a web based visual analysis component
2 stars 0 forks source link

Cannot load JSON file on top of sample data #347

Closed ugurdogrusoz closed 3 years ago

ugurdogrusoz commented 3 years ago
canbax commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.