Skip to main content

Python + Qt based 2D data visualization solution for irregular data points

Project description

FieldView

FieldView is a high-performance Python + Qt (PySide6) library for 2D data visualization, specifically designed for handling irregular data points. It provides a robust rendering engine for heatmaps, markers, and text labels with minimal external dependencies.

Quick Start

Key Features

  • Fast Heatmap Rendering: Hybrid RBF (Radial Basis Function) interpolation for high-quality visualization with real-time performance optimization.
  • Irregular Data Support: Native handling of non-grid data points.
  • Polygon Masking: Support for arbitrary boundary shapes (Polygon, Circle, Rectangle) to clip heatmaps.
  • Layer System: Modular architecture with support for:
    • HeatmapLayer: Color-based data visualization.
    • ValueLayer/LabelLayer: Text rendering with collision avoidance.
    • PinLayer: Marker placement.
    • SvgLayer: Background floor plans or overlays.
  • Minimal Dependencies: Built on numpy, scipy, and PySide6.

Installation

pip install fieldview

Note: Requires Python 3.10+

Quick Start

Here is a minimal example to get a heatmap up and running:

import sys
import os
import numpy as np
from PySide6.QtWidgets import QApplication, QGraphicsView, QGraphicsScene
from PySide6.QtCore import Qt
from fieldview.core.data_container import DataContainer
from fieldview.layers.heatmap_layer import HeatmapLayer
from fieldview.layers.text_layer import ValueLayer
from fieldview.layers.svg_layer import SvgLayer
from fieldview.layers.pin_layer import PinLayer

app = QApplication(sys.argv)

# 1. Setup Data
data = DataContainer()
np.random.seed(44)
points = (np.random.rand(20, 2) - 0.5) * 300
values = np.random.rand(20) * 100
data.set_data(points, values)

# 2. Create Scene & Layers
scene = QGraphicsScene()

# SVG Layer (Background)
# Assuming floorplan.svg exists in current dir or provide path
svg_layer = SvgLayer()
svg_layer.load_svg("examples/floorplan.svg")
svg_layer.setZValue(0)
scene.addItem(svg_layer)

# Heatmap Layer
heatmap = HeatmapLayer(data)
heatmap.setOpacity(0.6)
heatmap.setZValue(1)
heatmap.set_boundary_shape(svg_layer._bounding_rect)
scene.addItem(heatmap)

# Pin Layer
pin_layer = PinLayer(data)
pin_layer.setZValue(2)
scene.addItem(pin_layer)

# Value Layer
values_layer = ValueLayer(data)
values_layer.setZValue(3)
scene.addItem(values_layer)

# 3. Setup View
view = QGraphicsView(scene)
view.resize(800, 600)
view.show()

# Ensure content is visible
scene.setSceneRect(scene.itemsBoundingRect())
view.fitInView(scene.sceneRect(), Qt.AspectRatioMode.KeepAspectRatio)

sys.exit(app.exec())

Running the Demo

To see all features in action, including the property editor and real-time interaction:

# Clone the repository
git clone https://github.com/yourusername/fieldview.git
cd fieldview

# Run the demo using uv (recommended)
uv run examples/demo.py
Demo

License

MIT License

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

fieldview-0.1.0.tar.gz (141.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fieldview-0.1.0-py3-none-any.whl (143.8 kB view details)

Uploaded Python 3

File details

Details for the file fieldview-0.1.0.tar.gz.

File metadata

  • Download URL: fieldview-0.1.0.tar.gz
  • Upload date:
  • Size: 141.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for fieldview-0.1.0.tar.gz
Algorithm Hash digest
SHA256 97131781f02fc0b7444dc7e4ebe2e55ce74a904c2aba7fb6f9b66cc22856e510
MD5 50757b0e0c41a76d3a650d46f8d78071
BLAKE2b-256 50a8f0d2dfba3b1539fb67d085f7906c0647a43c33d2d36a341f8c088572674e

See more details on using hashes here.

File details

Details for the file fieldview-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fieldview-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 143.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for fieldview-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e83321c4a2f4efe7db075f6029a313c7811e7ba9cd3221512c7d932154c00b51
MD5 f35818efdc0bc8a03769a1fb242b0a16
BLAKE2b-256 0a46cd104a062f10dd93bf40ab0a042a600ce3e40040db53ed9f7172d48e57f1

See more details on using hashes here.

Supported by

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