-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
937d990
commit 015c2af
Showing
10 changed files
with
123 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
data: | ||
path: "./dev/NDViewer/examples/speedyweather.nc" | ||
layers: | ||
- figure: | ||
size: [1000, 800] | ||
- type: LScene | ||
position: [1, 1] | ||
attributes: | ||
show_axis: false | ||
plots: | ||
- type: sphereplot | ||
args: [[1, 2]] | ||
- type: Axis | ||
position: [1, 2] | ||
plots: | ||
- type: image | ||
args: [[1, 2]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,9 @@ | ||
using Bonito, WGLMakie, NDViewer | ||
|
||
|
||
function create_app_from_yaml(file) | ||
yaml_str = read(file, String) | ||
viewer = NDViewer.load_from_yaml(yaml_str) | ||
app = App() do | ||
editor = CodeEditor("yaml"; initial_source=yaml_str, width=300, height=600, foldStyle="manual") | ||
css = DOM.style(""" | ||
.ace_scrollbar-v, | ||
.ace_scrollbar-h { | ||
display: none !important; | ||
} | ||
""") | ||
set_editor = js""" | ||
const editor = ace.edit($(editor.element)) | ||
editor.setReadOnly(true); | ||
""" | ||
yaml_display = DOM.div(css, Card(editor; width="fit-content"), set_editor) | ||
style = Styles("word-wrap" => "break-word") | ||
app_dom = Grid( | ||
yaml_display, viewer; | ||
justify_content="center", | ||
# align_items="center", | ||
style=Styles("grid-auto-flow" => "column") | ||
) | ||
return Centered(app_dom; style=Styles("width" => "100%")) | ||
end | ||
return app, viewer | ||
end | ||
|
||
app1, viewer = create_app_from_yaml(joinpath(@__DIR__, "speedyweather.yaml")); app1 | ||
NDViewer.add_slice_view(viewer, 1, 1, 1, :black) | ||
NDViewer.add_slice_view(viewer, 1, 1, 2, :blue) | ||
|
||
app2, viewer = create_app_from_yaml(joinpath(@__DIR__, "speedyweather-tyler.yaml")); app2 | ||
app3, viewer = create_app_from_yaml(joinpath(@__DIR__, "tas-gn-64gb.yaml")); app3 | ||
using Bonito, WGLMakie, NDViewer, GeometryBasics | ||
using NDViewer: yaml_viewer | ||
yaml_path(name) = joinpath(@__DIR__, name) | ||
WGLMakie.activate!() | ||
app1 = yaml_viewer(yaml_path("speedyweather.yaml")) | ||
app2 = yaml_viewer(yaml_path("speedy-volume.yaml")) | ||
app3 = yaml_viewer(yaml_path("speedyweather-tyler.yaml")) | ||
app4 = yaml_viewer(yaml_path("tas-gn-64gb.yaml")) | ||
app5 = yaml_viewer(yaml_path("earth-sphere.yaml")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
data: | ||
path: "./dev/NDViewer/examples/speedyweather.nc" | ||
layers: | ||
- figure: | ||
size: [1000, 800] | ||
- type: Axis3 | ||
position: [1, 1] | ||
plots: | ||
- type: volume | ||
args: [[1, 2, 3]] | ||
- type: Axis | ||
position: [1, 2] | ||
plots: | ||
- type: image | ||
args: [[1, 2]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Bonito | ||
using DelimitedFiles | ||
volcano = readdlm(Makie.assetpath("volcano.csv"), ',', Float64) | ||
App() do | ||
f = contourf(volcano, levels=10; axis=(; title="normal")) | ||
f2 = contourf(volcano, levels=10; axis=(; title="resize_to=:parent")) | ||
r = WGLMakie.WithConfig(f2; resize_to=:parent) | ||
DOM.div(Grid(f, r; columns="50% 50%"); style=Styles("height" => "700px")) | ||
|
||
end | ||
|
||
using GeoMakie, GLMakie | ||
fig = Figure() | ||
ga = GeoAxis( | ||
fig[1, 1]; # any cell of the figure's layout | ||
dest="+proj=wintri", # the CRS in which you want to plot | ||
) | ||
lines!(ga, GeoMakie.coastlines()) # plot coastlines from Natural Earth as a reference | ||
# You can plot your data the same way you would in Makie | ||
scatter!(ga, -120:15:120, -60:7.5:60; color=-60:7.5:60, strokecolor=(:black, 0.2)) | ||
fig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters