<jupyter_start><jupyter_text>Krisk also introduced a very simplistic for you to resync data or create a reproducible charts. Consider this plot,<jupyter_code>p = kk.bar(df[df.year == 1952],'continent',y='pop', how='mean')
p.set_size(width=800)<jupyter_output><empty_output><jupyter_text>Executing this code below<jupyter_code>p.resync_data(df[df.year == 2007])<jupyter_output><empty_output><jupyter_text>Would let you to modify the plot above instead of returning new plot. As you can see this is useful when you combine it to `ipywidgets` to interact with your data.<jupyter_code>def resync(year):
    return p.resync_data(df[df.year == year])
interact(resync,year=IntSlider(min=df.year.min(),max=df.year.max(),step=5,value=1952))<jupyter_output><empty_output><jupyter_text>You can also replot entirely the plot you have in the cell where the variable is<jupyter_code>p.replot(kk.line(df,'continent'))<jupyter_output><empty_output><jupyter_text>Finally, there is `read_df` method for reproducible charts. You have a plot, and using it to just replace the data. This is especially useful when you have a beautiful chart already, and sharing to others just by replacing the data. Note that this is similar resync_data. But instead of replacing the cell where previous chart contained, it create new cell.<jupyter_code>p.read_df(df)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09926470588235294, 'fraction_numerical': 0.011764705882352941, 'mean_word_length': 7.198795180722891, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '393741', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 458, 'n_tokens_neox': 434, 'n_words': 136, 'path': 'notebooks/resync-reproducible.ipynb', 'repo_name': 'JackEasons/krisk', 'size': '1360'}