-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from informatics-lab/tidy-ui
Tidy UI
- Loading branch information
Showing
14 changed files
with
266 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .time import TimeUI | ||
from .colorbar import ColorbarUI | ||
from .headline import Headline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import bokeh.models | ||
|
||
|
||
class Headline: | ||
"""Summarise selected state""" | ||
def __init__(self): | ||
self._template = "<h3>{}</h3>" | ||
self.div = bokeh.models.Div(text=self._template.format(""), | ||
sizing_mode="stretch_width") | ||
self.layout = self.div | ||
|
||
def connect(self, store): | ||
store.add_subscriber(self.render) | ||
return self | ||
|
||
def render(self, state): | ||
labels = state.get("layers", {}).get("labels", []) | ||
content = ", ".join([label for label in labels if label is not None]) | ||
self.div.text = self._template.format(content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
let openId = function(id) { | ||
document.getElementById(id).style.width = "400px"; | ||
} | ||
let closeId = function(id) { | ||
document.getElementById(id).style.width = "0"; | ||
} |
Oops, something went wrong.