We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
DataInspector
Convert values shown in DataInspector with corresponding axis dimension conversions
Here is a light mockup of what it could be for DateConversion and for Line and LineSegment plots
DateConversion
Line
LineSegment
Add a value to dimension conversion in dates-integrations.jl
# Conversions to DateTimeConversion.type function convert_value_dim(conversion::DateTimeConversion, value) return number_to_date(conversion.type[], value) end convert_value_dim(::Union{Nothing, NoDimConversion}, value) = value
Replace position2string functions in inspector.jl with ones using dimension conversions
position2string
value2string(conversion::T, value) where {T<:Union{Nothing,<:AbstractDimConversion}} = (converted = convert_value_dim(conversion, value)) isa AbstractFloat ? @sprintf("%0.3f", converted) : string(converted) dimspos2string(conversions, p::StaticVector{2}) = @sprintf("x: %s\ny: %s", (value2string(c, p) for (c, p) in zip(ntuple(i -> conversions[i], 2), p))...) dimspos2string(conversions, p::StaticVector{3}) = @sprintf("x: %s\ny: %s\nz: %s", (value2string(c, p) for (c, p) in zip(ntuple(i -> conversions[i], 3), p))...)
Use them in show_data functions
show_data
if to_value(get(plot, :inspector_label, automatic)) == automatic <<< tt.text[] = position2string(eltype(plot[1][])(pos)) >>> conversions = get_conversions(plot) >>> tt.text[] = dimspos2string(conversions, eltype(plot[1][])(pos)) else ...
using GLMakie using Dates # Sample data dates = [Date(2022, 1, 1) + Dates.Day(i) for i = 0:10] values = [1, 3, 2, 4, 5, 3, 6, 4, 7, 6, 8] fig = Figure(size=(800, 600)) axis = Axis(fig[1, 1], xlabel = "Date", ylabel = "Value") lines!(axis, dates, values) DataInspector(fig) display(fig)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Feature description
Convert values shown in
DataInspector
with corresponding axis dimension conversionsHere is a light mockup of what it could be for
DateConversion
and forLine
andLineSegment
plotsAdd a value to dimension conversion in dates-integrations.jl
Replace
position2string
functions in inspector.jl with ones using dimension conversionsUse them in
show_data
functionsOutput plot example
Examples code
Before
After
The text was updated successfully, but these errors were encountered: