← 返回首页
add parrot icon, favicon, use for docs and window icon by FlynnOConnell · Pull Request #970 · fastplotlib/fastplotlib · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ico  (1) .js  (1) .png  (5) .py  (2) .rst  (1) .svg  (4) dotfile  (1) All 7 file types selected Viewed files
Conversations
Failed to load comments. Retry
Loading
Jump to
Jump to file
Failed to load files. Retry
Loading
Diff view
Unified
Split
Hide whitespace
Apply and reload
Show whitespace
Diff view
Unified
Split
Hide whitespace
Apply and reload
2 changes: 2 additions & 0 deletions .gitattributes
Show comments View file Edit file Delete file Open in desktop
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
@@ -1,3 +1,5 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.ico filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text
1 change: 1 addition & 0 deletions docs/source/_static/custom.js
Show comments View file Edit file Delete file Open in desktop
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 @@
document.title = "fastplotlib";
3 changes: 3 additions & 0 deletions docs/source/_static/favicon.ico
Show comments View file Edit file Delete file Open in desktop
Git LFS file not shown
3 changes: 3 additions & 0 deletions docs/source/_static/logo-dark.png
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
3 changes: 3 additions & 0 deletions docs/source/_static/logo-dark.svg
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
3 changes: 3 additions & 0 deletions docs/source/_static/logo-light.png
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
3 changes: 3 additions & 0 deletions docs/source/_static/logo-light.svg
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
3 changes: 3 additions & 0 deletions docs/source/_static/parrot-icon.png
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
3 changes: 3 additions & 0 deletions docs/source/_static/parrot-icon.svg
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
19 changes: 13 additions & 6 deletions docs/source/conf.py
Show comments View file Edit file Delete file Open in desktop
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
Expand Up @@ -9,13 +9,14 @@
# otherwise fpl tries to select glfw canvas
os.environ["WGPU_FORCE_OFFSCREEN"] = "1"

import fastplotlib
from pygfx.utils.gallery_scraper import find_examples_for_gallery
from pathlib import Path
import sys
from sphinx_gallery.sorting import ExplicitOrder
from pathlib import Path

import imageio.v3 as iio
from pygfx.utils.gallery_scraper import find_examples_for_gallery
from sphinx_gallery.sorting import ExplicitOrder

import fastplotlib

ROOT_DIR = Path(__file__).parents[1].parents[0] # repo root
EXAMPLES_DIR = Path.joinpath(ROOT_DIR, "examples")
Expand Down Expand Up @@ -112,13 +113,19 @@
"name": "Github",
"url": "https://github.com/fastplotlib/fastplotlib",
"icon": "fa-brands fa-github",
}
},
],
"logo": {
"image_light": "_static/logo-light.png",
"image_dark": "_static/logo-dark.png",
},
}

html_static_path = ["_static"]
html_js_files = ["custom.js"]
html_logo = "_static/logo.png"
html_title = f"v{release}"
html_favicon = "_static/favicon.ico"
html_title = ""

autodoc_member_order = "groupwise"
autoclass_content = "both"
Expand Down
2,976 changes: 3 additions & 2,973 deletions docs/source/fastplotlib_logo.svg
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
4 changes: 2 additions & 2 deletions docs/source/index.rst
Show comments View file Edit file Delete file Open in desktop
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
@@ -1,5 +1,5 @@
Welcome to fastplotlib's documentation!
=======================================
fastplotlib
===========

.. toctree::
:caption: Getting started
Expand Down
4 changes: 2 additions & 2 deletions fastplotlib/assets/fastplotlib_face_logo.png
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
3 changes: 3 additions & 0 deletions fastplotlib/assets/icon.png
Show comments View file Edit file Delete file Open in desktop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires iframe.
52 changes: 52 additions & 0 deletions fastplotlib/layouts/_utils.py
Show comments View file Edit file Delete file Open in desktop
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
@@ -1,5 +1,6 @@
import importlib
from itertools import product
from pathlib import Path

import numpy as np

Expand All @@ -8,6 +9,8 @@

from ..utils.gui import BaseRenderCanvas, RenderCanvas

ICON_PATH = Path(__file__).parent.parent / "assets" / "icon.png"

try:
import imgui_bundle
except ImportError:
Expand Down Expand Up @@ -50,6 +53,8 @@ def make_canvas_and_renderer(
f"renderer option must be a pygfx.Renderer instance such as pygfx.WgpuRenderer"
)

_set_window_icon(canvas)

return canvas, renderer


Expand Down Expand Up @@ -123,3 +128,50 @@ def get_extents_from_grid(
extents.append(extent)

return extents


def _set_window_icon(canvas) -> None:
"""Set the window icon based on canvas type."""
if not ICON_PATH.exists():
return

canvas_name = canvas.__class__.__name__

if canvas_name == "QRenderCanvas":
_set_icon_qt(canvas)
elif canvas_name == "GlfwRenderCanvas":
_set_icon_glfw(canvas)


def _set_icon_glfw(canvas) -> None:
"""Set window icon for GLFW backend."""
try:
import glfw
from PIL import Image
except ImportError:
return

if not hasattr(canvas, "_window"):
return

img = Image.open(ICON_PATH).convert("RGBA")
pixels = np.array(img)
glfw.set_window_icon(canvas._window, 1, [(img.width, img.height, pixels)])


def _set_icon_qt(canvas) -> None:
"""Set window icon for Qt backend."""
try:
from qtpy.QtGui import QIcon
from qtpy.QtWidgets import QApplication
except ImportError:
return

icon = QIcon(str(ICON_PATH))

app = QApplication.instance()
if app is not None:
app.setWindowIcon(icon)

for window in app.topLevelWidgets():
window.setWindowIcon(icon)
Loading
Toggle all file notes Toggle all file annotations

Footer

© 2026 GitHub, Inc.