Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
end
@series begin
seriestype --> :scatter
[pt.x], [pt.y], [pt.z]
[to_internal_units(pt.x) * internal_length_unit],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick explanation: to_internal_units will convert the value to internal_length_unit (in our case meters) and then strip the unit (or do nothing if the value does not have any units), and then add the unit again afterwards.
Therefore, we can handle both numbers with and without units.

Copy link
Member

@oschulz oschulz Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that seems very safe! I like it.

[to_internal_units(pt.y) * internal_length_unit],
[to_internal_units(pt.z) * internal_length_unit]
end
end

Expand Down Expand Up @@ -35,7 +37,9 @@ end
end
@series begin
if !isempty(v) seriestype --> :scatter end
[v[i].x for i in eachindex(v)], [v[i].y for i in eachindex(v)], [v[i].z for i in eachindex(v)]
[to_internal_units(v[i].x) * internal_length_unit for i in eachindex(v)],
[to_internal_units(v[i].y) * internal_length_unit for i in eachindex(v)],
[to_internal_units(v[i].z) * internal_length_unit for i in eachindex(v)]
end
end

Expand Down
Loading