* Respond to Lumino events
(msg: any, _super: any)
| 927 | * Respond to Lumino events |
| 928 | */ |
| 929 | _processLuminoMessage(msg: any, _super: any) { |
| 930 | _super.apply(this, arguments); |
| 931 | var that = this; |
| 932 | switch (msg.type) { |
| 933 | case "before-attach": |
| 934 | // Render an initial empty figure. This establishes with |
| 935 | // the page that the element will not be empty, avoiding |
| 936 | // some occasions where the dynamic sizing behavior leads |
| 937 | // to collapsed figure dimensions. |
| 938 | var axisHidden = { |
| 939 | showgrid: false, |
| 940 | showline: false, |
| 941 | tickvals: [] as any[], |
| 942 | }; |
| 943 | |
| 944 | Plotly.newPlot(that.el, [], { |
| 945 | xaxis: axisHidden, |
| 946 | yaxis: axisHidden, |
| 947 | }); |
| 948 | this.resizeEventListener = () => { |
| 949 | this.autosizeFigure(); |
| 950 | } |
| 951 | window.addEventListener("resize", this.resizeEventListener); |
| 952 | break; |
| 953 | case "after-attach": |
| 954 | // Rendering actual figure in the after-attach event allows |
| 955 | // Plotly.js to size the figure to fill the available element |
| 956 | this.perform_render(); |
| 957 | break; |
| 958 | case "after-show": |
| 959 | case "resize": |
| 960 | this.autosizeFigure(); |
| 961 | break; |
| 962 | } |
| 963 | } |
| 964 | |
| 965 | autosizeFigure() { |
| 966 | var that = this; |
nothing calls this directly
no test coverage detected