Git Product home page Git Product logo

Comments (8)

etpinard avatar etpinard commented on May 4, 2024

plotly.js is a heavy user of browserify transforms, not just glslify. Adapting the build tasks to other build systems won't be easy.

May I ask, in what context are you trying to build plotly.js?

If you can't make the switch to browserify, maybe you should consider including plotly.js in a separate <script> tag than the rest of your code. Note that plotly.js exports the global Plotly.

I hope this helps.

from plotly.js.

justinwoo avatar justinwoo commented on May 4, 2024

I'm using webpack, since I have a lot of other things (e.g. loaders for babel, Elm, SASS) that I use with it and make a lot of use of the features there. Besides existing webpack loader work, there's some personal preference and other reasons why I don't want to use browserify.

I also ran into a problem with trying to just bundle the dist build and conflicts with the global Plotly. It'd be nicer if we just had a UMD build or something, I think, but it's not a huge priority for me.

from plotly.js.

Hypercubed avatar Hypercubed commented on May 4, 2024

@justinwoo See #14, dist/plotly.js is UMD but broken ATM. Removing the last line allowed me to use the bundle with JSPM/SystemJS. Might also work for webpack.

from plotly.js.

trebor avatar trebor commented on May 4, 2024

@Hypercubed, ya, as far as i can tell that last line (dist/plotly.js:83327) is the only thing that limits use with requirejs. with a shim, i get what appears to be a good plotly object. i get the nasty error though.

from plotly.js.

Hypercubed avatar Hypercubed commented on May 4, 2024

I'd also kindly suggest that d3 be removed from the bundle. I believe many of use will already have a copy of d3 installed, an additional copy in the bundle is redundant. Of course documentation would need to be clear that d3 should be added as a peer.

from plotly.js.

etpinard avatar etpinard commented on May 4, 2024

I'd also kindly suggest that d3 be removed from the bundle

This will not happen I'm afraid.

We chose to have an all-in-one bundle for simplicity and robustness (as d3 in notoriously bad at following semver).

Note that d3 is exported onto the Plotly object. I'd would recommend removing your <script src="d3"> tag and using Plotly.d3 instead d3 (or equivalently mapping window.d3 = Plotly.d3 after importing plotly.js).

from plotly.js.

etpinard avatar etpinard commented on May 4, 2024

Fixed in v1.1.0

See webpack example: https://gist.github.com/etpinard/f3d44dab330785368534

from plotly.js.

mdtusz avatar mdtusz commented on May 4, 2024

A webpack field has been added to the package.json so that you can use plotly.js with webpack as normal. You will see a warning when webpack builds your bundle because it is using the distribution version of plotly.js, but this is unavoidable at the moment.

from plotly.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.