(dataView: powerbiVisualsApi.DataView)
| 233 | } |
| 234 | |
| 235 | show(dataView: powerbiVisualsApi.DataView) { |
| 236 | this.settings = Visual.parseSettings(dataView); |
| 237 | const oldData = this.app.getDataContent(); |
| 238 | const temp = convertTableToObjectArray(dataView.table, oldData, this.host); |
| 239 | const { data } = temp; |
| 240 | let { different } = temp; |
| 241 | if (!this.prevSettings) { |
| 242 | different = true; |
| 243 | } |
| 244 | |
| 245 | this.app.setChromeless(!this.settings.sandDanceMainSettings.showchrome); |
| 246 | this.app.changeTheme(this.settings.sandDanceMainSettings.darktheme); |
| 247 | |
| 248 | const wasSignalChange = this.persistAction.signalChange; |
| 249 | this.persistAction = {}; |
| 250 | |
| 251 | this.prevSettings = util.clone(this.settings); |
| 252 | |
| 253 | if (!different || wasSignalChange) { |
| 254 | // console.log('Visual update - not different'); |
| 255 | return; |
| 256 | } |
| 257 | |
| 258 | const { sandDanceConfig } = this.settings; |
| 259 | |
| 260 | let snapshots: SandDance.types.Snapshot[] = []; |
| 261 | if (sandDanceConfig.snapshotsJSON) { |
| 262 | try { |
| 263 | snapshots = JSON.parse(sandDanceConfig.snapshotsJSON); |
| 264 | } catch (e) { |
| 265 | // continue regardless of error |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | let tooltipExclusions: string[] = []; |
| 270 | if (sandDanceConfig.tooltipExclusionsJSON) { |
| 271 | try { |
| 272 | tooltipExclusions = JSON.parse(sandDanceConfig.tooltipExclusionsJSON); |
| 273 | } catch (e) { |
| 274 | // continue regardless of error |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | this.app.load( |
| 279 | data, |
| 280 | columns => { |
| 281 | if (!columns) return; |
| 282 | |
| 283 | // remove column which contains powerbi selectionId |
| 284 | for (let i = 0; i < columns.length; i++) { |
| 285 | if (SandDance.util.isInternalFieldName(columns[i].name)) { |
| 286 | columns.splice(i, 1); |
| 287 | i--; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | let insight: Partial<SandDance.specs.Insight>; |
| 292 |
no test coverage detected