Skip to main content
Deno 2 is finally here 🎉️
Learn more


Deplot

Simple and complete Plot gui module for Deno local scripts to provide a helper for science computing.

deno module deno compatibility vr scripts deno doc

Dependencies

Use Webview for window managing and plots libraries for tracing.

WARNING: Still under active development, GChart is not supported, deplot.screenshot and deplot.update neither. Require internet connection until UI caching is not fixed.

Usage

All the modules are exposed in mod.ts

import { Datas, Deplot, Plotly } from 'https://deno.land/x/deplot/mod.ts';

const deplot = new Deplot('Plotly');

const trace: Plotly.Data = {
  x: ['Zebras', 'Lions', 'Pelicans'],
  y: [90, 40, 60],
  type: 'bar',
  name: 'New York Zoo',
};

const layout: Partial<Plotly.Layout> = {
  title: 'Hide the Modebar',
  showlegend: true,
};

const datas: Datas = { data: [trace], layout, config: { editable: true } };

deplot.plot(datas, { title: 'My plot', size: [800, 600] });

const trace2: Plotly.Data = {
  x: [1, 2, 3, 4, 5],
  y: [4, 0, 4, 6, 8],
  mode: 'lines+markers',
  type: 'scatter',
};

const datas2 = { data: [trace2], layout };

deplot.plot(datas, { title: 'My second plot', size: [450, 450] });

Documentation

Examples

Plotly.js

deno run --allow-read --allow-write --allow-net --allow-run --allow-env --allow-ffi --unstable --no-check https://deno.land/x/deplot/examples/plotly.ts

Chart.js

deno run --allow-read --allow-write --allow-net --allow-run --allow-env --allow-ffi --unstable --no-check https://deno.land/x/deplot/examples/chartjs.ts