3 alt.data_transformers.disable_max_rows()
4 alt.data_transformers.enable('data_server')
6 from numpy import random
8 from sklearn.manifold import TSNE
10 pd.read_feather("tsne_subreddit_fit.feather")
12 slider = alt.binding_range(min=1,max=100,step=1,name='zoom: ')
13 selector = alt.selection_single(name='zoomselect',fields=['zoom'],bind='scales',init={'zoom':1})
15 xrange = plot_data.x.max()-plot_data.x.min()
16 yrange = plot_data.y.max()-plot_data.y.min()
18 chart = alt.Chart(plot_data).mark_text().encode(
19 alt.X('x',axis=alt.Axis(grid=False)),
20 alt.Y('y',axis=alt.Axis(grid=False)),
23 #chart = chart.add_selection(selector)
25 chart = chart.configure_view(
26 continuousHeight=xrange/20,
27 continuousWidth=yrange/20
30 amount_shown = lambda zoom: {'width':xrange/zoom,'height':yrange/zoom}
32 alt.data_transformers.enable('default')
33 chart = chart.properties(width=1000,height=1000)
34 chart = chart.interactive()
35 chart.save("test_tsne_whole.html")
36 chart = chart.properties(width=10000,height=10000)
37 chart.save("test_tsne_whole.svg")