angular-plotly icon indicating copy to clipboard operation
angular-plotly copied to clipboard

Adjust size in percent

Open hackermd opened this issue 8 years ago • 1 comments

Is there a way to adjust the size of the figure element in %?

e.g.:

layout.height = '100%';
layout.width = '100%';

hackermd avatar Jul 11 '16 19:07 hackermd

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?

kbzowski avatar Sep 13 '16 14:09 kbzowski