(options: VisualUpdateOptions)
| 194 | } |
| 195 | |
| 196 | public update(options: VisualUpdateOptions) { |
| 197 | // console.log('Visual update', options); |
| 198 | |
| 199 | this.renderingOptions = options; |
| 200 | this.events.renderingStarted(this.renderingOptions); |
| 201 | |
| 202 | if (this.fetchMoreTimer) { |
| 203 | clearTimeout(this.fetchMoreTimer); |
| 204 | } |
| 205 | |
| 206 | if (!capabilities.webgl) { |
| 207 | this.app.unload(); |
| 208 | return; |
| 209 | } |
| 210 | |
| 211 | const dataView = options && options.dataViews && options.dataViews[0]; |
| 212 | if (!dataView || !dataView.table) { |
| 213 | this.app.unload(); |
| 214 | } else { |
| 215 | this.columns = dataView.metadata.columns; |
| 216 | let doneFetching = true; |
| 217 | if (dataView.metadata.segment) { |
| 218 | doneFetching = !this.host.fetchMoreData(); |
| 219 | } |
| 220 | this.app.fetchStatus(dataView.table.rows.length, !doneFetching); |
| 221 | if (doneFetching) { |
| 222 | this.show(dataView); |
| 223 | } else { |
| 224 | this.fetchMoreTimer = window.setTimeout(() => { |
| 225 | // console.log('Visual fetchMoreTimeout', options); |
| 226 | |
| 227 | this.app.fetchStatus(dataView.table.rows.length, false); |
| 228 | this.show(dataView); |
| 229 | |
| 230 | }, Visual.fetchMoreTimeout); |
| 231 | } |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | show(dataView: powerbiVisualsApi.DataView) { |
| 236 | this.settings = Visual.parseSettings(dataView); |
nothing calls this directly
no test coverage detected