Skip to main content

tkfastscatter

GPU-accelerated 3D scatter plot widget for Tkinter, written in Rust.

Renders large point clouds (250 k+ points) at interactive frame rates by using wgpu (Vulkan / Metal / DirectX 12) via PyO3. The widget embeds directly in any Tkinter layout — no separate window or subprocess.

Installation

pip install tkfastscatter

Pre-built wheels will be published to PyPI for Python 3.9–3.12 on Windows, macOS, and Linux once a CI release pipeline is in place. Until then, install from source (see Building from source below).

GitHub release publishing

This repo now includes automated PyPI publishing through release.yml. The workflow builds:

  • a source distribution
  • Linux x86_64 manylinux wheels
  • Windows x64 wheels
  • macOS x86_64 and arm64 wheels

Publishing uses PyPI Trusted Publishing. Before the first release, configure tkfastscatter on PyPI to trust this exact GitHub Actions workflow:

  1. Repository owner: NKocur
  2. Repository name: tkfastscatter
  3. Workflow path: .github/workflows/release.yml

After that, publishing a GitHub Release will build artifacts and upload them to PyPI automatically. You can also run the same workflow manually from GitHub Actions via workflow_dispatch; leave publish unchecked for a build-only dry run, or enable it to upload to PyPI.

Quick start

import tkinter as tk
import numpy as np
from tkfastscatter import ScatterWidget

root = tk.Tk()
widget = ScatterWidget(root, width=900, height=700)
widget.pack(fill="both", expand=True)

pts = np.random.default_rng(0).standard_normal((250_000, 3)).astype(np.float32)
widget.set_points(pts, colormap="plasma")

root.mainloop()

API

Widget construction

ScatterWidget(master, *, width=800, height=600, fps=60, vsync=True, **kwargs)

A tk.Frame subclass. All standard frame keyword arguments are forwarded.

Pre-map behaviour: The following may be called before mainloop() and are queued, then replayed when the renderer initialises on widget map: set_points, add_points, add_lines, add_box, scalar_bar, show_orientation_axes, point_style, show_grid, set_background, set_axes, set_ticks, and the parallel_projection property.

Camera methods (reset_camera, view_*, fit, get_camera, set_camera) and overlay-mutation methods (update_lines, remove_overlay, set_overlay_visibility) are silent no-ops before the widget is mapped.


Point clouds

widget.set_points(positions, *, colors=None, scalars=None, colormap="viridis",
                  point_size=4.0, clim=None, nan_color=(0.3,0.3,0.3),
                  log_scale=False, opacity=1.0)

Replace all point actors with a single point cloud. Line overlays are not affected; call clear() first to reset the whole scene.

Parameter Type Description
positions (N, 3) float32 XYZ coordinates
colors (N, 3) float32, optional Per-point RGB in [0, 1]. Takes priority over scalars.
scalars (N,) float32, optional Mapped through colormap. Used when colors is absent.
colormap str One of the names returned by colormap_names().
point_size float Point diameter in pixels (default 4).
clim (float, float), optional Colormap range. Defaults to data min/max.
nan_color (r, g, b) Colour for NaN scalars (default dark grey).
log_scale bool Apply log₁₀ normalisation before colouring.
opacity float Per-call alpha, [0, 1] (default 1.0).
handle = widget.add_points(positions, *, ...)   # same kwargs as set_points
widget.update_actor(handle, positions, *, ...)  # replace in-place
widget.set_actor_visibility(handle, visible)
widget.remove_actor(handle)
widget.clear()                                   # remove all actors, overlays, and grid

Rendering style

widget.point_style = "circle"   # "circle" | "square" | "gaussian"
widget.set_ticks(x=None, y=None, z=None)

Camera

widget.reset_camera()
widget.fit(bounds=None)          # (xmin,ymin,zmin,xmax,ymax,zmax) or re-fit data
widget.view_xy(); widget.view_xz(); widget.view_yz(); widget.view_isometric()
widget.parallel_projection       # bool property
state = widget.get_camera()
widget.set_camera(state)

Axis labels, grid and background

widget.set_axes(x="X", y="Y", z="Z")   # axis title labels at grid extents
widget.show_grid(visible=True)          # toggle grid lines + tick labels
widget.set_background(color)            # (r,g,b) tuple or "#RRGGBB" hex string

Scalar bar

widget.scalar_bar(visible=True, *, vmin=0.0, vmax=1.0, log_scale=False,
                  colormap="viridis", title="")

Line overlays

Segments are (N, 6) float32 arrays, each row [x0,y0,z0, x1,y1,z1]. Overlay bounds are included in camera fitting and grid extents.

