forked from enthought/NECOFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ocean_view.enaml
63 lines (61 loc) · 2.34 KB
/
ocean_view.enaml
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
from enaml.layout.api import hbox, vbox, spacer
from enaml.stdlib.slider_transforms import FloatTransform
from enaml.widgets.api import Window, Container, MPLCanvas, Slider, Label, DatetimeSelector, GroupBox, PushButton
from matplotlib.figure import Figure
enamldef Main(Window):
attr model
Container:
constraints = [
hbox(canvas, vbox(dt, itime, animate, geo, spacer))
]
MPLCanvas: canvas:
toolbar_visible = True
constraints = [width>=600, height>=600]
figure << model.figure
DatetimeSelector: dt:
datetime_format = 'yyyy-MMM-dd HH:mm'
datetime := model.start
Slider: itime:
maximum = model.time_steps
value := model.itime
PushButton: animate:
text << 'animation %s' % ('start' if not model.running else 'stop')
checkable = True
checked := model.running
GroupBox: geo:
Label:
text << 'North: %4.1f' % model.north
Slider: north:
tick_position = 'no_ticks'
FloatTransform:
minimum = float(model.lat.min())
maximum = float(model.lat.max())
precision = 200
value := model.north
Label:
text << 'South: %4.1f' % model.south
Slider: south:
tick_position = 'no_ticks'
FloatTransform:
minimum = float(model.lat.min())
maximum = float(model.lat.max())
precision = 200
value := model.south
Label:
text << 'West: %4.1f' % model.west
Slider: west:
tick_position = 'no_ticks'
FloatTransform:
minimum = float(model.lon.min())
maximum = float(model.lon.max())
precision = 200
value := model.west
Label:
text << 'East: %4.1f' % model.east
Slider: east:
tick_position = 'no_ticks'
FloatTransform:
minimum = float(model.lon.min())
maximum = float(model.lon.max())
precision = 200
value := model.east