working on glvisualize
This commit is contained in:
parent
49f774eb0d
commit
368429b757
@ -13,9 +13,13 @@ function _create_plot(pkg::GLVisualizePackage; kw...)
|
|||||||
d = Dict(kw)
|
d = Dict(kw)
|
||||||
# TODO: create the window/canvas/context that is the plot within the backend (call it `o`)
|
# TODO: create the window/canvas/context that is the plot within the backend (call it `o`)
|
||||||
# TODO: initialize the plot... title, xlabel, bgcolor, etc
|
# TODO: initialize the plot... title, xlabel, bgcolor, etc
|
||||||
|
|
||||||
|
# TODO: this should be moved to the display method?
|
||||||
w,r=GLVisualize.glscreen()
|
w,r=GLVisualize.glscreen()
|
||||||
@async r()
|
@async r()
|
||||||
Plot(GLScreenWrapper(w,r), pkg, 0, d, Dict[])
|
o = GLScreenWrapper(w,r)
|
||||||
|
|
||||||
|
Plot(o, pkg, 0, d, Dict[])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -23,8 +27,12 @@ function _add_series(::GLVisualizePackage, plt::Plot; kw...)
|
|||||||
d = Dict(kw)
|
d = Dict(kw)
|
||||||
# TODO: add one series to the underlying package
|
# TODO: add one series to the underlying package
|
||||||
push!(plt.seriesargs, d)
|
push!(plt.seriesargs, d)
|
||||||
x,y,z=map(Float32,d[:x]), map(Float32,d[:y]), map(Float32,d[:surface].surf)
|
|
||||||
GLVisualize.view(GLVisualize.visualize(x*ones(y)', ones(x)*y', z, :surface))
|
# TODO: this should be moved to the display method?
|
||||||
|
x, y, z = map(Float32, d[:x]), map(Float32, d[:y]), map(Float32, d[:z].surf)
|
||||||
|
viz = GLVisualize.visualize(x*ones(y)', ones(x)*y', z, :surface)
|
||||||
|
GLVisualize.view(viz)
|
||||||
|
|
||||||
plt
|
plt
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -51,13 +59,16 @@ end
|
|||||||
# accessors for x/y data
|
# accessors for x/y data
|
||||||
|
|
||||||
function Base.getindex(plt::Plot{GLVisualizePackage}, i::Int)
|
function Base.getindex(plt::Plot{GLVisualizePackage}, i::Int)
|
||||||
series = plt.o.lines[i]
|
# TODO:
|
||||||
series.x, series.y
|
# series = plt.o.lines[i]
|
||||||
|
# series.x, series.y
|
||||||
|
nothing, nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
function Base.setindex!(plt::Plot{GLVisualizePackage}, xy::Tuple, i::Integer)
|
function Base.setindex!(plt::Plot{GLVisualizePackage}, xy::Tuple, i::Integer)
|
||||||
series = plt.o.lines[i]
|
# TODO:
|
||||||
series.x, series.y = xy
|
# series = plt.o.lines[i]
|
||||||
|
# series.x, series.y = xy
|
||||||
plt
|
plt
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -83,6 +94,10 @@ end
|
|||||||
|
|
||||||
function Base.display(::PlotsDisplay, plt::Plot{GLVisualizePackage})
|
function Base.display(::PlotsDisplay, plt::Plot{GLVisualizePackage})
|
||||||
# TODO: display/show the plot
|
# TODO: display/show the plot
|
||||||
|
|
||||||
|
# NOTE: I think maybe this should be empty? We can start with the assumption that creating
|
||||||
|
# and adding to a plot will automatically open a window and draw to it, then the display
|
||||||
|
# wouldn't actually need to do anything
|
||||||
end
|
end
|
||||||
|
|
||||||
function Base.display(::PlotsDisplay, plt::Subplot{GLVisualizePackage})
|
function Base.display(::PlotsDisplay, plt::Subplot{GLVisualizePackage})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user