import type { Interface } from './types';

/**
 * Build a blank "plot panel": a special interface whose viewport is filled by
 * plots arranged in a recursive split layout. It starts with a single
 * full-viewport plot; the user splits panes and drops signals in the editor.
 */
export function newPlotPanel(): Interface {
  const wid = `w${Date.now()}`;
  return {
    id: '',
    name: 'New Plot Panel',
    version: 1,
    w: 1200,
    h: 800,
    kind: 'plot',
    layout: { type: 'leaf', widget: wid },
    widgets: [
      {
        id: wid,
        type: 'plot',
        x: 0,
        y: 0,
        w: 800,
        h: 500,
        signals: [],
        options: { plotType: 'timeseries', timeWindow: '60', legend: 'bottom' },
      },
    ],
  };
}
