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

Add fill/strokeOpacity and strokeWidth channels to support interaction design #4259

Merged
merged 5 commits into from
Nov 14, 2018

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented Nov 14, 2018

Also added an example of an interactive bar chart with highlighting on hover and selecting on click. (Inspired by Tableau's interaction style.)

tableau

kapture 2018-11-14 at 11 08 57

Note that I also added cursor: pointer after capturing the video.

…mple

The conditional rule support for these channels are important for interaction design.
(Also useful for interaction design)
@kanitw kanitw requested a review from domoritz November 14, 2018 19:14
"test": {
"and": [
{"selection": "select"},
"length(data(\"select_store\"))"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is a cheat by directly accessing the underlying data store to check if the selection is not empty. I think we might wanna expose this as a type of predicate in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have a way to change the selection to be empty or everything when nothing is selected by the user?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do, but it doesn't work for this case since we need the opacity to be 1 when the "select" selection is empty but the strokeWidth to be 0 when the "select" selection is empty.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make two selections?

Copy link
Member Author

@kanitw kanitw Nov 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that totally doesn't make sense. There should be only one selection for clicking that gets applied to different encoding channels differently.

@kanitw kanitw changed the title Add fill/strokeOpacity and strokeWidth to support interaction design Add fill/strokeOpacity and strokeWidth channels to support interaction design Nov 14, 2018
Copy link
Member

@domoritz domoritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another simple design is to change the opacity/darkness on hover. See https://schasins.com/blog/when-do-cs-researchers-peak.html

"type": "bar",
"fill": "#4C78A8",
"stroke": "black",
"cursor": "pointer"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be the default. Let's not add it manually just here, okay?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. I don't know when that default gonna land. You can undo that in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, please create an issue and link to this example then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol you already created it a few months ago. #4155

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, shows how much I want it.

"test": {
"and": [
{"selection": "select"},
"length(data(\"select_store\"))"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have a way to change the selection to be empty or everything when nothing is selected by the user?

@kanitw
Copy link
Member Author

kanitw commented Nov 14, 2018

Another simple design is to change the opacity/darkness on hover. See https://schasins.com/blog/when-do-cs-researchers-peak.html

That doesn't work if you want to handle both hovering to highlight (soft selection) AND clicking to do (hard) selection.

@kanitw kanitw merged commit 5a19e60 into master Nov 14, 2018
@kanitw kanitw deleted the kw/fillstrokeopacity branch November 14, 2018 20:52
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.

None yet

2 participants