Dashboards & Visualizations

Trying to load a d3 library in a JavaScript wrapper, why am I getting a script error?

edrivera3
Builder

Hi

I am trying to load d3 library in a js wrapper, but I am encountering an error. I believe the cause of the problem is a wrong path. The js wrapper and the d3,js are located at apps/myappname/django/myappname/static/myappname.

This is the beginning of the wrapper:

define(function(require, exports, module) {
    var _ = require('underscore');
    var d3 = require(["d3.js"]);
    var mvc = require('splunkjs/mvc');
    var SimpleSplunkView = require('splunkjs/mvc/simplesplunkview');
    ...
    ...

This is the error displayed on the console:

Script error for: d3.js  http://requirejs.org/docs/errors.html#scripterror
0 Karma
1 Solution

edrivera3
Builder

Hi

I solved my problem:

var d3 = require('myappname/d3');

Note: This works if you are using Django Binding.

View solution in original post

0 Karma

edrivera3
Builder

Hi

I solved my problem:

var d3 = require('myappname/d3');

Note: This works if you are using Django Binding.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...