Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding mapLoaded event to tile_map visualization #8372

Merged
merged 3 commits into from
Sep 22, 2016

Conversation

ppisljar
Copy link
Member

@ppisljar ppisljar commented Sep 20, 2016

adding mapLoaded event to tile_map visualization.

update: i added rendered event to each chart and renderComplete event which is fired once all the charts have been rendered.

we can now attach listener to Vis

const vis = new Vis(element, params);
vis.on('renderComplete', () => {
   console.log('visualization is now ready');
});
vis.render(data, uistate);

@epixa
Copy link
Contributor

epixa commented Sep 21, 2016

This isn't a blocker for 5.0.0

@epixa epixa removed the blocker label Sep 21, 2016
@ppisljar
Copy link
Member Author

ppisljar commented Sep 21, 2016

sorry ... its a blocker for the visualization detection in Reporting

@spalger spalger self-assigned this Sep 21, 2016
@@ -116,14 +116,22 @@ export default function HandlerBaseClass(Private) {
});

// render the chart(s)
selection.selectAll('.chart')
.each(function (chartData) {
this.loadedCount = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to expose this on this? I would rather it just be local variable.

chart.events.on('rendered', () => {
self.loadedCount++;
if (self.loadedCount === chartSelection.length) {
charts[0].events.emit('renderComplete');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why this is using charts[0] in a comment in the code? I would expect this to happen at a higher level.

@spalger
Copy link
Contributor

spalger commented Sep 22, 2016

LGTM

@ppisljar ppisljar merged commit 5b28367 into elastic:master Sep 22, 2016
elastic-jasper added a commit that referenced this pull request Sep 22, 2016
---------

**Commit 1:**
adding mapLoaded event to tile_map visualization

* Original sha: e198f41
* Authored by ppisljar <[email protected]> on 2016-09-20T10:22:43Z

**Commit 2:**
adding rendered event to each chart and renderComplete to vis

* Original sha: 8324f5a
* Authored by ppisljar <[email protected]> on 2016-09-20T17:54:52Z

**Commit 3:**
fixing based on Spencers comments

* Original sha: b4780fe
* Authored by ppisljar <[email protected]> on 2016-09-22T07:24:19Z
elastic-jasper added a commit that referenced this pull request Sep 22, 2016
---------

**Commit 1:**
adding mapLoaded event to tile_map visualization

* Original sha: e198f41
* Authored by ppisljar <[email protected]> on 2016-09-20T10:22:43Z

**Commit 2:**
adding rendered event to each chart and renderComplete to vis

* Original sha: 8324f5a
* Authored by ppisljar <[email protected]> on 2016-09-20T17:54:52Z

**Commit 3:**
fixing based on Spencers comments

* Original sha: b4780fe
* Authored by ppisljar <[email protected]> on 2016-09-22T07:24:19Z
ppisljar added a commit that referenced this pull request Sep 22, 2016
ppisljar added a commit that referenced this pull request Sep 22, 2016
@ppisljar ppisljar deleted the fix/vislibRenderedEvent branch September 22, 2016 16:23
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
---------

**Commit 1:**
adding mapLoaded event to tile_map visualization

* Original sha: 0f673d7c14ee9fa638b7f284f5254ef570f17c93 [formerly e198f41]
* Authored by ppisljar <[email protected]> on 2016-09-20T10:22:43Z

**Commit 2:**
adding rendered event to each chart and renderComplete to vis

* Original sha: 39530305081240930e33369de64db51fd68e7fc5 [formerly 8324f5a]
* Authored by ppisljar <[email protected]> on 2016-09-20T17:54:52Z

**Commit 3:**
fixing based on Spencers comments

* Original sha: fabc53d93bde22909ee696a5d18ce21434e0d638 [formerly b4780fe]
* Authored by ppisljar <[email protected]> on 2016-09-22T07:24:19Z


Former-commit-id: c064f87
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants