From 4b74c43a0b733670b6a50d86c935dd3fcdce6de4 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Mon, 25 Jan 2016 10:41:49 -0800 Subject: [PATCH 01/10] removing split chart option for tile map visualization --- src/plugins/kbn_vislib_vis_types/public/tileMap.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/plugins/kbn_vislib_vis_types/public/tileMap.js b/src/plugins/kbn_vislib_vis_types/public/tileMap.js index 0b7860a5147ca..c02d46e248089 100644 --- a/src/plugins/kbn_vislib_vis_types/public/tileMap.js +++ b/src/plugins/kbn_vislib_vis_types/public/tileMap.js @@ -111,13 +111,6 @@ define(function (require) { aggFilter: 'geohash_grid', min: 1, max: 1 - }, - { - group: 'buckets', - name: 'split', - title: 'Split Chart', - min: 0, - max: 1 } ]) }); From 0ee2bc7622d173a5241320efb7e4b6445efbfa16 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Mon, 25 Jan 2016 10:41:49 -0800 Subject: [PATCH 02/10] Closes #5728. Removing split chart option for tile map visualization. --- src/plugins/kbn_vislib_vis_types/public/tileMap.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/plugins/kbn_vislib_vis_types/public/tileMap.js b/src/plugins/kbn_vislib_vis_types/public/tileMap.js index 0b7860a5147ca..c02d46e248089 100644 --- a/src/plugins/kbn_vislib_vis_types/public/tileMap.js +++ b/src/plugins/kbn_vislib_vis_types/public/tileMap.js @@ -111,13 +111,6 @@ define(function (require) { aggFilter: 'geohash_grid', min: 1, max: 1 - }, - { - group: 'buckets', - name: 'split', - title: 'Split Chart', - min: 0, - max: 1 } ]) }); From 8e1bec8bd8d3048c17a2c8aaa522ffec261d8572 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Fri, 29 Jan 2016 10:07:41 -0800 Subject: [PATCH 03/10] removing splits from geo_json converter in tests --- src/ui/public/agg_response/geo_json/__tests__/geo_json.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js index f4ad5d637e614..1dfe8917c4617 100644 --- a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js +++ b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js @@ -23,7 +23,6 @@ describe('GeoJson Agg Response Converter', function () { type: 'tile_map', aggs: [ { schema: 'metric', type: 'avg', params: { field: 'bytes' } }, - { schema: 'split', type: 'terms', params: { field: '@tags' } }, { schema: 'segment', type: 'geohash_grid', params: { field: 'geo.coordinates', precision: 3 } } ], params: { @@ -34,7 +33,6 @@ describe('GeoJson Agg Response Converter', function () { aggs = { metric: vis.aggs[0], - split: vis.aggs[1], geo: vis.aggs[2] }; })); From 8072b043d7355c3d92760c57fe221461d73e6525 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Wed, 2 Mar 2016 10:58:51 -0800 Subject: [PATCH 04/10] troubleshooting test failures --- src/fixtures/agg_resp/geohash_grid.js | 22 ++++++++++--------- .../geo_json/__tests__/geo_json.js | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/fixtures/agg_resp/geohash_grid.js b/src/fixtures/agg_resp/geohash_grid.js index b62d56d21ae57..6f14f13921d71 100644 --- a/src/fixtures/agg_resp/geohash_grid.js +++ b/src/fixtures/agg_resp/geohash_grid.js @@ -47,16 +47,18 @@ export default function GeoHashGridAggResponseFixture() { }; }); - return { - key: 'tag ' + (i + 1), - doc_count: docCount, - 3: { - buckets: buckets - }, - 1: { - value: 1000 + i - } - }; + return tags; + + //return { + // key: 'tag ' + (i + 1), + //doc_count: docCount, + // 3: { + // buckets: buckets + // }, + // 1: { + // value: 1000 + i + // } + //}; }); return { diff --git a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js index 0b2f794e72fa9..c5f3beca2eda9 100644 --- a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js +++ b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js @@ -38,7 +38,7 @@ describe('GeoJson Agg Response Converter', function () { aggs = { metric: vis.aggs[0], - geo: vis.aggs[2] + geo: vis.aggs[1] }; })); From 392063ca4c766c0ebc41fa4021e3873080ce7415 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Wed, 2 Mar 2016 11:09:17 -0800 Subject: [PATCH 05/10] fixing minor bug --- src/fixtures/agg_resp/geohash_grid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fixtures/agg_resp/geohash_grid.js b/src/fixtures/agg_resp/geohash_grid.js index 6f14f13921d71..f571c6007d73d 100644 --- a/src/fixtures/agg_resp/geohash_grid.js +++ b/src/fixtures/agg_resp/geohash_grid.js @@ -47,7 +47,7 @@ export default function GeoHashGridAggResponseFixture() { }; }); - return tags; + return buckets; //return { // key: 'tag ' + (i + 1), From 4d167b4090d3c2e4444cdcc071874cb49199f411 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Wed, 2 Mar 2016 12:47:08 -0800 Subject: [PATCH 06/10] fixing failing tests --- src/fixtures/agg_resp/geohash_grid.js | 49 ++++++------------- .../geo_json/__tests__/geo_json.js | 2 +- 2 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/fixtures/agg_resp/geohash_grid.js b/src/fixtures/agg_resp/geohash_grid.js index f571c6007d73d..641e87e6bc09e 100644 --- a/src/fixtures/agg_resp/geohash_grid.js +++ b/src/fixtures/agg_resp/geohash_grid.js @@ -8,7 +8,6 @@ export default function GeoHashGridAggResponseFixture() { // type: 'tile_map', // aggs:[ // { schema: 'metric', type: 'avg', params: { field: 'bytes' } }, - // { schema: 'split', type: 'terms', params: { field: '@tags', size: 10 } }, // { schema: 'segment', type: 'geohash_grid', params: { field: 'geo.coordinates', precision: 3 } } // ], // params: { @@ -25,40 +24,22 @@ export default function GeoHashGridAggResponseFixture() { var totalDocCount = 0; - var tags = _.times(_.random(4, 20), function (i) { - // random number of tags - var docCount = 0; - var buckets = _.times(_.random(40, 200), function () { - return _.sample(geoHashCharts, 3).join(''); - }) - .sort() - .map(function (geoHash) { - var count = _.random(1, 5000); + var buckets = _.times(_.random(40, 200), function () { + return _.sample(geoHashCharts, 3).join(''); + }) + .sort() + .map(function (geoHash, i) { + var count = _.random(1, 5000); - totalDocCount += count; - docCount += count; + totalDocCount += count; - return { - key: geoHash, - doc_count: count, - 1: { - value: 2048 + i - } - }; - }); - - return buckets; - - //return { - // key: 'tag ' + (i + 1), - //doc_count: docCount, - // 3: { - // buckets: buckets - // }, - // 1: { - // value: 1000 + i - // } - //}; + return { + key: geoHash, + doc_count: count, + 1: { + value: 2048 + i + } + }; }); return { @@ -76,7 +57,7 @@ export default function GeoHashGridAggResponseFixture() { }, aggregations: { 2: { - buckets: tags + buckets: buckets } } }; diff --git a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js index c5f3beca2eda9..9dc870a397dda 100644 --- a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js +++ b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js @@ -45,7 +45,7 @@ describe('GeoJson Agg Response Converter', function () { [ { asAggConfigResults: true }, { asAggConfigResults: false } ].forEach(function (tableOpts) { function makeTable() { - return _.sample(_.sample(tabify(vis, esResponse, tableOpts).tables).tables); + return _.sample(tabify(vis, esResponse, tableOpts).tables); } function makeSingleChart(table) { From 7314ef6c6045bed7f7449b8abfea1d51cb73b423 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Fri, 25 Mar 2016 15:48:14 -0700 Subject: [PATCH 07/10] replacing split chart ability --- src/fixtures/agg_resp/geohash_grid.js | 39 +++++++++++++------ .../kbn_vislib_vis_types/public/tile_map.js | 8 ++++ .../geo_json/__tests__/geo_json.js | 6 ++- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/fixtures/agg_resp/geohash_grid.js b/src/fixtures/agg_resp/geohash_grid.js index 641e87e6bc09e..b62d56d21ae57 100644 --- a/src/fixtures/agg_resp/geohash_grid.js +++ b/src/fixtures/agg_resp/geohash_grid.js @@ -8,6 +8,7 @@ export default function GeoHashGridAggResponseFixture() { // type: 'tile_map', // aggs:[ // { schema: 'metric', type: 'avg', params: { field: 'bytes' } }, + // { schema: 'split', type: 'terms', params: { field: '@tags', size: 10 } }, // { schema: 'segment', type: 'geohash_grid', params: { field: 'geo.coordinates', precision: 3 } } // ], // params: { @@ -24,20 +25,36 @@ export default function GeoHashGridAggResponseFixture() { var totalDocCount = 0; - var buckets = _.times(_.random(40, 200), function () { - return _.sample(geoHashCharts, 3).join(''); - }) - .sort() - .map(function (geoHash, i) { - var count = _.random(1, 5000); + var tags = _.times(_.random(4, 20), function (i) { + // random number of tags + var docCount = 0; + var buckets = _.times(_.random(40, 200), function () { + return _.sample(geoHashCharts, 3).join(''); + }) + .sort() + .map(function (geoHash) { + var count = _.random(1, 5000); - totalDocCount += count; + totalDocCount += count; + docCount += count; + + return { + key: geoHash, + doc_count: count, + 1: { + value: 2048 + i + } + }; + }); return { - key: geoHash, - doc_count: count, + key: 'tag ' + (i + 1), + doc_count: docCount, + 3: { + buckets: buckets + }, 1: { - value: 2048 + i + value: 1000 + i } }; }); @@ -57,7 +74,7 @@ export default function GeoHashGridAggResponseFixture() { }, aggregations: { 2: { - buckets: buckets + buckets: tags } } }; diff --git a/src/plugins/kbn_vislib_vis_types/public/tile_map.js b/src/plugins/kbn_vislib_vis_types/public/tile_map.js index 7b673a52a3ea1..824177545ff70 100644 --- a/src/plugins/kbn_vislib_vis_types/public/tile_map.js +++ b/src/plugins/kbn_vislib_vis_types/public/tile_map.js @@ -116,6 +116,14 @@ export default function TileMapVisType(Private, getAppState, courier, config) { aggFilter: 'geohash_grid', min: 1, max: 1 + }, + { + group: 'buckets', + name: 'split', + title: 'Split Chart', + deprecate: true, + min: 0, + max: 1 } ]) }); diff --git a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js index 64d8ffa55d487..78fc73fdd6c2b 100644 --- a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js +++ b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js @@ -28,6 +28,7 @@ describe('GeoJson Agg Response Converter', function () { type: 'tile_map', aggs: [ { schema: 'metric', type: 'avg', params: { field: 'bytes' } }, + { schema: 'split', type: 'terms', params: { field: '@tags' } }, { schema: 'segment', type: 'geohash_grid', params: { field: 'geo.coordinates', precision: 3 } } ], params: { @@ -38,14 +39,15 @@ describe('GeoJson Agg Response Converter', function () { aggs = { metric: vis.aggs[0], - geo: vis.aggs[1] + split: vis.aggs[1], + geo: vis.aggs[2] }; })); [ { asAggConfigResults: true }, { asAggConfigResults: false } ].forEach(function (tableOpts) { function makeTable() { - return _.sample(tabify(vis, esResponse, tableOpts).tables); + return _.sample(_.sample(tabify(vis, esResponse, tableOpts).tables).tables); } function makeSingleChart(table) { From 07817ba71ec75fe3510f364398388f3c2a77f1ad Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Fri, 25 Mar 2016 17:52:45 -0700 Subject: [PATCH 08/10] adding ability to hide agg schema when deprecated --- src/plugins/kibana/public/visualize/editor/agg_add.html | 3 ++- src/plugins/kibana/public/visualize/editor/agg_group.js | 5 ++++- src/ui/public/vis/schemas.js | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/kibana/public/visualize/editor/agg_add.html b/src/plugins/kibana/public/visualize/editor/agg_add.html index d1de5c7f1ee7f..ba7135f6daa8f 100644 --- a/src/plugins/kibana/public/visualize/editor/agg_add.html +++ b/src/plugins/kibana/public/visualize/editor/agg_add.html @@ -2,6 +2,7 @@
  • @@ -21,7 +22,7 @@
    Add {{ groupName }}
    -
    +
    Add sub-{{ groupName }}
    diff --git a/src/plugins/kibana/public/visualize/editor/agg_group.js b/src/plugins/kibana/public/visualize/editor/agg_group.js index 52efea728f254..d0223fa90ef0b 100644 --- a/src/plugins/kibana/public/visualize/editor/agg_group.js +++ b/src/plugins/kibana/public/visualize/editor/agg_group.js @@ -25,7 +25,10 @@ uiModules const stats = $scope.stats = { min: 0, max: 0, - count: $scope.group ? $scope.group.length : 0 + count: $scope.group ? $scope.group.length : 0, + numDeprecated: $scope.schemas.raw.filter(function (o) { + return o.deprecate; + }).length }; if (!$scope.schemas) return; diff --git a/src/ui/public/vis/schemas.js b/src/ui/public/vis/schemas.js index 37fed29291947..3eeea29d6be73 100644 --- a/src/ui/public/vis/schemas.js +++ b/src/ui/public/vis/schemas.js @@ -30,7 +30,8 @@ export default function VisTypeSchemasFactory(Private) { title: schema.name, aggFilter: '*', editor: false, - params: [] + params: [], + deprecate: false }); // convert the params into a params registry From 02bef3078363375e256682557be5e105bdca3e0a Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Mon, 28 Mar 2016 14:46:09 -0700 Subject: [PATCH 09/10] reworking the pr based on new design spec. see pr comments --- src/plugins/kibana/public/visualize/editor/agg_add.html | 4 ++-- src/plugins/kibana/public/visualize/editor/agg_group.js | 6 ++---- .../kibana/public/visualize/editor/agg_params.html | 8 +++++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/plugins/kibana/public/visualize/editor/agg_add.html b/src/plugins/kibana/public/visualize/editor/agg_add.html index ba7135f6daa8f..0ce5acbfb9fa5 100644 --- a/src/plugins/kibana/public/visualize/editor/agg_add.html +++ b/src/plugins/kibana/public/visualize/editor/agg_add.html @@ -19,10 +19,10 @@ class="vis-editor-agg-wide-btn">
    -
    +
    Add {{ groupName }}
    -
    +
    Add sub-{{ groupName }}
    diff --git a/src/plugins/kibana/public/visualize/editor/agg_group.js b/src/plugins/kibana/public/visualize/editor/agg_group.js index d0223fa90ef0b..1718d80c1b580 100644 --- a/src/plugins/kibana/public/visualize/editor/agg_group.js +++ b/src/plugins/kibana/public/visualize/editor/agg_group.js @@ -25,10 +25,7 @@ uiModules const stats = $scope.stats = { min: 0, max: 0, - count: $scope.group ? $scope.group.length : 0, - numDeprecated: $scope.schemas.raw.filter(function (o) { - return o.deprecate; - }).length + count: $scope.group ? $scope.group.length : 0 }; if (!$scope.schemas) return; @@ -36,6 +33,7 @@ uiModules $scope.schemas.forEach(function (schema) { stats.min += schema.min; stats.max += schema.max; + stats.deprecate = schema.deprecate; }); $scope.availableSchema = $scope.schemas.filter(function (schema) { diff --git a/src/plugins/kibana/public/visualize/editor/agg_params.html b/src/plugins/kibana/public/visualize/editor/agg_params.html index e4473e73a8b2e..6a3c8c7cf3871 100644 --- a/src/plugins/kibana/public/visualize/editor/agg_params.html +++ b/src/plugins/kibana/public/visualize/editor/agg_params.html @@ -10,4 +10,10 @@ style="display: none;">
    - \ No newline at end of file +
    +

    + "{{ agg.schema.title }}" has been deprecated. +

    +
    + + From b9e685f398a458dc0c2e9d6db7b560123add99a8 Mon Sep 17 00:00:00 2001 From: Shelby Sturgis Date: Mon, 28 Mar 2016 17:00:30 -0700 Subject: [PATCH 10/10] adding option to specify custome deprecate message --- src/plugins/kbn_vislib_vis_types/public/tile_map.js | 1 + src/plugins/kibana/public/visualize/editor/agg_params.html | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/kbn_vislib_vis_types/public/tile_map.js b/src/plugins/kbn_vislib_vis_types/public/tile_map.js index 824177545ff70..acc7e45918485 100644 --- a/src/plugins/kbn_vislib_vis_types/public/tile_map.js +++ b/src/plugins/kbn_vislib_vis_types/public/tile_map.js @@ -122,6 +122,7 @@ export default function TileMapVisType(Private, getAppState, courier, config) { name: 'split', title: 'Split Chart', deprecate: true, + deprecateMessage: 'The Split Chart feature for Tile Maps has been deprecated.', min: 0, max: 1 } diff --git a/src/plugins/kibana/public/visualize/editor/agg_params.html b/src/plugins/kibana/public/visualize/editor/agg_params.html index 6a3c8c7cf3871..5f822ada4f0e4 100644 --- a/src/plugins/kibana/public/visualize/editor/agg_params.html +++ b/src/plugins/kibana/public/visualize/editor/agg_params.html @@ -11,7 +11,10 @@
    -

    +

    + {{ agg.schema.deprecateMessage }} +

    +

    "{{ agg.schema.title }}" has been deprecated.