benbria / d3.chart.bubble-matrix

A bubble-matrix chart based on d3.chart
MIT License
55 stars 10 forks source link

Uncaught TypeError: Cannot read property 'indexOf' of undefined #5

Closed trobrock closed 9 years ago

trobrock commented 9 years ago

On a mobile device when I rotate the device I get the titled error on the last line of this code:

function _onModeChange() {

    var chart = this;

    for(var layerName in chart._layersArguments) {

      // is this chart in the current mode?
      var layerArgs = chart._layersArguments[layerName];

      // if this layer should not exist in the current mode
      // unlayer it and then save it so we can reattach it 
      // later.
      if (layerArgs.options.modes.indexOf(chart.mode()) === -1) {

It seems like it doesnt cause the code to fully crash, I'm not too familiar with the internals of this code and am hoping for some guidance on what this might be, or if anyone else has already seen this.

trobrock commented 9 years ago

It looks like this is related to the "modes" functionality of d3.chart.base. I'll send a PR with a fix.

trobrock commented 9 years ago

This is fixed with #6