Some properties in Bokeh can accept either a single value (x=10
) or a reference to a column of values in a CDS (x="distance"
). These are called “DataSpecs”. Under the covers, things are always denoted explicitly:
x = dict(value=10) # single value
x = dict(field="distance") # reference to a column
Where possible, we try to shield users from having to care about this. If a given DataSpec property can only use numeric values, then it is easy Bokeh us to assume: numbers are values, strings are fields. Where things get trickier is if values can also be strings. In some cases, we can still auto-magically make good assumptions, e.g. a ColorSpec
property will assume strings that are valid color values are value and otherwise assume they are field.
But, it’s always possible to be explicit and pass dict(value=...)
or dict(field=...)
explicity, and in some cases (like above) where Bokeh can’t make the right assumption, it may be necessary for users to be explicit.
Note there is actual API for this now:
x = value(10) # single value
x = field("distance") # reference to a column
and that is slightly preferable for users to use.
I’m not quite sure I understand question 2, the use of a theme and a given embedding method seem like completely orthogonal considerations to me.