A project providing a Graphic Walker Pane for use with HoloViz Panel.
Project description
✨ Welcome to Panel Graphic Walker
A simple way to explore your data through a Tableau-like interface directly in your Panel data applications.
What is Panel Graphic Walker?
panel-graphic-walker
brings the power of Graphic Walker to your data science workflow, seamlessly integrating interactive data exploration into notebooks and Panel applications. Effortlessly create dynamic visualizations, analyze datasets, and build dashboards—all within a Pythonic, intuitive interface.
Why choose Panel Graphic Walker?
- Simplicity: Just plug in your data, and
panel-graphic-walker
takes care of the rest. - Quick Data Exploration: Start exploring in seconds, with instant chart and table rendering via a Tableau-like interface.
- Integrates with Python Visualization Ecosystem: Easily integrates with Panel, HoloViz, and the broader Python Visualization ecosystem.
- Scales to your Data: Designed for diverse data backends and scalable, so you can explore even larger datasets seamlessly. (More Features Coming Soon)
Pin your version!
This project is in early stages, so if you find a version that suits your needs, it’s recommended to pin your version, as updates may introduce changes.
Installation
Install panel-graphic-walker
via pip
:
pip install panel-graphic-walker
Usage
Basic Graphic Walker Pane
Here’s an example of how to create a simple GraphicWalker
pane:
import pandas as pd
import panel as pn
from panel_gwalker import GraphicWalker
pn.extension()
df = pd.read_csv("https://datasets.holoviz.org/windturbines/v1/windturbines.csv.gz", nrows=10000)
GraphicWalker(df).servable()
Configuring Fields
You may also configure the fields
(data columns) manually:
import pandas as pd
import panel as pn
from panel_gwalker import GraphicWalker
pn.extension()
df = pd.read_csv("https://datasets.holoviz.org/windturbines/v1/windturbines.csv.gz", nrows=10000)
fields = [
{
"fid": "t_county",
"name": "t_county",
"semanticType": "nominal",
"analyticType": "dimension",
},
{
"fid": "t_model",
"name": "t_model",
"semanticType": "nominal",
"analyticType": "dimension",
},
{
"fid": "t_cap",
"name": "t_cap",
"semanticType": "quantitative",
"analyticType": "measure",
},
]
GraphicWalker(df, fields=fields).servable()
You can get the full list of fields via GraphicWalker(df).calculated_fields()
.
Configuring the Appearance
By default, the appearance is determined by the value of pn.config.theme
. However, you can manually change this, for example, to dark
or media
. media
corresponds to the user's preference as set in the browser.
import pandas as pd
import panel as pn
from panel_gwalker import GraphicWalker
pn.extension()
df = pd.read_csv(
"https://datasets.holoviz.org/windturbines/v1/windturbines.csv.gz", nrows=10000
)
GraphicWalker(df, appearance="media").servable()
Additional Configuration
Extra configuration options are available via the Graphic Walker API. For instance, you can change the language to Japanese:
import pandas as pd
import panel as pn
from panel_gwalker import GraphicWalker
pn.extension()
df = pd.read_csv(
"https://datasets.holoviz.org/windturbines/v1/windturbines.csv.gz", nrows=10000
)
config = {
"i18nLang": "ja-JP"
}
GraphicWalker(df, config=config).servable()
Export the Chart(s)
You can export the current chart(s) from the client to the server by running the asynchronous export
method:
import pandas as pd
import panel as pn
from panel_gwalker import GraphicWalker
pn.extension()
df = pd.read_csv("https://datasets.holoviz.org/windturbines/v1/windturbines.csv.gz", nrows=10000)
walker = GraphicWalker(df)
exported = pn.pane.JSON(depth=3)
async def export(_):
exported.object = await walker.export()
pn.Column(
walker,
pn.Row(
pn.widgets.ButtonIcon(icon="download", on_click=export, active_icon='check', toggle_duration=1000),
exported,
)
).servable()
Scale with Server-Side Computation
In some environments you may meet message or client side data limits. To handle larger datasets, you can offload the computation to the server.
First you will need to install extra dependencies:
pip install panel-graphic-walker[server]
Then you can use server side computation with server_computation=True
:
import pandas as pd
import panel as pn
from panel_gwalker import GraphicWalker
pn.extension()
df = pd.read_csv("https://datasets.holoviz.org/windturbines/v1/windturbines.csv.gz")
# Enable server-side computation for scalable data processing
walker = GraphicWalker(df, server_computation=True)
pn.Column(
walker,
walker.param.server_computation,
).servable()
This setup allows your application to manage larger datasets efficiently by leveraging server resources for data processing.
Please note that if running on Pyodide the computations will always take place on the client.
App Demo
API
Parameters
Core
object
(DataFrame): The data for exploration. Please note that if you update theobject
, then the existing chart(s) will not be deleted and you will have to create a new one manually to use the new dataset.fields
(list): Optional specification of fields (columns).server_computation
(bool): Optional. If True the computations will take place on the Panel server or in the Jupyter kernel instead of the client to scale to larger datasets. Default is False.
Style
appearance
(str): Optional dark mode preference: 'light', 'dark' or 'media'. If not provided the appearance is derived frompn.config.theme
.theme
(str): Optional chart theme: 'vega' (default), 'g2' or 'streamlit'.
Other
config
(dict): Optional additional configuration for Graphic Walker. See the Graphic Walker API for more details.
Methods
calculated_fields()
: Returns a list offields
calculated from theobject
. This is a great starting point if you want to provide customfields
.export(mode: 'code' | 'svg' = 'svg', scope: 'current' | 'all', timeout: int = 5000)
Returns chart(s) from the frontend exported either as Vega specifications or as SVG strings.
Vision
Our dream is that this package is super simple to use and supports your use cases:
- Great documentation including examples.
- Supports your preferred data backend including Pandas, Polars and DuckDB.
- Supports persisting and reusing Graphic Walker specifications.
- Scales to even the largest datasets only limited by your server or cluster.
❤️ Contributions
Contributions and co-maintainers are very welcome! Please submit issues or pull requests to the GitHub repository. Check out the DEVELOPER_GUIDE for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file panel_graphic_walker-0.3.2.tar.gz
.
File metadata
- Download URL: panel_graphic_walker-0.3.2.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be14b2027cce7716b6facd85bb96a059dc6775e4c3c41deabee1bfeb2a793356 |
|
MD5 | 965a4dcb4a25804e21c774ef990f2f2e |
|
BLAKE2b-256 | 4be753e3ef45d6652d614af2f8e69a6399beaffeac2315e5e61f5b317a433634 |
File details
Details for the file panel_graphic_walker-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: panel_graphic_walker-0.3.2-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69d51ee05c8f975f8205fb0d6c82640162aedb23f007bbd33eb4f779dabaa353 |
|
MD5 | d8d4d58239a1956fc023688f22b71c8b |
|
BLAKE2b-256 | f506e1e1bb878027d705cf74c1b79da177534efe4601cf5b0278fdf49261c867 |