-
-
Notifications
You must be signed in to change notification settings - Fork 477
/
trend.py
31 lines (27 loc) · 836 Bytes
/
trend.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
"""
A Bokeh model indicating trends.
"""
from bokeh.core.properties import Float, Instance, String
from bokeh.models import (
BasicTickFormatter, NumeralTickFormatter, TickFormatter,
)
from bokeh.models.sources import ColumnDataSource
from .layout import HTMLBox
class TrendIndicator(HTMLBox):
"""
A Bokeh model indicating trends.
"""
description = String()
change_formatter = Instance(TickFormatter, default=lambda: NumeralTickFormatter(format='0.00%'))
formatter = Instance(TickFormatter, default=lambda: BasicTickFormatter())
layout = String()
source = Instance(ColumnDataSource)
plot_x = String()
plot_y = String()
plot_color = String()
plot_type = String()
pos_color = String()
neg_color = String()
title = String()
value = Float()
value_change = Float()