* Render data into a visualization. * @param insight Object to create a visualization specification. * @param data Array of data objects. * @param view Optional View to specify camera type. * @param ordinalMap Optional map of ordinals to assign to the data such that the same cube
(insight, data, options = {})
| 9617 | * @param view Optional View to specify camera type. |
| 9618 | * @param ordinalMap Optional map of ordinals to assign to the data such that the same cubes can be re-used for new data. |
| 9619 | */ render(insight, data, options = {}) { |
| 9620 | return __awaiter(this, void 0, void 0, function*() { |
| 9621 | let result; |
| 9622 | //see if refine expression has changed |
| 9623 | if (!_searchExpression.compare(insight.filter, this.insight.filter)) { |
| 9624 | const allowAsyncRenderTime = 100; |
| 9625 | if (insight.filter) { |
| 9626 | //refining |
| 9627 | result = yield this._render(insight, data, options, true); |
| 9628 | this.presenter.animationQueue(()=>{ |
| 9629 | this.filter(insight.filter, options.rebaseFilter && options.rebaseFilter()); |
| 9630 | }, allowAsyncRenderTime, { |
| 9631 | waitingLabel: "layout before refine", |
| 9632 | handlerLabel: "refine after layout" |
| 9633 | }); |
| 9634 | } else { |
| 9635 | //not refining |
| 9636 | this._dataScope.setFilteredData(null); |
| 9637 | result = yield this._render(insight, data, options, true); |
| 9638 | this.presenter.animationQueue(()=>{ |
| 9639 | this.reset(); |
| 9640 | }, allowAsyncRenderTime, { |
| 9641 | waitingLabel: "layout before reset", |
| 9642 | handlerLabel: "reset after layout" |
| 9643 | }); |
| 9644 | } |
| 9645 | } else result = yield this._render(insight, data, options, false); |
| 9646 | return result; |
| 9647 | }); |
| 9648 | } |
| 9649 | shouldViewstateTransition(newInsight, oldInsight) { |
| 9650 | if (!oldInsight.columns) return false; |
| 9651 | if (oldInsight.chart !== newInsight.chart) return true; |
no test coverage detected