remove viz

This commit is contained in:
Mark Eaton
2025-07-20 01:11:04 -04:00
parent c47dfb0890
commit e3743bbb33
3 changed files with 307 additions and 45 deletions
-23
View File
@@ -62,29 +62,6 @@ def histogram(data):
plt.show()
def dash_viz(data):
title_keywords = extract_title_keywords(data)
word_output = {}
for line in title_keywords:
if line[0] not in word_output:
word_output[line[0]] = [line[1]]
else:
word_output[line[0]].append(line[1])
output_data = []
for word in word_output:
if word:
output_data.append({'data': {'id': word, 'label': word}})
for all_words in word_output.values():
for title_words in all_words:
edges = [(word1, word2) for i, word1 in enumerate(title_words) for word2
in title_words[i+1:]]
for edge1, edge2 in edges:
if edge1 and edge2:
output_data.append({'data': {'source': edge1, 'target': edge2}})
with open('viz_data.json', 'w') as file:
json.dump(output_data, file)
if __name__ == '__main__':
parse_csv(file_path)
data = data[1:]