Skip to content
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

Attempt at multiple clickSelects #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

cpsievert
Copy link
Collaborator

No description provided.

@tdhock
Copy link
Owner

tdhock commented Nov 19, 2014

Interesting observation. I thought that it should be easy to update the showSelected geoms, but you are right it is more complicated for updating geoms with multiple clickSelects. The correct behavior should be: highlight only the geoms that have all their clickSelects values selected.

So I think it will require changing ifSelectedElse

https://github.com/tdhock/animint/blob/multiple-clickSelects/inst/htmljs/animint.js#L1148-L1149

https://github.com/tdhock/animint/blob/multiple-clickSelects/inst/htmljs/animint.js#L1157-L1158

https://github.com/tdhock/animint/blob/multiple-clickSelects/inst/htmljs/animint.js#L1292-L1306

I guess inside of ifSelectedElse we will need to loop over all the clickSelects variables.

@tdhock
Copy link
Owner

tdhock commented Nov 24, 2014

another way to implement ifSelectedElse for geoms with multiple clickSelects would be to keep track of an integer which counts the number of selectors which are activated for each geom, and then we could write something like

d.is_selected = d.count_selected_clickSelects_variables == g_info.number_of_clickSelects_variables

and then we would updated d.is_selected whenever the selection is updated (instead of checking every time we call ifSelectedElse).

@srvanderplas
Copy link
Collaborator

That might be simpler to implement than attempting to check the
intersection. So long as we're only using the multiple clickSelects
statements to select points at the intersection of the variables, we should
be fine with that approach. Otherwise, it could get hairy.

On Mon, Nov 24, 2014 at 10:55 AM, Toby Dylan Hocking <
notifications@github.com> wrote:

another way to implement ifSelectedElse for geoms with multiple
clickSelects would be to keep track of an integer which counts the number
of selectors which are activated for each geom, and then we could write
something like

d.is_selected = d.count_selected_clickSelects_variables == g_info.number_of_clickSelects_variables

and then we would updated d.is_selected whenever the selection is updated
(instead of checking every time we call ifSelectedElse).


Reply to this email directly or view it on GitHub
#31 (comment).

@caijun caijun force-pushed the master branch 2 times, most recently from d06b5a2 to a0677f2 Compare June 1, 2015 08:50
@cpsievert cpsievert mentioned this pull request Aug 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants