MCPcopy Create free account
hub / github.com/Datakitpage/Datakit / containsPlotting

Function containsPlotting

frontend/src/lib/python/executor.ts:290–301  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

288 * Check if code contains plotting commands
289 */
290export function containsPlotting(code: string): boolean {
291 const plottingPatterns = [
292 /plt\.(plot|bar|scatter|hist|show|figure)/,
293 /sns\.(plot|bar|scatter|hist)/,
294 /plotly\.(graph_objects|express)/,
295 /\.plot\(/,
296 /\.hist\(/,
297 /\.scatter\(/,
298 ];
299
300 return plottingPatterns.some((pattern) => pattern.test(code));
301}
302
303/**
304 * Validate Python code syntax

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected