Skip to content

Conversation

VaradhaCodes
Copy link
Contributor

@VaradhaCodes VaradhaCodes commented Sep 21, 2025

Complete overhaul of the Python plotting module with modern UI and new features

What this does

This completely rewrites eSim's plotting interface from scratch. The old pythonPlotting.py was a massive 810-line file that had grown into an unmaintainable mess over time. I've broken it down into clean, separate modules and added a bunch of features that users have been missing.

The transformation

Before: One giant file doing everything
After: Clean modular structure with:

  • plot_window.py - Main plotting interface
  • data_extraction.py - Handles all the simulation data processing
  • plotting_widgets.py - Reusable UI components
  • Updated NgspiceWidget.py - Better integration

Before vs After Comparison

Original interface

Old interface with basic functionality

New modernized interface

New interface with enhanced features

New Features

Visual Waveform Selection

The biggest improvement is ditching those plain checkboxes for color-coded icons that show exactly which trace is which color. When you're dealing with circuits that have dozens of signals, this makes finding and selecting the right waveforms way more intuitive.

Old waveform selection

Old: Separate checkboxes and color labels

New visual waveform selection

New: Integrated color icons with search box

Search and Filtering

You can now search through your waveforms in real-time. Type "clk" and instantly see only clock-related signals. No more scrolling through endless lists trying to find what you need.

Context Menu System

Right-click any waveform to access customization options. Change colors using a visual palette, adjust line thickness, switch between solid/dashed/dotted styles, or hide traces you don't need.

Context menu with color picker
Visual color palette for quick customization

Line style options
Line style options (solid, dashed, dotted, step)

Interactive Cursor Measurements

Dual-cursor system that automatically calculates time differences, frequencies, and delta values. Click to place cursors anywhere on your plots and get instant precision measurements for timing analysis.

Cursor measurements in action
Automatic delta time and frequency calculations between cursors

Digital Timing Diagram Mode

Proper digital timing diagrams with configurable logic thresholds and voltage annotations. Perfect for analyzing digital circuits with clear high/low states and actual voltage readings at trace endpoints.

Digital timing controls

Threshold and spacing controls

Digital timing diagram

Digital timing view with voltage annotations

Smart Console Management

The console area automatically collapses when you open plotting tools, giving you maximum screen space for analysis. It expands back when you need to see simulation output or debug information.

Normal console layout

Normal layout with console visible

Auto-collapsed console

Auto-collapsed console for more plot space

Collapsible Interface Panels

Side panels can be collapsed to maximize your plot viewing area when you're focused on analysis, then expanded when you need access to controls and settings.

Collapsed interface panels

Collapsed panels for maximum plot space

Expanded interface panels

Expanded panels for full functionality

Configuration Persistence

Your preferences (trace colors, grid settings, measurement units) now save automatically and persist between sessions. No more reconfiguring everything each time you restart eSim.

Enhanced Export Capabilities

Export plots in multiple formats (PNG, SVG, PDF) with publication-quality settings. Includes proper DPI settings and clean formatting for papers and presentations.

Improved Error Handling

Comprehensive error handling with structured logging means fewer crashes and better debugging information when things go wrong.

Technical Improvements

Modular Architecture

The new structure separates data processing from UI logic, making the code much easier to maintain and extend. Each module has a single responsibility and clear interfaces.

Type Annotations

Full type hints throughout the codebase improve code readability and enable better IDE support for future development.

Memory Efficiency

Optimized data structures and intelligent refresh algorithms reduce memory usage, especially important when working with large simulation datasets.

Responsive Design

Proper size policies ensure the interface scales correctly across different screen sizes and window configurations.

Why this matters

The plotting module is where users spend most of their time analyzing simulation results. The old interface worked but felt dated and clunky. This modernization brings eSim's plotting up to current standards while making future development much more manageable.

The modular structure means adding new analysis features or UI improvements no longer requires surgery on a massive monolithic file.

Backward compatibility

All existing eSim projects continue to work exactly as before. These are purely under-the-hood improvements and new features that don't break existing functionality.

Integration Suggestion

Given the scope of this refactor, I recommend creating a feature branch (e.g., feature/plotting-refactor) for testing before merging to master.


Part of my FOSSEE Summer Fellowship 2025 at IIT Bombay - Full Technical Report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant