You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
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:
# patch the first three elements of a 1d column
p1 = patcher[0:3]
patches = { 'foo': (p1, [1, 2, 3] }
# patch the entire second column of a the 10th image
p2 = patcher[10, :, 2]
patches = { 'baz' : (p2, [...] }
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 CDS patch method:
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: