-
Notifications
You must be signed in to change notification settings - Fork 463
/
default_tooltip.py
65 lines (54 loc) · 2.24 KB
/
default_tooltip.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 2015 Bloomberg Finance L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
r"""
=============================
Default bqplot tooltip widget
=============================
.. currentmodule:: bqplot.default_tooltip
.. autosummary::
:toctree: _generate/
Tooltip
"""
from ipywidgets import DOMWidget
from traitlets import Unicode, List, Bool
from ._version import __frontend_version__
class Tooltip(DOMWidget):
"""Default tooltip widget for marks.
Attributes
----------
fields: list (default: [])
list of names of fields to be displayed in the tooltip
All the attributes of the mark are accesible in the tooltip
formats: list (default: [])
list of formats to be applied to each of the fields.
if no format is specified for a field, the value is displayed as it is
labels: list (default: [])
list of labels to be displayed in the table instead of the fields. If
the length of labels is less than the length of fields, then the field
names are displayed for those fields for which label is missing.
show_labels: bool (default: True)
Boolean attribute to enable and disable display of the
label /field name
as the first column along with the value
"""
fields = List().tag(sync=True)
formats = List().tag(sync=True)
show_labels = Bool(True).tag(sync=True)
labels = List().tag(sync=True)
_view_name = Unicode('Tooltip').tag(sync=True)
_model_name = Unicode('TooltipModel').tag(sync=True)
_view_module = Unicode('bqplot').tag(sync=True)
_model_module = Unicode('bqplot').tag(sync=True)
_view_module_version = Unicode(__frontend_version__).tag(sync=True)
_model_module_version = Unicode(__frontend_version__).tag(sync=True)