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

[Lens] Transient suggestions #44234

Merged
merged 246 commits into from
Sep 18, 2019
Merged
Changes from 1 commit
Commits
Show all changes
246 commits
Select commit Hold shift + click to select a range
1c3bfaa
[lens] Initial Commit (#35627)
May 3, 2019
11a9173
[lens] Initial state for IndexPatternDatasource (#36052)
wylieconlon May 7, 2019
38ce5a4
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon May 7, 2019
c7e0704
[lens] Editor frame initializes datasources and visualizations (#36060)
wylieconlon May 9, 2019
abc6f04
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 May 10, 2019
0dfd683
[lens][draft] Lens/drag drop (#36268)
chrisdavies May 10, 2019
dd51978
remove local package (#36456)
flash1293 May 10, 2019
3329f33
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 May 12, 2019
ddb68e2
[lens] Native renderer (#36165)
flash1293 May 12, 2019
87c1d81
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 May 20, 2019
2961d76
[Lens] No explicit any (#36515)
flash1293 May 21, 2019
83b864c
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 May 21, 2019
4581a2f
[Lens] Implement basic editor frame state handling (#36443)
flash1293 May 22, 2019
7837bd5
[lens] Load index patterns and render in data panel (#36463)
wylieconlon May 22, 2019
77bee20
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 May 23, 2019
63d59da
[draft] Lens/line chart renderer (#36827)
chrisdavies May 23, 2019
37202a5
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 May 24, 2019
3902b92
[lens] Index pattern data panel (initial) (#37015)
May 24, 2019
76556f3
[Lens] Editor state 2 (#36513)
flash1293 May 27, 2019
f88ee1e
[lens] Dimension panel that generates columns (#37117)
May 29, 2019
35a28e9
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon May 29, 2019
c3df4c2
[lens] Generate esdocs queries from index pattern (#37361)
May 29, 2019
de5bb7f
Merge branch 'origin/master' into feature/lens
wylieconlon May 30, 2019
f179ee6
Update yarn.lock from yarn kbn bootstrap
wylieconlon May 30, 2019
51996f9
Merge branch 'master' into feature/lens
flash1293 May 31, 2019
d362819
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 May 31, 2019
6575000
[Lens] Add basic Lens xy chart suggestions (#37030)
chrisdavies May 31, 2019
f67a1ba
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jun 3, 2019
9d5b3ea
[Lens] Expression rendering (#37648)
flash1293 Jun 3, 2019
bca7b17
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jun 3, 2019
98a3e69
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jun 4, 2019
b5ffb12
[Lens] Expression handling (#37876)
flash1293 Jun 5, 2019
bbf80f2
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jun 6, 2019
717eaff
[Lens] Lens/xy config panel (#37391)
chrisdavies Jun 6, 2019
21b9431
[Lens] Xy expression building (#37967)
flash1293 Jun 7, 2019
b594b6c
[Lens] Initialize visualization with datasource api (#38142)
flash1293 Jun 7, 2019
8f231d2
[lens] Dimension panel lets users select operations and fields indivi…
Jun 7, 2019
f67878e
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jun 10, 2019
142cb9d
[Lens] Rename columns (#38278)
flash1293 Jun 12, 2019
307cb12
[Lens] Lens/index pattern drag drop (#37711)
chrisdavies Jun 12, 2019
c83651c
[lens] Only allow aggregated dimensions (#38820)
Jun 14, 2019
f73057c
[lens] Suggest on drop (#38848)
Jun 14, 2019
1bba073
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jun 17, 2019
acad4e7
fix merge
flash1293 Jun 17, 2019
f780d02
[Lens] Parameter configurations and new dimension config flow (#38863)
flash1293 Jun 18, 2019
4ce7fe6
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jun 18, 2019
1f4d7ae
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jun 19, 2019
8bf1626
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jun 21, 2019
4c69044
fix eslint failure
flash1293 Jun 21, 2019
abed39a
[lens] Fix build by updating saved objects and i18n (#39391)
Jun 21, 2019
2a1eea8
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jun 21, 2019
8e1fdbf
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jun 24, 2019
33802fd
Lens basic metric visualization
chrisdavies Jun 19, 2019
85d4543
[lens] Fix arguments to esaggs using booleans (#39462)
Jun 24, 2019
02a3698
[lens] Datatable visualization plugin (#39390)
Jun 24, 2019
f5c809a
Fix merge issues, localize expression help text
chrisdavies Jun 24, 2019
55a1fe3
Merge upstream
chrisdavies Jun 24, 2019
c159b4e
Add auto-scaling to the lens metric visualization
chrisdavies Jun 20, 2019
356e9b6
Fix unit tests broken by autoscale
chrisdavies Jun 20, 2019
6aea5dc
Move autoscale to the new Lens folder
chrisdavies Jun 24, 2019
cbcabf1
[lens] Use first suggestion when switching visualizations (#39377)
Jun 24, 2019
6cb569f
[lens] Label each Y axis with its operation label (#39461)
Jun 25, 2019
306d384
[Lens] Suggestion preview rendering (#39576)
flash1293 Jun 27, 2019
2297f95
[Lens] Popover configs (#39565)
flash1293 Jun 27, 2019
95d7735
[Lens] Basic layouting (#39587)
flash1293 Jun 28, 2019
d857227
remove datasource public API in suggestions (#39772)
flash1293 Jun 28, 2019
1dd57f6
[Lens] Basic save / load (#39257)
chrisdavies Jun 28, 2019
54ae4c2
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jul 1, 2019
b7bd0cd
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jul 2, 2019
1130e56
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jul 2, 2019
6bf5018
[lens] Fix lint error
wylieconlon Jul 2, 2019
aefc18b
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jul 3, 2019
8b4807b
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jul 5, 2019
d2b8d91
[lens] Use node scripts/eslint.js --fix to fix errors
wylieconlon Jul 5, 2019
9c754fe
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jul 8, 2019
e2dc494
[lens] Include link to lens from Visualize (#40542)
Jul 9, 2019
65ab82d
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jul 10, 2019
cbccad6
[lens] Support stacking in xy visualization (#40546)
Jul 10, 2019
b0a2325
[Lens] Add xy split series support (#39726)
chrisdavies Jul 10, 2019
5c6f552
[lens] Lens Filter Ratio (#40196)
Jul 12, 2019
4e361a6
[Lens] Terms order direction (#39884)
flash1293 Jul 15, 2019
97f6818
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jul 16, 2019
d0ae61c
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jul 16, 2019
dd49f8a
fix types
flash1293 Jul 16, 2019
9202916
[Lens] Data panel styling and optimizations (#40787)
chrisdavies Jul 17, 2019
1135b3d
Merge upstream
chrisdavies Jul 17, 2019
2dc623f
Add metric preview icon
chrisdavies Jul 17, 2019
bae8a6c
Fix metric vis tests
chrisdavies Jul 17, 2019
4ee8f63
Fix metric plugin imports
chrisdavies Jul 17, 2019
218cf00
Use the operation label as the metric title
chrisdavies Jul 17, 2019
292aa40
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jul 18, 2019
9581e4e
[Lens] Optimize dimension panel flow (#41114)
flash1293 Jul 18, 2019
7933175
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jul 19, 2019
e5b7cad
[Lens] re-introduce no-explicit-any (#41454)
flash1293 Jul 19, 2019
e071976
[Lens] No results marker (#41450)
flash1293 Jul 22, 2019
1a0d705
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Jul 22, 2019
7db032c
[lens] Support layers for visualizing results of multiple queries (#4…
Jul 24, 2019
0143fcd
[Lens] Embeddable (#41361)
flash1293 Jul 25, 2019
a68aacf
[lens] Move XY chart config into popover and fix layering (#41927)
Jul 25, 2019
e60f6c7
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jul 26, 2019
3bbac9a
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jul 29, 2019
112c5b0
[Lens] Fix bugs in date_histogram and filter ratio (#42046)
flash1293 Jul 29, 2019
9ff1638
[Lens] Performance improvements (#41784)
flash1293 Jul 29, 2019
8f76203
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Jul 30, 2019
2d9fbb3
fix type error
flash1293 Jul 30, 2019
4a1c899
switch default size of terms operation to 3 (#42334)
flash1293 Jul 31, 2019
8b1105d
[lens] Improve suggestions for split series (#42052)
flash1293 Aug 2, 2019
78ea487
[lens] Add chart switcher (#42093)
chrisdavies Aug 2, 2019
d73a483
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Aug 2, 2019
b00f3df
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Aug 5, 2019
b10ddc8
solve merge conflicts
flash1293 Aug 5, 2019
c94e3fe
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Aug 5, 2019
9941757
fix test case
flash1293 Aug 5, 2019
ce1f652
[Lens] Allow only current visualization on field drop in workspace (#…
flash1293 Aug 5, 2019
79ceaa1
[Lens] Remove indexpattern id on column (#42429)
flash1293 Aug 5, 2019
b8eba00
[lens] Implement app-level filtering and time picker (#42031)
Aug 7, 2019
23d453f
[Lens] Add some tests around document handling in dimension panel (#4…
flash1293 Aug 7, 2019
13ea53e
[Lens] Terms operation boolean support (#42817)
flash1293 Aug 7, 2019
36cd955
[lens] Minor UX/UI improvements in Lens (#42852)
Aug 8, 2019
2e22935
Add missing translations (#42921)
Aug 8, 2019
a4f8c18
Merge upstream
chrisdavies Aug 8, 2019
2282946
[Lens] Config panel design (#42980)
cchaos Aug 8, 2019
59e19d9
Add metric suggestions, fix tests
chrisdavies Aug 9, 2019
629f63a
Remove a couple of non-null assertions (#43013)
Aug 9, 2019
5492e13
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Aug 9, 2019
7c9db79
[Lens] Switch indexpattern manually (#42599)
flash1293 Aug 9, 2019
27be022
[Lens] Update frame to put suggestions at the bottom (#42997)
cchaos Aug 9, 2019
eda40df
Back out suggestion changes, in lieu
chrisdavies Aug 9, 2019
55b59dd
Merge branch 'feature/lens' of github.com:elastic/kibana into lens/me…
chrisdavies Aug 9, 2019
f961fc9
fix type errors
flash1293 Aug 11, 2019
c808106
switch indexpattern on layer if there is only a single empty one (#43…
flash1293 Aug 13, 2019
65ea9e3
[Lens] Suggest reduced versions of current data table (#42537)
flash1293 Aug 13, 2019
43a9bf1
[Lens] Field formatter support (#38874)
flash1293 Aug 13, 2019
bf18d72
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Aug 13, 2019
398a3de
Fix bugs
flash1293 Aug 13, 2019
77b02a2
Merge upstream
chrisdavies Aug 13, 2019
085210c
Fix metric autoscale logic
chrisdavies Aug 13, 2019
d00ddbb
Register metric as an embeddable
chrisdavies Aug 13, 2019
8436275
Fix metric autoscale flicker
chrisdavies Aug 13, 2019
4cbf3c8
Render mini metric in suggestions panel
chrisdavies Aug 13, 2019
5065a14
Cache the metric filterOperations function
chrisdavies Aug 13, 2019
b11021b
fix auto scaling edge cases
flash1293 Aug 14, 2019
e9f5807
[Lens] Add bucket nesting editor to indexpattern (#42869)
chrisdavies Aug 14, 2019
d7bf71b
Merge pull request #9 from flash1293/lens/metric-scale-fixes
chrisdavies Aug 14, 2019
3d947ab
Merge branch 'feature/lens' of github.com:elastic/kibana into lens/me…
chrisdavies Aug 14, 2019
e46f935
Modify auto-scale to handle resize events
chrisdavies Aug 14, 2019
43ffe23
use format hints in metric vis
flash1293 Aug 15, 2019
981c577
start cleaning up suggestions
flash1293 Aug 15, 2019
4b09eba
[Lens] Remove unnecessary fields and indexing from mappings (#43285)
chrisdavies Aug 15, 2019
1bc7e10
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Aug 16, 2019
7e1c550
Tweak metric to only scale down so far, and
chrisdavies Aug 16, 2019
859aa99
Fix lens metric tests
chrisdavies Aug 16, 2019
227d798
Merge pull request #10 from flash1293/lens/metric-scale-formathints
chrisdavies Aug 16, 2019
8f35c2b
[Lens] Xy scale type (#42142)
flash1293 Aug 19, 2019
c85345e
start adding more suggestions
flash1293 Aug 19, 2019
7cdc774
Merge remote-tracking branch 'upstream/feature/lens' into lens/other-…
flash1293 Aug 19, 2019
c3beb1a
Merge remote-tracking branch 'upstream/feature/lens' into lens/metric…
flash1293 Aug 19, 2019
837c76c
remove unused imports
flash1293 Aug 19, 2019
b78a44f
Merge branch 'lens/metric-scale' into lens/other-suggestions
flash1293 Aug 19, 2019
e5ebcf8
work on suggestions
flash1293 Aug 19, 2019
400c352
work more on suggestions
flash1293 Aug 20, 2019
8d9cab5
work more on suggestions
flash1293 Aug 20, 2019
40b99f3
work more on suggestions
flash1293 Aug 20, 2019
54d9d41
[lens] Allow updater function to be used for updating state (#43373)
Aug 20, 2019
2401b4f
[Lens] Lens metric visualization (#39364)
chrisdavies Aug 20, 2019
e3667ce
Merge branch 'feature/lens' into lens/other-suggestions
flash1293 Aug 21, 2019
2c975bd
clean up tests and add new ones
flash1293 Aug 21, 2019
1dfa94e
Merge remote-tracking branch 'upstream/feature/lens' into lens/other-…
flash1293 Aug 21, 2019
30f27b5
remove isMetric
flash1293 Aug 21, 2019
16c3b03
area as default on time dimension
flash1293 Aug 21, 2019
d5452fd
fix bug in area chart for time
flash1293 Aug 21, 2019
ea662ec
Fix axis rotation (#43792)
Aug 23, 2019
db9bce7
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Aug 23, 2019
9b3d76c
Merge branch 'feature/lens' into lens/other-suggestions
flash1293 Aug 23, 2019
ed11229
remove title form layer
flash1293 Aug 23, 2019
c7fae6c
[Lens] Auto date histogram (#43775)
Aug 23, 2019
694e845
handle state in app
flash1293 Aug 23, 2019
61f3eba
Merge branch 'lens/fix-querybar-integration' into lens/other-suggestions
flash1293 Aug 23, 2019
3cec779
Merge remote-tracking branch 'upstream/feature/lens' into lens/fix-qu…
flash1293 Aug 23, 2019
54ad77c
fix isMetric usages
flash1293 Aug 23, 2019
82a4fc8
fix integration tests
flash1293 Aug 23, 2019
0dfa265
Merge branch 'lens/fix-querybar-integration' into lens/other-suggestions
flash1293 Aug 23, 2019
355f3fc
fix type errors
flash1293 Aug 23, 2019
3a6a23c
fix date handling on submit
flash1293 Aug 26, 2019
9a1ff84
Merge branch 'lens/fix-querybar-integration' into lens/other-suggestions
flash1293 Aug 26, 2019
7a31208
add new suggestion types
flash1293 Aug 26, 2019
4729ae4
fix test
flash1293 Aug 26, 2019
563205b
Merge branch 'lens/fix-querybar-integration' into lens/other-suggestions
flash1293 Aug 26, 2019
f35c722
do not suggest single tables
flash1293 Aug 26, 2019
25cdc68
remove unused import
flash1293 Aug 26, 2019
6fa6715
[Lens] Fix query bar integration (#43865)
flash1293 Aug 26, 2019
9775b02
Merge branch 'master' of github.com:elastic/kibana into feature/lens
chrisdavies Aug 26, 2019
5cbca86
switch order of appending new string column
flash1293 Aug 27, 2019
d1d3647
Merge remote-tracking branch 'upstream/feature/lens' into lens/other-…
flash1293 Aug 27, 2019
aad9403
resolve merge conflicts
flash1293 Aug 27, 2019
8e81b5b
[Lens] Clean up operations code (#43784)
flash1293 Aug 28, 2019
d69a3db
Merge remote-tracking branch 'upstream/feature/lens' into lens/other-…
flash1293 Aug 28, 2019
f9bf7b1
fix merge conflicts
flash1293 Aug 28, 2019
801a020
poc implementation
flash1293 Aug 28, 2019
cc049ea
highlight currently active suggestion and provide button to submit cu…
flash1293 Aug 28, 2019
1bb0910
[Lens] Functional tests (#44279)
chrisdavies Aug 29, 2019
65008c9
[Lens] Add Lens visualizations to Visualize list (#43398)
chrisdavies Aug 29, 2019
3948678
[Lens] Suggestion improvements (#43688)
flash1293 Sep 2, 2019
e1881cb
Merge remote-tracking branch 'upstream/feature/lens' into lens/uncomm…
flash1293 Sep 2, 2019
cf03503
fix bugs
flash1293 Sep 2, 2019
426d9d7
[lens] Calculate existence of fields in datasource (#44422)
Sep 3, 2019
b443d3e
[Lens ] Preview metric (#43755)
flash1293 Sep 4, 2019
57d9380
format filter ratio as percentage (#44625)
flash1293 Sep 4, 2019
32ddc97
[Lens] Remove datasource suggestion id (#44495)
flash1293 Sep 4, 2019
a4e53b8
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Sep 4, 2019
c250c7d
[Lens] Make breadcrumbs look and feel like Visualize (#44258)
chrisdavies Sep 4, 2019
68e0515
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Sep 4, 2019
9f36baf
[lens] Fix breakage from app-arch movements (#44720)
wylieconlon Sep 5, 2019
80f02e0
Design cleanup
Sep 5, 2019
1207b06
Merge remote-tracking branch 'upstream/feature/lens' into lens/uncomm…
flash1293 Sep 6, 2019
8cfe012
Merge pull request #2 from cchaos/lens/uncommited-suggestion/design
flash1293 Sep 6, 2019
b6a4286
Merge branch 'lens/uncommited-suggestion' of github.com:flash1293/kib…
flash1293 Sep 6, 2019
37df649
PR review comments
flash1293 Sep 9, 2019
d912aab
fix tests
flash1293 Sep 9, 2019
8e14812
small cleanup
flash1293 Sep 9, 2019
35c8241
remove unused import
flash1293 Sep 9, 2019
894e76f
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Sep 9, 2019
c40938e
[lens] Fix type error in test from merge
wylieconlon Sep 9, 2019
19510ba
[lens] Fix registration of embeddable (#45171)
Sep 9, 2019
d773481
Merge remote-tracking branch 'upstream/feature/lens' into lens/uncomm…
flash1293 Sep 10, 2019
999eec7
keep references stable if table is just extended and add tests
flash1293 Sep 10, 2019
ba1488e
changed label for stack/unstack
flash1293 Sep 10, 2019
cb00019
fix test
flash1293 Sep 10, 2019
1abef4b
[Lens] Functional tests (#44814)
chrisdavies Sep 10, 2019
ad61702
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Sep 10, 2019
3d1e668
[lens] Add Lens to CODEOWNERS (#45296)
Sep 10, 2019
0bc2e89
Merge remote-tracking branch 'upstream/feature/lens' into lens/uncomm…
flash1293 Sep 11, 2019
6067f7d
Merge remote-tracking branch 'upstream/master' into feature/lens
flash1293 Sep 11, 2019
d48595c
Merge branch 'feature/lens' into lens/uncommited-suggestion
flash1293 Sep 11, 2019
4e76620
[lens] Fix visualization alias registration
wylieconlon Sep 11, 2019
2206a3c
Merge remote-tracking branch 'upstream/feature/lens' into lens/uncomm…
flash1293 Sep 11, 2019
44dcc7e
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Sep 11, 2019
234ffb6
[lens] Fix usage of EUI after typescript upgrade (#45404)
Sep 11, 2019
7178b54
Merge remote-tracking branch 'upstream/feature/lens' into lens/uncomm…
flash1293 Sep 12, 2019
910640a
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Sep 12, 2019
5aad545
Merge remote-tracking branch 'origin/master' into feature/lens
wylieconlon Sep 12, 2019
67111f6
Merge remote-tracking branch 'upstream/feature/lens' into lens/uncomm…
flash1293 Sep 13, 2019
38578af
Merge remote-tracking branch 'origin/master' into HEAD
wylieconlon Sep 17, 2019
aa5cace
fix bug and address reviews
flash1293 Sep 18, 2019
ea5ea5d
Merge branch 'master' into lens/uncommited-suggestion
elasticmachine Sep 18, 2019
7a3b4b8
Fix frame tests
wylieconlon Sep 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Lens] Remove datasource suggestion id (#44495)
flash1293 authored Sep 4, 2019
commit 32ddc97b275a19d50435a9430c78278b524af202
Original file line number Diff line number Diff line change
@@ -126,58 +126,54 @@ export const datatableVisualization: Visualization<
getPersistableState: state => state,

getSuggestions({
tables,
table,
state,
}: SuggestionRequest<DatatableVisualizationState>): Array<
VisualizationSuggestion<DatatableVisualizationState>
> {
const maxColumnCount = Math.max.apply(undefined, tables.map(table => table.columns.length));
return (
tables
// don't suggest current table if visualization is active
.filter(({ changeType }) => !state || changeType !== 'unchanged')
.map(table => {
const title =
table.changeType === 'unchanged'
? i18n.translate('xpack.lens.datatable.suggestionLabel', {
defaultMessage: 'As table',
})
: i18n.translate('xpack.lens.datatable.visualizationOf', {
defaultMessage: 'Table {operations}',
values: {
operations:
table.label ||
table.columns
.map(col => col.operation.label)
.join(
i18n.translate('xpack.lens.datatable.conjunctionSign', {
defaultMessage: ' & ',
description:
'A character that can be used for conjunction of multiple enumarated items. Make sure to include spaces around it if needed.',
})
),
},
});

return {
title,
// largest possible table will have a score of 0.2, fewer columns reduce score
score: (table.columns.length / maxColumnCount) * 0.2,
datasourceSuggestionId: table.datasourceSuggestionId,
state: {
layers: [
{
layerId: table.layerId,
columns: table.columns.map(col => col.columnId),
},
],
if (state && table.changeType === 'unchanged') {
return [];
}
const title =
table.changeType === 'unchanged'
? i18n.translate('xpack.lens.datatable.suggestionLabel', {
defaultMessage: 'As table',
})
: i18n.translate('xpack.lens.datatable.visualizationOf', {
defaultMessage: 'Table {operations}',
values: {
operations:
table.label ||
table.columns
.map(col => col.operation.label)
.join(
i18n.translate('xpack.lens.datatable.conjunctionSign', {
defaultMessage: ' & ',
description:
'A character that can be used for conjunction of multiple enumarated items. Make sure to include spaces around it if needed.',
})
),
},
previewIcon: 'visTable',
// dont show suggestions for reduced versions or single-line tables
hide: table.changeType === 'reduced' || !table.isMultiRow,
};
})
);
});

return [
{
title,
// table with >= 10 columns will have a score of 0.6, fewer columns reduce score
score: (Math.min(table.columns.length, 10) / 10) * 0.6,
state: {
layers: [
{
layerId: table.layerId,
columns: table.columns.map(col => col.columnId),
},
],
},
previewIcon: 'visTable',
// dont show suggestions for reduced versions or single-line tables
hide: table.changeType === 'reduced' || !table.isMultiRow,
},
];
},

renderConfigPanel: (domElement, props) =>
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ describe('chart_switch', () => {
score: 1,
title: '',
state: `suggestion ${id}`,
datasourceSuggestionId: options.tables[0].datasourceSuggestionId,
previewIcon: 'empty',
},
];
@@ -91,7 +90,6 @@ describe('chart_switch', () => {
state: {},
table: {
columns: [],
datasourceSuggestionId: 0,
isMultiRow: true,
layerId: 'a',
changeType: 'unchanged',
@@ -217,7 +215,6 @@ describe('chart_switch', () => {
},
},
],
datasourceSuggestionId: 0,
layerId: 'first',
isMultiRow: true,
changeType: 'unchanged',
@@ -446,7 +443,6 @@ describe('chart_switch', () => {
},
},
],
datasourceSuggestionId: 0,
layerId: 'a',
isMultiRow: true,
changeType: 'unchanged',
Original file line number Diff line number Diff line change
@@ -24,12 +24,11 @@ import { EuiPanel, EuiToolTip } from '@elastic/eui';
// datasources to be processed by its callers.
const waitForPromises = () => new Promise(resolve => setTimeout(resolve));

function generateSuggestion(datasourceSuggestionId = 1, state = {}): DatasourceSuggestion {
function generateSuggestion(state = {}): DatasourceSuggestion {
return {
state,
table: {
columns: [],
datasourceSuggestionId,
isMultiRow: true,
layerId: 'first',
changeType: 'unchanged',
@@ -905,7 +904,6 @@ describe('editor_frame', () => {
state: {},
table: {
columns: [],
datasourceSuggestionId: 0,
isMultiRow: true,
layerId: 'first',
changeType: 'unchanged',
@@ -989,7 +987,6 @@ describe('editor_frame', () => {
{
title: 'Suggested vis',
score: 1,
datasourceSuggestionId: 0,
state: initialState,
previewIcon: 'empty',
},
@@ -1047,6 +1044,17 @@ describe('editor_frame', () => {
});

it('should fetch suggestions of all visualizations', async () => {
mockDatasource.getDatasourceSuggestionsFromCurrentState.mockReturnValue([
{
state: {},
table: {
changeType: 'unchanged',
columns: [],
isMultiRow: true,
layerId: 'first',
},
},
]);
mount(
<EditorFrame
{...getDefaultProps()}
@@ -1079,28 +1087,24 @@ describe('editor_frame', () => {
...mockVisualization,
getSuggestions: () => [
{
datasourceSuggestionId: 0,
score: 0.1,
state: {},
title: 'Suggestion6',
previewIcon: 'empty',
},
{
datasourceSuggestionId: 0,
score: 0.5,
state: {},
title: 'Suggestion3',
previewIcon: 'empty',
},
{
datasourceSuggestionId: 0,
score: 0.7,
state: {},
title: 'Suggestion2',
previewIcon: 'empty',
},
{
datasourceSuggestionId: 0,
score: 0.8,
state: {},
title: 'Suggestion1',
@@ -1112,14 +1116,12 @@ describe('editor_frame', () => {
...mockVisualization,
getSuggestions: () => [
{
datasourceSuggestionId: 0,
score: 0.4,
state: {},
title: 'Suggestion5',
previewIcon: 'empty',
},
{
datasourceSuggestionId: 0,
score: 0.45,
state: {},
title: 'Suggestion4',
@@ -1163,7 +1165,6 @@ describe('editor_frame', () => {
...mockVisualization,
getSuggestions: () => [
{
datasourceSuggestionId: 0,
score: 0.8,
state: suggestionVisState,
title: 'Suggestion1',
@@ -1222,14 +1223,12 @@ describe('editor_frame', () => {
...mockVisualization,
getSuggestions: () => [
{
datasourceSuggestionId: 0,
score: 0.2,
state: {},
title: 'Suggestion1',
previewIcon: 'empty',
},
{
datasourceSuggestionId: 0,
score: 0.8,
state: suggestionVisState,
title: 'Suggestion2',
@@ -1279,14 +1278,12 @@ describe('editor_frame', () => {
...mockVisualization,
getSuggestions: () => [
{
datasourceSuggestionId: 0,
score: 0.2,
state: {},
title: 'Suggestion1',
previewIcon: 'empty',
},
{
datasourceSuggestionId: 0,
score: 0.6,
state: {},
title: 'Suggestion2',
@@ -1298,7 +1295,6 @@ describe('editor_frame', () => {
...mockVisualization2,
getSuggestions: () => [
{
datasourceSuggestionId: 0,
score: 0.8,
state: suggestionVisState,
title: 'Suggestion3',
Loading