Using RequireJS to load plotly and D3

前端 未结 3 1227
傲寒
傲寒 2021-01-21 07:22

I am trying to use RequireJS to load the plotly and d3 libraries in my js code. I have tried this:

require.config({
    paths: {
       d3: \'/static/scripts/plo         


        
3条回答
  •  遇见更好的自我
    2021-01-21 07:48

    Have you tried coupling your third Java script file with these two files. Here is a suggestion:

    require.config({
        paths: {
           d3: '/static/scripts/plotly/dependencies/d3.v3.min',
           plotly: '/static/scripts/plotly/plotly.min',
           myfile: '/stattic/scripts/myfile',
        }
    });
    
    require(['d3', 'plotly', 'myfile'], function(d3, plotly, myfile) {
        generate_heatmap();
    });
    

提交回复
热议问题