cytoscape / cyjShiny

An R/shiny widget for cytoscape.js
Other
92 stars 28 forks source link

Highlight edges and neighbouring nodes on clicking a node #20

Open saksham219 opened 4 years ago

saksham219 commented 4 years ago

Great package! I was wondering if there is a way to highlight the edges of a node and its connected nodes on clicking it. Similar to http://www.htmlwidgets.org/showcase_visNetwork.html Thanks!

paul-shannon commented 4 years ago

@saksham219 Interactively (with your mouse)? or programmatically?

saksham219 commented 4 years ago

It would be good to have both. I am thinking of a dense network of nodes where the users might want to know the connection of one node to another by clicking on it or they might want to search using text for a node in a network which contains a lot of nodes.

paul-shannon commented 4 years ago

Hi Saksham,

Sorry for my delay in following up.

These capabilities are already present, pretty much… Next week I’ll have some time to create a shiny webapp demonstrating this. You might want to experiment yourself before that:

1) manual selection: shift-clicking on nodes and edges will select them one at a time 2) hide-unselected followed by fit will leave only the selected nodes and edges visible 3) selectFirstNeighbor programmatically expands the node selection 4) selection by text search works also

A quick look at the API https://github.com/cytoscape/cyjShiny/blob/master/NAMESPACE and the source code https://github.com/cytoscape/cyjShiny/blob/master/R/cyjShiny.R should clarify the currently available features - and set the stage for your suggesting new features to add.

More from me next week.

On Aug 22, 2019, at 8:40 AM, Saksham Malhotra notifications@github.com wrote:

It would be good to have both. I am thinking of a dense network of nodes where the users might want to know the connection of one node to another by clicking on it or they might want to search using text for a node in a network which contains a lot of nodes.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

paul-shannon commented 4 years ago

@oshah97 Heh Omar, here's a request I'd love to get your help on. Could you give it a look?

oshah97 commented 4 years ago

Yes, on it!


From: Paul Shannon notifications@github.com Sent: Sunday, September 1, 2019 7:40 AM To: cytoscape/cyjShiny cyjShiny@noreply.github.com Cc: Omar Shah oshah97@outlook.com; Mention mention@noreply.github.com Subject: Re: [cytoscape/cyjShiny] Highlight edges and neighbouring nodes on clicking a node (#20)

@oshah97https://github.com/oshah97 Heh Omar, here's a request I'd love to get your help on. Could you give it a look?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/cytoscape/cyjShiny/issues/20?email_source=notifications&email_token=AG7CYIVGRGKDMZE3NE4HHSTQHPH5VA5CNFSM4IOTYPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5UDXJQ#issuecomment-526924710, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AG7CYIUCCXPZMQVMHOLXNO3QHPH5VANCNFSM4IOTYPSA.

nhanvu327 commented 4 years ago

hello, any news on this ?

paul-shannon commented 4 years ago

@nhanvu327 - I will get to this (after too long!) by the end of the week. @saksham219 - apologies for letting this lapse.

nhanvu327 commented 4 years ago

thanks @paul-shannon , looking forward to it

paul-shannon commented 4 years ago

@nhanvu327 I've been slowed down a bit, needing build advice from cytoscape.js author, Max Franz. So expect delivery on this next week.

paul-shannon commented 4 years ago

@nhanvu327 - One more, sorry. Two competing deadlines I cannot ignore.

On Jun 19, 2020, at 10:50 AM, Paul Shannon notifications@github.com wrote:

@nhanvu327 I've been slowed down a bit, needing build advice from cytoscape.js author, Max Franz. So expect delivery on this next week.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

oshah97 commented 3 years ago

How is this issue coming along? Is there any thing I can do to help get this issue closed? :)

paul-shannon commented 3 years ago

Hi Omar,

Alas, I never got around to this. Then it slipped out of my memory…

So it still needs doing. Do you have some time? I can follow if you take the lead.

On Sep 15, 2020, at 4:53 PM, Omar Shah notifications@github.com wrote:

How is this issue coming along? Is there any thing I can do to help get this issue closed? :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

oshah97 commented 3 years ago

Hi Paul,

I will have a few hours a week to dedicate to this - hopefully we'll be able to get this resolved in a few weeks, and continue to add new features!

Do you remember where this particular issue was left off?

Omar

paul-shannon commented 3 years ago

Hi Omar,

Thanks for helping with this!

Here are my notes from when, in June, I left this incomplete. This process got started when I went to do a fresh build, from the bottom up, using npm and webpack to assemble a current cytoscape.js file. My npm & webpack were out of date, so those tools auto-updated. But not smoothly. Hundreds, if not thousands of separate and often cross-dependent software packages are needed. webpack has always made me nervous; when it works, I don’t really know how it works, configuration files are a mystery; when it fails I am at a loss. The fix is probably easy if you know what your are doing.

Here’s the whole thread, my conversation with the always-helpful Max Franz, author of cytoscap.js.

--- email from max franz (19 jun 2020) in answer to my stackoverflow question: simplest build system for cytoscape.js? https://stackoverflow.com/q/62417689/2041386?sem=2

--- context from me (18 jun 2020) I was actually :} hoping you could provide a full build, with all dependencies already rolled in.

Precedents for this, I believe, are

igv.js: https://github.com/igvteam/igv.js/
   igv.js consists of a single javascript file with no external dependencies. To link 
   directly to the current release copy this snippet  
     <script src="https://cdn.jsdelivr.net/npm/igv@2.5.5/dist/igv.min.js"></script>

ngl.js: https://github.com/arose/ngl/dist/

Both of these projects provide a few ready-to-go dist versions with all their dependencies included. Maybe you already provide this, and I missed it?

--- costs of js build systems

 As far as I know: If you use a typical JS build system, you’re inevitably going to install lots
 of dependencies.  Rollup has over 2,000 dependencies, for example.  Webpack has about 20,000.
 Parcel has less dependencies (about 60) and has a reputation of being much easier to use.

 I suspect that there won’t be a simple, minimalistic solution until there’s more widespread
 support for ES modules, but that technology isn’t quit mature enough yet.

--- alternatively, max suggests https://js.cytoscape.org/#getting-started/including-cytoscape.js

--- but some things missing I get stuck when trying to include the layout extensions: cytoscape.use(cola); Uncaught ReferenceError: cola is not defined at cyjShiny.js:9 htmlwidgets assumptions do not seem to include esm6, or require. Can you suggest any way that I can make use of the layout extensions in the htmlwidgets context?
I had thought that cola and the other layout extensions are already included in cytoscape.min.js, so that no further import or require would be needed…

--- max replies

You raise a good point, Paul.  I’m hesitant to put all the extensions into the main library, as
that may go against the ethos of extensibility that we’ve encouraged.  I also don’t want to go
down the road of picking favourites with some extensions over others. There’s a balance to be
had between out-of-the-box convenience and including the kitchen sink.  I think we’ve done
pretty well in that regard, but there should be a discussion to reevaluate that topic for v4.

Have you seen the source of the layout demos?  Those are all using plain files that are readable
with “view source”, so they may serve as a good template.  I think those demos are just using
<script> tags.  It should be the same process, regardless of whether an extension is a layout or
a UI widget.

On Sep 16, 2020, at 3:09 AM, Omar Shah notifications@github.com wrote:

Hi Paul,

I will have a few hours a week to dedicate to this - hopefully we'll be able to get this resolved in a few weeks, and continue to add new features!

Do you remember where this particular issue was left off?

Omar

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.