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

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


Install

Marketplace

ext install feur25.seraplot-vscode

Or from the Extensions view: search for SeraPlot.

From a .vsix

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

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.


Installation

Marketplace

ext install feur25.seraplot-vscode

Ou depuis la vue Extensions : rechercher SeraPlot.

Depuis un .vsix

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

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.