_canvas_type in unicodeplots
This commit is contained in:
parent
e9ccdef447
commit
eba1e366bb
@ -45,6 +45,18 @@ end
|
|||||||
|
|
||||||
# -------------------------------
|
# -------------------------------
|
||||||
|
|
||||||
|
const _canvas_type = Ref(:auto)
|
||||||
|
|
||||||
|
function _canvas_map()
|
||||||
|
KW(
|
||||||
|
:braille => UnicodePlots.BrailleCanvas,
|
||||||
|
:ascii => UnicodePlots.AsciiCanvas,
|
||||||
|
:block => UnicodePlots.BlockCanvas,
|
||||||
|
:dot => UnicodePlots.DotCanvas,
|
||||||
|
:density => UnicodePlots.DensityCanvas,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# do all the magic here... build it all at once, since we need to know about all the series at the very beginning
|
# do all the magic here... build it all at once, since we need to know about all the series at the very beginning
|
||||||
function rebuildUnicodePlot!(plt::Plot, width, height)
|
function rebuildUnicodePlot!(plt::Plot, width, height)
|
||||||
@ -66,7 +78,12 @@ function rebuildUnicodePlot!(plt::Plot, width, height)
|
|||||||
y = Float64[ylim[1]]
|
y = Float64[ylim[1]]
|
||||||
|
|
||||||
# create a plot window with xlim/ylim set, but the X/Y vectors are outside the bounds
|
# create a plot window with xlim/ylim set, but the X/Y vectors are outside the bounds
|
||||||
canvas_type = isijulia() ? UnicodePlots.AsciiCanvas : UnicodePlots.BrailleCanvas
|
ct = _canvas_type[]
|
||||||
|
canvas_type = if ct == :auto
|
||||||
|
isijulia() ? UnicodePlots.AsciiCanvas : UnicodePlots.BrailleCanvas
|
||||||
|
else
|
||||||
|
_canvas_map()[ct]
|
||||||
|
end
|
||||||
|
|
||||||
# special handling for spy
|
# special handling for spy
|
||||||
if length(sp.series_list) == 1
|
if length(sp.series_list) == 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user