writemime fix for Interact; working on glvisualize
This commit is contained in:
parent
5c52d68091
commit
16a2e34e95
@ -151,7 +151,11 @@ function gl_draw_lines_3d(x, y, z, color, linewidth, sp_screen)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function gl_draw_axes_2d(sp::Subplot{GLVisualizeBackend}, sp_screen)
|
function gl_annotate(sp::Subplot{GLVisualizeBackend}, x, y, txt::PlotText)
|
||||||
|
end
|
||||||
|
|
||||||
|
function gl_draw_axes_2d(sp::Subplot{GLVisualizeBackend})
|
||||||
|
sp_screen = sp.o
|
||||||
xaxis = sp[:xaxis]
|
xaxis = sp[:xaxis]
|
||||||
xmin, xmax = axis_limits(xaxis)
|
xmin, xmax = axis_limits(xaxis)
|
||||||
yaxis = sp[:yaxis]
|
yaxis = sp[:yaxis]
|
||||||
@ -175,12 +179,6 @@ function gl_draw_axes_2d(sp::Subplot{GLVisualizeBackend}, sp_screen)
|
|||||||
# TODO: add the ticklabel
|
# TODO: add the ticklabel
|
||||||
end
|
end
|
||||||
gl_draw_lines_2d(xsegs.pts, ysegs.pts, yaxis[:foreground_color_border], 1, sp_screen)
|
gl_draw_lines_2d(xsegs.pts, ysegs.pts, yaxis[:foreground_color_border], 1, sp_screen)
|
||||||
|
|
||||||
# # x axis
|
|
||||||
# gl_draw_lines_2d([xmin, xmax], [ymin, ymin], xaxis[:foreground_color_border], 1, sp_screen)
|
|
||||||
|
|
||||||
# # y axis
|
|
||||||
# gl_draw_lines_2d([xmin, xmin], [ymin, ymax], yaxis[:foreground_color_border], 1, sp_screen)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@ -206,8 +204,9 @@ function gl_display(plt::Plot{GLVisualizeBackend})
|
|||||||
area = GLVisualize.const_lift(f, screen.area)
|
area = GLVisualize.const_lift(f, screen.area)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
sp.o = sp_screen
|
||||||
if !is3d(sp)
|
if !is3d(sp)
|
||||||
gl_draw_axes_2d(sp, sp_screen)
|
gl_draw_axes_2d(sp)
|
||||||
end
|
end
|
||||||
|
|
||||||
# loop over the series and add them to the subplot
|
# loop over the series and add them to the subplot
|
||||||
|
|||||||
@ -156,6 +156,7 @@ for mime in keys(_mimeformats)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# A backup, if no PNG generation is defined, is to try to make a PDF and use FileIO to convert
|
# A backup, if no PNG generation is defined, is to try to make a PDF and use FileIO to convert
|
||||||
|
|
||||||
@ -222,6 +223,11 @@ function setup_ijulia()
|
|||||||
global _ijulia_output
|
global _ijulia_output
|
||||||
Dict{Compat.ASCIIString, ByteString}(_ijulia_output[1] => sprint(writemime, _ijulia_output[1], plt))
|
Dict{Compat.ASCIIString, ByteString}(_ijulia_output[1] => sprint(writemime, _ijulia_output[1], plt))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# default text/plain passes to html... handles Interact issues
|
||||||
|
function Base.writemime(io::IO, m::MIME"text/plain", plt::Plot)
|
||||||
|
writemime(io, MIME("text/html"), plt)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
set_ijulia_output("text/html")
|
set_ijulia_output("text/html")
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user