-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement cytoscape filtering #5
Comments
for this one I think you need to think some more about how it is implemented and what the use case is.
Now I suspect that you are wanting to interact with the chart after it has rendered. In this case you will need some sort of js UI element to manage the interaction. This could more easily be done in R (likely shiny) with a slider element. The Have a think and let me know. Matt |
In the case where you have nice and neat dataframes of nodes and edges to pass to My actual use case is a Shiny app where the graph is built off these pre-generated JSON files. Then, I need to have couple groups of checkbox inputs, which basically toggle showing different nodes/edges. So in my
or something like this, where I handle it in JavaScript:
|
Any thoughts on how I might go about this? I'm at a loss for ideas. |
Sorry Kyle I have not had much spare time lately. I would be using the
first option but only because I think the second js implementation will be
complicated.
Are you able to import your json and convert it into a dataframe? This
would at least allow you to filter the data mite result in r.
…On Wed., 25 Jul. 2018, 19:53 kyleweise, ***@***.***> wrote:
Any thoughts on how I might go about this? I'm at a loss for ideas.
I'm not even sure the second option is viable because that involves a
custom .js file associated with my app, and not the cytoscape.js file of
the package. So they would not have access to the same cy = cytoscape(...)
object.
Let me know your thoughts.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB1TAbb-y3YzmsHnDx5IWRph-aVEK7C1ks5uKEAEgaJpZM4VWonn>
.
|
Yes, I am able to do that. However, using Also, have a look at this blog post by Dean Attali, in particular tip 8. I think it might be useful to reconstruct this package a bit to mimic the structure he describes, although I'm not sure exactly how it would work in regards to the many many methods that |
Hi Kyle, have a look at the latest commit it is a very basic implementation based on the link you mentioned above. I have not tested that it works only that nothing else broke. Try to incorporate it into a shiny example (it will only work in shiny). When you define the widget make sure you define the Matt |
Just tried testing this by making some changes to the
and added the
and although it doesn't throw any errors (in R or JavaScript), the graph does not appear. My first thought is because the functionality for the piping is not set up properly / at all? |
ah of course. this won't work with the pipe as the output is a message and not the entire widget. In shiny you will have to apply the function from inside an So something like:
|
Hey Matt, see my most recent PR, I've gotten the Thanks, -Kyle |
I think another main action that other users and myself would like to be able to do is filter nodes/edges(i.e. this ), where the usage would be something like
cytoscape(...) %>% nodes() %>% filter('[weight > 50]')
or
cytoscape(...) %>% filter_nodes('[weight > 50]')
The first more closely matches the example given by cytoscape.js in the link. Again, my JavaScript is not so good and I'm relatively new to package development in R, but I'm hoping contributing to this repo with aid in both of those areas.
Thanks,
-Kyle
The text was updated successfully, but these errors were encountered: