Repository: pyqtgraph/pyqtgraph

Issue:
Images in Docs Need Tweaking
Right now, the documentation with the pydata sphinx theme isn't handling images particularly well.

For example:

https://pyqtgraph.readthedocs.io/en/latest/api_reference/colormap.html

Click on either of the images, the only way to go back is via the back button on the browser which is far from ideal.  Furthermore, no good image capture information is present.

The second issue involves the UML diagram:

https://pyqtgraph.readthedocs.io/en/latest/api_reference/uml_overview.html

Here we have the UML diagram that should expand to the full width on the right, and likely not modify the image so much due to dark mode.



Discussion:
For images, we likely want to use the sphinxcontrib-images extension here: https://sphinxcontrib-images.readthedocs.io/en/latest/

Resolving patch:
diff --git a/doc/source/conf.py b/doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -39,7 +39,8 @@
     "sphinx.ext.intersphinx",
     "sphinx_qt_documentation",
     "sphinx_design",
-    "sphinxext.rediraffe"
+    "sphinxext.rediraffe",
+    "sphinxcontrib.images",
 ]
 
 # Add any paths that contain templates here, relative to this directory.
@@ -140,11 +141,38 @@
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
 # documentation.
-html_theme_options = dict(
-    github_url="https://github.com/pyqtgraph/pyqtgraph",
-    navbar_end=["theme-switcher", "navbar-icon-links"],
-    twitter_url="https://twitter.com/pyqtgraph",
-)
+html_theme_options = {
+    "favicons": [
+        {
+            "rel": "icon",
+            "sizes": "32x32",
+            "href": "peegee_03_square_no_bg_32_cleaned.png"
+        },
+        {
+            "rel": "icon",
+            "href": "peegee_03_square_no_bg_32_cleaned.ico",
+            "sizes": "any"
+        },
+        {
+            "rel": "apple-touch-icon",
+            "href": "peegee_04_square_no_bg_180_cleaned.png"
+        },
+    ],
+    "github_url": "https://github.com/pyqtgraph/pyqtgraph",
+    "navbar_end": ["theme-switcher", "navbar-icon-links"],
+    "twitter_url": "https://twitter.com/pyqtgraph",
+    "use_edit_page_button": False,
+    "page_sidebar_items": ["page-toc"]
+}
+
+
+if os.getenv("BUILD_DASH_DOCSET"):
+    html_theme_options |= {
+        'page_sidebar_items': [],
+        "show_prev_next": False,
+        "collapse_navigation": True,
+    }
+
 
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = []
@@ -163,7 +191,7 @@
 # The name of an image file (within the static path) to use as favicon of the
 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
 # pixels large.
-#html_favicon = None
+# html_favicon = "_static/peegee_03_square_no_bg_32_cleaned.ico"
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
@@ -175,6 +203,9 @@
     "custom.css",
 ]
 
+if os.getenv("BUILD_DASH_DOCSET"):
+    html_css_files.append("dash.css")
+
 # Redirects for pages that were moved to new locations
 rediraffe_redirects = {
     "3dgraphics/glaxisitem.rst": "api_reference/3dgraphics/glaxisitem.rst",
@@ -309,7 +340,15 @@
 #html_use_smartypants = True
 
 # Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
+if os.getenv("BUILD_DASH_DOCSET"):  # used for building dash docsets
+    html_sidebars = {
+        "**": []
+    }
+else:
+    html_sidebars = {
+        "**": ["sidebar-nav-bs.html", "sidebar-ethical-ads.html"],
+        'index': []  # don't show sidebar on main landing page
+    }
 
 # Additional templates that should be rendered to pages, maps page names to
 # template names.
@@ -325,7 +364,7 @@
 #html_split_index = False
 
 # If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
+html_show_sourcelink = False
 
 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
 #html_show_sphinx = True
diff --git a/pyqtgraph/Point.py b/pyqtgraph/Point.py
--- a/pyqtgraph/Point.py
+++ b/pyqtgraph/Point.py
@@ -134,6 +134,7 @@ def dot(self, a):
         return Point.dotProduct(self, a)
     
     def cross(self, a):
+        """Returns the cross product of a and this Point"""
         if not isinstance(a, QtCore.QPointF):
             a = Point(a)
         return self.x() * a.y() - self.y() * a.x()


Test patch: