Các cuộc gọi lại Python [đôi khi còn được gọi là Trình xử lý sự kiện] là các hàm Python mà bạn có thể gắn vào các widget. Bạn chỉ có thể sử dụng các cuộc gọi lại này trong các ứng dụng Bokeh Server. Đối với các cuộc gọi lại tương tác mà don lồng yêu cầu một máy chủ Bokeh, hãy xem các cuộc gọi lại JavaScript.Bokeh server apps. For interactive callbacks that don’t require a Bokeh server, see JavaScript callbacks.
Các cuộc gọi lại Python Bokeh sườn được gọi khi một số thuộc tính nhất định trên Bokeh
>>> plot.circle[[1,2,3], [4,5,6], name="temp"] >>> plot.select[name="temp"] [GlyphRenderer[id='399d53f5-73e9-44d9-9527-544b761c7705', ...]]8 được thay đổi. Chữ ký chức năng của trình xử lý sự kiện được xác định bởi cách chúng được gắn vào các vật dụng [ví dụ như bằng
>>> plot.circle[[1,2,3], [4,5,6], name="temp"] >>> plot.select[name="temp"] [GlyphRenderer[id='399d53f5-73e9-44d9-9527-544b761c7705', ...]]9 hay
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]0].
>>> r = plot.circle[[1,2,3], [4,5,6]]
>>> r.tags = ["foo", 10]
>>> plot.select[tags=['foo', 10]]
[GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]
1 Trình kích hoạt gọi lại#
Ví dụ, tất cả các tiện ích đều có phương thức
>>> plot.circle[[1,2,3], [4,5,6], name="temp"] >>> plot.select[name="temp"] [GlyphRenderer[id='399d53f5-73e9-44d9-9527-544b761c7705', ...]]9 lấy tên thuộc tính và một hoặc nhiều trình xử lý sự kiện làm tham số. Các trình xử lý này dự kiến sẽ có chữ ký chức năng,
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]3, trong đó
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 đề cập đến tên thuộc tính đã thay đổi và
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]5 và
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]6 đề cập đến các giá trị trước đó và cập nhật của thuộc tính.widgets, for example, have an
>>> plot.circle[[1,2,3], [4,5,6], name="temp"] >>> plot.select[name="temp"] [GlyphRenderer[id='399d53f5-73e9-44d9-9527-544b761c7705', ...]]9 method that takes an attribute name and one or more event handlers as parameters. These handlers are expected to have the function signature,
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]3, where
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 refers to the changed attribute’s name, and
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]5 and
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]6 refer to the previous and updated values of the attribute.
def my_text_input_handler[attr, old, new]: print["Previous label: " + old] print["Updated label: " + new] text_input = TextInput[value="default", title="Label:"] text_input.on_change["value", my_text_input_handler]
Để biết thêm thông tin về các thuộc tính cần xem bằng cách sử dụng
>>> plot.circle[[1,2,3], [4,5,6], name="temp"] >>> plot.select[name="temp"] [GlyphRenderer[id='399d53f5-73e9-44d9-9527-544b761c7705', ...]]9, hãy xem mô hình tương ứng theo Bokeh.models trong hướng dẫn tham khảo.bokeh.models in the reference guide.
>>> r = plot.circle[[1,2,3], [4,5,6]]
>>> r.tags = ["foo", 10]
>>> plot.select[tags=['foo', 10]]
[GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]
8 Trình kích hoạt gọi lại#
Ngoài ra, một số widget, bao gồm nút, thả xuống và nhóm kiểm tra, có một phương thức
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]0 lấy trình xử lý sự kiện làm tham số duy nhất của nó. Đối với một
select.js_link['value', plot, 'sizing_mode']0 đơn giản, trình xử lý này được gọi là không có thông số. Đối với các tiện ích khác với
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]0, trình xử lý được thông qua giá trị thuộc tính mới.Button, Dropdown, and CheckboxGroup, have an
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]0 method that takes an event handler as its only parameter. For a plain
select.js_link['value', plot, 'sizing_mode']0, this handler is called without parameters. For the other widgets with
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]0, the handler is passed the new attribute value.
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]
Để biết thêm thông tin về các thuộc tính cần xem bằng
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]0, hãy xem mục nhập tương ứng để biết tiện ích theo Bokeh.models trong hướng dẫn tham khảo.bokeh.models in the reference guide.
Ví dụ
Sau đây là tương đương:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]2 Callback[*args, **kwargs][source]¶
update_from_json [json_attribut: dict [str, json], *, mô hình: ánh xạ [id, hasprops] | none = none, setter: setter | none = none]
Cập nhật các thuộc tính của đối tượng từ Từ điển thuộc tính JSON.
JSON_Attributes-[JSON-DICT]: Các thuộc tính và giá trị để cập nhật
mô hình [dict hoặc none, tùy chọn] -It is not useful to instantiate on its own.
Ánh xạ ID mô hình thành các mô hình [mặc định: Không có]{ "id": "1709", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "syncable": true, "tags": [] }
Điều này là cần thiết trong trường hợp các thuộc tính để cập nhật cũng có các giá trị có tài liệu tham khảo.
setter [khách hàng hoặc máy chủ hoặc không có, tùy chọn] -select.js_link['value', plot, 'sizing_mode']4 | |
select.js_link['value', plot, 'sizing_mode']5 | |
select.js_link['value', plot, 'sizing_mode']6 | |
select.js_link['value', plot, 'sizing_mode']7 | Điều này được sử dụng để ngăn chặn các bản cập nhật của Boom Boomerang cho các ứng dụng Bokeh. |
select.js_link['value', plot, 'sizing_mode']8 | Trong bối cảnh của một ứng dụng máy chủ Bokeh, các bản cập nhật đến các thuộc tính sẽ được chú thích với phiên đang thực hiện cập nhật. Giá trị này được truyền qua bất kỳ thông báo thay đổi tiếp theo nào mà bản cập nhật kích hoạt. Phiên có thể so sánh người đặt sự kiện với chính nó và triệt tiêu mọi cập nhật bắt nguồn từ chính nó. |
select.js_link['value', plot, 'sizing_mode']9 | PropertyDocument: tài liệu | Không có |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]0 | Mô hình from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]7 này được gắn vào [có thể là from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]8] |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]2 | Propertystruct: bokeh.core.types.referencejson¶ |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]3 | Một giao thức Bokeh cấu trúc của cấu trúc của mô hình này, tức là một phương pháp của hình thức: |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]5 | def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]3 |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]6 | Trigger [attr: str, cũ: không xác định, mới: không xác định, gợi ý: documentpatchedevent | none = none, setter: setter | none = none] |
Xóa bất kỳ giá trị theo chủ đề và khôi phục mặc định.
setter [khách hàng hoặc máy chủ hoặc không có, tùy chọn] -from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]9[] | Điều này được sử dụng để ngăn chặn các bản cập nhật của Boom Boomerang cho các ứng dụng Bokeh. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]0[cls, *args, **kwargs] | |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]2[] | Trong bối cảnh của một ứng dụng máy chủ Bokeh, các bản cập nhật đến các thuộc tính sẽ được chú thích với phiên đang thực hiện cập nhật. Giá trị này được truyền qua bất kỳ thông báo thay đổi tiếp theo nào mà bản cập nhật kích hoạt. Phiên có thể so sánh người đặt sự kiện với chính nó và triệt tiêu mọi cập nhật bắt nguồn từ chính nó. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]3[] | PropertyDocument: tài liệu | Không có |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]4[] | Mô hình from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]7 này được gắn vào [có thể là from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]8] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]5[event, *callbacks] | |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]6[attr, other, other_attr[, attr_selector]] | Propertystruct: bokeh.core.types.referencejson¶ |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]7[event, *callbacks] | Một giao thức Bokeh cấu trúc của cấu trúc của mô hình này, tức là một phương pháp của hình thức: |
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]1[attr, *callbacks] | Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi >>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]1[] | Trả về tất cả from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]2 mà đối tượng này có tài liệu tham khảo. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]3[selector] | Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]4[selector] | Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]5[selector, updates] | Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]6[include_defaults] | Trả về một từ điển của các thuộc tính của đối tượng này, chỉ chứa "các loại json" [chuỗi, số, boolean, none, dict, list]. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]7[include_defaults] | Trả về một chuỗi JSON mã hóa các thuộc tính của đối tượng này. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]8[attr, old, new[, hint, setter]] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]0[name, value] | Cài đặt thuộc tính chặn trên HasProps Để trường hợp đặc biệt Một vài tình huống: |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]1[name] | Cài đặt thuộc tính chặn trên HasProps Để trường hợp đặc biệt Một vài tình huống: |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]2[] | Trả lại str [tự]. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]3[] | Trả lại repr [tự]. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]4[other] | Bình đẳng cấu trúc của các mô hình. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]5[serializer] | |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]6[serializer] | |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]7[name, json, *[, models, setter]] | Đặt giá trị thuộc tính trên đối tượng này từ JSON. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]8[**kwargs] | Cập nhật các thuộc tính của đối tượng từ các đối số từ khóa đã cho. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]9[json_attributes, *[, ...]] | Cập nhật các thuộc tính của đối tượng từ Từ điển thuộc tính JSON. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]00[name, *[, raises]] | Tìm def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]01 cho thuộc tính Bokeh trên một lớp, được đặt tên thuộc tính. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]02[*[, _with_props]] | Thu thập tên của các thuộc tính trên lớp này. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]03[] | Thu thập tên của tất cả các thuộc tính trên lớp này cũng có tài liệu tham khảo. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]04[] | Thu thập tên của tất cả các thuộc tính def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 trên lớp này. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]06[*[, ...]] | Thu thập một tên thuộc tính ánh xạ Dict cho các giá trị của chúng. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]07[query, *[, ...]] | Truy vấn các giá trị thuộc tính của các trường hợp def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]08 với vị ngữ. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]09[] | Nhận bất kỳ sự ghi đè được cung cấp chủ đề. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]10[property_values] | Áp dụng một tập hợp các giá trị chủ đề sẽ được sử dụng thay vì mặc định, nhưng sẽ không ghi đè các giá trị bộ ứng dụng. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]11[] | Xóa bất kỳ giá trị theo chủ đề và khôi phục mặc định. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]1[attr, *callbacks] | Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi >>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]16[attr, *callbacks] | Xóa một cuộc gọi lại khỏi đối tượng này |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]8[attr, old, new[, hint, setter]] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]8[event, *callbacks] | Chạy các cuộc gọi lại khi sự kiện được chỉ định xảy ra trên mô hình này |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]20[
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]21]
Một tên tùy ý, do người dùng cung cấp cho mô hình này.
Tên này có thể hữu ích khi truy vấn tài liệu để truy xuất các mô hình Bokeh cụ thể.
>>> plot.circle[[1,2,3], [4,5,6], name="temp"] >>> plot.select[name="temp"] [GlyphRenderer[id='399d53f5-73e9-44d9-9527-544b761c7705', ...]]
Ghi chú
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ tên nào được cung cấp, cũng không phải là tên được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
Syncable = true¶type= True¶Typedef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]22
Cho biết liệu mô hình này có nên được đồng bộ hóa trở lại máy chủ Bokeh khi được cập nhật trong trình duyệt web hay không. Cài đặt thành
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 có thể hữu ích để giảm lưu lượng mạng khi xử lý các đối tượng được cập nhật thường xuyên có giá trị cập nhật mà chúng tôi không cần.
Ghi chú
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ tên nào được cung cấp, cũng không phải là tên được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
Syncable = true¶type= []¶Typedef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]26
Cho biết liệu mô hình này có nên được đồng bộ hóa trở lại máy chủ Bokeh khi được cập nhật trong trình duyệt web hay không. Cài đặt thành
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 có thể hữu ích để giảm lưu lượng mạng khi xử lý các đối tượng được cập nhật thường xuyên có giá trị cập nhật mà chúng tôi không cần.
Đặt thuộc tính này thành
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 sẽ ngăn bất kỳ cuộc gọi lại
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]25 nào trên đối tượng này kích hoạt. Tuy nhiên, bất kỳ cuộc gọi lại phía JS nào vẫn sẽ hoạt động.
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]
Tags = [] ¶Type
Ghi chú
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ tên nào được cung cấp, cũng không phải là tên được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
Syncable = true¶type[property_values:Dict[str,Any]] → None¶Áp dụng một tập hợp các giá trị chủ đề sẽ được sử dụng thay vì mặc định, nhưng sẽ không ghi đè các giá trị bộ ứng dụng.
Xóa bất kỳ giá trị theo chủ đề và khôi phục mặc định.
Được thừa hưởng từ: PY: Lớp: HasdocumentrefĐược thừa hưởng từ: PY: Class: PropertyCallbackManager [dict] – theme values to use in place of defaults
Xóa một cuộc gọi lại khỏi đối tượng nàyĐược thừa hưởng từ: PY: Lớp: EventCallBackManager
Chạy các cuộc gọi lại khi sự kiện được chỉ định xảy ra trên mô hình nàydataspecs[] → Dict[str, DataSpec]¶Thu thập tên của tất cả các thuộc tính
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 trên lớp này.
Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.
Trả lạiTên của
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 thuộc tínhLoại trở lại
set[str]
phá hủy [] → không có[] → None¶Làm sạch các tài liệu tham khảo đến tài liệu và tài sản
B bằng [Khác: Bokeh.core.has_props.hasprops] → Bool¶[other:bokeh.core.has_props.HasProps] → bool¶Bình đẳng cấu trúc của các mô hình.
Thông sốKhác [HASPROPS] - trường hợp khác để so sánh với [HasProps] – the other instance to compare to
Trả lạiTên của
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 thuộc tính Loại trở lại[attr: str, other:bokeh.model.model.Model, other_attr: str, attr_selector:Optional[Union[int, str]]=None] → None¶
phá hủy [] → không có
Làm sạch các tài liệu tham khảo đến tài liệu và tài sản
Thông sốKhác [HASPROPS] - trường hợp khác để so sánh với [str] – The name of a Bokeh property on this model
Đúng, nếu các thuộc tính có cấu trúc bằng nhau, nếu không thì sai [Model] – A Bokeh model to link to self.attr
js_link [attr: str, other: bokeh.model.model.model, other_attr: str, attr_selector: tùy chọn [union [int, str]] = none] [str] – The property on
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]
31 to link togetherLiên kết hai thuộc tính mô hình Bokeh bằng JavaScript. [Union[int, str]] – The index to link an item in a subscriptable
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]
4
Đây là một phương thức tiện lợi giúp đơn giản hóa việc thêm một cuộc gọi lại CustomJS để cập nhật một thuộc tính mô hình Bokeh bất cứ khi nào thay đổi giá trị khác.
attr [str] - tên của một thuộc tính bokeh trên mô hình nàyKhác [Mô hình] - Một mô hình Bokeh để liên kết đến Self.Attr –
other_attr [str] - thuộc tính trên
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]31 để liên kết với nhau
attr_selector [Union [int, str]] - Chỉ mục liên kết một mục trong một
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 có thể đăng ký
select.js_link['value', plot, 'sizing_mode']
Đã thêm vào phiên bản 1.1
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]
Tăng
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]
ValueError -
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]Ví dụ[event: str, *callbacks:JSEventCallback] → None¶
Mã này với
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]6:
tương đương với những điều sau:
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]
Ngoài ra, để sử dụng attr_selector để gắn phía bên trái của một slider phạm vi vào cốt truyện của X X_Range:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]0 tương đương với: lookup[name:str, *, raises: bool=True] → Optional[bokeh.core.property.descriptors.PropertyDescriptor[Any]]¶
JS_ON_CHANGE [Sự kiện: Str, *Callbacks: JSEventCallback] → Không ai
Thông sốKhác [HASPROPS] - trường hợp khác để so sánh với [str] – name of the property to search for
Đúng, nếu các thuộc tính có cấu trúc bằng nhau, nếu không thì sai [bool] – whether to raise or return None if missing
js_link [attr: str, other: bokeh.model.model.model, other_attr: str, attr_selector: tùy chọn [union [int, str]] = none]
Loại trở lạiLiên kết hai thuộc tính mô hình Bokeh bằng JavaScript.
Đây là một phương thức tiện lợi giúp đơn giản hóa việc thêm một cuộc gọi lại CustomJS để cập nhật một thuộc tính mô hình Bokeh bất cứ khi nào thay đổi giá trị khác.[attr: str, *callbacks:PropertyCallback] → None¶attr [str] - tên của một thuộc tính bokeh trên mô hình này
Thông sốKhác [HASPROPS] - trường hợp khác để so sánh với [str] – an attribute name on this object
Đúng, nếu các thuộc tính có cấu trúc bằng nhau, nếu không thì sai [callable] – callback functions to register
js_link [attr: str, other: bokeh.model.model.model, other_attr: str, attr_selector: tùy chọn [union [int, str]] = none]
Example:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]1 Liên kết hai thuộc tính mô hình Bokeh bằng JavaScript.[event:Union[str, Type[bokeh.events.Event]], *callbacks: Union[Callable[[bokeh.events.Event], None],Callable[[], None]]] → None¶
Đây là một phương thức tiện lợi giúp đơn giản hóa việc thêm một cuộc gọi lại CustomJS để cập nhật một thuộc tính mô hình Bokeh bất cứ khi nào thay đổi giá trị khác.
attr [str] - tên của một thuộc tính bokeh trên mô hình nàybokeh.events for more information on which Models are able to trigger them.
Khác [Mô hình] - Một mô hình Bokeh để liên kết đến Self.Attrproperties[*, _with_props: bool=False] → Union[Set[str],Dict[str, Property[Any]]]¶other_attr [str] - thuộc tính trên
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]31 để liên kết với nhau
attr_selector [Union [int, str]] - Chỉ mục liên kết một mục trong một
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 có thể đăng ký
Đã thêm vào phiên bản 1.1
Trả lạiTăng
ValueError -properties_with_refs[] → Dict[str, Property[Any]]¶Ví dụ
Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.
Trả lạiMã này với
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]6:Loại trở lại
set[str]
Ngoài ra, để sử dụng attr_selector để gắn phía bên trái của một slider phạm vi vào cốt truyện của X X_Range:
Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.
tương đương với:
Thông sốKhác [HASPROPS] - trường hợp khác để so sánh với [bool, optional] – Whether to include properties that haven’t been explicitly set since the object was created. [default: True]
Trả lạiĐúng, nếu các thuộc tính có cấu trúc bằng nhau, nếu không thì sai
Loại trở lạijs_link [attr: str, other: bokeh.model.model.model, other_attr: str, attr_selector: tùy chọn [union [int, str]] = none]
Liên kết hai thuộc tính mô hình Bokeh bằng JavaScript.[query: Callable[[bokeh.core.property.descriptors.PropertyDescriptor[Any]], bool], *, include_defaults:bool= True, include_undefined:bool=False] → Dict[str,Any]¶Đây là một phương thức tiện lợi giúp đơn giản hóa việc thêm một cuộc gọi lại CustomJS để cập nhật một thuộc tính mô hình Bokeh bất cứ khi nào thay đổi giá trị khác.
Thông sốTruy vấn [có thể gọi được] - một người có thể gọi chấp nhận mô tả thuộc tính và trả về đúng hoặc sai [callable] – A callable that accepts property descriptors and returns True or False
Bao gồm_defaults [bool, tùy chọn] - có bao gồm các thuộc tính chưa được người dùng đặt rõ ràng [mặc định: true] [bool, optional] – Whether to include properties that have not been explicitly set by a user [default: True]
ánh xạ tên và giá trị thuộc tính cho các thuộc tính phù hợp
Loại trở lạiDIGN
Tài liệu tham khảo [] → Đặt [Bokeh.Model.Model.Model] ¶[] → Set[bokeh.model.model.Model]¶Trả về tất cả
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]2 mà đối tượng này có tài liệu tham khảo. remove_on_change [attr: str, *gọi lại: có thể gọi được [[str, any, any], none]] → none¶[attr:str, *callbacks: Callable[[str,Any,Any], None]] → None¶
Xóa một cuộc gọi lại khỏi đối tượng này
Chọn [Selector: Selectorype] → Itable [model] ¶[selector:SelectorType] → Iterable[Model]¶Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho.
Thông sốbộ chọn [giống JSON]- [JSON-like] –
Trả lạiseq[Model]
ánh xạ tên và giá trị thuộc tính cho các thuộc tính phù hợp[selector:SelectorType] → Model|None¶Loại trở lại
Trả lạiánh xạ tên và giá trị thuộc tính cho các thuộc tính phù hợp
Loại trở lại[name: str, json:JSON, *, models:Dict[ID, HasProps]|None=None, setter:Setter| None=None] → None¶DIGN
Thông sốTài liệu tham khảo [] → Đặt [Bokeh.Model.Model.Model] ¶ – [str] : name of the attribute to set
Trả về tất cả
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]
2 mà đối tượng này có tài liệu tham khảo. – [JSON-value] : value to set to the attribute toremove_on_change [attr: str, *gọi lại: có thể gọi được [[str, any, any], none]] → none¶ [dict or None, optional] –
Xóa một cuộc gọi lại khỏi đối tượng này
Chọn [Selector: Selectorype] → Itable [model] ¶
Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho. [ClientSession or ServerSession or None, optional] –
bộ chọn [giống JSON]-
select_one [selector: selectorype] → model | none¶
ánh xạ tên và giá trị thuộc tính cho các thuộc tính phù hợp
Loại trở lại[selector:Type[Model]| SelectorType, updates:Dict[str,Unknown]] → None¶DIGN
Thông sốbộ chọn [giống JSON]- [JSON-like] –
select_one [selector: selectorype] → model | none¶ [dict] –
ánh xạ tên và giá trị thuộc tính cho các thuộc tính phù hợp
Loại trở lại[] → Optional[Dict[str, Any]]¶DIGN
Tài liệu tham khảo [] → Đặt [Bokeh.Model.Model.Model] ¶
Trả lạiánh xạ tên và giá trị thuộc tính cho các thuộc tính phù hợp
Loại trở lại[include_defaults:bool] → JSON¶DIGN
Tài liệu tham khảo [] → Đặt [Bokeh.Model.Model.Model] ¶
Trả về tất cả
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]2 mà đối tượng này có tài liệu tham khảo.
remove_on_change [attr: str, *gọi lại: có thể gọi được [[str, any, any], none]] → none¶
Thông sốXóa một cuộc gọi lại khỏi đối tượng này [bool] – whether to include attributes that haven’t been changed from the default
Chọn [Selector: Selectorype] → Itable [model] ¶[include_defaults:bool] → str¶Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho.
bộ chọn [giống JSON]-
select_one [selector: selectorype] → model | none¶
remove_on_change [attr: str, *gọi lại: có thể gọi được [[str, any, any], none]] → none¶
Thông sốXóa một cuộc gọi lại khỏi đối tượng này [bool] – whether to include attributes that haven’t been changed from the default
Chọn [Selector: Selectorype] → Itable [model] ¶[attr: str, old:Unknown, new:Unknown, hint:DocumentPatchedEvent |None=None, setter:Setter| None=None] → None¶ unapply_theme[] → None¶Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho.
Trả lạiánh xạ tên và giá trị thuộc tính cho các thuộc tính phù hợp
Loại trở lại[**kwargs:Any] → None¶DIGN
Trả lạiánh xạ tên và giá trị thuộc tính cho các thuộc tính phù hợp
Loại trở lại
DIGN
Tài liệu tham khảo [] → Đặt [Bokeh.Model.Model.Model] ¶
Trả về tất cảfrom bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]2 mà đối tượng này có tài liệu tham khảo.[json_attributes:Dict[str,JSON], *, models:Mapping[ID,HasProps]|None =None, setter:Setter|None=None] → None¶
remove_on_change [attr: str, *gọi lại: có thể gọi được [[str, any, any], none]] → none¶
Thông sốXóa một cuộc gọi lại khỏi đối tượng này – [JSON-dict] : attributes and values to update
remove_on_change [attr: str, *gọi lại: có thể gọi được [[str, any, any], none]] → none¶ [dict or None, optional] –
Xóa một cuộc gọi lại khỏi đối tượng này
Chọn [Selector: Selectorype] → Itable [model] ¶
Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho. [ClientSession or ServerSession or None, optional] –
bộ chọn [giống JSON]-
Trong bối cảnh của một ứng dụng máy chủ Bokeh, các bản cập nhật đến các thuộc tính sẽ được chú thích với phiên đang thực hiện cập nhật. Giá trị này được truyền qua bất kỳ thông báo thay đổi tiếp theo nào mà bản cập nhật kích hoạt. Phiên có thể so sánh người đặt sự kiện với chính nó và triệt tiêu mọi cập nhật bắt nguồn từ chính nó.
Không có
PropertyDocument: tài liệu | Không códocument:Document| None¶Mô hình
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]7 này được gắn vào [có thể là
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]8] Propertystruct: bokeh.core.types.referencejson¶struct:bokeh.core.types.ReferenceJson¶
Một giao thức Bokeh cấu trúc của cấu trúc của mô hình này, tức là một phương pháp của hình thức:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]3
Ngoài ra, có thể có một trường phân nhóm nếu mô hình này là một kiểu con.
CustomJS¶
ClassCustomJs [*args, ** kwargs] [nguồn] ¶ CustomJS[*args, **kwargs][source]¶Cơ sở:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]50
Thực hiện chức năng JavaScript.
Cảnh báo
Mục đích rõ ràng của mô hình Bokeh này là nhúng mã JavaScript thô để trình duyệt thực thi. Nếu bất kỳ phần nào của mã được lấy từ các đầu vào người dùng không tin cậy, thì bạn phải chăm sóc thích hợp để vệ sinh đầu vào của người dùng trước khi chuyển đến Bokeh.
Nguyên mẫu JSONdef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]4
Thuộc tính dữ liệu công khai:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]51 | Một ánh xạ tên cho các đối tượng Python. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]52 | Một đoạn mã JavaScript để thực thi trong trình duyệt. |
select.js_link['value', plot, 'sizing_mode']4 | |
select.js_link['value', plot, 'sizing_mode']5 | |
select.js_link['value', plot, 'sizing_mode']6 | |
select.js_link['value', plot, 'sizing_mode']7 | Một giao thức Bokeh "Cấu trúc" của mô hình này, tức là một lệnh của hình thức:. |
select.js_link['value', plot, 'sizing_mode']8 | Một tên tùy ý, do người dùng cung cấp cho mô hình này. |
select.js_link['value', plot, 'sizing_mode']9 | Một danh sách tùy chọn các giá trị tùy ý, do người dùng cung cấp để đính kèm với mô hình này. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]0 | Một ánh xạ tên sự kiện vào danh sách các cuộc gọi lại from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]2 | Danh sách các sự kiện được đăng ký bởi các cuộc gọi lại Python. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]3 | Một ánh xạ của các tên thuộc tính vào danh sách các cuộc gọi lại from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1, sẽ được thiết lập ở phía Bokehjs khi tài liệu được tạo. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]5 | Cho biết liệu mô hình này có nên được đồng bộ hóa trở lại máy chủ Bokeh khi được cập nhật trong trình duyệt web hay không. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]6 | Mô hình from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]7 này được gắn vào [có thể là from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]8] |
Propertystruct: bokeh.core.types.referencejson¶
Được thừa hưởng từ: PY: Class: Modelfrom bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]9[] | Một giao thức Bokeh "Cấu trúc" của mô hình này, tức là một lệnh của hình thức:. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]0[cls, *args, **kwargs] | |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]2[] | Một tên tùy ý, do người dùng cung cấp cho mô hình này. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]3[] | Một danh sách tùy chọn các giá trị tùy ý, do người dùng cung cấp để đính kèm với mô hình này. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]4[] | Một ánh xạ tên sự kiện vào danh sách các cuộc gọi lại from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]5[event, *callbacks] | |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]6[attr, other, other_attr[, attr_selector]] | Danh sách các sự kiện được đăng ký bởi các cuộc gọi lại Python. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]7[event, *callbacks] | Một ánh xạ của các tên thuộc tính vào danh sách các cuộc gọi lại from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1, sẽ được thiết lập ở phía Bokehjs khi tài liệu được tạo. |
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]1[attr, *callbacks] | Cho biết liệu mô hình này có nên được đồng bộ hóa trở lại máy chủ Bokeh khi được cập nhật trong trình duyệt web hay không. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]1[] | Được thừa hưởng từ: PY: Lớp: Hasdocumentref |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]3[selector] | Phương pháp công khai: |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]4[selector] | Phương pháp công khai: |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]5[selector, updates] | Phương pháp này được gọi là khi một lớp được phân lớp. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]6[include_defaults] | Trả lại str [tự]. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]7[include_defaults] | Trả lại repr [tự]. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]8[attr, old, new[, hint, setter]] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]0[name, value] | Liên kết hai thuộc tính mô hình Bokeh bằng JavaScript. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]1[name] | Liên kết hai thuộc tính mô hình Bokeh bằng JavaScript. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]2[] | Một tên tùy ý, do người dùng cung cấp cho mô hình này. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]3[] | Một danh sách tùy chọn các giá trị tùy ý, do người dùng cung cấp để đính kèm với mô hình này. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]4[other] | Một ánh xạ tên sự kiện vào danh sách các cuộc gọi lại from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]5[serializer] | |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]6[serializer] | |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]7[name, json, *[, models, setter]] | Danh sách các sự kiện được đăng ký bởi các cuộc gọi lại Python. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]8[**kwargs] | Một ánh xạ của các tên thuộc tính vào danh sách các cuộc gọi lại from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1, sẽ được thiết lập ở phía Bokehjs khi tài liệu được tạo. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]9[json_attributes, *[, ...]] | Cho biết liệu mô hình này có nên được đồng bộ hóa trở lại máy chủ Bokeh khi được cập nhật trong trình duyệt web hay không. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]00[name, *[, raises]] | Được thừa hưởng từ: PY: Lớp: Hasdocumentref |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]02[*[, _with_props]] | Phương pháp công khai: |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]03[] | Phương pháp này được gọi là khi một lớp được phân lớp. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]04[] | Trả lại str [tự]. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]06[*[, ...]] | Trả lại repr [tự]. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]07[query, *[, ...]] | Làm sạch các tài liệu tham khảo đến tài liệu và tài sản |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]09[] | Nhận bất kỳ sự ghi đè được cung cấp chủ đề. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]10[property_values] | Áp dụng một tập hợp các giá trị chủ đề sẽ được sử dụng thay vì mặc định, nhưng sẽ không ghi đè các giá trị bộ ứng dụng. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]11[] | Xóa bất kỳ giá trị theo chủ đề và khôi phục mặc định. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]1[attr, *callbacks] | Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi >>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]16[attr, *callbacks] | Xóa một cuộc gọi lại khỏi đối tượng này |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]8[attr, old, new[, hint, setter]] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]8[event, *callbacks] | Chạy các cuộc gọi lại khi sự kiện được chỉ định xảy ra trên mô hình này |
________ 219 [________ 121,
{ "id": "1709", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "syncable": true, "tags": [] }21]
Một ánh xạ tên cho các đối tượng Python. Đặc biệt đó có thể là mô hình Bokeh. Các đối tượng này được cung cấp cho đoạn mã Callback, mã giá trị của các tham số được đặt tên cho cuộc gọi lại.
mã = '' ¶Type= ''¶Typedef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]21
Một đoạn mã JavaScript để thực thi trong trình duyệt. Mã được tạo thành phần thân của một hàm và tất cả các đối tượng được đặt tên trong
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]51 có sẵn dưới dạng các tham số mà mã có thể sử dụng. Ngoài ra, tham số
{ "id": "1709", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "syncable": true, "tags": [] }24 chứa đối tượng đã kích hoạt cuộc gọi lại và tham số
{ "id": "1709", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "syncable": true, "tags": [] }25 tùy chọn chứa bất kỳ dữ liệu cụ thể cho công cụ nào [nghĩa là tọa độ chuột và chỉ số GlyPH lơ lửng cho
{ "id": "1709", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "syncable": true, "tags": [] }26]. Tên = không có = None¶Type
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]20[
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]21]
Một tên tùy ý, do người dùng cung cấp cho mô hình này.
Tên này có thể hữu ích khi truy vấn tài liệu để truy xuất các mô hình Bokeh cụ thể.
>>> plot.circle[[1,2,3], [4,5,6], name="temp"] >>> plot.select[name="temp"] [GlyphRenderer[id='399d53f5-73e9-44d9-9527-544b761c7705', ...]]
Ghi chú
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ tên nào được cung cấp, cũng không phải là tên được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
Syncable = true¶type= True¶Typedef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]22
Cho biết liệu mô hình này có nên được đồng bộ hóa trở lại máy chủ Bokeh khi được cập nhật trong trình duyệt web hay không. Cài đặt thành
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 có thể hữu ích để giảm lưu lượng mạng khi xử lý các đối tượng được cập nhật thường xuyên có giá trị cập nhật mà chúng tôi không cần.
Ghi chú
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ tên nào được cung cấp, cũng không phải là tên được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]26
Cho biết liệu mô hình này có nên được đồng bộ hóa trở lại máy chủ Bokeh khi được cập nhật trong trình duyệt web hay không. Cài đặt thành
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 có thể hữu ích để giảm lưu lượng mạng khi xử lý các đối tượng được cập nhật thường xuyên có giá trị cập nhật mà chúng tôi không cần.
Đặt thuộc tính này thành
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 sẽ ngăn bất kỳ cuộc gọi lại
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]25 nào trên đối tượng này kích hoạt. Tuy nhiên, bất kỳ cuộc gọi lại phía JS nào vẫn sẽ hoạt động.
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]
Tags = [] ¶Type
Ghi chú
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ tên nào được cung cấp, cũng không phải là tên được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
Syncable = true¶type[property_values:Dict[str,Any]] → None¶Áp dụng một tập hợp các giá trị chủ đề sẽ được sử dụng thay vì mặc định, nhưng sẽ không ghi đè các giá trị bộ ứng dụng.
Cho biết liệu mô hình này có nên được đồng bộ hóa trở lại máy chủ Bokeh khi được cập nhật trong trình duyệt web hay không. Cài đặt thành
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 có thể hữu ích để giảm lưu lượng mạng khi xử lý các đối tượng được cập nhật thường xuyên có giá trị cập nhật mà chúng tôi không cần.Đặt thuộc tính này thành
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 sẽ ngăn bất kỳ cuộc gọi lại
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]25 nào trên đối tượng này kích hoạt. Tuy nhiên, bất kỳ cuộc gọi lại phía JS nào vẫn sẽ hoạt động.
Tags = [] ¶Type [dict] – theme values to use in place of defaults
Một danh sách tùy chọn các giá trị tùy ý, do người dùng cung cấp để đính kèm với mô hình này.Dữ liệu này có thể hữu ích khi truy vấn tài liệu để truy xuất các mô hình Bokeh cụ thể:
Hoặc đơn giản là một cách thuận tiện để gắn bất kỳ siêu dữ liệu cần thiết nào vào mô hình có thể được truy cập bằng các cuộc gọi lạifrom bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1, v.v.dataspecs[] → Dict[str, DataSpec]¶
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ thẻ nào được cung cấp, cũng không phải là các thẻ được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
Ứng dụng_theme [Property_Values: Dict [Str, Any]] → Không ai
Một danh sách tùy chọn các giá trị tùy ý, do người dùng cung cấp để đính kèm với mô hình này.Dữ liệu này có thể hữu ích khi truy vấn tài liệu để truy xuất các mô hình Bokeh cụ thể:
Hoặc đơn giản là một cách thuận tiện để gắn bất kỳ siêu dữ liệu cần thiết nào vào mô hình có thể được truy cập bằng các cuộc gọi lạifrom bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1, v.v.
set[str]
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ thẻ nào được cung cấp, cũng không phải là các thẻ được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.[] → None¶Ứng dụng_theme [Property_Values: Dict [Str, Any]] → Không ai
Từ điển truyền qua có thể được giữ xung quanh AS-IS và được chia sẻ với các trường hợp khác để lưu bộ nhớ [vì vậy cả người gọi và trường hợp ____108 đều không nên sửa đổi nó].[other:bokeh.core.has_props.HasProps] → bool¶Thông số
Đặt thuộc tính này thànhdef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 sẽ ngăn bất kỳ cuộc gọi lại
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]25 nào trên đối tượng này kích hoạt. Tuy nhiên, bất kỳ cuộc gọi lại phía JS nào vẫn sẽ hoạt động.
Tags = [] ¶Type [HasProps] – the other instance to compare to
Một danh sách tùy chọn các giá trị tùy ý, do người dùng cung cấp để đính kèm với mô hình này.Dữ liệu này có thể hữu ích khi truy vấn tài liệu để truy xuất các mô hình Bokeh cụ thể:
Hoặc đơn giản là một cách thuận tiện để gắn bất kỳ siêu dữ liệu cần thiết nào vào mô hình có thể được truy cập bằng các cuộc gọi lạifrom bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1, v.v.[attr: str, other:bokeh.model.model.Model, other_attr: str, attr_selector:Optional[Union[int, str]]=None] → None¶
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ thẻ nào được cung cấp, cũng không phải là các thẻ được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
Ứng dụng_theme [Property_Values: Dict [Str, Any]] → Không ai
Đặt thuộc tính này thànhdef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 sẽ ngăn bất kỳ cuộc gọi lại
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]25 nào trên đối tượng này kích hoạt. Tuy nhiên, bất kỳ cuộc gọi lại phía JS nào vẫn sẽ hoạt động.
Tags = [] ¶Type [str] – The name of a Bokeh property on this model
Một danh sách tùy chọn các giá trị tùy ý, do người dùng cung cấp để đính kèm với mô hình này. [Model] – A Bokeh model to link to self.attr
Dữ liệu này có thể hữu ích khi truy vấn tài liệu để truy xuất các mô hình Bokeh cụ thể: [str] – The property on
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]
31 to link togetherHoặc đơn giản là một cách thuận tiện để gắn bất kỳ siêu dữ liệu cần thiết nào vào mô hình có thể được truy cập bằng các cuộc gọi lại
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]
1, v.v. [Union[int, str]] – The index to link an item in a subscriptable>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]
4
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ thẻ nào được cung cấp, cũng không phải là các thẻ được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
Ứng dụng_theme [Property_Values: Dict [Str, Any]] → Không aiTừ điển truyền qua có thể được giữ xung quanh AS-IS và được chia sẻ với các trường hợp khác để lưu bộ nhớ [vì vậy cả người gọi và trường hợp ____108 đều không nên sửa đổi nó]. –
Thông số
Property_Values [Dict] - Giá trị chủ đề để sử dụng thay cho mặc định
select.js_link['value', plot, 'sizing_mode']
Trả lại
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]
Không có
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]
classMethodDatAspecs [] → dict [str, dataspec] ¶
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]Thu thập tên của tất cả các thuộc tính
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 trên lớp này.[event: str, *callbacks:JSEventCallback] → None¶
Đính kèm một cuộc gọi lại
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1 vào một sự kiện mô hình BokeHJS tùy ý.
Về phía BokeHJS, các sự kiện thay đổi cho các thuộc tính mô hình có dạng
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]35. Để thuận tiện, nếu tên sự kiện được chuyển cho phương thức này cũng là tên của một thuộc tính trên mô hình, thì nó sẽ được đặt trước với
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]36 tự động:
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]
Tuy nhiên, có những loại sự kiện khác có thể hữu ích để đáp ứng, ngoài các sự kiện thay đổi tài sản. Ví dụ: để chạy một cuộc gọi lại bất cứ khi nào dữ liệu được truyền đến
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]37, hãy sử dụng sự kiện
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]38 trên nguồn:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]0 classMethodLookup [Tên: str, *, tăng: bool = true] → tùy chọn [bokeh.core.property.descriptors.propertydescriptor [any]] ¶ lookup[name:str, *, raises: bool=True] → Optional[bokeh.core.property.descriptors.PropertyDescriptor[Any]]¶
Tìm
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]01 cho thuộc tính Bokeh trên một lớp, được đặt tên thuộc tính.Thông số
Tên [str] - tên của tài sản để tìm kiếm [str] – name of the property to search for
tăng [bool] - dù sẽ tăng hay không trả lại nếu thiếu [bool] – whether to raise or return None if missing
Mô tả cho tài sản có tên
select.js_link['value', plot, 'sizing_mode']8Loại trở lại
PropertyDescriptor
on_change [attr: str, *gọi lại: propertyCallback] → none¶[attr: str, *callbacks:PropertyCallback] → None¶Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi.Thông số
Tên [str] - tên của tài sản để tìm kiếm [str] – an attribute name on this object
tăng [bool] - dù sẽ tăng hay không trả lại nếu thiếu [callable] – callback functions to register
Mô tả cho tài sản có tên
select.js_link['value', plot, 'sizing_mode']8
Example:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]1 Loại trở lại[event:Union[str, Type[bokeh.events.Event]], *callbacks: Union[Callable[[bokeh.events.Event], None],Callable[[], None]]] → None¶
PropertyDescriptor
on_change [attr: str, *gọi lại: propertyCallback] → none¶bokeh.events for more information on which Models are able to trigger them.
Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi.properties[*, _with_props: bool=False] → Union[Set[str],Dict[str, Property[Any]]]¶
attr [str] - một tên thuộc tính trên đối tượng này
*gọi lại [có thể gọi] - Các chức năng gọi lại để đăng ký
Không có
Trả lạiMô tả cho tài sản có tên
select.js_link['value', plot, 'sizing_mode']8 Loại trở lạiproperties_with_refs[] → Dict[str, Property[Any]]¶
PropertyDescriptor
on_change [attr: str, *gọi lại: propertyCallback] → none¶
Trả lạiMô tả cho tài sản có tên
select.js_link['value', plot, 'sizing_mode']8Loại trở lại
set[str]
PropertyDescriptor[*, include_defaults:bool=True, include_undefined: bool=False] → Dict[str, Any]¶on_change [attr: str, *gọi lại: propertyCallback] → none¶
on_change [attr: str, *gọi lại: propertyCallback] → none¶
Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi.Thông số
Tên [str] - tên của tài sản để tìm kiếm [bool, optional] – Whether to include properties that haven’t been explicitly set since the object was created. [default: True]
Trả lạiMô tả cho tài sản có tên
select.js_link['value', plot, 'sizing_mode']8Loại trở lại
PropertyDescriptor
on_change [attr: str, *gọi lại: propertyCallback] → none¶[query: Callable[[bokeh.core.property.descriptors.PropertyDescriptor[Any]], bool], *, include_defaults:bool= True, include_undefined:bool=False] → Dict[str,Any]¶Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi.Thông số
Tên [str] - tên của tài sản để tìm kiếm [callable] – A callable that accepts property descriptors and returns True or False
tăng [bool] - dù sẽ tăng hay không trả lại nếu thiếu [bool, optional] – Whether to include properties that have not been explicitly set by a user [default: True]
Mô tả cho tài sản có tên
select.js_link['value', plot, 'sizing_mode']8Loại trở lại
PropertyDescriptor
on_change [attr: str, *gọi lại: propertyCallback] → none¶[] → Set[bokeh.model.model.Model]¶Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi. attr [str] - một tên thuộc tính trên đối tượng này[attr:str, *callbacks: Callable[[str,Any,Any], None]] → None¶
*gọi lại [có thể gọi] - Các chức năng gọi lại để đăng ký
Không có[selector:SelectorType] → Iterable[Model]¶on_event [sự kiện: Union [str, type [bokeh.events.event]], *gọi lại: Union [Callable [[bokeh.events.event], none], callable [[], none]]]
Thông sốChạy các cuộc gọi lại khi sự kiện được chỉ định xảy ra trên mô hình này [JSON-like] –
Trả lạiseq[Model]
Mô tả cho tài sản có tênselect.js_link['value', plot, 'sizing_mode']8[selector:SelectorType] → Model|None¶
Loại trở lại
Trả lạiMô tả cho tài sản có tên
select.js_link['value', plot, 'sizing_mode']8 Loại trở lại[name: str, json:JSON, *, models:Dict[ID, HasProps]|None=None, setter:Setter| None=None] → None¶
PropertyDescriptor
Thông sốon_change [attr: str, *gọi lại: propertyCallback] → none¶ – [str] : name of the attribute to set
Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]
4 thay đổi. – [JSON-value] : value to set to the attribute toattr [str] - một tên thuộc tính trên đối tượng này [dict or None, optional] –
*gọi lại [có thể gọi] - Các chức năng gọi lại để đăng ký
Điều này là cần thiết trong trường hợp các thuộc tính để cập nhật cũng có các giá trị có tài liệu tham khảo.
setter [khách hàng hoặc máy chủ hoặc không có, tùy chọn] - [ClientSession or ServerSession or None, optional] –
Điều này được sử dụng để ngăn chặn các bản cập nhật của Boom Boomerang cho các ứng dụng Bokeh.
Trong bối cảnh của một ứng dụng máy chủ Bokeh, các bản cập nhật đến các thuộc tính sẽ được chú thích với phiên đang thực hiện cập nhật. Giá trị này được truyền qua bất kỳ thông báo thay đổi tiếp theo nào mà bản cập nhật kích hoạt. Phiên có thể so sánh người đặt sự kiện với chính nó và triệt tiêu mọi cập nhật bắt nguồn từ chính nó.
Không có
set_select [selector: type [model] | selectorype, cập nhật: dict [str, không xác định]] → none¶[selector:Type[Model]| SelectorType, updates:Dict[str,Unknown]] → None¶Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định.
Thông sốbộ chọn [giống JSON]- [JSON-like] –
Cập nhật [Dict] - [dict] –
Không có
set_select [selector: type [model] | selectorype, cập nhật: dict [str, không xác định]] → none¶[] → Optional[Dict[str, Any]]¶Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định.
Thông số
Trả lạiKhông có
set_select [selector: type [model] | selectorype, cập nhật: dict [str, không xác định]] → none¶[include_defaults:bool] → JSON¶Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định.
Thông số
bộ chọn [giống JSON]-
Cập nhật [Dict] -
Thông sốbộ chọn [giống JSON]- [bool] – whether to include attributes that haven’t been changed from the default
Cập nhật [Dict] -[include_defaults:bool] → str¶Theo chủ đề_values [] → Tùy chọn [Dict [Str, Any]]
Nhận bất kỳ sự ghi đè được cung cấp chủ đề.
Kết quả được trả về dưới dạng dict từ tên thuộc tính sang giá trị hoặc
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]8 nếu không có chủ đề nào ghi đè bất kỳ giá trị nào cho trường hợp này.
Cập nhật [Dict] -
Thông sốbộ chọn [giống JSON]- [bool] – whether to include attributes that haven’t been changed from the default
Cập nhật [Dict] -[attr: str, old:Unknown, new:Unknown, hint:DocumentPatchedEvent |None=None, setter:Setter| None=None] → None¶ unapply_theme[] → None¶Theo chủ đề_values [] → Tùy chọn [Dict [Str, Any]]
Trả lạiKhông có
set_select [selector: type [model] | selectorype, cập nhật: dict [str, không xác định]] → none¶[**kwargs:Any] → None¶Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định.
Trả lạiKhông có
set_select [selector: type [model] | selectorype, cập nhật: dict [str, không xác định]] → none¶
Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định.
Thông số
bộ chọn [giống JSON]-[json_attributes:Dict[str,JSON], *, models:Mapping[ID,HasProps]|None =None, setter:Setter|None=None] → None¶Cập nhật [Dict] -
Thông sốbộ chọn [giống JSON]- – [JSON-dict] : attributes and values to update
Cập nhật [Dict] - [dict or None, optional] –
Theo chủ đề_values [] → Tùy chọn [Dict [Str, Any]]
Điều này là cần thiết trong trường hợp các thuộc tính để cập nhật cũng có các giá trị có tài liệu tham khảo.
setter [khách hàng hoặc máy chủ hoặc không có, tùy chọn] - [ClientSession or ServerSession or None, optional] –
Điều này được sử dụng để ngăn chặn các bản cập nhật của Boom Boomerang cho các ứng dụng Bokeh.
Trong bối cảnh của một ứng dụng máy chủ Bokeh, các bản cập nhật đến các thuộc tính sẽ được chú thích với phiên đang thực hiện cập nhật. Giá trị này được truyền qua bất kỳ thông báo thay đổi tiếp theo nào mà bản cập nhật kích hoạt. Phiên có thể so sánh người đặt sự kiện với chính nó và triệt tiêu mọi cập nhật bắt nguồn từ chính nó.
Không có
set_select [selector: type [model] | selectorype, cập nhật: dict [str, không xác định]] → none¶document:Document| None¶Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định.
Thông sốstruct:bokeh.core.types.ReferenceJson¶bộ chọn [giống JSON]-
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]3
Cập nhật [Dict] -
Theo chủ đề_values [] → Tùy chọn [Dict [Str, Any]]
Nhận bất kỳ sự ghi đè được cung cấp chủ đề. OpenURL[*args, **kwargs][source]¶Kết quả được trả về dưới dạng dict từ tên thuộc tính sang giá trị hoặc
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]8 nếu không có chủ đề nào ghi đè bất kỳ giá trị nào cho trường hợp này.
ra lệnh hoặc không có
to_json [bao gồm_defaults: bool] → json¶{ "id": "1709", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "syncable": true, "tags": [] }6
Trả về một từ điển của các thuộc tính của đối tượng này, chỉ chứa các loại json json [chuỗi, số, boolean, none, dict, danh sách].
{ "id": "1709", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "syncable": true, "tags": [] }58 | Các tham chiếu đến các đối tượng khác được tuần tự hóa dưới dạng ref refs [chỉ là ID đối tượng và thông tin loại], do đó, trình phân hủy sẽ cần phải có các thuộc tính đầy đủ của các đối tượng khác. |
{ "id": "1709", "js_event_callbacks": {}, "js_property_callbacks": {}, "name": null, "subscribed_events": [], "syncable": true, "tags": [] }59 | Không có def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]46 tương ứng vì để giải phóng một đối tượng thường được thực hiện trong bối cảnh của một tài liệu [vì tài liệu có thể giải quyết các tài liệu tham khảo]. |
select.js_link['value', plot, 'sizing_mode']4 | |
select.js_link['value', plot, 'sizing_mode']5 | |
select.js_link['value', plot, 'sizing_mode']6 | |
select.js_link['value', plot, 'sizing_mode']7 | bao gồm_defaults [bool] - có bao gồm các thuộc tính mà thiên đường đã được thay đổi từ mặc định |
select.js_link['value', plot, 'sizing_mode']8 | to_json_string [bao gồm_defaults: bool] → str¶ |
select.js_link['value', plot, 'sizing_mode']9 | Trả về một chuỗi JSON mã hóa các thuộc tính của đối tượng này. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]0 | Các tham chiếu đến các đối tượng khác được tuần tự hóa dưới dạng tài liệu tham khảo [chỉ ID đối tượng và thông tin loại], do đó, trình phân hủy sẽ cần phải có các thuộc tính đầy đủ của các đối tượng khác. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]2 | Không có def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]47 tương ứng vì để giải phóng một đối tượng thường được thực hiện trong bối cảnh của một tài liệu [vì tài liệu có thể giải quyết các tài liệu tham khảo]. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]3 | Một ánh xạ của các tên thuộc tính vào danh sách các cuộc gọi lại from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1, sẽ được thiết lập ở phía Bokehjs khi tài liệu được tạo. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]5 | Cho biết liệu mô hình này có nên được đồng bộ hóa trở lại máy chủ Bokeh khi được cập nhật trong trình duyệt web hay không. |
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]6 | Mô hình from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]7 này được gắn vào [có thể là from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]8] |
Phương pháp công khai:
Được thừa hưởng từ: PY: Class: Modelfrom bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]9[] | Phương pháp này được gọi là khi một lớp được phân lớp. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]0[cls, *args, **kwargs] | |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]2[] | Trả lại str [tự]. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]3[] | Trả lại repr [tự]. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]4[] | Làm sạch các tài liệu tham khảo đến tài liệu và tài sản |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]5[event, *callbacks] | |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]6[attr, other, other_attr[, attr_selector]] | Liên kết hai thuộc tính mô hình Bokeh bằng JavaScript. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]7[event, *callbacks] | Đính kèm một cuộc gọi lại from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1 vào một sự kiện mô hình BokeHJS tùy ý. |
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]1[attr, *callbacks] | Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi >>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]1[] | Trả về tất cả from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]2 mà đối tượng này có tài liệu tham khảo. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]3[selector] | Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]4[selector] | Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]5[selector, updates] | Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]6[include_defaults] | Trả về một từ điển của các thuộc tính của đối tượng này, chỉ chứa "các loại json" [chuỗi, số, boolean, none, dict, list]. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]7[include_defaults] | Trả về một chuỗi JSON mã hóa các thuộc tính của đối tượng này. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]8[attr, old, new[, hint, setter]] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]0[name, value] | Cài đặt thuộc tính chặn trên HasProps Để trường hợp đặc biệt Một vài tình huống: |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]1[name] | Cài đặt thuộc tính chặn trên HasProps Để trường hợp đặc biệt Một vài tình huống: |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]2[] | Trả lại str [tự]. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]3[] | Trả lại repr [tự]. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]4[other] | Làm sạch các tài liệu tham khảo đến tài liệu và tài sản |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]5[serializer] | |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]6[serializer] | |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]7[name, json, *[, models, setter]] | Liên kết hai thuộc tính mô hình Bokeh bằng JavaScript. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]8[**kwargs] | Đính kèm một cuộc gọi lại from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1 vào một sự kiện mô hình BokeHJS tùy ý. |
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]9[json_attributes, *[, ...]] | Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi >>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]00[name, *[, raises]] | Trả về tất cả from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]2 mà đối tượng này có tài liệu tham khảo. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]02[*[, _with_props]] | Truy vấn đối tượng này và tất cả các tài liệu tham khảo của nó cho các đối tượng phù hợp với bộ chọn đã cho. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]03[] | Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]04[] | Trả về một từ điển của các thuộc tính của đối tượng này, chỉ chứa "các loại json" [chuỗi, số, boolean, none, dict, list]. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]06[*[, ...]] | Trả về một chuỗi JSON mã hóa các thuộc tính của đối tượng này. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]07[query, *[, ...]] | Được thừa hưởng từ: PY: Lớp: Hasprops |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]09[] | Cài đặt thuộc tính chặn trên HasProps Để trường hợp đặc biệt Một vài tình huống: |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]10[property_values] | Bình đẳng cấu trúc của các mô hình. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]11[] | Đặt giá trị thuộc tính trên đối tượng này từ JSON. |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]1[attr, *callbacks] | Thêm một cuộc gọi lại trên đối tượng này để kích hoạt khi >>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]4 thay đổi. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]16[attr, *callbacks] | Trả về tất cả from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]2 mà đối tượng này có tài liệu tham khảo. |
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]8[attr, old, new[, hint, setter]] |
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]1[**kwargs] | |
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]8[event, *callbacks] | Cập nhật các đối tượng khớp với một bộ chọn nhất định với các bản cập nhật thuộc tính/giá trị được chỉ định. |
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]20[
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]21]
Trả về một chuỗi JSON mã hóa các thuộc tính của đối tượng này.
Được thừa hưởng từ: PY: Lớp: Hasprops
>>> plot.circle[[1,2,3], [4,5,6], name="temp"] >>> plot.select[name="temp"] [GlyphRenderer[id='399d53f5-73e9-44d9-9527-544b761c7705', ...]]
Cài đặt thuộc tính chặn trên HasProps Để trường hợp đặc biệt Một vài tình huống:
Bình đẳng cấu trúc của các mô hình.
Đặt giá trị thuộc tính trên đối tượng này từ JSON.= False¶Typedef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]22
Cập nhật các thuộc tính của đối tượng từ các đối số từ khóa đã cho.
Cập nhật các thuộc tính của đối tượng từ Từ điển thuộc tính JSON.= True¶Typedef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]22
Tìm
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]01 cho thuộc tính Bokeh trên một lớp, được đặt tên thuộc tính.
Ghi chú
Đặt thuộc tính này thành
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]23 sẽ ngăn bất kỳ cuộc gọi lại
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]25 nào trên đối tượng này kích hoạt. Tuy nhiên, bất kỳ cuộc gọi lại phía JS nào vẫn sẽ hoạt động. Tags = [] ¶Type= []¶Type
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]26
Một danh sách tùy chọn các giá trị tùy ý, do người dùng cung cấp để đính kèm với mô hình này.
Dữ liệu này có thể hữu ích khi truy vấn tài liệu để truy xuất các mô hình Bokeh cụ thể:
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]
Hoặc đơn giản là một cách thuận tiện để gắn bất kỳ siêu dữ liệu cần thiết nào vào mô hình có thể được truy cập bằng các cuộc gọi lại
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]1, v.v.
Ghi chú
Không có đảm bảo tính duy nhất hoặc các điều kiện khác được thực thi trên bất kỳ thẻ nào được cung cấp, cũng không phải là các thẻ được Bokeh sử dụng trực tiếp vì bất kỳ lý do gì.
url = ' //' ¶type= '//'¶Typedef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]21
URL để hướng trình duyệt web đến. Đây có thể là một chuỗi mẫu, sẽ được định dạng với dữ liệu từ nguồn dữ liệu.
Ứng dụng_theme [Property_Values: Dict [Str, Any]] → Không ai[property_values:Dict[str,Any]] → None¶Áp dụng một tập hợp các giá trị chủ đề sẽ được sử dụng thay vì mặc định, nhưng sẽ không ghi đè các giá trị bộ ứng dụng.
Từ điển truyền qua có thể được giữ xung quanh AS-IS và được chia sẻ với các trường hợp khác để lưu bộ nhớ [vì vậy cả người gọi và trường hợp ____108 đều không nên sửa đổi nó].
Thông sốProperty_Values [Dict] - Giá trị chủ đề để sử dụng thay cho mặc định [dict] – theme values to use in place of defaults
Trả lạiKhông có
classMethodDatAspecs [] → dict [str, dataspec] ¶dataspecs[] → Dict[str, DataSpec]¶Thu thập tên của tất cả các thuộc tính
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 trên lớp này.
Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.
Trả lạiKhông có
classMethodDatAspecs [] → dict [str, dataspec] ¶set[str]
Thu thập tên của tất cả các thuộc tínhdef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 trên lớp này.[] → None¶
Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.
Tên củadef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 thuộc tính[other:bokeh.core.has_props.HasProps] → bool¶
Loại trở lại
Thông sốProperty_Values [Dict] - Giá trị chủ đề để sử dụng thay cho mặc định [HasProps] – the other instance to compare to
Trả lạiKhông có
classMethodDatAspecs [] → dict [str, dataspec] ¶[attr: str, other:bokeh.model.model.Model, other_attr: str, attr_selector:Optional[Union[int, str]]=None] → None¶Thu thập tên của tất cả các thuộc tính
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 trên lớp này.
Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.
Thông sốProperty_Values [Dict] - Giá trị chủ đề để sử dụng thay cho mặc định [str] – The name of a Bokeh property on this model
Trả lại [Model] – A Bokeh model to link to self.attr
Không có [str] – The property on
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]
31 to link togetherclassMethodDatAspecs [] → dict [str, dataspec] ¶ [Union[int, str]] – The index to link an item in a subscriptable
>>> r = plot.circle[[1,2,3], [4,5,6]] >>> r.tags = ["foo", 10] >>> plot.select[tags=['foo', 10]] [GlyphRenderer[id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...]]
4
Thu thập tên của tất cả các thuộc tính
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 trên lớp này.Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.
Tên của def my_radio_handler[new]:
print['Radio button option ' + str[new] + ' selected.']
radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0]
radio_group.on_event['button_click', my_radio_handler]
05 thuộc tính –
Loại trở lại
phá hủy [] → không có
select.js_link['value', plot, 'sizing_mode']
Làm sạch các tài liệu tham khảo đến tài liệu và tài sản
from bokeh.models import CustomJS select.js_on_change['value', CustomJS[args=dict[other=plot], code="other.sizing_mode = this.value" ] ]
B bằng [Khác: Bokeh.core.has_props.hasprops] → Bool¶
range_slider.js_link['value', plot.x_range, 'start', attr_selector=0]
Bình đẳng cấu trúc của các mô hình.
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]Khác [HASPROPS] - trường hợp khác để so sánh với[event:str, *callbacks:JSEventCallback] → None¶
Đúng, nếu các thuộc tính có cấu trúc bằng nhau, nếu không thì sai
js_link [attr: str, other: bokeh.model.model.model, other_attr: str, attr_selector: tùy chọn [union [int, str]] = none]
# these two are equivalent source.js_on_change['data', callback] source.js_on_change['change:data', callback]
Liên kết hai thuộc tính mô hình Bokeh bằng JavaScript.
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]0 Đây là một phương thức tiện lợi giúp đơn giản hóa việc thêm một cuộc gọi lại CustomJS để cập nhật một thuộc tính mô hình Bokeh bất cứ khi nào thay đổi giá trị khác. lookup[name:str, *, raises: bool=True] → Optional[bokeh.core.property.descriptors.PropertyDescriptor[Any]]¶
attr [str] - tên của một thuộc tính bokeh trên mô hình này
Thông sốProperty_Values [Dict] - Giá trị chủ đề để sử dụng thay cho mặc định [str] – name of the property to search for
Trả lại [bool] – whether to raise or return None if missing
Không có
classMethodDatAspecs [] → dict [str, dataspec] ¶Thu thập tên của tất cả các thuộc tính
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 trên lớp này. Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.[attr: str, *callbacks:PropertyCallback] → None¶
Tên của
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 thuộc tínhThông số
Property_Values [Dict] - Giá trị chủ đề để sử dụng thay cho mặc định [str] – an attribute name on this object
Trả lại [callable] – callback functions to register
Không có
Example:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]1 classMethodDatAspecs [] → dict [str, dataspec] ¶[event:Union[str, Type[bokeh.events.Event]], *callbacks: Union[Callable[[bokeh.events.Event], None],Callable[[], None]]] → None¶
Thu thập tên của tất cả các thuộc tính
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 trên lớp này.
Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.bokeh.events for more information on which Models are able to trigger them.
Tên củadef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]05 thuộc tínhproperties[*, _with_props: bool=False] → Union[Set[str],Dict[str, Property[Any]]]¶
Loại trở lại
phá hủy [] → không có
Làm sạch các tài liệu tham khảo đến tài liệu và tài sản
Trả lạiKhông có
classMethodDatAspecs [] → dict [str, dataspec] ¶properties_with_refs[] → Dict[str,Property[Any]]¶Thu thập tên của tất cả các thuộc tính trên lớp này cũng có tài liệu tham khảo.
Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.
Trả lạiTên của các thuộc tính có tài liệu tham khảo
Loại trở lạiset[str]
Thuộc tính_with_values [*, bao gồm_defaults: bool = true, bao gồm_undefined: bool = false] → dict [str, any][*, include_defaults: bool=True, include_undefined:bool =False] → Dict[str, Any]¶Thu thập một tên thuộc tính ánh xạ Dict cho các giá trị của chúng.
Phương pháp này luôn đi qua hệ thống phân cấp lớp và bao gồm các thuộc tính được xác định trên bất kỳ lớp mẹ nào.
Trả lại
Tên của các thuộc tính có tài liệu tham khảoLoại trở lại [bool, optional] – Whether to include properties that haven’t been explicitly set since the object was created. [default: True]
Trả lạiTên của các thuộc tính có tài liệu tham khảo
Loại trở lạiThuộc tính_with_values [*, bao gồm_defaults: bool = true, bao gồm_undefined: bool = false] → dict [str, any]
Thu thập một tên thuộc tính ánh xạ Dict cho các giá trị của chúng.[query: Callable[[bokeh.core.property.descriptors.PropertyDescriptor[Any]], bool], *, include_defaults:bool= True, include_undefined:bool=False] → Dict[str,Any]¶Các thuộc tính không thể sử dụng được được bỏ qua và các giá trị thuộc tính ở định dạng tuần tự hóa có thể khác một chút so với các giá trị bạn thường đọc từ các thuộc tính; Mục đích của phương pháp này là trả về thông tin cần thiết để không thể xử lý lại thể hiện đối tượng.
Tên của các thuộc tính có tài liệu tham khảoLoại trở lại [callable] – A callable that accepts property descriptors and returns True or False
Thuộc tính_with_values [*, bao gồm_defaults: bool = true, bao gồm_undefined: bool = false] → dict [str, any] [bool, optional] – Whether to include properties that have not been explicitly set by a user [default: True]
Tên của các thuộc tính có tài liệu tham khảo
Loại trở lạiThuộc tính_with_values [*, bao gồm_defaults: bool = true, bao gồm_undefined: bool = false] → dict [str, any]
Thu thập một tên thuộc tính ánh xạ Dict cho các giá trị của chúng.[] → Set[bokeh.model.model.Model]¶Các thuộc tính không thể sử dụng được được bỏ qua và các giá trị thuộc tính ở định dạng tuần tự hóa có thể khác một chút so với các giá trị bạn thường đọc từ các thuộc tính; Mục đích của phương pháp này là trả về thông tin cần thiết để không thể xử lý lại thể hiện đối tượng.
Thông số[attr:str, *callbacks: Callable[[str,Any,Any], None]] → None¶Bao gồm_defaults [bool, tùy chọn] - có bao gồm các thuộc tính mà thiên đường đã được thiết lập rõ ràng kể từ khi đối tượng được tạo. [Mặc định: Đúng]
ánh xạ từ tên thuộc tính đến giá trị của chúng[selector:SelectorType] → Iterable[Model]¶DIGN
Tên của các thuộc tính có tài liệu tham khảoLoại trở lại [JSON-like] –
Trả lạiseq[Model]
Thuộc tính_with_values [*, bao gồm_defaults: bool = true, bao gồm_undefined: bool = false] → dict [str, any][selector:SelectorType] → Model|None¶Thu thập một tên thuộc tính ánh xạ Dict cho các giá trị của chúng.
Trả lạiCác thuộc tính không thể sử dụng được được bỏ qua và các giá trị thuộc tính ở định dạng tuần tự hóa có thể khác một chút so với các giá trị bạn thường đọc từ các thuộc tính; Mục đích của phương pháp này là trả về thông tin cần thiết để không thể xử lý lại thể hiện đối tượng.
Thông số[name: str, json:JSON, *, models:Dict[ID, HasProps]|None=None, setter:Setter| None=None] → None¶Bao gồm_defaults [bool, tùy chọn] - có bao gồm các thuộc tính mà thiên đường đã được thiết lập rõ ràng kể từ khi đối tượng được tạo. [Mặc định: Đúng]
Tên của các thuộc tính có tài liệu tham khảoLoại trở lại – [str] : name of the attribute to set
Thuộc tính_with_values [*, bao gồm_defaults: bool = true, bao gồm_undefined: bool = false] → dict [str, any] – [JSON-value] : value to set to the attribute to
Thu thập một tên thuộc tính ánh xạ Dict cho các giá trị của chúng. [dict or None, optional] –
Các thuộc tính không thể sử dụng được được bỏ qua và các giá trị thuộc tính ở định dạng tuần tự hóa có thể khác một chút so với các giá trị bạn thường đọc từ các thuộc tính; Mục đích của phương pháp này là trả về thông tin cần thiết để không thể xử lý lại thể hiện đối tượng.
Thông số
Bao gồm_defaults [bool, tùy chọn] - có bao gồm các thuộc tính mà thiên đường đã được thiết lập rõ ràng kể từ khi đối tượng được tạo. [Mặc định: Đúng] [ClientSession or ServerSession or None, optional] –
ánh xạ từ tên thuộc tính đến giá trị của chúng
DIGN
query_properies_with_values [truy vấn: callable [[bokeh.core.property.descriptors.propertydescriptor [any], bool], *, bao gồm_defaults: bool = true, bao gồm
Truy vấn các giá trị thuộc tính của các trường hợpdef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]08 với vị ngữ.[selector:Type[Model]|SelectorType, updates:Dict[str,Unknown]] → None¶
Truy vấn [có thể gọi được] - một người có thể gọi chấp nhận mô tả thuộc tính và trả về đúng hoặc sai
Tên của các thuộc tính có tài liệu tham khảoLoại trở lại [JSON-like] –
Thuộc tính_with_values [*, bao gồm_defaults: bool = true, bao gồm_undefined: bool = false] → dict [str, any] [dict] –
query_properies_with_values [truy vấn: callable [[bokeh.core.property.descriptors.propertydescriptor [any], bool], *, bao gồm_defaults: bool = true, bao gồm
Truy vấn các giá trị thuộc tính của các trường hợpdef my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]08 với vị ngữ.[] → Optional[Dict[str,Any]]¶
Truy vấn [có thể gọi được] - một người có thể gọi chấp nhận mô tả thuộc tính và trả về đúng hoặc sai
Bao gồm_defaults [bool, tùy chọn] - có bao gồm các thuộc tính chưa được người dùng đặt rõ ràng [mặc định: true]
Trả lạiánh xạ tên và giá trị thuộc tính cho các thuộc tính phù hợp
Tài liệu tham khảo [] → Đặt [Bokeh.Model.Model.Model] ¶[include_defaults:bool] → JSON¶Trả về tất cả
from bokeh.models import CustomJS range_slider.js_on_change['value', CustomJS[args=dict[other=plot.x_range], code="other.start = this.value[0]" ] ]2 mà đối tượng này có tài liệu tham khảo.
remove_on_change [attr: str, *gọi lại: có thể gọi được [[str, any, any], none]] → none¶
Xóa một cuộc gọi lại khỏi đối tượng này
Chọn [Selector: Selectorype] → Itable [model] ¶
Tên của các thuộc tính có tài liệu tham khảoLoại trở lại [bool] – whether to include attributes that haven’t been changed from the default
Thuộc tính_with_values [*, bao gồm_defaults: bool = true, bao gồm_undefined: bool = false] → dict [str, any][include_defaults:bool] → str¶Thu thập một tên thuộc tính ánh xạ Dict cho các giá trị của chúng.
Các thuộc tính không thể sử dụng được được bỏ qua và các giá trị thuộc tính ở định dạng tuần tự hóa có thể khác một chút so với các giá trị bạn thường đọc từ các thuộc tính; Mục đích của phương pháp này là trả về thông tin cần thiết để không thể xử lý lại thể hiện đối tượng.
Không có
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]47 tương ứng vì để giải phóng một đối tượng thường được thực hiện trong bối cảnh của một tài liệu [vì tài liệu có thể giải quyết các tài liệu tham khảo].
Đối với hầu hết các mục đích, nó tốt nhất để tuần tự hóa và giải phóng toàn bộ tài liệu.
Thông sốbao gồm_defaults [bool] - có bao gồm các thuộc tính mà thiên đường đã được thay đổi từ mặc định [bool] – whether to include attributes that haven’t been changed from the default
Trigger [attr: str, cũ: không xác định, mới: không xác định, gợi ý: documentpatchedevent | none = none, setter: setter | none = none][attr: str, old:Unknown, new:Unknown, hint:DocumentPatchedEvent |None=None, setter:Setter| None=None] → None¶ unapply_theme[] → None¶Xóa bất kỳ giá trị theo chủ đề và khôi phục mặc định.
Trả lạiKhông có
CẬP NHẬT [** kwargs: any] → không[**kwargs:Any] → None¶Cập nhật các thuộc tính của đối tượng từ các đối số từ khóa đã cho.
Trả lạiKhông có
CẬP NHẬT [** kwargs: any] → không
Cập nhật các thuộc tính của đối tượng từ các đối số từ khóa đã cho.
Ví dụ
Sau đây là tương đương:[json_attributes:Dict[str,JSON], *, models:Mapping[ID,HasProps]|None =None, setter:Setter|None=None] → None¶def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]2Thông số
bao gồm_defaults [bool] - có bao gồm các thuộc tính mà thiên đường đã được thay đổi từ mặc định – [JSON-dict] : attributes and values to update
Trigger [attr: str, cũ: không xác định, mới: không xác định, gợi ý: documentpatchedevent | none = none, setter: setter | none = none] [dict or None, optional] –
Xóa bất kỳ giá trị theo chủ đề và khôi phục mặc định.
Trả lại
Không có [ClientSession or ServerSession or None, optional] –
CẬP NHẬT [** kwargs: any] → không
Cập nhật các thuộc tính của đối tượng từ các đối số từ khóa đã cho.
Không có
CẬP NHẬT [** kwargs: any] → khôngdocument:Document| None¶Cập nhật các thuộc tính của đối tượng từ các đối số từ khóa đã cho.
Ví dụstruct:bokeh.core.types.ReferenceJson¶Sau đây là tương đương:
def my_radio_handler[new]: print['Radio button option ' + str[new] + ' selected.'] radio_group = RadioGroup[labels=["Option 1", "Option 2", "Option 3"], active=0] radio_group.on_event['button_click', my_radio_handler]2
update_from_json [json_attribut: dict [str, json], *, mô hình: ánh xạ [id, hasprops] | none = none, setter: setter | none = none]