From caebdbf4a185a0239334e61773507f41a4a0af0f Mon Sep 17 00:00:00 2001 From: amir-enzen Date: Mon, 21 Oct 2024 10:47:48 +1000 Subject: [PATCH] Fix variable name bug and add classification in mutate! --- Project.toml | 2 +- src/Displaz.jl | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 456f311..a79ac36 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Displaz" uuid = "67fdca37-c731-5d95-9a19-4e7673210fab" -version = "1.2.2" +version = "1.2.3" [deps] Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" diff --git a/src/Displaz.jl b/src/Displaz.jl index a712325..0b8c017 100644 --- a/src/Displaz.jl +++ b/src/Displaz.jl @@ -384,7 +384,7 @@ function mutate!(plotobj::DisplazWindow, label::AbstractString, index::AbstractV for (fieldname, fielddata) ∈ kwargs if fieldname == :position - fielddaata = interpret_position(fielddata) + fielddata = interpret_position(fielddata) size(fielddata) == (3,nvertices) || error("position must be a 3x$nvertices array") push!(fields, (:position, vector_semantic, fielddata)) @@ -413,6 +413,12 @@ function mutate!(plotobj::DisplazWindow, label::AbstractString, index::AbstractV fielddata = interpret_linebreak(fielddata) push!(fields, (:linebreak, array_semantic, vec(fielddata)')) + elseif fieldname == :classification + if length(fielddata) == 1 + fielddata = repeat(fielddata, nvertices) + end + fielddata = map(UInt8, fielddata) + push!(fields, (:classification, array_semantic, vec(fielddata)')) else if length(fielddata) == 1 fielddata = repeat(fielddata, nvertices)