Skip to content

Commit

Permalink
Merge pull request #9 from compute-tooling/bokeh-versions
Browse files Browse the repository at this point in the history
Grab bokeh version from object
  • Loading branch information
hdoupe authored Apr 19, 2020
2 parents 646819a + b829362 commit 9fe612c
Show file tree
Hide file tree
Showing 6 changed files with 806 additions and 210 deletions.
8 changes: 1 addition & 7 deletions cs_storage/screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,13 @@
# without the screenshot component.
from jinja2 import Template
from pyppeteer import launch
from bokeh.resources import CDN

BASE_ARGS = {
"bokeh_scripts": {"cdn_js": CDN.js_files[0], "widget_js": CDN.js_files[1]}
}
SCREENSHOT_ENABLED = True

except ImportError:
SCREENSHOT_ENABLED = False
Template = None
launch = None
CDN = None
BASE_ARGS = {}

import cs_storage

Expand All @@ -46,7 +40,7 @@ def get_template():


def write_template(output):
kwargs = {**BASE_ARGS, **{"output": output}}
kwargs = {"output": output}
return TEMPLATE.render(**kwargs)


Expand Down
10 changes: 6 additions & 4 deletions cs_storage/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@

<meta name="viewport" content="width=device-width, initial-scale=1">


<script type="text/javascript" src={{bokeh_scripts.cdn_js|safe}}></script>
<script type="text/javascript" src={{bokeh_scripts.widget_js|safe}}></script>

{% if output.media_type == 'bokeh' %}
<script type="text/javascript"
src="https://cdn.pydata.org/bokeh/release/bokeh-{{output.data.doc.version}}.min.js"></script>
<script type="text/javascript"
src="https://cdn.pydata.org/bokeh/release/bokeh-widgets-{{output.data.doc.version}}.min.js"></script>
{% endif %}
<script>
window.MathJax = {
tex: {
Expand Down
58 changes: 29 additions & 29 deletions cs_storage/tests/test-ogusa-remote.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"outputs": {
"renderable": {
"outputs": [
{
"id": "2ba84d72-4a70-429b-8167-00d050658615",
"title": "Percentage Changes in Consumption by Lifetime Income Percentile Group",
"filename": "Percentage Changes in Consumption by Lifetime Income Percentile Group.png",
"media_type": "PNG"
},
{
"id": "9513e496-357d-4ee8-b6ad-a98d0e37e118",
"title": "Percentage Changes in Economic Aggregates Between Baseline and Reform Policy",
"filename": "Percentage Changes in Economic Aggregates Between Baseline and Reform Policy.html",
"media_type": "table"
}
],
"ziplocation": "91d6b58b-a2f6-4faf-92e9-b51f2cd08525_renderable.zip"
"outputs": {
"renderable": {
"outputs": [
{
"id": "9c9bac3a-8540-4f25-bea9-0b824b97f286",
"title": "Percentage Changes in Consumption by Lifetime Income Percentile Group",
"filename": "Percentage Changes in Consumption by Lifetime Income Percentile Group.png",
"media_type": "PNG"
},
"downloadable": {
"outputs": [
{
"id": "033c82f4-f8b7-4d5a-8313-4f9516fb672d",
"title": "Percentage Changes in Economic Aggregates Between Baseline and Reform Policy",
"filename": "Percentage Changes in Economic Aggregates Between Baseline and Reform Policy.csv",
"media_type": "CSV"
}
],
"ziplocation": "91d6b58b-a2f6-4faf-92e9-b51f2cd08525_downloadable.zip"
{
"id": "7db41835-3689-4975-a203-7fc6d736d450",
"title": "Percentage Changes in Economic Aggregates Between Baseline and Reform Policy",
"filename": "Percentage Changes in Economic Aggregates Between Baseline and Reform Policy.html",
"media_type": "table"
}
],
"ziplocation": "563c5492-043d-44e1-8f30-4474cb6237c7_renderable.zip"
},
"version": "v1"
}
"downloadable": {
"outputs": [
{
"id": "8b358a93-7973-47a1-9415-b4c5b15caa49",
"title": "Percentage Changes in Economic Aggregates Between Baseline and Reform Policy",
"filename": "Percentage Changes in Economic Aggregates Between Baseline and Reform Policy.csv",
"media_type": "CSV"
}
],
"ziplocation": "563c5492-043d-44e1-8f30-4474cb6237c7_downloadable.zip"
}
},
"version": "v1"
}
Loading

0 comments on commit 9fe612c

Please sign in to comment.