Skip to content

Commit

Permalink
forgot to add ext package
Browse files Browse the repository at this point in the history
  • Loading branch information
joshday committed Sep 20, 2024
1 parent 00bbd5d commit 468084e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ext/PlotlyLightUnitfulExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module PlotlyLightUnitfulExt

import PlotlyLight: _json
using Unitful

# JSON3.write(::Quantity) is annoying: JSON3.write(1u"kg") == "{\"val\":1}"
_json(x::Unitful.AbstractQuantity) = _json(x.val)
_json(x::AbstractArray{<:Unitful.AbstractQuantity}) = _json(map(x -> x.val, x))

end

0 comments on commit 468084e

Please sign in to comment.