Commit 82674525 authored by Jim Hoekstra's avatar Jim Hoekstra 👋🏻
Browse files

made url prefix an env variable

parent 91a99e10
import dash
import os
from dash_app.layout import external_stylesheets
app = dash.Dash(name=__name__, external_stylesheets=external_stylesheets, url_base_pathname='/msx/',
URL_PREFIX = '/msx/'
if os.getenv('MSX_URL_PREFIX', False):
URL_PREFIX = os.environ['MSX_URL_PREFIX']
app = dash.Dash(name=__name__, external_stylesheets=external_stylesheets, url_base_pathname=URL_PREFIX,
suppress_callback_exceptions=True)
......@@ -112,10 +112,11 @@ class Graph:
associated_words_filtered = [word for word in all_associated_words if word not in current_words]
associated_words_count = {word: associated_words_filtered.count(word) for word in list(set(associated_words_filtered))}
common_associated_words = [word for word, count in associated_words_count.items() if count >= self.COUNT_THRESHOLD]
count_threshold = self.COUNT_THRESHOLD
common_associated_words = [word for word, count in associated_words_count.items() if count >= count_threshold]
while len(common_associated_words) > self.MAX_NUM_WORDS:
self.COUNT_THRESHOLD += 1
common_associated_words = [word for word, count in associated_words_count.items() if count >= self.COUNT_THRESHOLD]
count_threshold += 1
common_associated_words = [word for word, count in associated_words_count.items() if count >= count_threshold]
self.add_nodes(common_associated_words)
self.add_edges(base_node, common_associated_words)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment