✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Please suggest path to implement effective binmap in plotly.py

Hello everyone,

I am working on data processing project for wafer data. Most of this data can be represented as scatter plots where each point with given X and Y coordinates is rectangle of given width and height and has color describing some value. Value can be both continious and discrete

Here is google search example of such data

Here is the link in case the picture doesn’t upload
https://www.google.com/url?sa=i&url=http%3A%2F%2Frobslink.com%2FSAS%2Fdemocd10%2Faaaindex.htm&psig=AOvVaw0rTN5ahpT7RardVWYMxki2&ust=1627041297960000&source=images&cd=vfe&ved=0CAsQjRxqFwoTCJCWxKnP9vECFQAAAAAdAAAAABAD

I want to have this kind of representation inside my Jupyter notebook and add interactivity such as for example selecting some area and plotting histogram of the selected values.

I have already achieved some of this functionality using
wafermap = px.scatter(wafer_df, x=“X”, y=“Y”, color=“Fo”, color_continuous_scale = “brbg”,
title=“Wafermap, Frequency”, range_color=(f_low, f_hi), symbol_sequence = [‘square’], height=900, width=900)

as well as for interactivity:
@app.callback(
Output(‘histogram’, ‘figure’),
Input(‘wafermap’, ‘selectedData’))
def update_figure(selectedData):…

But the size of points in scatter is not scaling with zoom. Also I want to add text on top of each rectangle.

Heatmap looks good for me but it doesn’t support lasso and box selection… I wish it could.

Is there way to implement own custom plot widget and is there some documentation on how to do that?
Very important question is speed. Right now I can handle up to 100k points with scatter and have robust zooming which is enough for me. I don’t want to sacrifice this speed.

Thank you for your suggestions.