Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

VS Code Extension

SeraPlot Live Preview
Live Preview

Official SeraPlot extension for Visual Studio Code — live preview, theme studio, snippets and a chart gallery.

Marketplace: https://marketplace.visualstudio.com/items?itemName=feur25.seraplot-vscode


Install

From the command palette or terminal — no browser needed:

ext install feur25.seraplot-vscode

Or from the Extensions view Ctrl+Shift+X, search SeraPlot:

Open in VS Code Marketplace →
💡 The extension auto-detects your Python environment via seraplot.pythonPath. Works on Windows, macOS and Linux.

Download the .vsix from the GitHub releases page, then install via terminal:

code --install-extension seraplot-vscode-0.6.1.vsix

Or drag the .vsix file directly into the VS Code Extensions panel.

📦 Ideal for air-gapped environments, corporate proxies, or pinning a specific version without going through the Marketplace.

Commands

IDTitleDescription
seraplot.previewSeraPlot: Live PreviewRender every sp.Chart of the current Python file in a side panel and refresh on save
seraplot.themeStudioSeraPlot: Open Theme StudioPick a palette + background, copy the generated sp.set_global_background(...) snippet
seraplot.gallerySeraPlot: Open GalleryBrowse all chart families with thumbnails and one-click code samples

The Live Preview button also appears in the editor title bar for any .py file.


Snippets

PrefixDescription
seraplot-importimport seraplot as sp
seraplot-barMinimal bar chart
seraplot-scatterScatter chart
seraplot-dashboard2x2 grid layout
seraplot-automlsp.auto_classify(...) skeleton
seraplot-driftsp.drift_detect(...) skeleton

Settings

KeyDefaultDescription
seraplot.pythonPathpythonPython interpreter used to render previews
seraplot.autoReloadtrueRe-render on save

Set seraplot.pythonPath to your project venv, e.g. ${workspaceFolder}/.venv/Scripts/python.exe on Windows or ${workspaceFolder}/.venv/bin/python on macOS / Linux.


How the preview works

  1. The active .py file is executed via runpy.run_path in a child Python process using seraplot.pythonPath.
  2. Every sp.Chart instance found in the module globals is exported with sp.export_html(chart).
  3. The HTML is concatenated and rendered inside a VS Code Webview panel.
  4. With seraplot.autoReload = true the panel re-runs automatically when the file is saved.

The preview is sandboxed in a Webview — no network access, no eval. Charts are CSP-safe (see config/csp.md).


Source

Repository: https://github.com/feur25/seraplot — folder seraplot-vscode/.

License: MIT.

Extension officielle SeraPlot pour Visual Studio Code — aperçu en direct, theme studio, snippets et galerie de graphiques.

Marketplace : https://marketplace.visualstudio.com/items?itemName=feur25.seraplot-vscode


Installation

Depuis la palette de commandes ou un terminal — sans navigateur :

ext install feur25.seraplot-vscode

Ou depuis la vue Extensions Ctrl+Shift+X, cherchez SeraPlot :

Ouvrir dans le Marketplace VS Code →
💡 L'extension détecte automatiquement votre environnement Python via seraplot.pythonPath. Fonctionne sur Windows, macOS et Linux.

Téléchargez le .vsix depuis la page des releases GitHub, puis installez via le terminal :

code --install-extension seraplot-vscode-0.6.1.vsix

Ou glissez-déposez le fichier .vsix directement dans le panneau Extensions de VS Code.

📦 Idéal pour les environnements hors ligne, les proxys d'entreprise, ou pour figer une version spécifique sans passer par le Marketplace.

Commandes

IDTitreDescription
seraplot.previewSeraPlot: Live PreviewAffiche tous les sp.Chart du fichier Python courant dans un panneau et rafraîchit à la sauvegarde
seraplot.themeStudioSeraPlot: Open Theme StudioChoisir une palette + un fond, copier le snippet sp.set_global_background(...) généré
seraplot.gallerySeraPlot: Open GalleryParcourir toutes les familles de graphiques avec aperçus et exemples de code en un clic

Le bouton Live Preview apparaît également dans la barre de titre de l'éditeur pour tout fichier .py.


Snippets

PréfixeDescription
seraplot-importimport seraplot as sp
seraplot-barGraphique en barres minimal
seraplot-scatterNuage de points
seraplot-dashboardGrille 2×2
seraplot-automlSquelette sp.auto_classify(...)
seraplot-driftSquelette sp.drift_detect(...)

Paramètres

CléDéfautDescription
seraplot.pythonPathpythonInterpréteur Python utilisé pour les aperçus
seraplot.autoReloadtrueRe-rendu à chaque sauvegarde

Pointer seraplot.pythonPath vers le venv du projet, par exemple ${workspaceFolder}/.venv/Scripts/python.exe sous Windows ou ${workspaceFolder}/.venv/bin/python sous macOS / Linux.


Fonctionnement de l'aperçu

  1. Le fichier .py actif est exécuté via runpy.run_path dans un processus Python enfant utilisant seraplot.pythonPath.
  2. Chaque instance sp.Chart trouvée dans les globales du module est exportée avec sp.export_html(chart).
  3. Le HTML est concaténé et rendu dans un panneau Webview de VS Code.
  4. Avec seraplot.autoReload = true, le panneau se relance automatiquement à chaque sauvegarde du fichier.

L'aperçu est sandboxé dans un Webview — pas d'accès réseau, pas d'eval. Les graphiques sont CSP-safe (voir config/csp.md).


Code source

Dépôt : https://github.com/feur25/seraplot — dossier seraplot-vscode/.

Licence : MIT.