Browse Source

HUE-7849 [search] Support selection on pie chart of two dimension facet

Range facet not implemented only field.
With Sunburst at some point.
Romain Rigaux 7 years ago
parent
commit
4449d14cd9

+ 1 - 1
desktop/libs/dashboard/src/dashboard/models.py

@@ -538,7 +538,7 @@ def augment_solr_response(response, collection, query):
             cols.append(f['field'])
             cols.append(f['field'])
             prev_last_seen_dim_col_index = last_seen_dim_col_index
             prev_last_seen_dim_col_index = last_seen_dim_col_index
             last_seen_dim_col_index = i + 2
             last_seen_dim_col_index = i + 2
-            print prev_last_seen_dim_col_index
+
           from libsolr.api import SolrApi
           from libsolr.api import SolrApi
           aggregate_name = SolrApi._get_aggregate_function(f)
           aggregate_name = SolrApi._get_aggregate_function(f)
           cols.append(aggregate_name + ('_%(field)s' % facet['properties']['facets'][last_seen_dim_col_index - 1] if aggregate_name in cols else ''))
           cols.append(aggregate_name + ('_%(field)s' % facet['properties']['facets'][last_seen_dim_col_index - 1] if aggregate_name in cols else ''))

+ 1 - 1
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -1648,7 +1648,7 @@ ${ dashboard.layout_skeleton(suffix='search') }
           <div data-bind="pieChart: {data: {counts: $parent.counts(), widget_id: $parent.id()}, field: field, fqs: $root.query.fqs,
           <div data-bind="pieChart: {data: {counts: $parent.counts(), widget_id: $parent.id()}, field: field, fqs: $root.query.fqs,
             transformer: pieChartDataTransformer,
             transformer: pieChartDataTransformer,
             maxWidth: 250,
             maxWidth: 250,
-            onClick: function(d){ searchViewModel.query.toggleFacet({facet: d.data.obj, widget_id: d.data.obj.widget_id}) },
+            onClick: function(d){ $parent.dimension() == 2 ? $root.query.togglePivotFacet({facet: d.data.obj, widget_id: id()}) : searchViewModel.query.toggleFacet({facet: d.data.obj, widget_id: d.data.obj.widget_id}) },
             onComplete: function(){ searchViewModel.getWidgetById($parent.id()).isLoading(false)} }" />
             onComplete: function(){ searchViewModel.getWidgetById($parent.id()).isLoading(false)} }" />
           <div class="clearfix"></div>
           <div class="clearfix"></div>
           <!-- /ko -->
           <!-- /ko -->

+ 1 - 0
docs/user-guide/user-guide.md

@@ -235,6 +235,7 @@ server.
 
 
 When you have multiple statements it's enough to put the cursor in the statement you want to execute, the active statement is indicated with a blue gutter marking.
 When you have multiple statements it's enough to put the cursor in the statement you want to execute, the active statement is indicated with a blue gutter marking.
 
 
+![image](images/note.jpg) **Note**: Use CTRL/Cmd + ENTER to execute queries.
 
 
 ![image](images/note.jpg) **Note**: Under the logs panel, you can view any
 ![image](images/note.jpg) **Note**: Under the logs panel, you can view any
 MapReduce or [Impala jobs](#impala-queries) that the query generated.
 MapReduce or [Impala jobs](#impala-queries) that the query generated.