dmachat / angular-datamaps

Angular directive for d3 Datamaps
MIT License
60 stars 30 forks source link

Map not refreshing on data / type change #12

Open Peege151 opened 9 years ago

Peege151 commented 9 years ago

I've created a simple ng-click Changing the values and map type, but the map doesn't actually change.

Controller:

$scope.setMapUSA = function(){
    $scope.map.data[0].values[0].value = 0
    $scope.map.type = 'usa'
}

HTML:

<section id="home" ng-controller="HomeController">
        <div datamap resize
          class="pangea-wrap"
          options="map.options"
          data="map.data"
          colors="map.colors"
          type=" {{map.type}}"
          on-click="logCountry"
          >
        </div>
</section>
dmachat commented 9 years ago

I think this is a Datamaps limitation. see https://github.com/markmarkoh/datamaps/issues/178

It's possible that the directive could reinitialize the Datamaps object to achieve, but it is currently not supported.