Menu

#2846 AutoplotScript doesn't paint renderer decorators

nextrelease
open-fixed
nobody
None
5
3 hours ago
2026-06-10
No

I discovered that decorators attached to renderers don't paint when using https://github.com/autoplot/dev/blob/master/demos/2026/20260605/demoRendererDecorator.jy with the ScriptGUIServlet.

1 Attachments

Discussion

  • Jeremy Faden

    Jeremy Faden - 2026-06-10

    This is what it should look like.

     
  • Jeremy Faden

    Jeremy Faden - 2026-06-10

    This is what it looks like instead.

     
  • Jeremy Faden

    Jeremy Faden - 2026-06-10

    There's a try/catch around each call to a decorator, so that a decorator can't disturb the rest of the drawing. It's failing with the exception:

    ex = (org.python.core.PyException) Traceback (innermost last):
      File "demoRendererDecorator.jy", line 23, in paint
    IOError: Stream Closed
    

    which is indicated in the server log file.

    Interestingly, if I draw a circle in Java code, at DasPlot.drawDecorator, it works fine. So maybe this is a permission problem. If I have the decorator simply print text, it still fails, so it's something with the callback. I wonder if any callbacks work in the server mode...

     

    Last edit: Jeremy Faden 2026-06-10
  • Jeremy Faden

    Jeremy Faden - 2026-06-10

    I noticed that the script https://github.com/autoplot/dev/blob/master/demos/annotations/strike/strikeDecorator.jy works, and it uses the addTopDecoration method in ScriptContext2023. I made this work with PlotElements as well as Plots and the Canvas, and sure enough this works. (So I think this has to due with thread security, and calling addTopDecorator calls into this properly.)

     

    Last edit: Jeremy Faden 1 day ago
  • Jeremy Faden

    Jeremy Faden - 3 hours ago
    • status: open --> open-fixed
     
Auth0 Logo