score:1
Accepted answer
try adding a $scope.$apply() after $scope.d3data = data;
$scope.d3data = data;
$scope.$apply();
if this doesn't work, you can always pass a function down into the directive and set it to update the data and then manually call it from the controller:
so controller logic:
$scope.updatedirective = function () {}; // this will be overridden in directive
directive logic:
scope: {
data: '=',
update: '&updatedirective'
label: '@'
}
scope.updatedirective = function () {
scope.render(scope.data); // call to update function
};
markup:
<div class="col-md-6">
<div class="module">
<div class="inner-module" ng-controller="downloadscloudctrl">
<div class="module-graph">
<d3-cloud data="d3data" update-directive="updatedirective"></d3-cloud>
</div>
</div>
</div>
</div>
Source: stackoverflow.com
Related Query
- Angular data issue- not sure how to troubleshoot
- How to render a directive only after data is loaded from tsv in angular js
- dc.js to plot line chart, How to break line if data is not present
- How to make sure text in treemap cell do not overflow?
- Angular directive async data not binding?
- How to fix a display issue in a multiple line graph. The svg.append("path") is not displaying anything
- How to show the unhighlighted/ not selected data points on scatter plots when using brush/group in dc.js? And is multiple brushes possible in dc.js
- How to draw a multi line series graph using d3.js with json data using angular directives
- How to refresh D3 tree, even though data has not changed?
- D3 - path outputs 0px by 0px - map won't show up - not sure how to use projection for this
- Angular 1.5: How to pass async data to child component
- Angular - how do I get data to load with ngOnChanges
- How to solve the undefined data issue when calling d3.layout.histogram().bins(...)(...)
- How to make sure that all data are pushed to the array before resolving promise?
- Not sure how to interpret D3 API
- D3 Charts, How to iterate through Json data NOT from file?
- d3 line chart x, y not in the same level of a data structure, how to set x, y function?
- How do I make sure that data is passed correctly in d3 on drag?
- How do I auto generate domain & range? Anyone know why my data is not showing up?
- How to update (but not redraw) a d3-geomap with new data
- how to change data via key not index in a dropdown in d3
- Angular How to use data from json in c3?
- How to implement hierarchical X-axis Bar chart in my angular JS application. The Bar should have +/- to open/close the hierarchical data like below
- how to send data to html in Angular using d3.js after on click piechart slice
- Data passed to angular d3 directive not arriving in time
- d3 issue with getting data out of a table created from a variable (works in D3.js v3.5.5 but not in v4.2.2)
- How to send dynamic data to c3chart angular line chart
- how to use string values as axis ticks properly in d3js? Not able to map data correctly can't figure out whats wrong in this code
- angular nvd3 xAxisTickFormatFunction updating the data which I do not want
- Understanding how D3.js binds data to nodes
More Query from same tag
- text elements not visible when appended from function
- Trying to add background images to D3 circles
- How to format brushed time axis (with context-dependent values)
- D3 SVG transform rotation transition behaving weirdly
- D3.js Bar Chart axis label having select box
- D3.js zoom and touch device smoothness
- How to add Tooltips to d3 Bar Graph?
- nvd3 Box Plot with Dates
- Translating mouse-over text in NVD3.js
- d3 - sine wave with circles, the problem is that circles are overlapped in curves
- IO Error in d3py example code -- no such file or directory: 'static/d3.js'
- D3 treeview - start with collapsed nodes
- Removing duplicate edges from an array for a d3 force directed graph
- converting from d3 3.0 to 4.0 x axis not displaying
- SVG text path not working correctly in IE
- javascript/D3 quirk?
- D3.js nodes set bgcolor from array but never adjacent
- D3 custom curve: bundle interpolation for areas
- How can I get the tick values of a '.nice()'ed scale?
- Point along path interpolation translate function
- Trouble with getting a bubble chart working in d3
- Can I update DOM elements in a D3 selector based on a data join to a different data object?
- Don't get AngularJS and D3 to work - SVG Element is there but no chart is generated
- Changing Edge color with D3
- How to modify a d3 force layout with voronoi polygons to trigger events on grouped elements?
- How do you access an array of Objects using D3?
- R2D3 as compared to D3.js
- javascript d3 selectAll transform to loop
- Fixing color to each path for donut in d3js
- d3 drag multiple text elements inside a group SVG