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

Fix highlighting for usage with cross-filter selection #146

Closed
wants to merge 1 commit into from

Conversation

spren9er
Copy link
Contributor

@spren9er spren9er commented Aug 4, 2023

Consider following scenario:

data:
  athletes: { file: data/athletes.csv }
params:
  query: { select: crossfilter }
  click: { select: single }
vconcat:
- hconcat:
  - input: menu
    label: Sport
    as: $query
    from: athletes
    column: sport
- vspace: 20
- name: total
  plot:
  - mark: barX
    data: { from: athletes, filterBy: $query }
    x: { count: '' }
  xLabel: Total →
  xDomain: Fixed
- vspace: 20
- name: total_by_country
  plot:
  - mark: barY
    data: { from: athletes, filterBy: $query }
    x: nationality
    y: { count: '' }
    sort: { x: -y, limit: 10 }
  - select: toggleX
    as: $query
  - select: toggleX
    as: $click
  - select: highlight
    by: $click
  xLabel: ''
  yLabel: Total
Bildschirmfoto 2023-08-04 um 12 35 55

As soon as a sport is selected in menu, highlighting does not work properly when clicking on bars.

Reason: Predicate function used for highlighting is based on query which is missing WHERE clause, e.g. here sport = 'athletics'.

See also #144 (reply in thread).

This PR covers a fix for above issue.

@jheer
Copy link
Member

jheer commented Aug 4, 2023

Thank you for identifying the crux of the issue. I made a slightly different fix, so this PR was superceded by #147.

@spren9er spren9er deleted the highlight-fix branch August 7, 2023 08:56
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