Skip to content
Prev Previous commit
Next Next commit
accidentally deleted heatmap file
  • Loading branch information
Caitlin Lewis committed Dec 28, 2022
commit 0dd74aa1a3cb7d57708af5b5b8d5064d39b1bff9
27 changes: 27 additions & 0 deletions fastplotlib/graphics/heatmap.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import numpy as np
import pygfx
from typing import *
<<<<<<< HEAD

from fastplotlib.graphics._base import Graphic

=======
>>>>>>> c523c28 (accidentally deleted heatmap file)
from .image import ImageGraphic

from ..utils import quick_min_max, get_cmap_texture

<<<<<<< HEAD
from ._base import Interaction

=======
>>>>>>> c523c28 (accidentally deleted heatmap file)

default_selection_options = {
"mode": "single",
Expand Down Expand Up @@ -45,6 +51,7 @@ def __init__(
self.callbacks = callbacks


<<<<<<< HEAD
class HeatmapGraphic(ImageGraphic, Interaction):
@property
def indices(self) -> Any:
Expand All @@ -61,6 +68,9 @@ def link(self, event: str, feature: Any, feature_data: Any, target: Graphic, tar
indices_mapper: Any):
pass

=======
class HeatmapGraphic(ImageGraphic):
>>>>>>> c523c28 (accidentally deleted heatmap file)
def __init__(
self,
data: np.ndarray,
Expand All @@ -73,12 +83,16 @@ def __init__(
):
"""
Create a Heatmap Graphic
<<<<<<< HEAD

=======
>>>>>>> c523c28 (accidentally deleted heatmap file)
Parameters
----------
data: array-like, must be 2-dimensional
| array-like, usually numpy.ndarray, must support ``memoryview()``
| Tensorflow Tensors also work _I think_, but not thoroughly tested
<<<<<<< HEAD

vmin: int, optional
minimum value for color scaling, calculated from data if not provided
Expand All @@ -91,6 +105,15 @@ def __init__(

selection_options

=======
vmin: int, optional
minimum value for color scaling, calculated from data if not provided
vmax: int, optional
maximum value for color scaling, calculated from data if not provided
cmap: str, optional
colormap to use to display the image data, default is ``"plasma"``
selection_options
>>>>>>> c523c28 (accidentally deleted heatmap file)
args:
additional arguments passed to Graphic
kwargs:
Expand Down Expand Up @@ -160,4 +183,8 @@ def add_highlight(self, event):
self.world_object.add(self.selection_graphic)
self._highlights.append(self.selection_graphic)

<<<<<<< HEAD
return rval
=======
return rval
>>>>>>> c523c28 (accidentally deleted heatmap file)