Pygwalker 0.2 Update
In this document, we will walk you through the latest Pygwalker (version 0.2) update. This version introduces three key features:
- Restore Configs: Maintains your configuration settings across sessions.
- Display Charts: Allows visualization of Pygwalker-generated charts.
- Preview Charts: Provides a chart preview when the kernel isn't running.
To install the pre-release version of Pygwalker, use pip:
pip install pygwalker --pre
You can view a live example of this feature in action here (opens in a new tab).
To restore your Pygwalker configurations, execute your Pygwalker code as follows:
import pygwalker as pyg pyg.walk(df, spec="config.json")
After interacting with the UI and setting up your chart, click the save icon. The configuration data for the current chart will be saved to the "config.json" file.
Upon re-running this code, Pygwalker will restore the last saved state, allowing you to pick up where you left off.
An operational demo of this feature can be found here (opens in a new tab).
You can generate and display your Pygwalker charts as follows:
import pygwalker as pyg walker = pyg.walk(df, spec="first_explore.json")
After creating your charts on the UI, click the save icon to store them.
display function to visualize the saved charts in other cells.
walker.display_chart("chart name", title="title", desc="description")
This feature's functionality is demonstrated here (opens in a new tab).
To generate a preview of your Pygwalker chart, use the following code:
import pygwalker as pyg pyg.walk(df, spec="preview.json", use_preview=True)
Create your chart and save it.
During the saving process, a preview chart, based on the current chart, will be generated. This preview will be displayed when the kernel is not started, allowing for a quick overview without the need for the kernel to be running.