Skip to content

Focus vs. context point styling in the non-lassoed plot for crossfiltering #1762

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
monfera opened this issue Jun 6, 2017 · 4 comments
Closed
Assignees
Labels
feature something new

Comments

@monfera
Copy link
Contributor

monfera commented Jun 6, 2017

Currently, lassoing a group of points (focus) causes the excluded points to fade (context).

For crossfiltering action, we similarly need to deemphasize points in other scatterplots that are linked to the same crossfilter. The effect can be mimicked by lowering the opacity on markers not currently selected, but it feels like meddling with the user supplied styling preferences. So this is a short conversation starter on whether we want to separate the lassoing input action from the focus+context differential rendering.

@monfera monfera self-assigned this Jun 7, 2017
@etpinard
Copy link
Contributor

Adding either

  • a set of *selected attributes in the marker attribute container:
var trace = {
  marker: {
     color: 'red',
     colorselected: 'blue',
     opacity: 0.7,
     opacityselected: 0.2
   }
}

or a separate markerselected container:

var trace = {
  marker: {
    color: 'red',
    opacity: 0.7
  },
  markerselected: {
    color: 'blue',
    opacity: 0.2
  }
}

I, personally, prefer the latter.

Moreover, we should maybe add a boolean attribute, (e.g selectable) to toggle if a trace's points can be selected or not.

@monfera
Copy link
Contributor Author

monfera commented Jun 17, 2017

@etpinard thanks for the informed design! Currently, the rectangular and lasso selectors switch eliminated elements into an opacity: 0.2. Should this preexisting functionality also consult this new spec for styling? For a twist, let's consider that applying a lasso selection in Scatter A will restyle eliminated points in Scatter B; then, selecting in Scatter B should (?) still have a visual impact, perhaps reducing opacity as done now. In other words, maybe it's good to keep the current hardcoded 0.2 opacity for selecting on the current chart as is, and use the above spec for styling points after the elimination happened, whether in the same chart or in another chart.

@monfera
Copy link
Contributor Author

monfera commented Jul 4, 2017

@etpinard maybe my example wasn't too clear in text, I whipped up a crossfiltering example in Vega-lite to show:
image

Box selection was done on the left panel, see the grey box, and the greyed-out points outside the box (analogous to our box select). What I'm talking about above is the panel on the right, where the retained points remain unchanged (magenta) but the eliminated points show up with some other styling even though we didn't do a box select in that plot.

(Technically, Vega doesn't restyle the eliminated points; it renders all data in grey and all kept data in magenta - we could mimic this with multiple traces, hmm maybe that's better than figuring out a new styling spec for crossfilter-eliminated points 😄 )

If you want to select yourself, copy the below into https://vega.github.io/editor (box select is quite slow at 2k points, wait a second or two)

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "data": {
    "url": "data/flights-2k.json",
    "format": {"parse": {"date": "date"}}
  },
  "transform": [{"calculate": "hours(datum.date)", "as": "time"}],
  "repeat": {"column": ["distance", "time"]},
  "spec": {
    "layer": [{
      "selection": {
        "brush": {"type": "interval", "encodings": ["x", "y"]}
      },
      "mark": "point",
      "encoding": {
        "x": {
          "field": {"repeat": "column"}
        },
        "y": {"field": "delay"},
        "color": {"value": "grey"},
        "opacity": {"value": 0.5}
      }
    }, {
      "transform": [{"filter": {"selection": "brush"}}],
      "mark": "point",
      "encoding": {
        "x": {
          "field": {"repeat": "column"}
        },
        "y": {"field": "delay"},
        "color": {"value": "magenta"}
      }
    }]
  }
}

@monfera
Copy link
Contributor Author

monfera commented Jul 5, 2017

Closing it in favor of #1847 which supersedes this item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

2 participants