Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodError with mutliple fields tooltip #415

Open
jfb-h opened this issue Jan 14, 2022 · 0 comments
Open

MethodError with mutliple fields tooltip #415

jfb-h opened this issue Jan 14, 2022 · 0 comments

Comments

@jfb-h
Copy link

jfb-h commented Jan 14, 2022

Specifying a tooltip via the encoding channel with multiple fields results in a method error for augment_encoding_type, which expects an AbstractDict and has no method for a Vector{AbstractDict}.

Here's an MWE:

d = [
  (x=1, y=1, l="a"),
  (x=2, y=2, l="b"),
  (x=3, y=3, l="c"),
]

@vlplot(
  :circle,
  data=d,
  x=:x,
  y=:y,
  tooltip=[
    {field=:x}, 
    {field=:y}, 
    {field=:l},
  ]
)

And this is the stacktrace:

Failed to show value:

MethodError: no method matching augment_encoding_type(::Vector{OrderedCollections.OrderedDict{String, Any}}, ::Vega.DataValuesNode)

Closest candidates are:

augment_encoding_type(!Matched::AbstractDict, ::Vega.DataValuesNode) at C:\Users\Jakob\.julia\packages\VegaLite\DBfOZ\src\vlspec.jl:17

    (::VegaLite.var"#6#9"{Vega.DataValuesNode})(::Pair{String, Vector{OrderedCollections.OrderedDict{String, Any}}})@none:0
    iterate@generator.jl:47[inlined]
    OrderedCollections.OrderedDict{String, Any}(::Base.Generator{OrderedCollections.OrderedDict{String, Any}, VegaLite.var"#6#9"{Vega.DataValuesNode}})@ordered_dict.jl:27
    (::VegaLite.var"#5#8"{Vega.DataValuesNode})(::Pair{String, OrderedCollections.OrderedDict{String, Any}})@none:0
    iterate@generator.jl:47[inlined]
    OrderedCollections.OrderedDict{String, Any}(::Base.Generator{OrderedCollections.OrderedDict{String, Any}, VegaLite.var"#5#8"{Vega.DataValuesNode}})@ordered_dict.jl:27
    add_encoding_types(::OrderedCollections.OrderedDict{String, Any}, ::Nothing)@vlspec.jl:45
    add_encoding_types(::OrderedCollections.OrderedDict{String, Any})@vlspec.jl:42
    our_json_print(::IOContext{IOBuffer}, ::VegaLite.VLSpec)@vlspec.jl:58
    var"#writehtml_partial_script#47"(::String, ::typeof(VegaLite.writehtml_partial_script), ::IOContext{IOBuffer}, ::VegaLite.VLSpec)@render.jl:174
    writehtml_partial_script@render.jl:155[inlined]
    show(::IOContext{IOBuffer}, ::MIME{Symbol("text/html")}, ::VegaLite.VLSpec)@show.jl:128
    show_richest(::IOContext{IOBuffer}, ::Any)@PlutoRunner.jl:1032
    var"#sprint_withreturned#54"(::IOContext{Base.DevNull}, ::Int64, ::typeof(Main.PlutoRunner.sprint_withreturned), ::Function, ::VegaLite.VLSpec)@PlutoRunner.jl:967
    format_output_default(::Any, ::Any)@PlutoRunner.jl:862
    var"#format_output#42"(::IOContext{Base.DevNull}, ::typeof(Main.PlutoRunner.format_output), ::Any)@PlutoRunner.jl:879
    formatted_result_of(::Base.UUID, ::Bool, ::Vector{String}, ::Nothing, ::Module)@PlutoRunner.jl:785
    top-level scope@none:1

this was on master.

Love the package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant