queryverse / queryverse/IterableTables.jl
Using JuliaDB/IndexedTables with Gadfly
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 79
- Forks
- 9
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 2
Description
So I'm just trying to get Gadfly to plot an IndexedTable I've produced with the JuliaDB.table function.
The IterableTables documentation claims to support JuliaDB tables as data sources and Gadfly as a sink, but I'm doing it wrong and/or it doesn't work for me
Complete example:
julia> using IterableTables, JuliaDB, Gadfly
julia> t = table(1:10, (1:10) * 3, names = (:x, :y))
Table with 10 rows, 2 columns:
x y
──────
1 3
2 6
3 9
4 12
5 15
6 18
7 21
8 24
9 27
10 30
julia> typeof(t)
IndexedTable{StructArrays.StructArray{NamedTuple{(:x, :y),Tuple{Int64,Int64}},1,NamedTuple{(:x, :y),Tuple{Array{Int64,1},Array{Int64,1}}}}}
julia> plot(t, x=:x, y=:y, Geom.point)
ERROR: MethodError: no method matching evalmapping(::IndexedTable{StructArrays.StructArray{NamedTuple{(:x, :y),Tuple{Int64,Int64}},1,NamedTuple{(:x, :y),Tuple{Array{Int64,1},Array{Int64,1}}}}}, ::Symbol)
```Closest candidates are:
evalmapping(::Any, ::AbstractArray) at /home/colin/.julia/packages/Gadfly/09PWZ/src/mapping.jl:185
evalmapping(::Any, ::Function) at /home/colin/.julia/packages/Gadfly/09PWZ/src/mapping.jl:186
evalmapping(::Any, ::Distributions.Distribution) at /home/colin/.julia/packages/Gadfly/09PWZ/src/mapping.jl:187
...
Stacktrace:
[1] evalmapping!(::Dict{Symbol,Any}, ::IndexedTable{StructArrays.StructArray{NamedTuple{(:x, :y),Tuple{Int64,Int64}},1,NamedTuple{(:x, :y),Tuple{Array{Int64,1},Array{Int64,1}}}}}, ::Gadfly.Data) at /home/colin/.julia/packages/Gadfly/09PWZ/src/mapping.jl:220
[2] #plot#65(::Base.Iterators.Pairs{Symbol,Symbol,Tuple{Symbol,Symbol},NamedTuple{(:x, :y),Tuple{Symbol,Symbol}}}, ::Function, ::IndexedTable{StructArrays.StructArray{NamedTuple{(:x, :y),Tuple{Int64,Int64}},1,NamedTuple{(:x, :y),Tuple{Array{Int64,1},Array{Int64,1}}}}}, ::Type{Gadfly.Geom.PointGeometry}) at /home/colin/.julia/packages/Gadfly/09PWZ/src/Gadfly.jl:327
[3] (::getfield(Gadfly, Symbol("#kw##plot")))(::NamedTuple{(:x, :y),Tuple{Symbol,Symbol}}, ::typeof(plot), ::IndexedTable{StructArrays.StructArray{NamedTuple{(:x, :y),Tuple{Int64,Int64}},1,NamedTuple{(:x, :y),Tuple{Array{Int64,1},Array{Int64,1}}}}}, ::Type{Gadfly.Geom.PointGeometry}) at ./none:0
[4] top-level scope at none:0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the complete Julia example using IterableTables, JuliaDB, and Gadfly, then start with the evalmapping methods in Gadfly's mapping.jl named in the stack trace. Trace how plot handles the IndexedTable and verify that the example succeeds without the MethodError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100