GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — add rectangular region selector by clewis7 · Pull Request #576 · fastplotlib/fastplotlib Conversation
|
rectangle-.2.mp4 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
rectangle_selection.mp4 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I wonder if a method that returns a mask and then using the mask for In [20]: %%timeit ...: a[(a > 50_000) & (a < 100_000)] ...: ...: 620 μs ± 7.79 μs per loop (mean ± std. dev. of 7 runs, 1,000 loops each) In [21]: %%timeit ...: a[np.where((a > 50_000) & (a < 100_000))] ...: ...: 747 μs ± 31.6 μs per loop (mean ± std. dev. of 7 runs, 1,000 loops each) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| ) | ||
|
|
||
| for vertex in self.vertices: | ||
| vertex.world.z = -0.25 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
why -0.25 🤔
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
the edges get set to -0.5, so if the vertices are -0.25 then they will be on top of the edges
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
how does this scale with rectangle size and camera zoom?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
what do you mean?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sometimes world objects will have weird overlapping when the z-planes are close with very high or very low zoom, I just tried it and it seems fine within reasonable levels.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Wondering if you tried the selector with different offsets for the parent graphic, does it return the correct selection, and correct arrays for get_selected_indices() and get_selected_data().
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ) | ||
|
|
||
| for vertex in self.vertices: | ||
| vertex.world.z = -0.25 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
how does this scale with rectangle size and camera zoom?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
For collection a helper method that gets indices or returns graphics under the selection could be useful. Not hard to implement currently, we can think about and add more helper functions later 😄 line_collection = figure[0, 0].add_line_collection(circles, cmap="jet", thickness=5) rs = line_collection.add_rectangle_selector() @rs.add_event_handler("selection") def bah(ev): line_collection.cmap = "jet" ixs = ev.get_selected_indices() # iterate through each of the selected indices, if the array size > 0 that mean it's under the selection selected_line_ixs = [i for i in range(len(ixs)) if ixs[i].size > 0] line_collection[selected_line_ixs].colors = "w" rectangle_selector-2024-08-08_23.43.52.mp4 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| ) | ||
|
|
||
| for vertex in self.vertices: | ||
| vertex.world.z = -0.25 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sometimes world objects will have weird overlapping when the z-planes are close with very high or very low zoom, I just tried it and it seems fine within reasonable levels.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Chiming in here because Kushal showed this to me IRL yesterday. Pretty cool!!!! I had two comments:
Keep it going. I love to see these demos! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.