Skip to main content

A Python package for visualizing 1x1024 matrices as 32x32 heatmaps

Project description

JQ-SDK

A Python package for visualizing 1x1024 matrices as beautiful 32x32 heatmaps with multiple color schemes.

Features

  • Convert 1D arrays (1024 elements) into 32x32 heatmap visualizations
  • Interactive Plotly-based heatmaps
  • 10 beautiful pre-configured color schemes
  • Simple and intuitive API
  • Python 3.7+ support

Installation

Install from PyPI:

pip install jq-sdk

Or install from source:

git clone https://github.com/yourusername/JQ-SDK.git
cd JQ-SDK
pip install -e .

Quick Start

import jq_sdk

# Create sample data (1024 elements)
data = list(range(1, 1025))

# Plot with default color scheme (viridis)
fig = jq_sdk.plot_heatmap(data)
fig.show()

# Use a different color scheme
fig = jq_sdk.plot_heatmap(data, colorscheme='plasma')
fig.show()

# Customize the plot
fig = jq_sdk.plot_heatmap(
    data,
    colorscheme='hot',
    title='My Custom Heatmap',
    width=1000,
    height=1000
)
fig.show()

Available Color Schemes

JQ-SDK provides 10 beautiful color schemes:

  • viridis (default) - Purple to yellow gradient
  • plasma - Dark purple to yellow gradient
  • hot - Black to red to yellow
  • blues - White to dark blue
  • reds - White to dark red
  • greens - White to dark green
  • rainbow - Full spectrum rainbow
  • inferno - Black to purple to yellow
  • magma - Black to purple to white
  • cividis - Colorblind-friendly blue to yellow

You can get the list programmatically:

import jq_sdk

schemes = jq_sdk.get_available_colorschemes()
print(schemes)

API Reference

plot_heatmap(data, colorscheme='viridis', title='Heatmap Visualization', show_colorbar=True, width=800, height=800)

Plot a 1x1024 matrix as a 32x32 heatmap.

Parameters:

  • data (list or numpy.ndarray): Input data with exactly 1024 elements
  • colorscheme (str, optional): Color scheme name. Default is 'viridis'
  • title (str, optional): Title of the heatmap. Default is 'Heatmap Visualization'
  • show_colorbar (bool, optional): Whether to show the colorbar. Default is True
  • width (int, optional): Width of the figure in pixels. Default is 800
  • height (int, optional): Height of the figure in pixels. Default is 800

Returns:

  • plotly.graph_objects.Figure: Plotly figure object. Call .show() to display.

Raises:

  • ValueError: If input data does not contain exactly 1024 elements
  • KeyError: If an invalid colorscheme is specified

get_available_colorschemes()

Get a list of available color schemes.

Returns:

  • list: List of available colorscheme names

Examples

Basic Usage

import jq_sdk
import numpy as np

# Using a list
data = list(range(1024))
fig = jq_sdk.plot_heatmap(data)
fig.show()

# Using numpy array
data = np.random.rand(1024)
fig = jq_sdk.plot_heatmap(data, colorscheme='plasma')
fig.show()

Comparing Different Color Schemes

import jq_sdk
import numpy as np

# Generate sample data
data = np.sin(np.linspace(0, 4*np.pi, 1024))

# Try different color schemes
for scheme in ['viridis', 'plasma', 'hot', 'rainbow']:
    fig = jq_sdk.plot_heatmap(
        data,
        colorscheme=scheme,
        title=f'Heatmap with {scheme} colorscheme'
    )
    fig.show()

Saving to File

import jq_sdk

data = list(range(1, 1025))
fig = jq_sdk.plot_heatmap(data, colorscheme='viridis')

# Save as HTML
fig.write_html('heatmap.html')

# Save as PNG (requires kaleido)
# pip install kaleido
fig.write_image('heatmap.png')

Requirements

  • Python >= 3.7
  • numpy >= 1.19.0
  • plotly >= 5.0.0

Development

Install development dependencies:

pip install -e ".[dev]"

Run tests:

pytest

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any issues or have questions, please file an issue on the GitHub issue tracker.

Changelog

0.1.0 (Initial Release)

  • Initial release with basic heatmap visualization
  • Support for 10 color schemes
  • Interactive Plotly-based visualizations
  • Python 3.7+ support

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

jq_sdk-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

jq_sdk-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for jq_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 887dc9470725f13135a30fff0ffdc4691d9336f8b24fa4906b359f8a9cd78e22
MD5 d74490d5db3f4b8de8f76e265fe76880
BLAKE2b-256 31e123f9d0870bf152ea2954ee6e9ec8493c70a1d73b7dca784fdad356cd8e8f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for jq_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9874221cf69a6930849d69cff6801bf553bf406589fe39118db551414c0d765
MD5 bbcedee006c4d3c0296b9362f3887572
BLAKE2b-256 a55089f88154b6b45c603072d84e05e82d0ccf546a3c5fe504b5d0c269a85be3

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