Skip to content

picker: click to update the plot's value #209

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

Closed
wants to merge 1 commit into from
Closed

picker: click to update the plot's value #209

wants to merge 1 commit into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Mar 10, 2021

  • this initial version works on rects
  • default picker is d => d (each rect will send its value to the viewof), one can set picker: d => d.x
  • picker: null will not set onclick
  • bin transforms set picker = group => groupData (aka "the right thing")
  • not fully tested with faceting, though it seems to work
  • added a general mechanism to send the value as an Input event (not sure it's the right thing to do though), better than the async method of Interactions: brush #71
  • q: should we always send the initial value, and if so what data? a solution to this problem would be to opt in with a global {picker: data} and the picking would only apply to marks that have the same data.

test https://observablehq.com/d/f4e32e31ec214e38

@Fil Fil requested a review from mbostock March 10, 2021 16:01
@Fil Fil force-pushed the picker branch 3 times, most recently from 195dde2 to a06b6bf Compare March 15, 2021 12:15
@tophtucker
Copy link
Contributor

nice! i might call picker value? i'm not sure it's necessary at all — i think it would be reasonable (and easy to understand) if every mark just dispatched its full value, d => d.

q: should we always send the initial value, and if so what data?

great question i hadn't thought about. it also reminds me, i had been thinking maybe brushing could just work with zero configuration, but your question makes me realize that that would result in selecting duplicate of many data points, e.g. if they're bound to both a bar and a text label. (i see you already handle this in #71 by explicitly giving the brush its data.)

@tophtucker
Copy link
Contributor

(i'll try it out though!)

@Fil
Copy link
Contributor Author

Fil commented May 3, 2021

if every mark just dispatched its full value, d => d.

The issue is not so much for individual points, but this is a way to track the original data when doing transforms (at least groups and bins).

@Fil
Copy link
Contributor Author

Fil commented May 24, 2023

superseded (by far) by #1630

@Fil Fil closed this May 24, 2023
@Fil Fil deleted the picker branch May 24, 2023 16:01
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.

2 participants