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

[PoC] visdata interpreter function #33674

Closed
wants to merge 3 commits into from

Conversation

ppisljar
Copy link
Member

@ppisljar ppisljar commented Mar 21, 2019

Summary

POC for visdata interpreter function

visdata id="saved-vis-id"

it will return datatable, or throw error if saved visualization is not table based (markdown, vega, tsvb, timelion)

if visualization requires a time range prepend expression with filters | and add a time picker to workpad.

currently it has no UI, but that would probably be easy for someone from canvas team to add (should show a dropdown or sth with all saved visualziations (or maybe even the ones that don't return datatable filtered out)

PS: changing the code to not set tableOnly to true and changing functions type to render will make this render all the visualizations (also checks for data.rows should be removed)

@lukeelmers this required few hacks to visualize loader:

  • we don't need dom element to get the data, also we shouldn't auto render
  • hack inside visualize_data_loader to return the table and stop
  • hack inside embedded visualize loader to not handle errors (custom error handler wanted)

all along the line of the new api that was discussed here: #25374

part of closing #23035

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@ppisljar ppisljar requested a review from a team as a code owner March 21, 2019 19:17
type: 'datatable',
rows: data.rows,
columns: data.columns.map(column => ({
name: column.id,
Copy link
Member Author

Choose a reason for hiding this comment

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

is there a way to pass title as well ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what the column object looks like here, but name should be the field name, not some unique identifier used by Kibana.

Also, don't forget to add the column type here, and just use 'string' if you can't detect that (but you should be able to based on the field mappings you have).

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@ppisljar ppisljar requested a review from lukeelmers March 25, 2019 10:04
@elasticmachine
Copy link
Contributor

💔 Build Failed

@ppisljar
Copy link
Member Author

ppisljar commented Apr 1, 2019

with move to using expressions in visualize this will become harder,
we don't know what data powers visualization. We could still return the response from last function returning datatable type.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@ppisljar ppisljar closed this Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants