Logo image Logo image
  • Overview
  • Getting Started
  • User Guide
  • Gallery
  • Reference Gallery
  • Developer Guide
  • API Reference
  • Releases
  • FAQ
  • About
  • Overview
  • Getting Started
    • Installation
    • Build an app
    • Core Concepts
  • User Guide
    • Overview
    • Components
    • APIs
    • Customization
    • Interact
    • Widgets
    • Parameters
    • Linking
    • Pipelines
    • Templates
    • Performance and Debugging
    • Session state & Callbacks
    • Asynchronous and Concurrent Process
    • Display & Export
    • Running Panel in the Browser with WASM
    • Server Configuration
    • Server Deployment
    • Authentication
    • Django Integration
    • FastAPI Integration
    • Building Custom Components
  • Gallery
    • VTKInteractive
    • VTKSlicer
    • VTKWarp
    • Attractors
    • Gapminders
    • Glaciers
    • Nyc Taxi
    • Portfolio-optimizer
    • Altair Brushing
    • Altair Choropleth
    • Clifford Interact
    • Color Speech Recognition
    • Deckgl Game Of Life
    • Defer Data Load
    • File Download Examples
    • Hvplot Explorer
    • Iris Kmeans
    • Loading Spinner
    • Random Number Generator
    • Save Filtered Df
    • Sync Location
    • Temperature Distribution
    • Xgboost Classifier
    • Stocks Altair
    • Stocks Hvplot
    • Stocks Matplotlib
    • Stocks Plotly
    • Distribution Tabs
    • Dynamic Tabs
    • Plot With Columns
    • Dynamic Plot Layout
    • Dynamic Timeseries Image Analysis
    • Dynamic Ui
    • Dynamic Widget Values
    • Action Button
    • Deck Gl Global Power Plants
    • Download Upload Csv
    • Loading Indicator
    • Param Subobjects
    • Precedence
    • Reactive Plots
    • Reactive Tables
    • Hardware Automation
    • Streaming Bokeh
    • Streaming Indicator
    • Streaming Perspective
    • Streaming Tabulator
    • CanvasDraw
    • LeafletHeatMap
    • MaterialUI
    • Bokeh Property Editor
    • Deck Gl Json Editor
    • Holoviews Glyph Link
    • Plotly Link
    • Vega Heatmap Link
    • MatplotlibStyle
    • PlotlyStyle
    • SeabornStyle
    • VegaAltairStyle
    • DataTable
    • Folium
    • Deck.gl
  • Reference Gallery
    • Alert
    • Audio
    • Bokeh
    • DataFrame
    • DeckGL
    • ECharts
    • Folium
    • GIF
    • HTML
    • HoloViews
    • IDOM
    • IPyWidget
    • JPG
    • JSON
    • LaTeX
    • Markdown
    • Matplotlib
    • PDF
    • PNG
    • Param
    • Perspective
    • Plotly
    • SVG
    • Str
    • Streamz
    • VTK
    • VTKJS
    • VTKVolume
    • Vega
    • Video
    • Accordion
    • Card
    • Column
    • Divider
    • FlexBox
    • GridBox
    • GridSpec
    • GridStack
    • Row
    • Tabs
    • WidgetBox
    • Bootstrap
    • FastGridTemplate
    • FastListTemplate
    • GoldenLayout
    • Material
    • React
    • Vanilla
    • Notifications
    • BooleanStatus
    • Dial
    • Gauge
    • LinearGauge
    • LoadingSpinner
    • Number
    • Progress
    • Tqdm
    • Trend
    • Ace
    • ArrayInput
    • AutocompleteInput
    • Button
    • CheckBoxGroup
    • CheckButtonGroup
    • Checkbox
    • ColorPicker
    • CrossSelector
    • DataFrame
    • DatePicker
    • DateRangeSlider
    • DateSlider
    • DatetimeInput
    • DatetimePicker
    • DatetimeRangeInput
    • DatetimeRangePicker
    • DatetimeRangeSlider
    • Debugger
    • DiscretePlayer
    • DiscreteSlider
    • EditableFloatSlider
    • EditableIntSlider
    • EditableRangeSlider
    • FileDownload
    • FileInput
    • FileSelector
    • FloatInput
    • FloatSlider
    • IntInput
    • IntRangeSlider
    • IntSlider
    • JSONEditor
    • LiteralInput
    • MenuButton
    • MultiChoice
    • MultiSelect
    • PasswordInput
    • Player
    • RadioBoxGroup
    • RadioButtonGroup
    • RangeSlider
    • Select
    • SpeechToText
    • StaticText
    • Tabulator
    • Terminal
    • TextAreaInput
    • TextEditor
    • TextInput
    • TextToSpeech
    • Toggle
    • ToggleGroup
    • VideoStream
  • Developer Guide
    • Testing
    • Developing custom models
  • API Reference
    • io
    • layout
    • pane
      • panel.vtk Package
    • param
    • pipeline
    • template
      • panel.bootstrap Package
      • panel.fast Package
        • panel.grid Package
        • panel.list Package
      • panel.golden Package
      • panel.material Package
      • panel.react Package
      • panel.theme Package
      • panel.vanilla Package
    • widgets
    • viewable
    • util
  • Releases
  • FAQ
  • About
    • Comparisons
On this page
  • links Module
    • Callback
      • Callback.init()
      • Callback.register_callback()
    • Link
      • Link.init()
      • Link.link()
      • Link.register_callback()
      • Link.unlink()

links Module#

links Module#

Defines Links which allow declaring links between bokeh properties.

class panel.links.Callback(source: Reactive, target: JSLinkTarget = None, args: Dict[str, Any] = None, code: Dict[str, str] = None, **params)[source]#

Bases: Parameterized

A Callback defines some callback to be triggered when a property changes on the source object. A Callback can execute arbitrary Javascript code and will make all objects referenced in the args available in the JS namespace.

args = param.Dict(allow_None=True, class_=<class ‘dict’>, default={}, label=’Args’)

A mapping of names to Python objects. These objects are made available to the callback’s code snippet as the values of named parameters to the callback.

code = param.Dict(allow_None=True, class_=<class ‘dict’>, label=’Code’)

A dictionary mapping from a source specication to a JS code snippet to be executed if the source property changes.

init() → None[source]#

Registers the Callback

classmethod register_callback(callback: Type[CallbackGenerator]) → None[source]#

Register a LinkCallback providing the implementation for the Link for a particular backend.

class panel.links.Link(source: Reactive, target: Optional['JSLinkTarget'] = None, **params)[source]#

Bases: Callback

A Link defines some connection between a source and target model. It allows defining callbacks in response to some change or event on the source object. Instead a Link directly causes some action to occur on the target, for JS based backends this usually means that a corresponding JS callback will effect some change on the target in response to a change on the source.

A Link must define a source object which is what triggers events, but must not define a target. It is also possible to define bi- directional links between the source and target object.

Parameters inherited from:

panel.links.Callback: args, code

bidirectional = param.Boolean(bounds=(0, 1), default=False, label=’Bidirectional’)

Whether to link source and target in both directions.

properties = param.Dict(class_=<class ‘dict’>, default={}, label=’Properties’)

A dictionary mapping between source specification to target specification.

init() → None#

Registers the Callback

link() → None[source]#

Registers the Link

classmethod register_callback(callback: Type[CallbackGenerator]) → None#

Register a LinkCallback providing the implementation for the Link for a particular backend.

unlink() → None[source]#

Unregisters the Link

© Copyright 2019-2022 Holoviz contributors.

Last updated on 2022-10-05.