handle = widget.add_lines(segments, color=(1,1,1))
handle = widget.add_box(bounds, color=(1,1,0))   # (xmin,ymin,zmin,xmax,ymax,zmax)
widget.update_lines(handle, segments, color)
widget.set_overlay_visibility(handle, visible)
widget.remove_overlay(handle)
widget.clear_overlays()
widget.show_orientation_axes(visible=True)

Picking

widget.enable_point_picking(on_pick=None)      # fires <<PointPicked>>
widget.enable_rectangle_picking(on_select=None) # Shift+drag; fires <<SelectionChanged>>
widget.disable_picking()
# After <<PointPicked>>:  widget.picked_point, .picked_index, .picked_actor
# After <<SelectionChanged>>: widget.selected  →  [{"actor":int,"index":int},...]

Animation export

widget.open_gif(path, fps=20, loop=0)
widget.write_frame()
widget.close_gif()
# or all-in-one orbit:
widget.orbit_gif(path, n_frames=60, fps=20, loop=0, elevation=0.3, on_progress=None)

Screenshot

rgba = widget.screenshot()   # (H, W, 4) uint8 ndarray, or None before map
widget.save_png(path)

Linked cameras

from tkfastscatter import link_cameras, unlink_cameras
link_cameras(w1, w2, w3, ...)
unlink_cameras(w1, w2)

Misc

ScatterWidget.colormap_names() → list[str]

Camera controls

Input Action
Left-drag Orbit
Shift + left-drag Pan
Middle-drag Pan
Scroll wheel Zoom
Double left-click Reset camera

Platform notes

Windows

Fully supported. Uses DirectX 12 or Vulkan via wgpu. No extra dependencies.

macOS

Fully supported. Uses Metal via wgpu. No extra dependencies.

Linux

Requires an X11/Xlib display (Wayland is not supported). The widget uses winfo_id() to obtain an XID and opens the display via libX11.so.6. Pure Wayland sessions will fail at renderer initialisation with a warning. Running under XWayland works.

# Confirm X11 is available:
echo $DISPLAY   # should print e.g. :0

Building from source

Requires Rust (stable) and maturin ≥ 1.7.

Development (installs the extension in-place for local imports):

pip install maturin
maturin develop --release
pytest tests/

Distribution wheel — use the helper script, which removes the maturin develop artifact from the source tree before building. Running maturin build directly from a development working tree will fail because the in-place extension collides with the freshly-compiled one:

python scripts/build_wheel.py           # produces target/wheels/*.whl
# or equivalently:
rm -f python/tkfastscatter/_tkfastscatter*.{pyd,so,dylib}
maturin build --release

License

MIT

Metadata

Release files for tkfastscatter 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tkfastscatter 0.1.0
File Size Uploaded Provenance
tkfastscatter-0.1.0.tar.gz 60.1 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for tkfastscatter 0.1.0
File
tkfastscatter-0.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
tkfastscatter-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
tkfastscatter-0.1.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
tkfastscatter-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details
tkfastscatter-0.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
tkfastscatter-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
tkfastscatter-0.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
tkfastscatter-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details
tkfastscatter-0.1.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
tkfastscatter-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
tkfastscatter-0.1.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
tkfastscatter-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.12+ x86-64 Details
tkfastscatter-0.1.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
tkfastscatter-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
tkfastscatter-0.1.0-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
tkfastscatter-0.1.0-cp39-cp39-macosx_10_12_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.12+ x86-64 Details

Total release size: 42.9 MB

Release files / tkfastscatter-0.1.0.tar.gz

Download URL tkfastscatter-0.1.0.tar.gz
Size 60.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6efbd51a7a48ee2ff5465975896ba4d69b12925574cf0cd27fb3ee8f3d1ddc50
BLAKE2b-256 checksum
How to use checksums
96125b34fb1fd58ea2177d32d1c104c7507043d5097c61dc5a7c0b18b1e12948
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp312-cp312-win_amd64.whl

Download URL tkfastscatter-0.1.0-cp312-cp312-win_amd64.whl
Size 2.9 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
0c43b89cc7233f076cb8161a519c2268d8e60dc959f4f58b7c6d5a14d39d8671
BLAKE2b-256 checksum
How to use checksums
dc06eebda8bf452e1d4a11f6031bbd11a0f83fb2cd98fa7aa489d56db297dcd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tkfastscatter-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.0 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
71b592833ed4c946468609181d21b1126b75e7ccfad17d50cd294f46502dce71
BLAKE2b-256 checksum
How to use checksums
a231ac429749e90d0d6c281c49466b00bb868a9b7534e52dd823ce8f61bd800a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL tkfastscatter-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Size 2.3 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5d5e99741edb34d72dfd4ebc083528691b7aba8c969c845ad304766ef59757cb
BLAKE2b-256 checksum
How to use checksums
bc13dfdcd631c9f1ac80b2353be457fb571f18aaae509e291ddb79798d9132a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl

