Skip to content

Commit 0171bb5

Browse files
committed
bump version, remove Unitful ext for now
1 parent 2157f31 commit 0171bb5

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PlotlyLight"
22
uuid = "ca7969ec-10b3-423e-8d99-40f33abb42bf"
33
authors = ["joshday <[email protected]>"]
4-
version = "0.9.2"
4+
version = "0.10.0"
55

66
[deps]
77
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
@@ -14,9 +14,9 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1414
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
1515

1616
[compat]
17-
Artifacts = "1.3"
1817
Aqua = "0.8"
19-
Cobweb = "0.6"
18+
Artifacts = "1.3"
19+
Cobweb = "0.6, 0.7"
2020
Downloads = "1.6"
2121
EasyConfig = "0.1"
2222
JSON3 = "1.14"

src/PlotlyLight.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ end
3939
settings::Settings = Settings()
4040

4141
#-----------------------------------------------------------------------------# utils/other
42-
fix_matrix(x::Config) = Config(k => fix_matrix(v) for (k,v) in pairs(x))
43-
fix_matrix(x) = x
44-
fix_matrix(x::AbstractMatrix) = eachrow(x)
42+
# Hack to change behavior of `JSON3.write` for `AbstractMatrix`
43+
_fix(x::Config) = Config(k => _fix(v) for (k,v) in pairs(x))
44+
_fix(x) = x
45+
_fix(x::AbstractMatrix) = eachrow(x)
4546

4647
attributes(t::Symbol) = plotly.schema.traces[t].attributes
4748
check_attribute(trace, attr::Symbol) = haskey(attributes(Symbol(trace)), attr) || @warn("`$trace` does not have attribute `$attr`.")
@@ -78,7 +79,7 @@ Base.getproperty(::typeof(plot), x::Symbol) = (; kw...) -> plot(x; kw...)
7879

7980
#-----------------------------------------------------------------------------# display/show
8081
function html_div(o::Plot; id=randstring(10))
81-
data = JSON3.write(fix_matrix.(o.data); allow_inf=true)
82+
data = JSON3.write(_fix.(o.data); allow_inf=true)
8283
layout = JSON3.write(merge(settings.layout, o.layout); allow_inf=true)
8384
config = JSON3.write(merge(settings.config, o.config); allow_inf=true)
8485
h.div(class="plotlylight-parent-div",

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ end
6161
@testset "other" begin
6262
@test propertynames(Plot()) isa Vector{Symbol}
6363
@test all(x in propertynames(Plot()) for x in propertynames(plot))
64-
@test PlotlyLight.fix_matrix([1 2; 3 4]) == [[1, 2], [3, 4]]
64+
@test PlotlyLight._fix([1 2; 3 4]) == [[1, 2], [3, 4]]
6565
@test propertynames(JSON3.read(JSON3.write(Plot()))) == [:data, :layout, :config]
6666
end
6767

0 commit comments

Comments
 (0)