Merge pull request #106 from rcnlee/master

Minor changes - animations and AbstractDataFrame
This commit is contained in:
Tom Breloff 2016-01-03 09:35:24 -05:00
commit 6fc0f858c7
2 changed files with 10 additions and 11 deletions

View File

@ -1,19 +1,18 @@
immutable Animation{P<:PlottingObject} immutable Animation
plt::P
dir::ASCIIString dir::ASCIIString
frames::Vector{ASCIIString} frames::Vector{ASCIIString}
end end
function Animation(plt::PlottingObject) function Animation()
Animation(plt, mktempdir(), ASCIIString[]) tmpdir = convert(ASCIIString, mktempdir())
Animation(tmpdir, ASCIIString[])
end end
Animation() = Animation(current())
function frame(anim::Animation) function frame{P<:PlottingObject}(anim::Animation, plt::P=current())
i = length(anim.frames) + 1 i = length(anim.frames) + 1
filename = @sprintf("%06d.png", i) filename = @sprintf("%06d.png", i)
png(anim.plt, joinpath(anim.dir, filename)) png(plt, joinpath(anim.dir, filename))
push!(anim.frames, filename) push!(anim.frames, filename)
end end

View File

@ -461,12 +461,12 @@ end
function dataframes() function dataframes()
@eval import DataFrames @eval import DataFrames
@eval function createKWargsList(plt::PlottingObject, df::DataFrames.DataFrame, args...; kw...) @eval function createKWargsList(plt::PlottingObject, df::DataFrames.AbstractDataFrame, args...; kw...)
createKWargsList(plt, args...; kw..., dataframe = df) createKWargsList(plt, args...; kw..., dataframe = df)
end end
# expecting the column name of a dataframe that was passed in... anything else should error # expecting the column name of a dataframe that was passed in... anything else should error
@eval function extractGroupArgs(s::Symbol, df::DataFrames.DataFrame, args...) @eval function extractGroupArgs(s::Symbol, df::DataFrames.AbstractDataFrame, args...)
if haskey(df, s) if haskey(df, s)
return extractGroupArgs(df[s]) return extractGroupArgs(df[s])
else else