Skip to content

Custom Partial Bundle - Scatter3d - Not working. #5031

Closed
@mithi

Description

@mithi

I'm trying to load my own custom partial bundle, because I only need the Scatter3d. I was not successful. There might be a bug which might be related to issue: -#4883

Here's the code sandbox link and screenshot.

Screen Shot 2020-07-30 at 7 37 51 PM

I found these related issues to help me with this

Here's the sandbox of my actual project which is working fine currently because i'm using the plotly partial bundle (OK)

Screen Shot 2020-07-30 at 9 15 26 PM

Here's the sandbox where I'm using a custom partial bundle (NOT OK)

Screen Shot 2020-07-30 at 9 21 25 PM

This is the only difference between the two:

import Plotly from "plotly.js/lib/core";
import Scatter3d from "plotly.js/lib/scatter3d"
import createPlotlyComponent from "react-plotly.js/factory";
Plotly.register([Scatter3d]);

const CustomPlotly = createPlotlyComponent(Plotly);
export default CustomPlotly;

Console log errors when running on local

react_devtools_backend.js:2273 WARN: webgl setup failed possibly due to enabling preserveDrawingBuffer config. 
The device may not be supported by is-mobile module! 
Inverting preserveDrawingBuffer option in second attempt to create webgl scene.

On Chrome Version 84.0.4147.89 (Official Build) (64-bit), MacBook Pro (Retina, 13-inch, Mid 2014)
MacOs Catalina 10.15.5
Screen Shot 2020-07-30 at 8 38 59 PM

Also happens on firefox 78.0.2 (64-bit)

Screen Shot 2020-07-30 at 8 41 42 PM

Additional info # 1

I experimented with https://github.com/mithi/plotly-webpack
and was somewhat successful (I wasn't able to load the paper background)...
I found out that I can reproduce my plot having only a gzipped bundle size of ~410kb. This is significantly lower than when I use plotly.js-gl3d-dist-min - The latter has a gzipped bundle size of ~450kb

Screen Shot 2020-07-30 at 8 13 47 PM

Additional info # 2

Importing all the requirements here https://github.com/plotly/plotly.js/blob/master/lib/index-gl3d.js

    require('./scatter3d'),
    require('./surface'),
    require('./mesh3d'),
    require('./isosurface'),
    require('./volume'),
    require('./cone'),
    require('./streamtube')

produces the same error discussed above ... while Commenting out Plotly.register([Scatter3d]); Will remove the error and produce the following

Screen Shot 2020-07-30 at 8 21 02 PM

I also saw this issue which might be related #4989
But i don't know how to fix it in my case.

Any help is appreciated! Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions