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
|
||||
|
||||
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]
|
||||
xmin, xmax = axis_limits(xaxis)
|
||||
yaxis = sp[:yaxis]
|
||||
@ -175,12 +179,6 @@ function gl_draw_axes_2d(sp::Subplot{GLVisualizeBackend}, sp_screen)
|
||||
# TODO: add the ticklabel
|
||||
end
|
||||
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
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@ -206,8 +204,9 @@ function gl_display(plt::Plot{GLVisualizeBackend})
|
||||
area = GLVisualize.const_lift(f, screen.area)
|
||||
)
|
||||
|
||||
sp.o = sp_screen
|
||||
if !is3d(sp)
|
||||
gl_draw_axes_2d(sp, sp_screen)
|
||||
gl_draw_axes_2d(sp)
|
||||
end
|
||||
|
||||
# loop over the series and add them to the subplot
|
||||
|
||||
@ -156,6 +156,7 @@ for mime in keys(_mimeformats)
|
||||
end
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 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
|
||||
Dict{Compat.ASCIIString, ByteString}(_ijulia_output[1] => sprint(writemime, _ijulia_output[1], plt))
|
||||
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
|
||||
set_ijulia_output("text/html")
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user