Skip to main content

A project providing a Graphic Walker Pane for use with HoloViz Panel.

Project description

✨ Welcome to Panel Graphic Walker

License py.cafe

A simple way to explore your data through a Tableau-like interface directly in your Panel data applications.

panel-graphic-walker-plot

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. (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.

Please note that displaying larger datasets (>= 10 MB) may currently not be possible depending on the limits of your environment.

Installation

Install panel-graphic-walker via pip:

pip install panel-graphic-walker

Usage

Basic Graphic Walker Pane

py.cafe

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()

panel-graphic-walker-table panel-graphic-walker-plot

Configuring Fields

py.cafe

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()

Configuring the Appearance

py.cafe

By default, the appearance is determined by pn.config.theme. However, you can manually change this, for example, to media, which 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

py.cafe

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)

py.cafe

You can export the current chart from the client to the server by triggering the parameter export_chart. The chart is exported to the chart parameter:

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.Button(icon="download", on_click=export),
        exported,
    )
).servable()

Scale with Server-Side Computation

py.cafe

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

py.cafe Static Badge

Panel Graphic Walker App Demo

API

Parameters

Core

  • object (DataFrame): The data for exploration. Please note that if you update the object, 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 from pn.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 of fields calculated from the object. This is a great starting point if you want to provide custom fields.
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panel_graphic_walker-0.3.1.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

panel_graphic_walker-0.3.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file panel_graphic_walker-0.3.1.tar.gz.

File metadata

  • Download URL: panel_graphic_walker-0.3.1.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

Hashes for panel_graphic_walker-0.3.1.tar.gz
Algorithm Hash digest
SHA256 eeb739202760870f86e7c8204601488b8f3b5a541aab8a933bb5a88eb1163107
MD5 fc6bcd431d1302318ebda7179ca0ae7e
BLAKE2b-256 13e1f6d967dc8c346597064f44049d0c3429c68899e9369e45473d282072a65c

See more details on using hashes here.

File details

Details for the file panel_graphic_walker-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for panel_graphic_walker-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bbe5992fdc3d2992390afc39375169537a08b60cc5f95d35e1aa39b5a72d2e20
MD5 f89204aaa48f4fcf25bd04785f8f8ff4
BLAKE2b-256 19269f79a3048591d52b1f28debb26a900d8fc150c61f4d69706e53157c84cc9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page