Download URL tkfastscatter-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4cabcca50df9d32335089c581e33dffb4a94633096137fa28e73ce37a5b29dd3
BLAKE2b-256 checksum
How to use checksums
29f1413998699e726cc788f0b31fe57d7025e8f4cb38d963286598eca998a973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp311-cp311-win_amd64.whl

Download URL tkfastscatter-0.1.0-cp311-cp311-win_amd64.whl
Size 2.9 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
172034202b24c9a01a3f69406de6441474102498f1b8f603b419aadc9dff5a59
BLAKE2b-256 checksum
How to use checksums
8cdbe614878c24a744ad988f4623bc190f860b158b0b46c6122f70e4a1a4eb08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tkfastscatter-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.0 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e51381f790bec4ed2d95d7662b7db294d0f94b6ba5f7597da478591e297e9cbe
BLAKE2b-256 checksum
How to use checksums
429942d4c6b79e8c48d3906e65d6e9cecb66cde27b907448cb3ab02935f4a4a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL tkfastscatter-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Size 2.3 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6daebaf8f71f059eb06069fb8fda62a39cd1f5de9f208067e60c178179cc2f20
BLAKE2b-256 checksum
How to use checksums
973c70ebea9e8f786c98bf741be9b62e177c3386c6f4caea25d979183e11ee1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl

Download URL tkfastscatter-0.1.0-cp311-cp311-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e1a3b84eb6a73616dddf62458c5e50b9e12fe7b69284a0866b7f0f3ed5e7f957
BLAKE2b-256 checksum
How to use checksums
d6c21e47aad17edc22e5a9b8a6593609e2795e1cc87faa220daf454711dd5ed5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp310-cp310-win_amd64.whl

Download URL tkfastscatter-0.1.0-cp310-cp310-win_amd64.whl
Size 2.9 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
51ad9f8a3f920c7c940e0970318ead487131ea04d5708574273c24993cbb064d
BLAKE2b-256 checksum
How to use checksums
66dcb86ad7a31b920ddae42a2016778c9b29b3569993dc371bffb3562bfe0894
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tkfastscatter-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
d930b1b9ff24f33d71eec1b9bed5425d0bbd0f72f8f348b0b295b306b15253f5
BLAKE2b-256 checksum
How to use checksums
f8ffd251da29fc1c7fad875529eb74a42cc98a5284687e616cba6f65b90c743d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL tkfastscatter-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Size 2.3 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f686555daeebac0499712afc33afb8bdaf4b64223c2df9dd65025ac3382455cc
BLAKE2b-256 checksum
How to use checksums
3db72005f37742ee04feef1e8d87486fd2062f01df1ddd5dea188ee0b4e698b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl

Download URL tkfastscatter-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.10 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ea6ca10a3588519af71b86190eab9cac8454dd3ad7acd6b94355026fc66feb81
BLAKE2b-256 checksum
How to use checksums
8546f5d85246e441a3c9c1258cff8b1293370e063614dfea61a809f056f0fd69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp39-cp39-win_amd64.whl

Download URL tkfastscatter-0.1.0-cp39-cp39-win_amd64.whl
Size 2.9 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
08eee509013469654505a6b6149aa4cd60e5a2624e54024e5b96e31bc5ebb1ed
BLAKE2b-256 checksum
How to use checksums
cc6cb955a55a361ad250836bc1765c36cb9203e5061ebc5f74dbbd8bb574de5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tkfastscatter-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
bac1b8897de30efc88239cedf5dbafb9def40f44d3428a7ab86f289f4a2258cf
BLAKE2b-256 checksum
How to use checksums
6ae153e6c4d77e84642047883a19debcd6747176854c718bbae2aa40bc334498
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp39-cp39-macosx_11_0_arm64.whl

Download URL tkfastscatter-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Size 2.3 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
457fee3160e43a8ac3d72b3d82e5352e4ebf9fd61e477f887a48fce66dc1fb01
BLAKE2b-256 checksum
How to use checksums
68394d4ef1f42026eb6c8bde7d10cbc19cf5bc6eed8ad1be31d304105f017531
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / tkfastscatter-0.1.0-cp39-cp39-macosx_10_12_x86_64.whl

Download URL tkfastscatter-0.1.0-cp39-cp39-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.9 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
5657e3102667afd5459d62cd890c7a25b1b9aa5836cf788e99bd6f42f0284a40
BLAKE2b-256 checksum
How to use checksums
55928f3184d3c8c72a71805f4d744754f7f899f68d2cba1951fcae234f035129
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Security for tkfastscatter 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

17 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page