-
Notifications
You must be signed in to change notification settings - Fork 53
Tooltips, add overlay render pass #830
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
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5ad0a06
add overlay render pass
kushalkolar 4689f5b
Graphic accessible in graphics
kushalkolar e009db0
tooltip prototype
kushalkolar 86e238a
basic tooltips work
kushalkolar 2784ab0
custom tooltip example
kushalkolar c22630d
auto tooltips
kushalkolar 32cf5fa
black
kushalkolar 1388b58
update iris example, add to __init__
kushalkolar 13859ec
update docs
kushalkolar 8b69cb6
type
kushalkolar fab75b8
comments
kushalkolar 97e681e
docstring
kushalkolar 3a87a1c
add tools dir to api root toctree
kushalkolar 49de4a7
forgot to regenerate
kushalkolar 0da5e38
Apply suggestions from code review
kushalkolar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
.. _api.Graphic: | ||
|
||
Graphic | ||
******* | ||
|
||
======= | ||
Graphic | ||
======= | ||
.. currentmodule:: fastplotlib | ||
|
||
Constructor | ||
~~~~~~~~~~~ | ||
.. autosummary:: | ||
:toctree: Graphic_api | ||
|
||
Graphic | ||
|
||
Properties | ||
~~~~~~~~~~ | ||
.. autosummary:: | ||
:toctree: Graphic_api | ||
|
||
Graphic.axes | ||
Graphic.block_events | ||
Graphic.deleted | ||
Graphic.event_handlers | ||
Graphic.name | ||
Graphic.offset | ||
Graphic.right_click_menu | ||
Graphic.rotation | ||
Graphic.supported_events | ||
Graphic.visible | ||
Graphic.world_object | ||
|
||
Methods | ||
~~~~~~~ | ||
.. autosummary:: | ||
:toctree: Graphic_api | ||
|
||
Graphic.add_axes | ||
Graphic.add_event_handler | ||
Graphic.clear_event_handlers | ||
Graphic.remove_event_handler | ||
Graphic.rotate | ||
Graphic.share_property | ||
Graphic.unshare_property | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ Graphics | |
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
Graphic | ||
LineGraphic | ||
ScatterGraphic | ||
ImageGraphic | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
.. _api.HistogramLUTTool: | ||
|
||
HistogramLUTTool | ||
**************** | ||
|
||
================ | ||
HistogramLUTTool | ||
================ | ||
.. currentmodule:: fastplotlib | ||
|
||
Constructor | ||
~~~~~~~~~~~ | ||
.. autosummary:: | ||
:toctree: HistogramLUTTool_api | ||
|
||
HistogramLUTTool | ||
|
||
Properties | ||
~~~~~~~~~~ | ||
.. autosummary:: | ||
:toctree: HistogramLUTTool_api | ||
|
||
HistogramLUTTool.axes | ||
HistogramLUTTool.block_events | ||
HistogramLUTTool.cmap | ||
HistogramLUTTool.deleted | ||
HistogramLUTTool.event_handlers | ||
HistogramLUTTool.image_graphic | ||
HistogramLUTTool.name | ||
HistogramLUTTool.offset | ||
HistogramLUTTool.right_click_menu | ||
HistogramLUTTool.rotation | ||
HistogramLUTTool.supported_events | ||
HistogramLUTTool.visible | ||
HistogramLUTTool.vmax | ||
HistogramLUTTool.vmin | ||
HistogramLUTTool.world_object | ||
|
||
Methods | ||
~~~~~~~ | ||
.. autosummary:: | ||
:toctree: HistogramLUTTool_api | ||
|
||
HistogramLUTTool.add_axes | ||
HistogramLUTTool.add_event_handler | ||
HistogramLUTTool.clear_event_handlers | ||
HistogramLUTTool.disconnect_image_graphic | ||
HistogramLUTTool.remove_event_handler | ||
HistogramLUTTool.rotate | ||
HistogramLUTTool.set_data | ||
HistogramLUTTool.share_property | ||
HistogramLUTTool.unshare_property | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.. _api.Tooltip: | ||
|
||
Tooltip | ||
******* | ||
|
||
======= | ||
Tooltip | ||
======= | ||
.. currentmodule:: fastplotlib | ||
|
||
Constructor | ||
~~~~~~~~~~~ | ||
.. autosummary:: | ||
:toctree: Tooltip_api | ||
|
||
Tooltip | ||
|
||
Properties | ||
~~~~~~~~~~ | ||
.. autosummary:: | ||
:toctree: Tooltip_api | ||
|
||
Tooltip.background_color | ||
Tooltip.font_size | ||
Tooltip.outline_color | ||
Tooltip.padding | ||
Tooltip.text_color | ||
Tooltip.world_object | ||
|
||
Methods | ||
~~~~~~~ | ||
.. autosummary:: | ||
:toctree: Tooltip_api | ||
|
||
Tooltip.register | ||
Tooltip.unregister | ||
Tooltip.unregister_all | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Tools | ||
***** | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
HistogramLUTTool | ||
Tooltip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
""" | ||
Tooltips | ||
======== | ||
|
||
Show tooltips on all graphics | ||
""" | ||
|
||
# test_example = false | ||
# sphinx_gallery_pygfx_docs = 'screenshot' | ||
|
||
import numpy as np | ||
import imageio.v3 as iio | ||
import fastplotlib as fpl | ||
|
||
|
||
# get some data | ||
scatter_data = np.random.rand(1_000, 3) | ||
|
||
xs = np.linspace(0, 2 * np.pi, 100) | ||
ys = np.sin(xs) | ||
|
||
gray = iio.imread("imageio:camera.png") | ||
rgb = iio.imread("imageio:astronaut.png") | ||
|
||
# create a figure | ||
figure = fpl.Figure( | ||
cameras=["3d", "2d", "2d", "2d"], | ||
controller_types=["orbit", "panzoom", "panzoom", "panzoom"], | ||
size=(700, 560), | ||
shape=(2, 2), | ||
show_tooltips=True, # tooltip will display data value info for all graphics | ||
) | ||
|
||
# create graphics | ||
scatter = figure[0, 0].add_scatter(scatter_data, sizes=3, colors="r") | ||
line = figure[0, 1].add_line(np.column_stack([xs, ys])) | ||
image = figure[1, 0].add_image(gray) | ||
image_rgb = figure[1, 1].add_image(rgb) | ||
|
||
|
||
figure.show() | ||
|
||
# to hide tooltips for all graphics in an existing Figure | ||
# figure.show_tooltips = False | ||
|
||
# to show tooltips for all graphics in an existing Figure | ||
# figure.show_tooltips = True | ||
|
||
|
||
# NOTE: `if __name__ == "__main__"` is NOT how to use fastplotlib interactively | ||
# please see our docs for using fastplotlib interactively in ipython and jupyter | ||
if __name__ == "__main__": | ||
print(__doc__) | ||
fpl.loop.run() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.