Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bokeh-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
bokeh-app:
image: epinux/ncmet:latest
hostname: bokeh-app
volumes:
- ./bokeh/main.py:/app/main.py
- ./bokeh/entrypoint.sh:/entrypoint.sh
entrypoint: ["bokeh", "serve", "/app/", "--address", "0.0.0.0", "--port", "5006", "--allow-websocket-origin=*"]
# command: ["bokeh", "serve", "--allow-websocket-origin=*", "--port=5006", "/app/main.py"]

44 changes: 44 additions & 0 deletions bokeh/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# myapp.py

from random import random

from bokeh.layouts import column
from bokeh.models import Button
from bokeh.palettes import RdYlBu3
from bokeh.plotting import figure, curdoc

# create a plot and style its properties
p = figure(x_range=(0, 100), y_range=(0, 100), toolbar_location=None)
p.border_fill_color = 'black'
p.background_fill_color = 'black'
p.outline_line_color = None
p.grid.grid_line_color = None

# add a text renderer to the plot (no data yet)
r = p.text(x=[], y=[], text=[], text_color=[], text_font_size="26px",
text_baseline="middle", text_align="center")

i = 0

ds = r.data_source

# create a callback that adds a number in a random location
def callback():
global i

# BEST PRACTICE --- update .data in one step with a new dict
new_data = dict()
new_data['x'] = ds.data['x'] + [random()*70 + 15]
new_data['y'] = ds.data['y'] + [random()*70 + 15]
new_data['text_color'] = ds.data['text_color'] + [RdYlBu3[i%3]]
new_data['text'] = ds.data['text'] + [str(i)]
ds.data = new_data

i = i + 1

# add a button widget and configure with the call back
button = Button(label="Press Me")
button.on_click(callback)

# put the button and plot in a layout and add to the document
curdoc().add_root(column(button, p))
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

RUN pip install -U git+https://github.com/opengeos/anymap
RUN pip install -U gdown
RUN pip install -U localtileserver

EXPOSE 7000

COPY app /app
Expand Down
4 changes: 3 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ LOG_LEVEL=${LOG_LEVEL:-debug}
# /map="Trajectory widget"
# /trajectory
# /tspt
panel serve --port ${PORT} --cookie-secret my_super_safe_cookie_secret --autoreload --address 0.0.0.0 --log-level ${LOG_LEVEL} --index /assets/custom_index.html --static-dirs assets=/assets --allow-websocket-origin='*' /TSP /trj /OGC_client /seaice/daily /seaice/monthly /seaicemod/monthlymod --index-titles /TSP="NC-Visualization Tool" /trj="trj" /csw="OGC Client" /daily="Sea Ice Daily" /monthly="Sea Ice Monthly" /monthlymod="Sea Ice Model"
# /OGC_client /seaice/daily /seaice/monthly /seaicemod/monthlymod /anymap
panel serve --autoreload --port ${PORT} --cookie-secret my_super_safe_cookie_secret --address 0.0.0.0 --log-level ${LOG_LEVEL} --index /assets/custom_index.html --static-dirs assets=/assets --allow-websocket-origin='*' /TSP /TRJ --index-titles /TSP="NC-Visualization Tool" /TRJ="Trajectory"
# /OGC_client="OGC Client" /daily="Sea Ice Daily" /monthly="Sea Ice Monthly" /monthlymod="Sea Ice Model" /anymap="Anymap"
Binary file not shown.
153 changes: 0 additions & 153 deletions metviz/OGC_client/csw_search.py

This file was deleted.

Loading