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

Selection tool is broken on the latest master #5029

Closed
peterroelants opened this issue Jul 17, 2021 · 1 comment · Fixed by #5040
Closed

Selection tool is broken on the latest master #5029

peterroelants opened this issue Jul 17, 2021 · 1 comment · Fixed by #5040

Comments

@peterroelants
Copy link
Contributor

Description of expected behavior and the observed behavior

The selection tool on only works for the first selection made on the plot, and fails for all further selections. No warnings or errors to be seen.

This is observed on latest master (6449bb4) and does not happen on the v1.14.4 tag with id f7a923065

Complete, minimal, self-contained example code that reproduces the issue

import numpy as np
import pandas as pd
import datashader as ds
import holoviews.operation.datashader as hd
import holoviews as hv
from holoviews.selection import link_selections

hv.extension('bokeh')

num = 100000
np.random.seed(1)

dists = {
    cat: pd.DataFrame({
        'x': np.random.normal(x, s, num), 
        'y': np.random.normal(y, s, num), 
        'val': np.random.normal(val, 1.5, num), 
        'cat': cat
    }) for x,  y,  s,  val, cat in 
     [(  2,  2, 0.03, 10, "d1"), 
      (  2, -2, 0.10, 20, "d2"), 
      ( -2, -2, 0.50, 30, "d3"), 
      ( -2,  2, 1.00, 40, "d4"), 
      (  0,  0, 3.00, 50, "d5")]
}

points = hv.Points(pd.concat(dists), ['x', 'y'], ['val', 'cat'])
datashaded = hd.datashade(points, aggregator=ds.count_cat('cat'))
spreaded = hd.dynspread(datashaded, threshold=0.50, how='over').opts(tools=['box_select', 'lasso_select'])

# Declare dim expression to color by cluster
dim_expr = ((0.1+hv.dim('val')/10).round()).categorize(hv.Cycle('Set1').values)
histogram = points.hist(num_bins=60, adjoin=False, normed=False).opts(color=dim_expr)

link_selections(spreaded + histogram) 

Screenshots or screencasts of the bug in action

  • On latest master (id=6449bb4):
    selection not working on master
  • On v1.14.4 tag (id=f7a923065)
    selection working on v1.14.4

ALL software version info

pip-freeze.txt

@peterroelants peterroelants changed the title Selection tool is broke on the latest master Selection tool is broken on the latest master Jul 17, 2021
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant