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

add tooltips to blocks #4451

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e72b2f6
add :center option for tooltip placement
bjarthur Oct 4, 2024
f517637
add tooltips to blocks
bjarthur Oct 4, 2024
07ce251
add hovering observables to all blocks
bjarthur Oct 4, 2024
d9aba80
add tests, more docs, update changelog, and fix a couple things
bjarthur Oct 9, 2024
6f2269c
more fixes
bjarthur Oct 9, 2024
da55624
modify tooltip reference test
bjarthur Oct 21, 2024
47aad66
Revert "add hovering observables to all blocks"
bjarthur Oct 24, 2024
aa8e832
refactor per jkrumbiegel's review
bjarthur Oct 24, 2024
cdd063a
fix initial visibility
bjarthur Oct 24, 2024
6da611a
add delay
bjarthur Oct 31, 2024
ed0c31e
display tooltip at cursor position
bjarthur Oct 31, 2024
0358860
make more performant
bjarthur Nov 4, 2024
83c9ba7
Merge branch 'master' into bja/blocktooltips
bjarthur Nov 20, 2024
5556369
remove placement=:center and visible=:always options
bjarthur Nov 20, 2024
67cff58
Merge branch 'master' into bja/blocktooltips
bjarthur Nov 20, 2024
e482b8a
remove test for :center
bjarthur Nov 20, 2024
5983709
make even more performant
bjarthur Nov 24, 2024
102f21b
Merge branch 'master' into bja/blocktooltips
bjarthur Nov 24, 2024
4927629
Merge branch 'master' into bja/blocktooltips
bjarthur Dec 4, 2024
951747a
hide tooltip when disabling callback
bjarthur Dec 4, 2024
2a216cb
disable all callbacks
bjarthur Dec 5, 2024
1c43419
Merge branch 'master' into bja/blocktooltips
bjarthur Dec 5, 2024
40b5c79
make depth kwarg observable
bjarthur Dec 10, 2024
7e62a7f
use channel like DataInspector
bjarthur Dec 10, 2024
c335e0a
rename visible kwarg to enabled
bjarthur Dec 10, 2024
48a007d
Merge branch 'master' into bja/blocktooltips
bjarthur Dec 10, 2024
3929b1f
update tooltip position only when visible
bjarthur Dec 10, 2024
dc8749c
Merge branch 'master' into bja/blocktooltips
bjarthur Jan 7, 2025
07f763e
fix tests
bjarthur Jan 7, 2025
6d6b0d4
fix changelog
bjarthur Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into bja/blocktooltips
  • Loading branch information
bjarthur committed Nov 20, 2024
commit 83c9ba76a2c5f61ef31019b5a2d15a2d721e7490
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
## [Unreleased]

- Add Tooltips for blocks [#4451](https://github.com/MakieOrg/Makie.jl/pull/4451)
- Prevent more default actions when canvas has focus [#4602](https://github.com/MakieOrg/Makie.jl/pull/4602).
- Fix an error in `convert_arguments` for PointBased plots and 3D polygons [#4585](https://github.com/MakieOrg/Makie.jl/pull/4585).
- Fix polygon rendering issue of `crossbar(..., show_notch = true)` in CairoMakie [#4587](https://github.com/MakieOrg/Makie.jl/pull/4587).
- Fix render order of Axis3 frame lines in CairoMakie [#4591](https://github.com/MakieOrg/Makie.jl/pull/4591)

## [0.21.16] - 2024-11-06

- Added `origin!()` to transformation so that the reference point of `rotate!()` and `scale!()` can be modified [#4472](https://github.com/MakieOrg/Makie.jl/pull/4472)
- Correctly render the tooltip triangle [#4560](https://github.com/MakieOrg/Makie.jl/pull/4560).
- Introduce `isclosed(scene)`, conditionally use `Bonito.LargeUpdate` [#4569](https://github.com/MakieOrg/Makie.jl/pull/4569).
- Allow plots to move between scenes in SpecApi [#4132](https://github.com/MakieOrg/Makie.jl/pull/4132).
- Added empty constructor to all backends for `Screen` allowing `display(Makie.current_backend().Screen(), fig)` [#4561](https://github.com/MakieOrg/Makie.jl/pull/4561).
- Added `subsup` and `left_subsup` functions that offer stacked sub- and superscripts for `rich` text which means this style can be used with arbitrary fonts and is not limited to fonts supported by MathTeXEngine.jl [#4489](https://github.com/MakieOrg/Makie.jl/pull/4489).
Expand Down
6 changes: 6 additions & 0 deletions ReferenceTests/src/tests/examples2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,12 @@ end
strokewidth = 2f0, strokecolor = :cyan
)
tooltip!(ax, "i'm an axis", placement=:center)
# Test depth (this part is expected to fail in CairoMakie)
p = tooltip!(ax, -5, -4, "test line\ntest line", backgroundcolor = :lightblue)
translate!(p, 0, 0, 100)
mesh!(ax,
Point3f.([-7, -7, -3, -3], [-4, -2, -4, -2], [99, 99, 101, 101]), [1 2 3; 2 3 4],
shading = NoShading, color = :orange)
fig
end

Expand Down
24 changes: 0 additions & 24 deletions src/basic_recipes/tooltip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,30 +204,6 @@ function plot!(p::Tooltip{<:Tuple{<:VecTypes}})
overdraw = p.overdraw, depth_shift = p.depth_shift,
inspectable = p.inspectable, transformation = Transformation()
)
onany(p, bbox, p.triangle_size, p.placement, p.align) do bb, s, placement, align
o = origin(bb); w = widths(bb)
scale!(mp, s, s, s)

if placement === :left
translate!(mp, Vec3f(o[1] + w[1], o[2] + align * w[2], o[3]))
rotate!(mp, qrotation(Vec3f(0,0,1), 0.5pi))
elseif placement === :right
translate!(mp, Vec3f(o[1], o[2] + align * w[2], o[3]))
rotate!(mp, qrotation(Vec3f(0,0,1), -0.5pi))
elseif placement in (:below, :down, :bottom)
translate!(mp, Vec3f(o[1] + align * w[1], o[2] + w[2], o[3]))
rotate!(mp, Quaternionf(0,0,1,0)) # pi
elseif placement in (:above, :up, :top)
translate!(mp, Vec3f(o[1] + align * w[1], o[2], o[3]))
rotate!(mp, Quaternionf(0,0,0,1)) # 0
elseif placement === :center
else
@error "Tooltip placement $placement invalid. Assuming :above"
translate!(mp, Vec3f(o[1] + align * w[1], o[2], o[3]))
rotate!(mp, Quaternionf(0,0,0,1))
end
return
end

# Outline

Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.