Black Lives Matter. Please consider donating to Black Girls Code today.

Only scatter bundle

Hi folks,

the plotly basic bundle, with scatter, bar and pie is still very big.
Does somebody knows, how to custom bundle plotly with only scatter traces and how much smaller this would be?

Kind regards,

From, for example using CommonJS syntax:

// in custom-plotly.js
var Plotly = require('plotly.js/lib/core');

// this includes only the scatter trace module
module.exports = Plotly;

Then elsewhere in your code:

var Plotly = require('./path/to/custom-plotly');

Hello there,

I’m using plotly to build an RMARDOWN FLEXDASHBOARD, and I would like to improve its speed. I’ve read about the partial_bundle() function. Unfortunately, there’s no bundle defined for the traces I use: scatter, heatmat, and sunburst.

So I guess I should need to go this way, as seen in

// in custom-plotly.js var Plotly = require(‘plotly.js/lib/core’);
// Load in the trace types
module.exports = Plotly;

Then elsewhere in your code:

var Plotly = require(’./path/to/custom-plotly’);

… Ooops…

I don’t know how to make that work!!! Must I include this in my Rmardown code? Or perform it somewhere else? Sorry, no experience with JavaScript!

Thanks a lot!