Skip to content

Commit

Permalink
try with plain array, test lines
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Feb 19, 2024
1 parent 98d0c4a commit b1ea1a6
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions examples/generic.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
using Bonito, WGLMakie, NDViewer
using NetCDF, YAXArrays
using DimensionalData
using Random

data_cube = Cube(joinpath(@__DIR__, "speedyweather.nc"))
layers = [
Dict(
"type" => heatmap,
# "attributes" => Dict("colorrange" => colorrange),
"args" => [[1, 2]],
"attributes" => Dict(
"colorrange" => [0, 1],
)
),
Dict(
"type" => lines,
"args" => [[1]],
"attributes" => Dict("color" => "black")
)
]

NDViewer.wgl_create_plot(data_cube, layers)

dd = data_cube = DimensionalData.modify(data_cube) do arr
return convert(Array{Float32}, arr)
end

NDViewer.wgl_create_plot(dd, layers)


layers = [
Expand All @@ -35,7 +43,6 @@ g = open_dataset(zopen(path; consolidated=true))
data_cube = DimensionalData.modify(g.tas) do arr
return DiskArrays.CachedDiskArray(arr)
end
vec(view(data_cube, :, :, 1))
data = (data=data_cube,
names=map(x -> name(x.dim), collect(axes(data_cube))));

Expand Down

0 comments on commit b1ea1a6

Please sign in to comment.