Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow defining external JS and CSS resources via config (#330)
- Loading branch information
1 parent
2403468
commit e67415c
Showing
5 changed files
with
72 additions
and
18 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
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,26 @@ | ||
""" | ||
Patches bokeh resources to make it easy to add external JS and CSS | ||
resources via the panel.config object. | ||
""" | ||
from __future__ import absolute_import, division, unicode_literals | ||
|
||
from bokeh.resources import Resources | ||
|
||
def css_raw(self): | ||
from ..config import config | ||
raw = super(Resources, self).css_raw | ||
return raw + config.raw_css | ||
|
||
def js_files(self): | ||
from ..config import config | ||
files = super(Resources, self).js_files | ||
return files + list(config.js_files.values()) | ||
|
||
def css_files(self): | ||
from ..config import config | ||
files = super(Resources, self).css_files | ||
return files + config.css_files | ||
|
||
Resources.css_raw = property(css_raw) | ||
Resources.js_files = property(js_files) | ||
Resources.css_files = property(css_files) |