Skip to content

Commit

Permalink
Release 3.2.2 (#199)
Browse files Browse the repository at this point in the history
* Fix browser caching of cdn.jsdelivr files.
* update ldavis.js to match ldavis.3.0.0.js
  • Loading branch information
msusol authored Feb 21, 2021
1 parent 440eb39 commit f1cdb65
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 126 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
History
-------

3.2.2 (2021-02-19)
--------------------

* Fix browser caching of cdn.jsdelivr files.
* update ldavis.js to match ldavis.3.0.0.js

3.2.1 (2021-02-17)
--------------------

Expand Down
2 changes: 1 addition & 1 deletion pyLDAvis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"display", "show", "save_html", "save_json",
"enable_notebook", "disable_notebook"]

__version__ = '3.2.1'
__version__ = '3.2.2'

from ._display import *
from ._prepare import prepare, js_PCoA, PreparedData
16 changes: 6 additions & 10 deletions pyLDAvis/_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,15 @@ def show(data, ip='127.0.0.1', port=8888, n_retries=50,
:func:`display` : embed visualization within the IPython notebook
:func:`enable_notebook` : automatically embed visualizations in IPython notebook
"""
files = None
if local:
kwargs['ldavis_url'] = urls.LDAVIS_URL
kwargs['d3_url'] = urls.D3_URL
kwargs['ldavis_css_url'] = urls.LDAVIS_CSS_URL
files = {'/LDAvis.js': ["text/javascript",
open(urls.LDAVIS_LOCAL, 'r').read()],
'/LDAvis.css': ["text/css",
open(urls.LDAVIS_CSS_URL, 'r').read()],
'/d3.js': ["text/javascript",
open(urls.D3_URL, 'r').read()]}
else:
files = None
files = {'/LDAvis.js': ["text/javascript", open(urls.LDAVIS_LOCAL, 'r').read()],
'/LDAvis.css': ["text/css", open(urls.LDAVIS_CSS_URL, 'r').read()],
'/d3.js': ["text/javascript", open(urls.D3_URL, 'r').read()]}


html = prepared_data_to_html(data, **kwargs)
serve(html, ip=ip, port=port, n_retries=n_retries, files=files,
Expand Down Expand Up @@ -305,8 +302,7 @@ def enable_notebook(local=False, **kwargs):

if local:
if 'ldavis_url' in kwargs or 'd3_url' in kwargs:
warnings.warn(
"enable_notebook: specified urls are ignored when local=True")
warnings.warn("enable_notebook: specified urls are ignored when local=True")
kwargs['d3_url'], kwargs['ldavis_url'], kwargs['ldavis_css_url'] = write_ipynb_local_js()

ip = get_ipython()
Expand Down
Loading

0 comments on commit f1cdb65

Please # to comment.