Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

plotly.js

Package Overview
Dependencies
Maintainers
10
Versions
261
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plotly.js

The open source javascript graphing library that powers plotly

  • 2.5.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
159K
decreased by-25.41%
Maintainers
10
Weekly downloads
 
Created

What is plotly.js?

Plotly.js is a high-level, declarative charting library built on D3.js and stack.gl. It enables the creation of a wide variety of interactive and publication-quality charts, including line plots, scatter plots, bar charts, histograms, heatmaps, and more. It is particularly well-suited for creating complex visualizations with minimal code.

What are plotly.js's main functionalities?

Line and Scatter Plots

This feature allows you to create line and scatter plots. The code sample demonstrates how to create a simple scatter plot with Plotly.js.

const Plotly = require('plotly.js-dist');
const data = [{
  x: [1, 2, 3, 4],
  y: [10, 15, 13, 17],
  type: 'scatter'
}];
const layout = { title: 'Line and Scatter Plot' };
Plotly.newPlot('myDiv', data, layout);

Bar Charts

This feature allows you to create bar charts. The code sample demonstrates how to create a simple bar chart with Plotly.js.

const Plotly = require('plotly.js-dist');
const data = [{
  x: ['A', 'B', 'C'],
  y: [20, 14, 23],
  type: 'bar'
}];
const layout = { title: 'Bar Chart' };
Plotly.newPlot('myDiv', data, layout);

Heatmaps

This feature allows you to create heatmaps. The code sample demonstrates how to create a simple heatmap with Plotly.js.

const Plotly = require('plotly.js-dist');
const data = [{
  z: [[1, 20, 30], [20, 1, 60], [30, 60, 1]],
  type: 'heatmap'
}];
const layout = { title: 'Heatmap' };
Plotly.newPlot('myDiv', data, layout);

3D Surface Plots

This feature allows you to create 3D surface plots. The code sample demonstrates how to create a simple 3D surface plot with Plotly.js.

const Plotly = require('plotly.js-dist');
const data = [{
  z: [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
  type: 'surface'
}];
const layout = { title: '3D Surface Plot' };
Plotly.newPlot('myDiv', data, layout);

Pie Charts

This feature allows you to create pie charts. The code sample demonstrates how to create a simple pie chart with Plotly.js.

const Plotly = require('plotly.js-dist');
const data = [{
  values: [19, 26, 55],
  labels: ['A', 'B', 'C'],
  type: 'pie'
}];
const layout = { title: 'Pie Chart' };
Plotly.newPlot('myDiv', data, layout);

Other packages similar to plotly.js

Keywords

FAQs

Package last updated on 16 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc