question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

oneOf on selection

See original GitHub issue

Hi, I’m trying to adapt the parallel coordinates plot with some interaction. I’ve been working at a minimal example here https://colab.research.google.com/drive/1qMMX5VfFpG0zxBvtHVvxhIS57LHZH_nt?usp=sharing

My goal is to be able to draw a selection box around some of the points and have all the lines/points with the same index be colored and everything else be grayed out. The image below shows that this sort of works, but only because the line is considered selected if its starting point is selected (and subsequent points with same index aren’t selected). It breaks down when you select points in the middle.

image image

The thing I can’t seem to figure out is how to do this: create a brush selection based on the key/value axes -> create a set of index numbers -> set the color condition on these. Any suggestions on how to do this?

I tried using oneOf with something like FieldOneOfPredicate('index', brush.index), but get the feeling this isn’t valid and its expected that the list of options is a static list. The only approach I can think of so far that might work is having a shadow set of points + transform_filters that create colored/non-colored sets of points/lines, which seems a bit messy. Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jakevdpcommented, Dec 9, 2020

No, I don’t know of any really good guide unfortunately. The API reference here is probably the most helpful thing: https://vega.github.io/vega/docs/expressions/

0reactions
joelostblomcommented, Mar 23, 2022

Closing for now, please reopen if there is anything that wasn’t resolved solutions provided above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

oneOf, anyOf, allOf, not - Swagger
oneOf – validates the value against exactly one of the subschemas ... Use the oneOf keyword to ensure the given data is valid...
Read more >
JSON schema conditional within array based on "oneOf ...
I'd like to to display a form field based on a selection within an array to be able to dynamically add items based...
Read more >
oneOf rendered as pulldown in API Reference
Our OAS has "oneOf" objects specified in component schemas, similar to the example ... Selecting an option from the pulldown does not result...
Read more >
Multiple Choice - JSON Forms
A single select can be achieved by using an enum or an oneOf in the JSON schema. Enum​. You can define an enum...
Read more >
1 Million+ NFTs. OnePass. - OneOf
... and privileges at 1.6 million partners in dining, nightlife, entertainment, travel and retail around the world, provided by OneOf partner SELECT Card....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found