napari-plot 0.3.1__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. {napari_plot-0.3.1 → napari_plot-0.4.0}/.github/workflows/test_and_deploy.yml +1 -0
  2. napari_plot-0.4.0/CHANGELOG.md +40 -0
  3. {napari_plot-0.3.1/napari_plot.egg-info → napari_plot-0.4.0}/PKG-INFO +22 -4
  4. {napari_plot-0.3.1 → napari_plot-0.4.0}/README.md +17 -0
  5. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/__init__.py +4 -4
  6. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/actions/_layerlist_context_actions.py +3 -3
  7. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/_qapp_model/_qproviders.py +3 -22
  8. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/component_controls/qt_legend_controls.py +22 -14
  9. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_layer_controls_base.py +2 -2
  10. napari_plot-0.4.0/napari_plot/_qt/layer_controls/qt_layer_controls_container.py +128 -0
  11. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_scatter_controls.py +6 -2
  12. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_text_controls.py +9 -1
  13. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/qt_event_loop.py +4 -14
  14. napari_plot-0.4.0/napari_plot/_qt/qt_layer_list.py +45 -0
  15. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/qt_main_window.py +16 -4
  16. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/qt_viewer.py +3 -5
  17. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/qt_welcome.py +1 -2
  18. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_version.py +3 -3
  19. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/canvas.py +55 -57
  20. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/components/camera.py +16 -3
  21. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/layers/scatter.py +7 -4
  22. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/layers/text.py +7 -1
  23. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/overlays/legend.py +16 -8
  24. napari_plot-0.4.0/napari_plot/_vispy/overlays/text.py +41 -0
  25. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/_viewer_key_bindings.py +12 -7
  26. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/_viewer_mouse_bindings.py +70 -80
  27. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/layerlist.py +4 -5
  28. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/legend.py +13 -2
  29. napari_plot-0.4.0/napari_plot/components/scene.py +12 -0
  30. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/viewer_model.py +75 -7
  31. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/scatter/scatter.py +4 -3
  32. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/text/text.py +14 -8
  33. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/napari.yaml +4 -0
  34. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/qss/10_napari_plot.qss +1 -1
  35. {napari_plot-0.3.1 → napari_plot-0.4.0/napari_plot.egg-info}/PKG-INFO +22 -4
  36. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot.egg-info/SOURCES.txt +7 -1
  37. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot.egg-info/requires.txt +6 -4
  38. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot.egg-info/scm_file_list.json +254 -248
  39. napari_plot-0.4.0/napari_plot.egg-info/scm_version.json +8 -0
  40. {napari_plot-0.3.1 → napari_plot-0.4.0}/pyproject.toml +21 -18
  41. napari_plot-0.4.0/tests/_qt/test_qt_layer_control_sliders.py +74 -0
  42. napari_plot-0.4.0/tests/_qt/test_qt_layer_list.py +144 -0
  43. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_qt/test_qt_viewer.py +41 -0
  44. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/test_camera.py +24 -0
  45. napari_plot-0.4.0/tests/components/test_viewer_mouse_bindings.py +114 -0
  46. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/test_examples.py +0 -7
  47. napari_plot-0.4.0/tests/test_napari_010.py +265 -0
  48. napari_plot-0.3.1/napari_plot/_qt/layer_controls/qt_layer_controls_container.py +0 -59
  49. napari_plot-0.3.1/napari_plot/_vispy/overlays/text.py +0 -50
  50. napari_plot-0.3.1/napari_plot/utils/_register.py +0 -60
  51. napari_plot-0.3.1/napari_plot.egg-info/scm_version.json +0 -8
  52. {napari_plot-0.3.1 → napari_plot-0.4.0}/.deepsource.toml +0 -0
  53. {napari_plot-0.3.1 → napari_plot-0.4.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  54. {napari_plot-0.3.1 → napari_plot-0.4.0}/.github/ISSUE_TEMPLATE/documentation.md +0 -0
  55. {napari_plot-0.3.1 → napari_plot-0.4.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  56. {napari_plot-0.3.1 → napari_plot-0.4.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  57. {napari_plot-0.3.1 → napari_plot-0.4.0}/.github/TEST_FAIL_TEMPLATE.md +0 -0
  58. {napari_plot-0.3.1 → napari_plot-0.4.0}/.github/dependabot.yml +0 -0
  59. {napari_plot-0.3.1 → napari_plot-0.4.0}/.github/workflows/auto_author_assign.yml +0 -0
  60. {napari_plot-0.3.1 → napari_plot-0.4.0}/.gitignore +0 -0
  61. {napari_plot-0.3.1 → napari_plot-0.4.0}/.pre-commit-config.yaml +0 -0
  62. {napari_plot-0.3.1 → napari_plot-0.4.0}/LICENSE +0 -0
  63. {napari_plot-0.3.1 → napari_plot-0.4.0}/MANIFEST.in +0 -0
  64. {napari_plot-0.3.1 → napari_plot-0.4.0}/Makefile +0 -0
  65. {napari_plot-0.3.1 → napari_plot-0.4.0}/codecov.yml +0 -0
  66. {napari_plot-0.3.1 → napari_plot-0.4.0}/conftest.py +0 -0
  67. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/__main__.py +0 -0
  68. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/__init__.py +0 -0
  69. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/_app.py +0 -0
  70. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/actions/__init__.py +0 -0
  71. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/constants/__init__.py +0 -0
  72. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/constants/_menus.py +0 -0
  73. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/context/__init__.py +0 -0
  74. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/context/_context.py +0 -0
  75. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/context/_context_keys.py +0 -0
  76. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/context/_layerlist_context.py +0 -0
  77. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_app_model/utils.py +0 -0
  78. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_contribution.py +0 -0
  79. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_plot_widget.py +0 -0
  80. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/__init__.py +0 -0
  81. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/_qapp_model/__init__.py +0 -0
  82. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/component_controls/__init__.py +0 -0
  83. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/component_controls/qt_axis_controls.py +0 -0
  84. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/component_controls/qt_camera_controls.py +0 -0
  85. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/__init__.py +0 -0
  86. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_bar_controls.py +0 -0
  87. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_centroids_controls.py +0 -0
  88. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_infline_controls.py +0 -0
  89. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_layers_dialog.py +0 -0
  90. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_line_controls.py +0 -0
  91. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_multiline_controls.py +0 -0
  92. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/layer_controls/qt_region_controls.py +0 -0
  93. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/qt_layer_buttons.py +0 -0
  94. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/qt_toolbar.py +0 -0
  95. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/widgets/__init__.py +0 -0
  96. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/widgets/qt_dev.py +0 -0
  97. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/widgets/qt_icon_button.py +0 -0
  98. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_qt/widgets/qt_splash_screen.py +0 -0
  99. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_scatter_widget.py +0 -0
  100. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/__init__.py +0 -0
  101. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/camera.py +0 -0
  102. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/components/__init__.py +0 -0
  103. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/components/axis.py +0 -0
  104. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/layers/__init__.py +0 -0
  105. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/layers/bar.py +0 -0
  106. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/layers/centroids.py +0 -0
  107. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/layers/infline.py +0 -0
  108. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/layers/line.py +0 -0
  109. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/layers/multiline.py +0 -0
  110. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/layers/region.py +0 -0
  111. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/overlays/__init__.py +0 -0
  112. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/overlays/axis.py +0 -0
  113. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/overlays/grid_lines.py +0 -0
  114. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/tools/__init__.py +0 -0
  115. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/tools/drag.py +0 -0
  116. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/tools/polygon.py +0 -0
  117. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/utils/__init__.py +0 -0
  118. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/utils/axis.py +0 -0
  119. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/utils/visual.py +0 -0
  120. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/visuals/__init__.py +0 -0
  121. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/visuals/bar.py +0 -0
  122. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/visuals/centroids.py +0 -0
  123. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/visuals/infline.py +0 -0
  124. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/visuals/line.py +0 -0
  125. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/visuals/multiline.py +0 -0
  126. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/visuals/region.py +0 -0
  127. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/_vispy/visuals/scatter.py +0 -0
  128. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/__init__.py +0 -0
  129. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/_viewer_utils.py +0 -0
  130. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/axis.py +0 -0
  131. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/camera.py +0 -0
  132. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/dragtool.py +0 -0
  133. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/grid_lines.py +0 -0
  134. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/gridlines.py +0 -0
  135. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/components/tools.py +0 -0
  136. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/__init__.py +0 -0
  137. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/bar/__init__.py +0 -0
  138. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/bar/bar.py +0 -0
  139. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/base.py +0 -0
  140. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/centroids/__init__.py +0 -0
  141. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/centroids/_centroids_constants.py +0 -0
  142. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/centroids/_centroids_key_bindings.py +0 -0
  143. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/centroids/_centroids_utils.py +0 -0
  144. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/centroids/centroids.py +0 -0
  145. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/infline/__init__.py +0 -0
  146. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/infline/_infline.py +0 -0
  147. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/infline/_infline_constants.py +0 -0
  148. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/infline/_infline_key_bindings.py +0 -0
  149. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/infline/_infline_list.py +0 -0
  150. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/infline/_infline_mouse_bindings.py +0 -0
  151. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/infline/_infline_utils.py +0 -0
  152. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/infline/infline.py +0 -0
  153. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/line/__init__.py +0 -0
  154. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/line/_line_constants.py +0 -0
  155. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/line/_line_key_bindings.py +0 -0
  156. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/line/line.py +0 -0
  157. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/multiline/__init__.py +0 -0
  158. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/multiline/_multiline_constants.py +0 -0
  159. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/multiline/_multiline_key_bindings.py +0 -0
  160. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/multiline/_multiline_list.py +0 -0
  161. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/multiline/_multiline_utils.py +0 -0
  162. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/multiline/multiline.py +0 -0
  163. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/region/__init__.py +0 -0
  164. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/region/_region.py +0 -0
  165. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/region/_region_constants.py +0 -0
  166. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/region/_region_key_bindings.py +0 -0
  167. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/region/_region_list.py +0 -0
  168. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/region/_region_mouse_bindings.py +0 -0
  169. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/region/_region_utils.py +0 -0
  170. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/region/region.py +0 -0
  171. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/scatter/__init__.py +0 -0
  172. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/scatter/_scatter_key_bindings.py +0 -0
  173. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/scatter/_utilities.py +0 -0
  174. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/text/__init__.py +0 -0
  175. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/utils/__init__.py +0 -0
  176. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/layers/utils/layer_utils.py +0 -0
  177. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/__init__.py +0 -0
  178. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/icon.icns +0 -0
  179. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/icon.ico +0 -0
  180. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/icons/logo_silhouette_plot.svg +0 -0
  181. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/icons/new_centroids.svg +0 -0
  182. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/icons/new_inf_line.svg +0 -0
  183. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/icons/new_line.svg +0 -0
  184. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/icons/new_region.svg +0 -0
  185. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/icons/new_scatter.svg +0 -0
  186. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/resources/logo.png +0 -0
  187. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/utils/__init__.py +0 -0
  188. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/utils/_test_support.py +0 -0
  189. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/utils/_tool.py +0 -0
  190. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/utils/action_manager.py +0 -0
  191. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/utils/system.py +0 -0
  192. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/utils/utilities.py +0 -0
  193. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/viewer.py +0 -0
  194. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot/window.py +0 -0
  195. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot.egg-info/dependency_links.txt +0 -0
  196. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot.egg-info/entry_points.txt +0 -0
  197. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot.egg-info/not-zip-safe +0 -0
  198. {napari_plot-0.3.1 → napari_plot-0.4.0}/napari_plot.egg-info/top_level.txt +0 -0
  199. {napari_plot-0.3.1 → napari_plot-0.4.0}/renovate.json +0 -0
  200. {napari_plot-0.3.1 → napari_plot-0.4.0}/scripts/png_to_icon.bat +0 -0
  201. {napari_plot-0.3.1 → napari_plot-0.4.0}/scripts/qtaicons.bat +0 -0
  202. {napari_plot-0.3.1 → napari_plot-0.4.0}/setup.cfg +0 -0
  203. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/__init__.py +0 -0
  204. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_app_model/__init__.py +0 -0
  205. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_app_model/test_app.py +0 -0
  206. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_app_model/test_constants.py +0 -0
  207. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_app_model/test_context.py +0 -0
  208. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_app_model/test_layerlist_context.py +0 -0
  209. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_qt/__init__.py +0 -0
  210. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_qt/test_qt_axis_controls.py +0 -0
  211. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_qt/test_qt_layer_buttons.py +0 -0
  212. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_qt/test_qt_layer_control_icons.py +0 -0
  213. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_qt/test_qt_legend.py +0 -0
  214. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_qt/test_qt_splash_screen.py +0 -0
  215. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_qt/test_qt_window.py +0 -0
  216. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/__init__.py +0 -0
  217. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/test_axis.py +0 -0
  218. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/test_vispy_bar_layer.py +0 -0
  219. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/test_vispy_infline_layer.py +0 -0
  220. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/test_vispy_line_layer.py +0 -0
  221. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/test_vispy_region_layer.py +0 -0
  222. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/test_vispy_scatter_layer.py +0 -0
  223. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/test_vispy_text_layer.py +0 -0
  224. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/_vispy/test_vispy_tools.py +0 -0
  225. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/components/__init__.py +0 -0
  226. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/components/test_axis.py +0 -0
  227. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/components/test_camera.py +0 -0
  228. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/components/test_tools.py +0 -0
  229. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/components/test_viewer_model.py +0 -0
  230. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layer_controls/__init__.py +0 -0
  231. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layer_controls/test_qt_bar_controls.py +0 -0
  232. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layer_controls/test_qt_infline_controls.py +0 -0
  233. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layer_controls/test_qt_line_controls.py +0 -0
  234. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layer_controls/test_qt_multiline_controls.py +0 -0
  235. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layer_controls/test_qt_region_controls.py +0 -0
  236. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layer_controls/test_qt_scatter_controls.py +0 -0
  237. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layer_controls/test_qt_text_controls.py +0 -0
  238. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/__init__.py +0 -0
  239. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/centroids/__init__.py +0 -0
  240. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/centroids/test_centroids.py +0 -0
  241. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/infline/__init__.py +0 -0
  242. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/infline/test_infline.py +0 -0
  243. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/infline/test_infline_list.py +0 -0
  244. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/infline/test_infline_mouse_bindings.py +0 -0
  245. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/infline/test_infline_utils.py +0 -0
  246. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/line/__init__.py +0 -0
  247. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/line/test_line.py +0 -0
  248. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/multiline/__init__.py +0 -0
  249. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/multiline/test_multiline.py +0 -0
  250. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/multiline/test_multiline_list.py +0 -0
  251. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/multiline/test_multiline_utils.py +0 -0
  252. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/region/__init__.py +0 -0
  253. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/region/test_region.py +0 -0
  254. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/region/test_region_mouse_bindings.py +0 -0
  255. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/scatter/__init__.py +0 -0
  256. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/scatter/test_scatter.py +0 -0
  257. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/test_bar.py +0 -0
  258. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/test_duplication.py +0 -0
  259. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/test_registration.py +0 -0
  260. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/text/__init__.py +0 -0
  261. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/layers/text/test_text.py +0 -0
  262. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/test_lazy_import.py +0 -0
  263. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/test_plot_widget.py +0 -0
  264. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/test_plotting_api.py +0 -0
  265. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/test_scatter_widget.py +0 -0
  266. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/utils/__init__.py +0 -0
  267. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/utils/test_tool.py +0 -0
  268. {napari_plot-0.3.1 → napari_plot-0.4.0}/tests/utils/test_utilities.py +0 -0
@@ -91,6 +91,7 @@ jobs:
91
91
  runs-on: ${{ matrix.os }}
92
92
  env:
93
93
  QT_API: ${{ matrix.backend }}
94
+ PYTEST_QT_API: ${{ matrix.backend }}
94
95
  UV_NO_SYNC: "1"
95
96
  UV_MANAGED_PYTHON: "1"
96
97
  strategy:
@@ -0,0 +1,40 @@
1
+ # napari-plot v0.3.1
2
+
3
+ Changes since `v0.2.0`.
4
+
5
+ ## Added
6
+
7
+ - Added `Bar` layers with vertical and horizontal orientations.
8
+ - Supports positions, values, baseline, bar width, fill and border colors, border width, opacity, selection, and removal of selected bars.
9
+ - Added bar-layer controls and `vbar()` / `hbar()` convenience methods.
10
+ - Added `Text` layers with per-label text and colors, font styling, alignment, rotation, and offsets.
11
+ - Added interactive plot legends with automatic layer entries, custom entries, `Points`-property legends, synchronization, placement, and styling controls.
12
+ - Added logarithmic axes with positive-value validation and log tick generation.
13
+ - Added categorical axes with configurable ordered category labels.
14
+ - Added axis controls for linear, logarithmic, and categorical scales.
15
+ - Added the concise plotting API: `plot()`, `scatter()`, `imshow()`, `vbar()`, and `hbar()`.
16
+ - Added lazy imports for the top-level package.
17
+ - Added a complete Add Layer menu for supported napari-plot and napari layer types.
18
+ - Added extensive examples and API/usage documentation.
19
+
20
+ ## Improvements and fixes
21
+
22
+ - Migrated to napari `0.8.0` and updated associated APIs, event handling, and Pydantic validation.
23
+ - Improved axis tick formatting, label-overlap handling, and custom tick formatter support.
24
+ - Improved region and infinite-line rendering using batched VisPy visuals.
25
+ - Improved region and infinite-line selection, opacity, visibility, extent calculation, and rendering updates.
26
+ - Improved camera drag and mouse-release handling.
27
+ - Improved layer duplication, registration, context menus, and layer controls.
28
+ - Improved embedded napari widgets with host-theme synchronization.
29
+ - Updated the scatter widget to use the currently displayed slices of selected image layers, support nD images, and report mismatched slice shapes clearly.
30
+ - Added broader test coverage for axes, legends, bars, text, rendering, controls, duplication, registration, and plotting helpers.
31
+
32
+ ## Compatibility and packaging
33
+
34
+ - Python `3.11+` is now required.
35
+ - napari `0.8.0` is required.
36
+ - Qt6 is now the default configuration through PyQt6 or PySide6.
37
+ - Replaced the legacy tox-oriented development setup with uv dependency groups and workflows.
38
+ - Updated CI workflows, GitHub Actions versions, pre-commit configuration, and release/deployment automation.
39
+ - Renamed the top-level public model export from `ViewerModel1D` to `ViewerModel`.
40
+ - Updated CI and deployment workflow configuration.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: napari_plot
3
- Version: 0.3.1
3
+ Version: 0.4.0
4
4
  Summary: Plugin providing support for 1d plotting in napari
5
5
  Author-email: Lukasz Migas <lukas.migas@yahoo.com>
6
6
  License: BSD 3-Clause
@@ -37,19 +37,20 @@ Requires-Dist: napari-plugin-engine>=0.2.0
37
37
  Requires-Dist: numpy
38
38
  Requires-Dist: qtpy
39
39
  Requires-Dist: qtawesome>=1.2.0
40
- Requires-Dist: napari==0.8.0
40
+ Requires-Dist: napari==0.10.0
41
41
  Requires-Dist: matplotlib
42
42
  Requires-Dist: vispy
43
43
  Requires-Dist: koyo
44
44
  Requires-Dist: qtextra
45
45
  Provides-Extra: pyside6
46
+ Requires-Dist: napari[pyside6]==0.10.0; extra == "pyside6"
47
+ Requires-Dist: pyside6!=6.12.0; python_version < "3.12" and extra == "pyside6"
46
48
  Requires-Dist: pyside6>6.9.0; platform_system == "Windows" and extra == "pyside6"
47
49
  Requires-Dist: pyside6; platform_system != "Windows" and extra == "pyside6"
48
50
  Provides-Extra: pyside
49
51
  Requires-Dist: napari_plot[pyside6]; extra == "pyside"
50
- Provides-Extra: pyqt5
51
- Requires-Dist: PyQt5!=5.15.0,>=5.13.2; extra == "pyqt5"
52
52
  Provides-Extra: pyqt6
53
+ Requires-Dist: napari[pyqt6]==0.10.0; extra == "pyqt6"
53
54
  Requires-Dist: pyqt6>=6.9.0; extra == "pyqt6"
54
55
  Requires-Dist: pyqt6!=6.6.1; platform_system == "Darwin" and extra == "pyqt6"
55
56
  Provides-Extra: pyqt
@@ -194,6 +195,10 @@ https://napari.org/docs/plugins/index.html
194
195
 
195
196
  ## Installation
196
197
 
198
+ napari-plot requires napari 0.10.0 and Python 3.11 or later. Use a Qt6 backend
199
+ with `pip install "napari-plot[pyqt6]"` or `pip install "napari-plot[pyside6]"`.
200
+ Qt5 is no longer supported.
201
+
197
202
  You can install `napari-plot` directly from PyPI via:
198
203
 
199
204
  ```shell
@@ -208,6 +213,19 @@ cd napari-plot
208
213
  pip install -e '.[all]'
209
214
  ```
210
215
 
216
+ The plot widgets open in a tabified bottom dock in napari. Custom layers retain
217
+ their individual controls; selecting several layers exposes shared opacity and
218
+ blending controls. Built-in-only selections use napari's dynamic controls.
219
+
220
+ `viewer.scene.camera` and `viewer.canvas.overlays` expose the new model layout.
221
+ Existing `viewer.camera`, `viewer.text_overlay`, `viewer.legend`, and
222
+ `viewer.grid_lines` accessors refer to the same objects. The custom camera,
223
+ log axes, and plot grid remain available.
224
+
225
+ Layer axis labels automatically populate the plot labels until those labels
226
+ are edited explicitly. Unspecified text and legend font sizes follow the
227
+ application's appearance font size; pass a number to fix the size.
228
+
211
229
  Python 3.11 or later is required. See the
212
230
  [documentation](https://napari-plot.readthedocs.io/) for standalone and embedded
213
231
  quick starts, layer examples, axis controls, interactions, and the public API.
@@ -81,6 +81,10 @@ https://napari.org/docs/plugins/index.html
81
81
 
82
82
  ## Installation
83
83
 
84
+ napari-plot requires napari 0.10.0 and Python 3.11 or later. Use a Qt6 backend
85
+ with `pip install "napari-plot[pyqt6]"` or `pip install "napari-plot[pyside6]"`.
86
+ Qt5 is no longer supported.
87
+
84
88
  You can install `napari-plot` directly from PyPI via:
85
89
 
86
90
  ```shell
@@ -95,6 +99,19 @@ cd napari-plot
95
99
  pip install -e '.[all]'
96
100
  ```
97
101
 
102
+ The plot widgets open in a tabified bottom dock in napari. Custom layers retain
103
+ their individual controls; selecting several layers exposes shared opacity and
104
+ blending controls. Built-in-only selections use napari's dynamic controls.
105
+
106
+ `viewer.scene.camera` and `viewer.canvas.overlays` expose the new model layout.
107
+ Existing `viewer.camera`, `viewer.text_overlay`, `viewer.legend`, and
108
+ `viewer.grid_lines` accessors refer to the same objects. The custom camera,
109
+ log axes, and plot grid remain available.
110
+
111
+ Layer axis labels automatically populate the plot labels until those labels
112
+ are edited explicitly. Unspecified text and legend font sizes follow the
113
+ application's appearance font size; pass a number to fix the size.
114
+
98
115
  Python 3.11 or later is required. See the
99
116
  [documentation](https://napari-plot.readthedocs.io/) for standalone and embedded
100
117
  quick starts, layer examples, axis controls, interactions, and the public API.
@@ -38,10 +38,10 @@ _LAZY_IMPORTS = {
38
38
 
39
39
  def __getattr__(name: str) -> ty.Any:
40
40
  """Lazily import objects when accessed."""
41
- # Need to import to ensure that `napari_plot` is included in the auto-class generator
42
- from napari_plot.utils import _register # isort:skip noqa
43
-
44
- del _register
41
+ # # Need to import to ensure that `napari_plot` is included in the auto-class generator
42
+ # from napari_plot.utils import _register # isort:skip noqa
43
+ #
44
+ # del _register
45
45
  try:
46
46
  module_name, attr_name = _LAZY_IMPORTS[name]
47
47
  except KeyError:
@@ -41,7 +41,7 @@ LAYERLIST_CONTEXT_SUBMENUS = [
41
41
  title="Projections",
42
42
  group=MenuGroup.LAYERLIST_CONTEXT.SPLIT_MERGE,
43
43
  order=None,
44
- enablement=LLSCK.active_layer_is_image_3d,
44
+ enablement=((LLSCK.active_layer_type == "image") & (LLSCK.active_layer_ndim > 2)),
45
45
  ),
46
46
  ),
47
47
  (
@@ -85,7 +85,7 @@ LAYERLIST_CONTEXT_ACTIONS: list[Action] = [
85
85
  title="Split Stack",
86
86
  callback=_layer_actions._split_stack,
87
87
  menus=[{**LAYERCTX_SPLITMERGE, "when": ~LLSCK.active_layer_is_rgb}],
88
- enablement=LLSCK.active_layer_is_image_3d,
88
+ enablement=((LLSCK.active_layer_type == "image") & (LLSCK.active_layer_ndim > 2)),
89
89
  ),
90
90
  Action(
91
91
  id="napari.layer.split_rgb",
@@ -238,7 +238,7 @@ for mode in ("max", "min", "std", "sum", "mean", "median"):
238
238
  id=f"napari.layer.project_{mode}",
239
239
  title=f"{mode} projection",
240
240
  callback=partial(_layer_actions._project, mode=mode),
241
- enablement=LLSCK.active_layer_is_image_3d,
241
+ enablement=((LLSCK.active_layer_type == "image") & (LLSCK.active_layer_ndim > 2)),
242
242
  menus=[{"id": MenuId.LAYERS_CONTEXT_PROJECT}],
243
243
  )
244
244
  )
@@ -9,7 +9,6 @@ from typing import TYPE_CHECKING
9
9
 
10
10
  from napari import components, layers
11
11
  from napari.utils._proxies import PublicOnlyProxy
12
- from napari.utils.translations import trans
13
12
 
14
13
  if TYPE_CHECKING:
15
14
  from napari._qt.qt_main_window import Window
@@ -33,13 +32,7 @@ def _provide_viewer_or_raise(msg: str = "", public_proxy: bool = False) -> Viewe
33
32
  return viewer
34
33
  if msg:
35
34
  msg = " " + msg
36
- raise RuntimeError(
37
- trans._(
38
- "No current `Viewer` found.{msg}",
39
- deferred=True,
40
- msg=msg,
41
- )
42
- )
35
+ raise RuntimeError(f"No current `Viewer` found.{msg}")
43
36
 
44
37
 
45
38
  def _provide_qt_viewer() -> QtViewer:
@@ -58,13 +51,7 @@ def _provide_qt_viewer_or_raise(msg: str = "") -> QtViewer:
58
51
  return qt_viewer
59
52
  if msg:
60
53
  msg = " " + msg
61
- raise RuntimeError(
62
- trans._(
63
- "No current `QtViewer` found.{msg}",
64
- deferred=True,
65
- msg=msg,
66
- )
67
- )
54
+ raise RuntimeError(f"No current `QtViewer` found.{msg}")
68
55
 
69
56
 
70
57
  def _provide_window() -> Window:
@@ -81,13 +68,7 @@ def _provide_window_or_raise(msg: str = "") -> Window:
81
68
  return window
82
69
  if msg:
83
70
  msg = " " + msg
84
- raise RuntimeError(
85
- trans._(
86
- "No current `Window` found.{msg}",
87
- deferred=True,
88
- msg=msg,
89
- )
90
- )
71
+ raise RuntimeError(f"No current `Window` found.{msg}")
91
72
 
92
73
 
93
74
  def _provide_active_layer() -> layers.Layer:
@@ -9,6 +9,7 @@ import qtextra.helpers as hp
9
9
  from napari._qt.utils import qt_signals_blocked
10
10
  from napari._qt.widgets.qt_color_swatch import QColorSwatchEdit
11
11
  from napari.components._viewer_constants import CanvasPosition
12
+ from napari.settings import get_settings
12
13
  from napari.utils.events import disconnect_events
13
14
  from qtextra.widgets.qt_dialog import QtFramelessPopup
14
15
  from qtpy.QtCore import Qt
@@ -38,17 +39,22 @@ class QtLegendControls(QtFramelessPopup):
38
39
  self.setMouseTracking(True)
39
40
 
40
41
  overlay = viewer.legend
41
- overlay.events.visible.connect(self._on_visible_change)
42
- overlay.events.position.connect(self._on_position_change)
43
- overlay.events.sync_with_source.connect(self._on_auto_sync_change)
44
- overlay.events.text_color.connect(self._on_text_color_change)
45
- overlay.events.font_size.connect(self._on_font_size_change)
46
- overlay.events.marker_size.connect(self._on_marker_size_change)
47
- overlay.events.row_spacing.connect(self._on_row_spacing_change)
48
- overlay.events.padding.connect(self._on_padding_change)
49
- overlay.events.background_color.connect(self._on_background_color_change)
50
- overlay.events.border_color.connect(self._on_border_color_change)
51
- overlay.events.border_width.connect(self._on_border_width_change)
42
+ self._overlay_connections = (
43
+ (overlay.events.visible, self._on_visible_change),
44
+ (overlay.events.position, self._on_position_change),
45
+ (overlay.events.sync_with_source, self._on_auto_sync_change),
46
+ (overlay.events.text_color, self._on_text_color_change),
47
+ (overlay.events.font_size, self._on_font_size_change),
48
+ (overlay.events.marker_size, self._on_marker_size_change),
49
+ (overlay.events.row_spacing, self._on_row_spacing_change),
50
+ (overlay.events.padding, self._on_padding_change),
51
+ (overlay.events.background_color, self._on_background_color_change),
52
+ (overlay.events.border_color, self._on_border_color_change),
53
+ (overlay.events.border_width, self._on_border_width_change),
54
+ )
55
+ for signal, callback in self._overlay_connections:
56
+ signal.connect(callback)
57
+ get_settings().appearance.events.font_size.connect(self._on_font_size_change)
52
58
 
53
59
  # noinspection PyAttributeOutsideInit
54
60
  def make_panel(self) -> QFormLayout:
@@ -88,7 +94,7 @@ class QtLegendControls(QtFramelessPopup):
88
94
  4,
89
95
  32,
90
96
  step_size=1,
91
- value=overlay.font_size,
97
+ value=overlay.effective_font_size,
92
98
  func=self.on_change_font_size,
93
99
  )
94
100
  self.marker_size_spinbox = hp.make_double_slider_with_text(
@@ -196,7 +202,7 @@ class QtLegendControls(QtFramelessPopup):
196
202
 
197
203
  def _on_font_size_change(self, _event=None) -> None:
198
204
  with qt_signals_blocked(self.font_size_spinbox):
199
- self.font_size_spinbox.setValue(self.viewer.legend.font_size)
205
+ self.font_size_spinbox.setValue(self.viewer.legend.effective_font_size)
200
206
 
201
207
  def on_change_marker_size(self) -> None:
202
208
  """Update legend marker size."""
@@ -232,7 +238,9 @@ class QtLegendControls(QtFramelessPopup):
232
238
 
233
239
  def close(self) -> None:
234
240
  """Disconnect overlay events before closing."""
235
- disconnect_events(self.viewer.legend.events, self)
241
+ for signal, callback in self._overlay_connections:
242
+ signal.disconnect(callback)
243
+ disconnect_events(get_settings().appearance.events, self)
236
244
  super().close()
237
245
 
238
246
 
@@ -3,7 +3,7 @@
3
3
  import typing as ty
4
4
 
5
5
  import qtextra.helpers as hp
6
- from napari.layers.base._base_constants import BLENDING_TRANSLATIONS, Blending, Mode
6
+ from napari.layers.base._base_constants import Blending, Mode
7
7
  from napari.utils.events import disconnect_events
8
8
  from qtpy.QtCore import Qt
9
9
  from qtpy.QtWidgets import QButtonGroup, QFormLayout, QFrame, QGridLayout
@@ -97,7 +97,7 @@ class QtLayerControls(QFrame):
97
97
 
98
98
  # Blending
99
99
  self.blending_combobox = hp.make_combobox(self)
100
- hp.set_combobox_data(self.blending_combobox, BLENDING_TRANSLATIONS, self.layer.blending)
100
+ hp.set_combobox_data(self.blending_combobox, {mode: str(mode) for mode in Blending}, self.layer.blending)
101
101
  self.blending_combobox.currentTextChanged.connect(self.on_change_blending)
102
102
 
103
103
  # opaque and minimum blending do not support changing alpha
@@ -0,0 +1,128 @@
1
+ """Layer controls."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING
6
+
7
+ import napari._qt.layer_controls.qt_layer_controls_container
8
+ import qtextra.helpers as hp
9
+ from napari._qt.layer_controls.dynamic.qt_dynamic_layer_controls import QtDynamicLayerControls
10
+ from napari._qt.layer_controls.dynamic.widgets import QtOpacityBlendingControls
11
+ from napari._qt.layer_controls.qt_layer_controls_container import (
12
+ QtLayerControlsContainer as NapariQtLayerControlsContainer,
13
+ create_qt_layer_controls,
14
+ )
15
+ from napari.settings import get_settings
16
+ from napari.utils.events import Event
17
+ from qtpy.QtWidgets import QFrame
18
+
19
+ from napari_plot._qt.layer_controls.qt_bar_controls import QtBarControls
20
+ from napari_plot._qt.layer_controls.qt_centroids_controls import QtCentroidControls
21
+ from napari_plot._qt.layer_controls.qt_infline_controls import QtInfLineControls
22
+ from napari_plot._qt.layer_controls.qt_line_controls import QtLineControls
23
+ from napari_plot._qt.layer_controls.qt_multiline_controls import QtMultiLineControls
24
+ from napari_plot._qt.layer_controls.qt_region_controls import QtRegionControls
25
+ from napari_plot._qt.layer_controls.qt_scatter_controls import QtScatterControls
26
+ from napari_plot._qt.layer_controls.qt_text_controls import QtTextControls
27
+ from napari_plot.layers import Bar, Centroids, InfLine, Line, MultiLine, Region, Scatter, Text
28
+
29
+ if TYPE_CHECKING:
30
+ from napari.layers import Layer
31
+
32
+ from napari_plot.components.viewer_model import ViewerModel
33
+
34
+ layer_to_controls = {
35
+ Bar: QtBarControls,
36
+ Line: QtLineControls,
37
+ Centroids: QtCentroidControls,
38
+ Scatter: QtScatterControls,
39
+ Region: QtRegionControls,
40
+ InfLine: QtInfLineControls,
41
+ MultiLine: QtMultiLineControls,
42
+ Text: QtTextControls,
43
+ }
44
+
45
+
46
+ # need to overwrite napari' default mapping of layer : control of layers to add our custom layers
47
+ napari._qt.layer_controls.qt_layer_controls_container.layer_to_controls.update(layer_to_controls)
48
+
49
+
50
+ class QtSharedLayerControls(QFrame):
51
+ """Edit opacity and blending across custom or mixed layer selections."""
52
+
53
+ ndisplay: int = 2
54
+
55
+ def __init__(self, layers: list[Layer]) -> None:
56
+ super().__init__()
57
+ self.setObjectName("layer")
58
+ self.controls = QtOpacityBlendingControls(layers, parent=self)
59
+ self._controls = [self.controls]
60
+ layout = hp.make_form_layout(parent=self)
61
+ for widgets in self.controls.get_widget_controls():
62
+ layout.addRow(*widgets)
63
+
64
+ def deleteLater(self) -> None:
65
+ """Disconnect layer events before disposing of the selection panel."""
66
+ self.controls.disconnect_widget_controls()
67
+ super().deleteLater()
68
+
69
+
70
+ class QtLayerControlsContainer(NapariQtLayerControlsContainer):
71
+ """Layer controls container with built-in control styling metadata."""
72
+
73
+ def __init__(self, viewer: ViewerModel) -> None:
74
+ super().__init__(viewer)
75
+ for layer in viewer.layers:
76
+ self._add(Event("inserted", value=layer))
77
+ self._populate()
78
+
79
+ def _add(self, event: Event) -> None:
80
+ """Add controls and mark those supplied by napari for scoped QSS rules."""
81
+ layer = event.value
82
+ controls = create_qt_layer_controls(layer)
83
+ controls.ndisplay = self.viewer.dims.ndisplay
84
+ self.addWidget(controls)
85
+ self.widgets[layer] = controls
86
+ controls.setProperty(
87
+ "napari_builtin",
88
+ controls.__class__.__module__.startswith("napari."),
89
+ )
90
+
91
+ def _remove(self, event: Event) -> None:
92
+ controls = self.widgets.pop(event.value)
93
+ self.removeWidget(controls)
94
+ controls.hide()
95
+ controls.deleteLater()
96
+
97
+ def _populate(self) -> None:
98
+ if self.panel is not None:
99
+ self.removeWidget(self.panel)
100
+ self.panel.hide()
101
+ self.panel.deleteLater()
102
+ self.panel = None
103
+ layers = [layer for layer in self.viewer.layers if layer in self.viewer.layers.selection]
104
+ if not layers:
105
+ self.setCurrentWidget(self.empty_widget)
106
+ return
107
+ custom = any(isinstance(layer, tuple(layer_to_controls)) for layer in layers)
108
+ if len(layers) == 1 and (custom or not get_settings().experimental.dynamic_layer_controls):
109
+ self.setCurrentWidget(self.widgets[layers[0]])
110
+ return
111
+ self.panel = QtSharedLayerControls(layers) if custom else QtDynamicLayerControls(layers)
112
+ self.panel.ndisplay = self.viewer.dims.ndisplay
113
+ self.addWidget(self.panel)
114
+ self.setCurrentWidget(self.panel)
115
+
116
+
117
+ __all__ = [
118
+ "QtBarControls",
119
+ "QtCentroidControls",
120
+ "QtInfLineControls",
121
+ "QtLayerControlsContainer",
122
+ "QtLineControls",
123
+ "QtMultiLineControls",
124
+ "QtRegionControls",
125
+ "QtScatterControls",
126
+ "QtTextControls",
127
+ "layer_to_controls",
128
+ ]
@@ -8,7 +8,7 @@ import qtextra.helpers as hp
8
8
  from napari._qt.utils import qt_signals_blocked, set_widgets_enabled_with_opacity
9
9
  from napari._qt.widgets.qt_color_swatch import QColorSwatch
10
10
  from napari.layers.base._base_constants import Mode
11
- from napari.layers.points._points_constants import SYMBOL_TRANSLATION
11
+ from napari.layers.points._points_constants import Symbol
12
12
  from napari.utils.events import disconnect_events
13
13
  from qtpy.QtCore import Qt, Slot
14
14
 
@@ -107,7 +107,11 @@ class QtScatterControls(QtLayerControls):
107
107
 
108
108
  self.symbol_combobox = hp.make_combobox(self, tooltip="Marker symbol")
109
109
  current_symbol = self.layer.symbol[-1] if len(self.layer.symbol) > 0 else None
110
- hp.set_combobox_data(self.symbol_combobox, SYMBOL_TRANSLATION, current_symbol)
110
+ hp.set_combobox_data(
111
+ self.symbol_combobox,
112
+ {symbol: symbol.name.lower().replace("_", " ") for symbol in Symbol},
113
+ current_symbol,
114
+ )
111
115
  self.symbol_combobox.currentTextChanged.connect(self.on_change_symbol)
112
116
 
113
117
  self.scaling_checkbox = hp.make_checkbox(self, val=self.layer.scaling, tooltip="Scale scatter points with zoom")
@@ -8,6 +8,8 @@ import numpy as np
8
8
  import qtextra.helpers as hp
9
9
  from napari._qt.utils import qt_signals_blocked, set_widgets_enabled_with_opacity
10
10
  from napari._qt.widgets.qt_color_swatch import QColorSwatchEdit
11
+ from napari.settings import get_settings
12
+ from napari.utils.events import disconnect_events
11
13
  from qtpy.QtCore import Qt
12
14
  from qtpy.QtGui import QFontDatabase, QGuiApplication
13
15
 
@@ -27,6 +29,7 @@ class QtTextControls(QtLayerControls):
27
29
  def __init__(self, layer: Text) -> None:
28
30
  super().__init__(layer)
29
31
  self.layer.events.size.connect(self._on_size_change)
32
+ get_settings().appearance.events.font_size.connect(self._on_size_change)
30
33
  self.layer.events.color.connect(self._on_color_change)
31
34
  self.layer.events.font_face.connect(self._on_font_face_change)
32
35
  self.layer.events.bold.connect(self._on_bold_change)
@@ -112,7 +115,7 @@ class QtTextControls(QtLayerControls):
112
115
 
113
116
  def _current_size(self) -> float:
114
117
  """Return the layer-wide font size."""
115
- return self.layer.size
118
+ return self.layer.effective_size
116
119
 
117
120
  def _current_color(self) -> np.ndarray:
118
121
  """Return the first label color or the empty-layer default."""
@@ -199,6 +202,11 @@ class QtTextControls(QtLayerControls):
199
202
  with qt_signals_blocked(self.vertical_alignment_combobox):
200
203
  self.vertical_alignment_combobox.setCurrentText(self._current_vertical_alignment())
201
204
 
205
+ def close(self) -> None:
206
+ """Disconnect inherited font settings before closing the controls."""
207
+ disconnect_events(get_settings().appearance.events, self)
208
+ super().close()
209
+
202
210
  def _on_visible_change(self, _event=None) -> None:
203
211
  """Enable common controls only while the layer is visible."""
204
212
  set_widgets_enabled_with_opacity(
@@ -15,8 +15,7 @@ from napari.settings import get_settings
15
15
  from napari.utils.notifications import notification_manager, show_console_notification
16
16
  from napari.utils.theme import _themes, build_theme_svgs
17
17
  from qtextra.config.theme import THEMES
18
- from qtpy import PYQT5, PYSIDE2
19
- from qtpy.QtCore import QDir, Qt
18
+ from qtpy.QtCore import QDir
20
19
  from qtpy.QtGui import QIcon
21
20
  from qtpy.QtWidgets import QApplication
22
21
 
@@ -121,15 +120,6 @@ def get_app(
121
120
  f"QApplication already existed, these arguments to to 'get_app' were ignored: {set_values}",
122
121
  )
123
122
  else:
124
- # automatically determine monitor DPI.
125
- # Note: this MUST be set before the QApplication is instantiated. Also, this
126
- # attributes need to be applied only to Qt5 bindings (PyQt5 and PySide2)
127
- # since the High DPI scaling attributes are deactivated by default while on Qt6
128
- # they are deprecated and activated by default. For more info see:
129
- # https://doc.qt.io/qtforpython-6/gettingstarted/porting_from2.html#class-function-deprecations
130
- if PYQT5 or PYSIDE2:
131
- QApplication.setAttribute(Qt.ApplicationAttribute.AA_EnableHighDpiScaling)
132
- QApplication.setAttribute(Qt.ApplicationAttribute.AA_UseHighDpiPixmaps)
133
123
  argv = sys.argv.copy()
134
124
  if sys.platform == "darwin" and not argv[0].endswith("napari_plot"):
135
125
  # Make sure the app name in the Application menu is `napari`
@@ -193,7 +183,7 @@ def quit_app():
193
183
  # otherwise, something else created the QApp before us (such as
194
184
  # %gui qt IPython magic). If we quit the app in this case, then
195
185
  # *later* attempts to instantiate a napari viewer won't work until
196
- # the event loop is restarted with app.exec_(). So rather than
186
+ # the event loop is restarted with app.exec(). So rather than
197
187
  # quit just close all the windows (and clear our app icon).
198
188
  else:
199
189
  QApplication.setWindowIcon(QIcon())
@@ -209,7 +199,7 @@ def run(*, force=False, max_loop_level=1, _func_name="run"):
209
199
  level widgets to show.
210
200
  max_loop_level : int, optional
211
201
  The maximum allowable "loop level" for the execution thread. Every
212
- time `QApplication.exec_()` is called, Qt enters the event loop,
202
+ time `QApplication.exec()` is called, Qt enters the event loop,
213
203
  increments app.thread().loopLevel(), and waits until exit() is called.
214
204
  This function will prevent calling `exec_()` if the application already
215
205
  has at least ``max_loop_level`` event loops running. By default, 1.
@@ -253,4 +243,4 @@ def run(*, force=False, max_loop_level=1, _func_name="run"):
253
243
  )
254
244
  return
255
245
  with _maybe_allow_interrupt(app):
256
- app.exec_()
246
+ app.exec()
@@ -0,0 +1,45 @@
1
+ """Layer list with context-menu providers scoped to the clicked plot."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from napari._app_model import get_app_model
6
+ from napari._qt.containers import QtLayerList as NapariQtLayerList
7
+ from napari._qt.containers._layer_delegate import LayerDelegate
8
+ from napari.components import LayerList
9
+ from napari.layers import Layer
10
+ from qtpy.QtCore import QModelIndex, QPoint, QSortFilterProxyModel
11
+ from qtpy.QtWidgets import QWidget
12
+
13
+
14
+ class _LayerDelegate(LayerDelegate):
15
+ """Provide the clicked layer list while native menu actions are evaluated."""
16
+
17
+ def show_context_menu(
18
+ self,
19
+ index: QModelIndex,
20
+ model: QSortFilterProxyModel,
21
+ pos: QPoint,
22
+ parent: QWidget,
23
+ ) -> None:
24
+ """Open the native menu with providers for the clicked plot's layers."""
25
+ layer_list: LayerList = model.sourceModel()._root
26
+ # Prefer the clicked plot over providers for the active napari window.
27
+ with get_app_model().injection_store.register(
28
+ providers=[
29
+ (lambda: layer_list, LayerList, 1),
30
+ (lambda: layer_list.selection.active, Layer, 1),
31
+ ]
32
+ ):
33
+ super().show_context_menu(index, model, pos, parent)
34
+
35
+
36
+ class QtLayerList(NapariQtLayerList):
37
+ """Keep native layer-list behavior with plot-aware context-menu actions."""
38
+
39
+ def __init__(self, root: LayerList, parent: QWidget | None = None) -> None:
40
+ super().__init__(root, parent)
41
+ previous_delegate = self.itemDelegate()
42
+ delegate = _LayerDelegate(self)
43
+ self.setItemDelegate(delegate)
44
+ delegate.loading_frame_changed.connect(self.viewport().update)
45
+ previous_delegate.deleteLater()