GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Create a new buffer if necessary when setting an existing Graphic · Issue #869 · fastplotlib/fastplotlib

Create a new buffer if necessary when setting an existing Graphic #869

New issue
Copy link
New issue
Copy link
Closed
#974
Closed
Create a new buffer if necessary when setting an existing Graphic#869
#974
Copy link

Description

@kushalkolar
kushalkolar
opened on Jun 29, 2025
Issue body actions

We can implement this pretty easily, would make things easier for users, tradeoff is that users are less aware that setting data this way is slower than setting data that fits in an existing buffer. We can just document it well.

image = fig[0, 0].add_image(np.random.rand(10, 10))

# allow this, internally delete the existing buffer 
# and world object and create a new one
image.data = np.random.rand(20, 20)

Might not have to create a new world object, might be possible to just replace the geometry I think.

Activity

  1. clewis7 commented on Jun 30, 2025

    @clewis7
    clewis7
    on Jun 30, 2025
    Member
    More actions

    I think this would be more flexible, but I think it is only worth doing if we are able to handle the change without creating a new world object.

    We should also probably benchmark here how much time this would really take. Imagine you are trying to change the data to something much larger: np.random.rand(3_000, 3_000). Maybe it would be more cost-efficient to just remove the graphic and add a new one, but idk

  2. kushalkolar commented on Jul 1, 2025

    @kushalkolar
    kushalkolar
    on Jul 1, 2025
    MemberAuthor
    More actions

    Yea this should be be benchmarked and good idea with keeping the world object because events are actually added to it.

    For this to work the buffer reference on the buffer manager needs to be changed as well as on the geometry, and garbage collection must occur if the buffer is isolated.

  3. kushalkolar commented on Oct 18, 2025

    @kushalkolar
    kushalkolar
    on Oct 18, 2025
    MemberAuthor
    More actions

    I also wonder how this could be done such that if the buffer is shared between objects, the shared buffer updates too 🤔

  4. kushalkolar commented on Dec 1, 2025

    @kushalkolar
    kushalkolar
    on Dec 1, 2025
    MemberAuthor
    More actions

    I got a better idea of how to do this after doing polygon vertex data stuff in #954

  5. kushalkolar
    changed the title [-]Create a new buffer and world object if necessary when setting an existing Graphic[/-] [+]Create a new buffer if necessary when setting an existing Graphic[/+] on Dec 2, 2025
  6. kushalkolar commented on Jan 13, 2026

    @kushalkolar
    kushalkolar
    on Jan 13, 2026
    MemberAuthor
    More actions

    I've started implementing this, will make the NDWidget easier in some ways.

    I'm going to get rid of isolated_buffer, because that was only for special usecases if you wanted to use a huge buffers on the GPU and not create a new huge buffer on system RAM as well. However, OOC rendering and LOD levels is the better way to do this.

  7. kushalkolar commented on Aug 4, 2026

    @kushalkolar
    kushalkolar
    on Aug 4, 2026
    MemberAuthor
    More actions

    done in #869

  8. kushalkolar
    closed this as completedon Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.