Open hackermd opened 8 years ago
Typical solution in pure JS would be:
var d3 = Plotly.d3;
var WIDTH_IN_PERCENT_OF_PARENT = 60,
HEIGHT_IN_PERCENT_OF_PARENT = 80;
var gd3 = d3.select('#plot');
var gd = gd3.node();
Plotly.d3.json('grain_and_forces.json', function(figure){
Plotly.plot(gd, figure['data'], figure['layout']);
});
window.onresize = function() {
Plotly.Plots.resize(gd);
};
How to do it in angular?
Is there a way to adjust the size of the figure element in
%
?e.g.: