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

Visualization Request/Response handler changes #24396

Closed
timroes opened this issue Oct 23, 2018 · 0 comments
Closed

Visualization Request/Response handler changes #24396

timroes opened this issue Oct 23, 2018 · 0 comments
Labels
release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:Visualizations Visualization editors, elastic-charts and infrastructure v6.5.0 v7.0.0

Comments

@timroes
Copy link
Contributor

timroes commented Oct 23, 2018

This issue is purely meant for documentation some developer changes, so it will be pulled into the automatically generated blog post.

Dev-Docs

Visualization Request/Response Handlers

Visualizations request and response handlers have been refactored and thus a couple of changes are required for plugins that provide custom visualizations, no matter if they used a custom request or response handler or not.

Related PRs: #19061, #22583

New tabify format

The default so called tabify format (tabular representation of data) has changed towards the following structure:

{
  columns: [
    {
      aggConfig: AggConfig,
      id: 'column1',
      title: 'column title',
    },
    //...
  ],
  rows: [
    {
      column1: 10,
      column2: 'sample',
    },
    //...
  ]
}

The main difference is, that each row is no longer an array of values, but an object where the key is the column id and the value the value for that column.

Request handlers

The default (courier) request handler will now return this new tabify format, instead of a raw elasticsearch response.

In case your plugin provides a custom request handler, we're recommending to return that tabified format too. This is not required at the moment, but makes it easier for your plugin to adjust to upcoming changes.

Response handlers

The old tabify response handler has been removed, since the default request handler now returns that tabified format. The default response handler is now none which just pass through the request handlers result.

Also the response handler doesn't recieve a vis parameter anymore, but only a single parameter which holds the tabified data.

Legacy response handler

For an easier conversion you can still use the old tabify format, by setting responseHandler: 'legacy' in your visualization type registration. This response handler converts the new tabify format to the old format.

The legacy response handler is deprecated! You should only switch to this in case you can't (immediately) update your visualization easily to the new tabify format. We will remove the legacy response handler in 7.0.

Basic response handler

The basic response handler has been renamed to vislib.

You should NOT use this response handler outside of Kibana.

@timroes timroes added v7.0.0 v6.5.0 release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Oct 23, 2018
@timroes timroes closed this as completed Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:Visualizations Visualization editors, elastic-charts and infrastructure v6.5.0 v7.0.0
Projects
None yet
Development

No branches or pull requests

1 participant