Merge pull request #1688 from mkborregaard/add_undef
Add some undefs to Array constructors
This commit is contained in:
commit
de3848ff53
@ -837,7 +837,7 @@ function gl_bar(d, kw_args)
|
|||||||
fillto = 0
|
fillto = 0
|
||||||
end
|
end
|
||||||
# create the bar shapes by adding x/y segments
|
# create the bar shapes by adding x/y segments
|
||||||
positions, scales = Array{Point2f0}(ny), Array{Vec2f0}(ny)
|
positions, scales = Array{Point2f0}(undef, ny), Array{Vec2f0}(undef, ny)
|
||||||
m = Reactive.value(kw_args[:model])
|
m = Reactive.value(kw_args[:model])
|
||||||
sx, sy = m[1,1], m[2,2]
|
sx, sy = m[1,1], m[2,2]
|
||||||
for i=1:ny
|
for i=1:ny
|
||||||
@ -988,7 +988,7 @@ function scale_for_annotations!(series::Series, scaletype::Symbol = :pixels)
|
|||||||
# we use baseshape to overwrite the markershape attribute
|
# we use baseshape to overwrite the markershape attribute
|
||||||
# with a list of custom shapes for each
|
# with a list of custom shapes for each
|
||||||
msw, msh = anns.scalefactor
|
msw, msh = anns.scalefactor
|
||||||
offsets = Array{Vec2f0}(length(anns.strs))
|
offsets = Array{Vec2f0}(undef, length(anns.strs))
|
||||||
series[:markersize] = map(1:length(anns.strs)) do i
|
series[:markersize] = map(1:length(anns.strs)) do i
|
||||||
str = _cycle(anns.strs, i)
|
str = _cycle(anns.strs, i)
|
||||||
# get the width and height of the string (in mm)
|
# get the width and height of the string (in mm)
|
||||||
|
|||||||
@ -594,12 +594,12 @@ function split_kw(key, val::SeriesAnnotations, indices)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function groupedvec2mat(x_ind, x, y::AbstractArray, groupby, def_val = y[1])
|
function groupedvec2mat(x_ind, x, y::AbstractArray, groupby, def_val = y[1])
|
||||||
y_mat = Array{promote_type(eltype(y), typeof(def_val))}(length(keys(x_ind)), length(groupby.groupLabels))
|
y_mat = Array{promote_type(eltype(y), typeof(def_val))}(undef, length(keys(x_ind)), length(groupby.groupLabels))
|
||||||
fill!(y_mat, def_val)
|
fill!(y_mat, def_val)
|
||||||
for i in 1:length(groupby.groupLabels)
|
for i in 1:length(groupby.groupLabels)
|
||||||
xi = x[groupby.groupIds[i]]
|
xi = x[groupby.groupIds[i]]
|
||||||
yi = y[groupby.groupIds[i]]
|
yi = y[groupby.groupIds[i]]
|
||||||
y_mat[getindex.(x_ind, xi), i] = yi
|
y_mat[getindex.(Ref(x_ind), xi), i] = yi
|
||||||
end
|
end
|
||||||
return y_mat
|
return y_mat
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user