Skip to content

Commit

Permalink
fix: fix bug that prevented negative heatmap values to be plotted
Browse files Browse the repository at this point in the history
  • Loading branch information
mchitre committed May 20, 2023
1 parent 711a27c commit 0518cdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "InteractiveViz"
uuid = "d14badfc-0adb-4d57-980e-37858d990fa5"
authors = ["Mandar Chitre <mandar@nus.edu.sg>"]
version = "0.4.0"
version = "0.4.1"

[deps]
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Expand Down
4 changes: 2 additions & 2 deletions src/datasrc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ struct Samples2D{S1<:AbstractRange,S2<:AbstractMatrix} <: Continuous2D
end
end

function sample(data::Samples2D, xrange::AbstractRange, yrange::AbstractRange; pool=max)
function sample(data::Samples2D, xrange::AbstractRange, yrange::AbstractRange; pool=max, init=convert(eltype(data.z), -Inf))
xrange = intersection(xrange, data.x)
yrange = intersection(yrange, data.y)
z = zeros(eltype(data.z), length(xrange), length(yrange))
z = fill(init, length(xrange), length(yrange))
Δx = step(xrange)
if Δx == 0
xis = 1:1
Expand Down

2 comments on commit 0518cdf

@mchitre
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/83933

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.1 -m "<description of version>" 0518cdf28ff935bbb453f5dd43c495c413b87c2f
git push origin v0.4.1

Please sign in to comment.