Conversation
Benchmark ResultsSHA: dbfe3ff0b56ce62c359969cb11daa713b69ef296 Warning These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking. |
| Conversion failed for $(P)$(conv_trait) with args: | ||
| $(typeof(args)) $(kw_str) | ||
| Got converted to: | ||
| $(typeof(converted)) | ||
| $(P) requires to convert to argument types | ||
| $(types), | ||
| which convert_arguments didn't succeed in. To fix this overload \ | ||
| convert_arguments(P, args...$(kw_convert)) for Type{<:$(P)} or $(PTrait) \ | ||
| and return an object of the correct type. | ||
| $dim_converts_info |
There was a problem hiding this comment.
I updated this to include some notes on dim converts. Example from a test failure:
ArgumentError:
Conversion failed for Tooltip with args:
Tuple{Vector{Makie.PlotElement{Scatter{Tuple{Vector{Point{2, Float32}}}}}}}
Got converted to:
Tuple{Vector{Makie.PlotElement{Scatter{Tuple{Vector{Point{2, Float32}}}}}}}
Tooltip requires to convert to argument types
Tuple{AbstractVector{<:Union{NTuple{N, var"#s417"}, StaticArraysCore.StaticArray{Tuple{N}, var"#s417", 1}}} where {N, var"#s417"<:Real}, Union{Nothing, AbstractVector}},
which convert_arguments didn't succeed in. To fix this overload convert_arguments(P, args...) for Type{<:Tooltip} or NoConversion() and return an object of the correct type.
(Dim converts were not applied. This happens if `space = data` is not in data space or if the target type of the conversion is reachable without dim converts.)
|
I think I fixed one of two problems with WGLMakie, the one visible in tests from b117521. When multiple graphs are connected it can happen that
With this the nodes set in step 6 are marked as clean while they are outdated with respect to update happening in 5. I believe this is what happened in the test - WGLMakie started resolving I changed the locking logic of The other issue here is that with WGLMakie some regions just refuse to generate a tooltip. As far as I can tell this happens when the cursor moves to an area that was previously occupied by a tooltip. The I also checked the javascript objects that picking returns. They also have |
Description
Related Issues:
scatterlines.inspector_labelis broken #4713access to undefined referencewith child plots #5383 by avoiding the need to setinspector_labelfor child plotsGoals
This aims to:
inspector_label(etc) of the top level plot (Recipes do not react to keyword arguments properly #3263, Histogram is now missing theinspector_labelattribute #4440,scatterlines.inspector_labelis broken #4713)may drop indicatorsI think I fixed #4866 too, which I should probably extract...
Problems
The previous version of DataInspector worked like this:
pick()picks a primitive plot, likelineslinesbelongs toshow_dataat each stepAs a consequence,
inspector_labeletc was only accessed for plots that implementedshow_data, and would be given that plot. For examplescatterlinesdid not implement ashow_datamethod and thus itsinspector_labelwas not considered. If it were simply passed down, it would be called with either the lines or scatter plot and a position and index relevant to that plot. This is problematic for more complex recipes where you may want the recipes attributes and an appropriate index to generate a label.Implementing
show_data()is probably rather difficult for people, as it does multiple things:pickto something appropriate for the given recipe plotPersistent Tooltips have been difficult to implement because
DataInspectorworked in a global scene. That forced tooltips to be drawn in pixel space, either by transforming a data space position or by directly using pixel space mouse positions. A persistent tooltip should be stuck somewhere in data space, e.g. anchored to a scattered marker, which means it would need to connect to the camera and project frequently. Withshow_datadoing everything a persistent tooltip would also need to extract relevant information from a dynamic tooltip.Plan
Plan
DataInspector being a global object has been more painful than useful, so I'm planning to make it per-scene. This will fix the general annoyances with it picking irrelevant plots in other scenes. It will also allow tooltips to exist in data space, as they don't have to work with different cameras anymore, which should simplify persistent tooltips.
I'm also planning to break up
show_datainto multiple pieces and restructure the infrastructure around it. As I see it, the main tasks ofshow_dataare:pick()data to something appropriate to a high level plot (typically an index or interpolation between indices)For the first point I'm planning to add a new
PlotElementtype generated by apick_element()function. ThePlotElementshould encapsulate the indexing or interpolation so that you can get whatever plot attribute you want for the picked element. Thepick_elementfunction should generate aPlotElementfrompickdata, attempting the root parent plot first and progressing down the to the picked primitive likeshow_data. The resultingPlotElementshould always be (considered to be) relevant to the root parent though. This may also be useful in general as a higher levelpick(). For example:With that, getting positions and labels can hopefully be rather simple and generic:
For persistent tooltips my current idea is to allow passing a
PlotElementarray totooltip(). The tooltip plot can then be saved in DataInspector and elements can be added or removed. Since different plots can have different transformations, there needs to be a tooltip plot for each parent plot. To allow tooltips to update with changes to plot attributes we need some sort ofmap!(..., parent_attributes, ...). I'm currently thinking of tracking which attributes are used when callingget_position()andget_tooltip_label()to collect the necessary attributes.Changes
DataInspector is now per scene. This simplifies persistent tooltips and using pre-transform/projection data because DataInspector no longer has to deal with multiple scenes. This also stops DataInspector from picking plots outside its designated scene, which was generally more of a hassle.
The whole structure of how data inspector gets from a picked plot to a tooltip + indicators has been reworked. Previously there were two parts. First a generic part, which traced the picked plot up to its root parent and dispatched calls to
show_data. If no fitting method exists, the function would try again with the next lower level plot. The second part is theshow_datamethod which did everything else, including providing an extension interface for recipe developers.The new structure breaks up
show_datato better separate concerns and through that simplify extension (I hope). It also reworks the fallback logic in a way that the plot trace doesn't disappear, allowing each step to do fallbacks independently. The steps now include:get_accessor(plot, idx, trace)methods for creating aAbstractElementAccessorwhich acts as an index or interpolation information for accessing the picked element of a plotPlotElementwhich bundles the trace with the accessor returned byget_accessor()get_position(element)method which successively removes parent plots from the trace in the PlotElement. This is used to identify the plot from which the position is pulled so that the appropriate transformations and space can be copied.position = get_position(::PlotElement{PlotType})which gets the picked positionget_tooltip_label(formatter, ::PlotElement{PlotType}, position)which produces the tooltip label stringget_default_tooltip_label(formatter, ::PlotElement{PlotType}, positionwhich produces the string if no attribute based string existsget_tooltip_data(::PlotElement{PlotType}, position)which returns data to be converted to a string (defaults to position) for the labelupdate_indicator_internal!(inspector, ::PlotElement{PlotType}, position)which updates transformations and space of an updated indicatorupdate_indicator!(inspector, ::PlotElement{PlotType}, position)which sets the data of an indicator plot and makes it visibleconstruct_indicator_plots!(inspector, PlotType)which produces a cached indicator plot for a given plot type.get_indicator_plot(inspector, PlotType)will call this function once to produce this plot and otherwise return the cached version.Changes to tooltips:
TODO
General feature testing - correct behavior with previously implemented tooltips, no hard errors in general
Notes
Type of change
Likely breaking because
show_datawill most likely be removed in its current stateChecklist