Vindaar / ggplotnim

A port of ggplot2 for Nim
https://vindaar.github.io/ggplotnim
MIT License
175 stars 15 forks source link

Experimental SDL2 backend for interactive plots #169

Closed Vindaar closed 10 months ago

Vindaar commented 10 months ago

This adds a very experimental and basic SDL2 interactive backend.

Simply compile your program with -d:experimentalSDL2. It makes ggshow available (which takes the size of the SDL2 window as optional arguments).

It creates an SDL2 window of the plot (and pauses the main thread). The only interactivity supported at the moment is zooming using the mouse. Click and hold on a rectangle zooms to that rectangle and a single click reverts the zoom.

Note: we do not catch exceptions due to invalid data ranges etc at the moment. Experiment at your own risk. :)