Extend patching to sub-items #6285
Closed
Milestone
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given the following CDS:
where
img1
, etc. are 2d NumPy arrays, it is currently possible to patch individual elements using the existing patch format:This suffers from two drawbacks:
The indexing scheme does not extend inside 2d images, it is only possible to patch entire images at a time.
Even for the 1d case, the indexing scheme is somewhat cumbersome in cases where it is desired to patch contiguous regions of a column.
Propose to extend the patching syntax to accept slices, and to provide a simple mechanism for generating slices:
Note: use of an object like
patcher
with a custom__getitem__
seems necessary, as slice syntax is only available inside indexing brackets.Would serialize slices
slice(1, 10, None)
as(1, 10, null)
. Bounds and consistency checking could occur on the python side, but handling of the slice would occur in BokehJS in the CDSpatch
method:https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/sources/column_data_source.coffee#L96-L101
The text was updated successfully, but these errors were encountered: