Skip to content

add selectable shapes or absolute marker sizes #3682

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

Open
SterlingButters opened this issue Mar 25, 2019 · 4 comments
Open

add selectable shapes or absolute marker sizes #3682

SterlingButters opened this issue Mar 25, 2019 · 4 comments
Labels
feature something new P3 backlog

Comments

@SterlingButters
Copy link

At first I started with shapes since their size can be explicitly defined in the same domain as the data (i.e. not an arbitrary number that doesn't correspond with the data as with marker size attribute). However, the problem that arises is that shapes do not express any visual feedback when selected (in selectData) as markers do.

So, unfortunately, I've run into a limitation with each method (shapes don't provide feedback when selected nor are they selectable [however you could put a transparent marker in the center which I did for awhile] and marker sizes/shapes cannot be defined in the same domain as the data). Alternatively, I think it might be useful to explicitly define the size and shape of a marker in the same "domain" as the data so that if you were to zoom in or out, the dimensions of the marker do not scale but instead maintain the specified dimensions because its size and shape is important relative to the data. Something like #2193 except for markers and no need for the movable functionality.

Additionally, this would provide some more freedom in customizing the marker i.e. the marker could be defined by an aggregate of shape objects (which is different than #330). That is, if it is important that a data point be represented by a red square behind a blue circle each of a specific size - it could be done.

@etpinard
Copy link
Contributor

Thanks for writing in.

I'll reference #2118 which is related.

@etpinard etpinard added the feature something new label May 22, 2019
@bjarthur
Copy link

bjarthur commented Apr 3, 2020

+1 for being able to specify marker size in data units

unfortunately plotly shapes doesn't seem to be a viable workaround for me as i am using scatter3d.

my hack for a circle that gets bigger as one zooms in (ie stays the same size w.r.t. the data units) is to use a mesh3d with alphahull and give it the coordinates of an icosahedron:

# typescript in bokeh
{type: 'mesh3d',
 x:[     0,     1, 1.618,     0,    -1, 1.618,     0,     1,-1.618,     0,    -1,-1.618].map(x=>x+this.model.source.data[this.model.x][0]),
 y:[     1, 1.618,     0,    -1, 1.618,     0,     1,-1.618,     0,    -1,-1.618,     0].map(x=>x+this.model.source.data[this.model.y][0]),
 z:[ 1.618,     0,     1, 1.618,     0,    -1,-1.618,     0,     1,-1.618,     0,    -1].map(x=>x+this.model.source.data[this.model.z][0]),
 alphahull:1.0,
};

unfortunately this is not completely what i want as multiple traces in 3D plots seem to maintain their "z-order" overlay position irrespective of the view of the camera. so for example, if i add a scatter3d to the above mesh3d on the same plot and position the icosahedron far away from the points and then rotate the camera, the icosahedron is always behind the points. this is the behavior if mesh3d is the first trace and scatter3d the second. if reversed plotly hangs chrome.

@bjarthur
Copy link

bjarthur commented Apr 3, 2020

the z-order problem i describe above only occurs when opacity is less than 1. see #4111

@asadow
Copy link

asadow commented May 29, 2024

This would also keep me from trying to replace markers with mesh3d, which adds complexity (and further there's no legend support for mesh3d, coming from R's plotly package).

@gvwilson gvwilson self-assigned this Jun 13, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson changed the title Feature Request: Selectable Shapes or Absolute Marker Sizes add selectable shapes or absolute marker sizes Aug 8, 2024
@gvwilson gvwilson added the P3 backlog label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

5 participants