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

Let interactors update more than one parameter #246

Open
frtennis1 opened this issue Dec 30, 2023 · 0 comments · May be fixed by #247
Open

Let interactors update more than one parameter #246

frtennis1 opened this issue Dec 30, 2023 · 0 comments · May be fixed by #247

Comments

@frtennis1
Copy link
Contributor

frtennis1 commented Dec 30, 2023

Here is an example of something that I think is currently impossible: say you have a dataset like,

df = pd.DataFrame(itertools.product(np.arange(.2, 1.2, .01), np.arange(0, 50)), columns=['alpha', 'x'])
df['alpha'] = df['alpha'].round(2)
df['x_pow_a'] = np.power(df['x'], df['alpha'])

>>> df
      alpha   x     x_pow_a
0      0.20   0    0.000000
1      0.20   1    1.000000
...     ...  ..         ...
4998   1.19  48  100.156023
4999   1.19  49  102.643945

[5000 rows x 3 columns]

and want to make two line plots: one of (x, x_pow_a) and one of (alpha, x_pow_a) cross-filtered each with a Nearest selector that maps to some global filter call it $filt. This so far is possible. But then if you want to use the selector to make a visual representation of what is being selected (like a "ruleX" element, as in the "Stocks" Mosaic example) it becomes impossible because,

(1) You can't have two Nearest selectors on the same plot because they overwrite some event listener.
(2) You can't have a Nearest selector simultaneously update two selections (one local to the chart to draw the rule and one global for the cross-filter).

A visual representation of the plot described in words:

image

My suggestion is to change the selection member of interactors to optionally be an array. I have implemented a proof of concept for Nearest and it seems to work well. Wanted to get people's thoughts on this before I took it any further.

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 a pull request may close this issue.

1 participant