Cannot read property 'rippleEffect' of undefined
Pratyush1197 opened this issue · 4 comments
I have set up express.js for the application but when I try to open sunburst I am getting the error Uncaught TypeError: Cannot read property 'rippleEffect' of undefined.
can you post your code here or a live example of it?
Yeah here it is-
`
<div class="primary-nav">
<nav role="navigation" class="menu">
<a href="#" class="logotype">LOGO<span>TYPE</span></a>
<div class="overflow-container">
<%
for (var i = 0; i < items.length; i++){
var value = '';
value = items[i].split('/')[6] %>
<li id="qw" onclick="wave.play();" data-val='<%= value %>'class="editField"><%= value %></li>
<% } %>
</div>
</nav>
</div>
<div id="chart-container" style="width: 100%; top: 00px; height: 100vh; padding: none; position: absolute;">
<script>
let wave = new CircularAudioWave(document.getElementById('chart-container'), {mode: 'sunburst'});
$( "li" ).click(function() {
var sel2 = 'audio/audio.mp3';
var sel1 = ($(this).data('val'));
sel2 = 'audio/' + sel1;
wave.loadAudio(sel2);
});
</script>
Some places that I think may cause the error:
-
There are two click binding events -
onclick
onli
and$( "li" ).click
. I think you are planning to have ali
for different audios? You will need different waves to store the audios and callwaves[i].play()
forli
. -
The audios should be loaded first before the click event, not during the click event, like the example:
circular-audio-wave/demo/sunburst.html
Lines 9 to 12 in 20189d0
- value of
sel2
is expected to be something likeaudio/audio1.mp3
? Better to check the logic ifsel1
or express is getting the correct value
Thanku so much it is working now