org-arl / InteractiveViz.jl

Interactive visualization tools for Julia
MIT License
109 stars 6 forks source link

Add support for iheatmap!() #25

Closed ConnectedSystems closed 8 months ago

ConnectedSystems commented 9 months ago

Add support for overlaying heatmaps on top of each other (adding to an existing axis). I've also reorganised the code as discussed in https://github.com/org-arl/InteractiveViz.jl/issues/22#issuecomment-1825531026

Closes #24

May close #22

There are some issues - occasionally the image will tear when panning/zooming, but not sure what causes it. It may be a Makie issue.

Example using WGLMakie:

using WGLMakie
using InteractiveViz
using InteractiveViz.Demo

WGLMakie.activate!(; framerate=20)

# Example using a function
# iheatmap(mandelbrot, -2, 0.66, -1, 1)

# Example using a large in-memory array
f = iheatmap(zeros(10_000, 10_000))
iheatmap!(f, rand(10_000, 10_000); alpha=0.1)

f

I have not tested with a disk-based array/matrix - hypothetically it should work.

Note: Every now and then, a warning will be raised.

Error in window event callback
exception =

All non scalars need same length, Found lengths for each argument: (5, 3, 1), (Vector{Makie.GlyphCollection}, Vector{Point{3, Float32}}, Quaternion{Float64})

The cause of this is already known https://github.com/MakieOrg/Makie.jl/issues/2473 and is not caused by/related to the changes in this PR.

marianoarnaiz commented 9 months ago

Hi. Thanks this is very helpful. :) I still cannot find how to pass a new pooling function to iheatmap, any example around?

mchitre commented 9 months ago

Hi. Thanks this is very helpful. :) I still cannot find how to pass a new pooling function to iheatmap, any example around?

Currently the pooling functionality is not user-facing. It shouldn't be hard to make it available to the user, and I have a test implementation, but it needs some testing before I can PR it. Perhaps this weekend...

marianoarnaiz commented 9 months ago

Hi. Thanks this is very helpful. :) I still cannot find how to pass a new pooling function to iheatmap, any example around?

Currently the pooling functionality is not user-facing. It shouldn't be hard to make it available to the user, and I have a test implementation, but it needs some testing before I can PR it. Perhaps this weekend...

HI again. I am sorry for the trouble. I do not mind copying the #master and making a change for myself. My data is not congruent with the current pooling. I did this for the previous version. I modded to prject for me, but the new version is quite different and I do not understand how the pooling is asing for the iheatmap. Could you let me know where is decided and I can change it.

You can see my post here

https://discourse.julialang.org/t/interactiveviz-an-interactive-visualization-toolkit-for-large-datasets/40878/27

from Mar 2023

ConnectedSystems commented 8 months ago

Okay, standardized to two-space indentation.

mchitre commented 8 months ago

LGTM, thanks!