Open new window

28 views
Skip to first unread message

Rand Batchelder

unread,
Jun 17, 2023, 12:06:52 AM6/17/23
to leo-editor
Can I write a script in Leo, which will create a new window in which I can display some graphics ?

Thomas Passin

unread,
Jun 17, 2023, 8:25:58 AM6/17/23
to leo-editor
Yes, but just how depends on what you mean.  For example, you can open a Qt window that displays MatPlotLib or Qt graphics.  Or, if within Leo you run some MatPlotLib code, the pyplot.plot() command will open a window to display the plots.  You can also run code for a system like Bokeh or Holoview that opens a browser window to display the graphics.  If you can create SVG for the output, you can display the graphics in the browser. 

Or if you can write the graphics data to an image file, you can view it with the viewrendered3 plugin.

I could be more specific if you would be more specific about what you want to do.

Thomas Passin

unread,
Jun 17, 2023, 2:16:13 PM6/17/23
to leo-editor
More examples:
- You can write a script to create a graph with GraphViz, save it to a file, and show that file in a browser;
- If you want to install the Ruby Asciidoc processor, you can write Asciidoc markup to create UML diagrams with plantuml, display them with the viewrendered3 plugin, and export them to a browser.  I've attached an image file illustrating this (this example was provided by @wangzhaohe).

asciidoc-plantuml_example.png

Thomas Passin

unread,
Jun 17, 2023, 2:18:38 PM6/17/23
to leo-editor
On Saturday, June 17, 2023 at 2:16:13 PM UTC-4 Thomas Passin wrote:
I've attached an image file illustrating this (this example was provided by @wangzhaohe).

I meant to write "this asciidoc markup  was provided by @wangzhaohe".
Reply all
Reply to author
Forward
0 new messages