select the desired area in the image

Hello! I am new to python and bokeh. My task is to select the desired section of the matrix data and summarize it (I choose the section myself).
To render the matrix, I use the image function.
There are some old posts on this topic. Does bokeh already have a widget for this?

The short answer is no. There are almost certainly individual pieces and feature you could put together yourself, but you will have to describe the exact interaction you are hoping to achieve in greater detail, as the current description is too vague to offer any concrete advice on.

in more detail, make a graph with the image function, select an area on the graph, and in a separate window see the coordinates of the selected area and all values ​​in the area

You can certainly respond to selection events with either JavaScript code (in a pure standalone HTML file) or with Python code (requires running a Bokeh server application). It’s not clear which of those you want. It’s not clear if you want the index coordinates of the matrix as the selection, or if you want the data coordinates of the selection geometry. Does “open a window” literally mean raise a separate browser window? AFAIK you would have to pass a real URL to to do that. If that’s the case I think you’d have to run a Bokeh server application and pass some encoded data as an HTTP argument in the URL to condition what exactly to render on the new page (i.e. based on the selection somehow).