Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Data inspector #677

Merged
merged 67 commits into from
May 12, 2021
Merged

Data inspector #677

merged 67 commits into from
May 12, 2021

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Mar 28, 2021

Plots TODO:

  • 2D and 3D scatter (marker position)
  • 2D and 3D meshscatter (marker position)
  • 2D and 3D mesh (bounding box)
  • 2D and 3D lines (position on line)
  • 2D and 3D linesegments (position on line)
  • heatmap, image (indices + value)
  • barplot (and hist) (bar x-position + height)
  • arrows kinda
  • surface (position on surface)
  • volume?
  • text

Any plot that isn't listed will fallback to the primitives it uses. (I.e. mesh, meshscatter, scatter, lines, linesegments, surface, heatmap, image, volume, text)

General/outside TODO:

To try it out, get JuliaPlots/GLMakie.jl#177 and #696 and use

fig, ax, p = lines(rand(Point3f0, 10))
x = DataInspector(fig) # or ax or any scene
fig

@ffreyer
Copy link
Collaborator Author

ffreyer commented Mar 28, 2021

@ffreyer
Copy link
Collaborator Author

ffreyer commented Apr 8, 2021

Just a reminder to myself - meshes are currently drawn under 2d scatter markers because those use fxaa = false and are therefore rendered later. I don't think that means depth tests shouldn't work though. Maybe I can fix that... This just happens due to overdraw=true as that disables the depth test.

@jkrumbiegel
Copy link
Member

Would be cool if this also worked with Axis in that one can enable and disable the interaction, now it looks to me as if it's an "add once" kind of thing

@ffreyer
Copy link
Collaborator Author

ffreyer commented Apr 17, 2021

Also related: MakieOrg/Makie.jl#810

@ffreyer ffreyer mentioned this pull request Apr 17, 2021
@ffreyer
Copy link
Collaborator Author

ffreyer commented Apr 20, 2021

Would be cool if this also worked with Axis in that one can enable and disable the interaction, now it looks to me as if it's an "add once" kind of thing

I added an enable!/disable! now. I would like this to work with any scene so I don't want to rely on Axis interactions.

I'm also still thinking about how to best ignore plots. With how it is right now only plots that exist when DataInspector(fig/ax) is called are added to the blacklist/whitelist. So you may end up being able to inspect things you generally want to ignore, or not being able inspect thing you do want to inspect.

My favorite solution for this is still adding an attribute pickable/inspectable. It would allow us to set, for example, Axis plots as not inspectable by default regardless of when they are added. I think plot!(..., inspectable = false) is also nicer for a user than messing with a blacklist or whitelist. It would just take a lot of tiny edits to do this now.

(If you want to try this you'll need to checkout JuliaPlots/GLMakie.jl#177 and #696)

@ffreyer
Copy link
Collaborator Author

ffreyer commented May 7, 2021

If think this should be in a merga-able state now, if tests pass.

Some things we should do later:

  • precompilation to reduce lag
  • find some way to stop 3d scenes from resizing when bounding boxes are shown
  • after priority observables get merged this should get some priority too. (Should work with default too)

@ffreyer
Copy link
Collaborator Author

ffreyer commented May 7, 2021

 Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] rgbatuple(c::Char)
    @ CairoMakie ~/.julia/packages/CairoMakie/GFZiw/src/utils.jl:87
  [3] draw_poly(scene::Scene, screen::CairoMakie.CairoScreen{Cairo.CairoSurfaceIOStream{UInt32}}, poly::Poly{Tuple{Vector{Vector{Point{2, Float32}}}}}, points::Vector{Point{2, Float32}}, color::Char, model::StaticArrays.SMatrix{4, 4, Float32, 16}, strokecolor::Symbol, strokewidth::Float64)
    @ CairoMakie ~/.julia/packages/CairoMakie/GFZiw/src/overrides.jl:45
  [4] (::CairoMakie.var"#58#59"{Scene, CairoMakie.CairoScreen{Cairo.CairoSurfaceIOStream{UInt32}}, Poly{Tuple{Vector{Vector{Point{2, Float32}}}}}})(points::Vector{Point{2, Float32}}, color::Char, strokecolor::Symbol, strokewidth::Float64)
    @ CairoMakie ~/.julia/packages/CairoMakie/GFZiw/src/overrides.jl:56
  [5] broadcast_foreach(::Function, ::Vector{Vector{Point{2, Float32}}}, ::Vararg{Any, N} where N)
    @ AbstractPlotting ~/work/AbstractPlotting.jl/AbstractPlotting.jl/src/utilities/utilities.jl:162
  [6] draw_poly(scene::Scene, screen::CairoMakie.CairoScreen{Cairo.CairoSurfaceIOStream{UInt32}}, poly::Poly{Tuple{Vector{Vector{Point{2, Float32}}}}}, points_list::Vector{Vector{Point{2, Float32}}})
    @ CairoMakie ~/.julia/packages/CairoMakie/GFZiw/src/overrides.jl:53

Could this be related to JuliaPlots/CairoMakie.jl#159 @jkrumbiegel ?

@ffreyer ffreyer changed the title Data inspector (do not merge yet) Data inspector May 7, 2021
@ffreyer
Copy link
Collaborator Author

ffreyer commented May 11, 2021

I checked a couple of plots, everything seems to be working. I also split up the docs for interactivity a bit, because I thought it was getting a bit large and fragmented for one page.

SimonDanisch
SimonDanisch previously approved these changes May 11, 2021
Copy link
Member

@SimonDanisch SimonDanisch left a comment

Choose a reason for hiding this comment

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

Thanks, this looks great :)

@ffreyer ffreyer merged commit 7569c3d into JuliaPlots:master May 12, 2021
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants