-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] Initialize visualization with datasource api #38142
Merged
flash1293
merged 18 commits into
elastic:feature/lens
from
flash1293:lens/datasource-in-vis
Jun 7, 2019
Merged
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7ae8d66
Basic xy chart suggestions
chrisdavies 6e4d523
Re-apply XY config panel after force merge
chrisdavies a57f406
Merge upstream
chrisdavies 0a9facd
Tweaks per Wylie's feedback
chrisdavies 291883c
Merge branch 'feature/lens' of github.com:elastic/kibana into lens/xy…
chrisdavies be86ff3
Add xy chart internationalization
chrisdavies 18efd00
Update xy chart i18n implementation
chrisdavies 1fe793b
Fix i18n id
chrisdavies 7a04220
Merge upstream
chrisdavies 91691fb
pass datasource api into visualization init
flash1293 dbd98fc
fix type errors
flash1293 60408c5
Merge branch 'feature/lens' into lens/datasource-in-vis
flash1293 1a0ac97
fix test
flash1293 9983e86
Merge branch 'feature/lens' into lens/datasource-in-vis
flash1293 64a8951
switch initialize parameters
flash1293 08a7a80
Merge branch 'feature/lens' into lens/datasource-in-vis
flash1293 d4f4ea5
fix test
flash1293 54cc54a
fix snapshot
flash1293 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but I do find it hard to follow the chain of useEffects and how each affects the next. It might be nice to do all initialization in one place, and make it mostly linear:
initializeDatasource().then(ds => initializeVisualization(undefined, ds)).then(...)
Obviously, not that ^^^ but something more direct and easier to reason about would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. I did it like this to avoid creating the public datasource API in two separate places and flatten out the whole thing a bit.
We could initialize the datasource api separately and move everything into one effect like this:
But IMHO this doesn't make the flow much clearer. I'm going to merge it in the current state and we can discuss this today, but I suspect this init logic will change again when Wylie is going to look into the "switch visualization" flow.