]> code.communitydata.science - cdsc_reddit.git/blobdiff - visualization/tsne_vis.py
fix bug in viz.
[cdsc_reddit.git] / visualization / tsne_vis.py
index 4b42e8e56547b410a4d190f2ce41252a7b62cfa6..a644ecf5ae7c77f9b1b753b94e83b2839bb17903 100644 (file)
@@ -16,7 +16,7 @@ def base_plot(plot_data):
 
     subreddit_dropdown = alt.binding_select(options=sorted(plot_data.subreddit))
 
-    cluster_click_select = alt.selection_single(on='click,',fields=['cluster'], bind=cluster_dropdown, name=' ')
+    cluster_click_select = alt.selection_single(on='click',fields=['cluster'], bind=cluster_dropdown, name=' ')
     # cluster_select = alt.selection_single(fields=['cluster'], bind=cluster_dropdown, name='cluster')
     # cluster_select_and = cluster_click_select & cluster_select
     #
@@ -155,13 +155,13 @@ def build_visualization(tsne_data, clusters, output):
 if __name__ == "__main__":
     fire.Fire(build_visualization)
 
-commenter_data = pd.read_feather("tsne_author_fit.feather")
-clusters = pd.read_feather('author_3000_clusters.feather')
-commenter_data = assign_cluster_colors(commenter_data,clusters,10,8)
-commenter_zoom_plot = zoom_plot(commenter_data)
-commenter_viewport_plot = viewport_plot(commenter_data)
-commenter_zoom_plot.save("subreddit_commenters_tsne_3000.html")
-commenter_viewport_plot.save("subreddit_commenters_tsne_3000_viewport.html")
+commenter_data = pd.read_feather("tsne_author_fit.feather")
+clusters = pd.read_feather('author_3000_clusters.feather')
+commenter_data = assign_cluster_colors(commenter_data,clusters,10,8)
+commenter_zoom_plot = zoom_plot(commenter_data)
+commenter_viewport_plot = viewport_plot(commenter_data)
+commenter_zoom_plot.save("subreddit_commenters_tsne_3000.html")
+commenter_viewport_plot.save("subreddit_commenters_tsne_3000_viewport.html")
 
 # chart = chart.properties(width=10000,height=10000)
 # chart.save("test_tsne_whole.svg")

Community Data Science Collective || Want to submit a patch?