|
@@ -145,7 +145,8 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
|
|
|
</a>
|
|
</a>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableNumbers() },
|
|
|
|
|
|
|
+ <div data-bind="visible: $root.isLatest,
|
|
|
|
|
+ css: { 'draggable-widget': true, 'disabled': !availableDraggableNumbers() },
|
|
|
draggable: {data: draggableCounter(), isEnabled: availableDraggableNumbers,
|
|
draggable: {data: draggableCounter(), isEnabled: availableDraggableNumbers,
|
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
|
'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
@@ -186,7 +187,8 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
|
|
|
<i class="hcha hcha-pie-chart"></i>
|
|
<i class="hcha hcha-pie-chart"></i>
|
|
|
</a>
|
|
</a>
|
|
|
</div>
|
|
</div>
|
|
|
- <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableChart() },
|
|
|
|
|
|
|
+ <div data-bind="visible: ! $root.isLatest(),
|
|
|
|
|
+ css: { 'draggable-widget': true, 'disabled': !availableDraggableChart() },
|
|
|
draggable: {data: draggableBar(), isEnabled: availableDraggableChart,
|
|
draggable: {data: draggableBar(), isEnabled: availableDraggableChart,
|
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
|
'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
@@ -195,7 +197,8 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
|
|
|
<i class="hcha hcha-bar-chart"></i>
|
|
<i class="hcha hcha-bar-chart"></i>
|
|
|
</a>
|
|
</a>
|
|
|
</div>
|
|
</div>
|
|
|
- <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableNumbers() },
|
|
|
|
|
|
|
+ <div data-bind="visible: ! $root.isLatest(),
|
|
|
|
|
+ css: { 'draggable-widget': true, 'disabled': !availableDraggableNumbers() },
|
|
|
draggable: {data: draggableLine(), isEnabled: availableDraggableNumbers,
|
|
draggable: {data: draggableLine(), isEnabled: availableDraggableNumbers,
|
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
|
'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
@@ -204,6 +207,16 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
|
|
|
<i class="hcha hcha-line-chart"></i>
|
|
<i class="hcha hcha-line-chart"></i>
|
|
|
</a>
|
|
</a>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div data-bind="visible: $root.isLatest(),
|
|
|
|
|
+ css: { 'draggable-widget': true, 'disabled': ! availableDraggableChart() },
|
|
|
|
|
+ draggable: {data: draggableBucket(), isEnabled: availableDraggableChart,
|
|
|
|
|
+ options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
|
|
|
+ 'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
|
|
|
+ title="${_('Histogram Chart')}" rel="tooltip" data-placement="top">
|
|
|
|
|
+ <a data-bind="style: { cursor: $root.availableDraggableChart() ? 'move' : 'default' }">
|
|
|
|
|
+ <i class="hcha hcha-bar-chart"></i>
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </div>
|
|
|
<div data-bind="css: { 'draggable-widget': true, 'disabled': false },
|
|
<div data-bind="css: { 'draggable-widget': true, 'disabled': false },
|
|
|
draggable: {data: draggableTree(), isEnabled: true,
|
|
draggable: {data: draggableTree(), isEnabled: true,
|
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
@@ -213,7 +226,8 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
|
|
|
<i class="fa fa-sitemap fa-rotate-270"></i>
|
|
<i class="fa fa-sitemap fa-rotate-270"></i>
|
|
|
</a>
|
|
</a>
|
|
|
</div>
|
|
</div>
|
|
|
- <div data-bind="css: { 'draggable-widget': true, 'disabled': false },
|
|
|
|
|
|
|
+ <div data-bind="visible: ! $root.isLatest(),
|
|
|
|
|
+ css: { 'draggable-widget': true, 'disabled': false },
|
|
|
draggable: {data: draggableHeatmap(), isEnabled: true,
|
|
draggable: {data: draggableHeatmap(), isEnabled: true,
|
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
|
'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
@@ -296,7 +310,7 @@ ${ dashboard.layout_skeleton() }
|
|
|
</div>
|
|
</div>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
|
|
|
|
|
- <!-- ko if: type() == 'range' || type() == 'range-up' || (type() == 'terms' && properties.min)-->
|
|
|
|
|
|
|
+ <!-- ko if: type() == 'range' || type() == 'range-up' || (type() == 'nested' && typeof properties.min != "undefined")-->
|
|
|
<!-- ko ifnot: properties.isDate() -->
|
|
<!-- ko ifnot: properties.isDate() -->
|
|
|
<div class="slider-cnt" data-bind="slider: {start: properties.min, end: properties.max, gap: properties.initial_gap, min: properties.initial_start, max: properties.initial_end, properties: properties, labels: SLIDER_LABELS}"></div>
|
|
<div class="slider-cnt" data-bind="slider: {start: properties.min, end: properties.max, gap: properties.initial_gap, min: properties.initial_start, max: properties.initial_end, properties: properties, labels: SLIDER_LABELS}"></div>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
@@ -306,7 +320,7 @@ ${ dashboard.layout_skeleton() }
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
|
|
|
|
|
- <!-- ko if: type() == 'field' || type() == 'terms' -->
|
|
|
|
|
|
|
+ <!-- ko if: type() == 'field' -->
|
|
|
<div class="facet-field-cnt">
|
|
<div class="facet-field-cnt">
|
|
|
<span class="spinedit-cnt">
|
|
<span class="spinedit-cnt">
|
|
|
<span class="facet-field-label facet-field-label-fixed-width">
|
|
<span class="facet-field-label facet-field-label-fixed-width">
|
|
@@ -332,8 +346,8 @@ ${ dashboard.layout_skeleton() }
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- ko if: type() == 'pivot' || type() == 'terms' -->
|
|
|
|
|
- <div class="facet-field-tile" data-bind="visible: properties.scope() == 'tree' || properties.facets().length == 0">
|
|
|
|
|
|
|
+ <!-- ko if: type() == 'pivot' || type() == 'nested' -->
|
|
|
|
|
+ <div class="facet-field-tile" data-bind="visible: properties.scope() == 'tree' || (type() == 'pivot' && properties.facets().length == 0) || (type() == 'nested' && properties.facets().length < 3)">
|
|
|
<div class="facet-field-cnt">
|
|
<div class="facet-field-cnt">
|
|
|
<span class="facet-field-label facet-field-label-fixed-width facet-field-label-fixed-width-double facet-field-label-title">
|
|
<span class="facet-field-label facet-field-label-fixed-width facet-field-label-fixed-width-double facet-field-label-title">
|
|
|
${ _('Add a dimension') }
|
|
${ _('Add a dimension') }
|
|
@@ -349,16 +363,11 @@ ${ dashboard.layout_skeleton() }
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <span class="facet-field-label">${ _('Metric') }</span>
|
|
|
|
|
- <select data-bind="value: properties.facets_form.function">
|
|
|
|
|
- <option value="unique" selected="selected" label="${ _('Unique Count') }">${ _('Unique Count') }</option>
|
|
|
|
|
- <option value="avg" label="${ _('Average') }">${ _('Average') }</option>
|
|
|
|
|
- <option value="sum" label="${ _('Sum') }">${ _('Sum') }</option>
|
|
|
|
|
- <option value="min" label="${ _('Min') }">${ _('Min') }</option>
|
|
|
|
|
- <option value="max" label="${ _('Max') }">${ _('Max') }</option>
|
|
|
|
|
- <option value="sumsq" label="${ _('Sum of square') }">${ _('Sum of square') }</option>
|
|
|
|
|
- <option value="median" label="${ _('Median') }">${ _('Median') }</option>
|
|
|
|
|
- </select>
|
|
|
|
|
|
|
+ <!-- ko if: type() == 'nested' -->
|
|
|
|
|
+ <span class="facet-field-label">${ _('Metric') }</span>
|
|
|
|
|
+ <select data-bind="options: HIT_OPTIONS, optionsText: 'label', optionsValue: 'value', value: properties.facets_form.aggregate">
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <!-- /ko -->
|
|
|
|
|
|
|
|
<div class="facet-field-cnt">
|
|
<div class="facet-field-cnt">
|
|
|
<span class="spinedit-cnt">
|
|
<span class="spinedit-cnt">
|
|
@@ -820,23 +829,70 @@ ${ dashboard.layout_skeleton() }
|
|
|
<a href="javascript:void(0)" data-bind="click: $root.collection.rangeZoomOut"><i class="fa fa-search-minus"></i> ${ _('reset') }</a>
|
|
<a href="javascript:void(0)" data-bind="click: $root.collection.rangeZoomOut"><i class="fa fa-search-minus"></i> ${ _('reset') }</a>
|
|
|
<span class="facet-field-label" data-bind="visible: $root.query.multiqs().length > 1">${ _('Group by') }</span>
|
|
<span class="facet-field-label" data-bind="visible: $root.query.multiqs().length > 1">${ _('Group by') }</span>
|
|
|
<select class="input-medium" data-bind="visible: $root.query.multiqs().length > 1, options: $root.query.multiqs, optionsValue: 'id', optionsText: 'label', value: $root.query.selectedMultiq"></select>
|
|
<select class="input-medium" data-bind="visible: $root.query.multiqs().length > 1, options: $root.query.multiqs, optionsValue: 'id', optionsText: 'label', value: $root.query.selectedMultiq"></select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- ko if: $root.collection.getFacetById($parent.id()) -->
|
|
|
|
|
+ <div data-bind="timelineChart: {datum: {counts: counts(), extraSeries: extraSeries(), widget_id: $parent.id(), label: label()}, stacked: $root.collection.getFacetById($parent.id()).properties.stacked(), field: field, label: label(), transformer: timelineChartDataTransformer,
|
|
|
|
|
+ type: $root.collection.getFacetById($parent.id()).properties.timelineChartType,
|
|
|
|
|
+ fqs: $root.query.fqs,
|
|
|
|
|
+ onSelectRange: function(from, to){ $root.collection.selectTimelineFacet({from: from, to: to, cat: field, widget_id: $parent.id()}) },
|
|
|
|
|
+ onStateChange: function(state){ $root.collection.getFacetById($parent.id()).properties.stacked(state.stacked); },
|
|
|
|
|
+ onClick: function(d){ $root.query.selectRangeFacet({count: d.obj.value, widget_id: $parent.id(), from: d.obj.from, to: d.obj.to, cat: d.obj.field}) },
|
|
|
|
|
+ onComplete: function(){ $root.getWidgetById($parent.id()).isLoading(false) }}" />
|
|
|
|
|
+ <!-- /ko -->
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- /ko -->
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
+<script type="text/html" id="bar-widget">
|
|
|
|
|
+ <div class="widget-spinner" data-bind="visible: isLoading()">
|
|
|
|
|
+ <!--[if !IE]> --><i class="fa fa-spinner fa-spin"></i><!-- <![endif]-->
|
|
|
|
|
+ <!--[if IE]><img src="${ static('desktop/art/spinner.gif') }" /><![endif]-->
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- ko if: $root.getFacetFromQuery(id()).has_data() -->
|
|
|
|
|
+ <div class="row-fluid" data-bind="with: $root.getFacetFromQuery(id())">
|
|
|
|
|
+ <div data-bind="visible: $root.isEditing, with: $root.collection.getFacetById($parent.id())" style="margin-bottom: 20px">
|
|
|
|
|
+ <span data-bind="template: { name: 'facet-toggle' }">
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div data-bind="with: $root.collection.getFacetById($parent.id())">
|
|
|
|
|
+ <!-- ko if: properties.canRange -->
|
|
|
|
|
+ <div style="padding-bottom: 10px; text-align: right; padding-right: 20px">
|
|
|
|
|
+ <span class="facet-field-label">${ _('Zoom') }</span>
|
|
|
|
|
+ <a href="javascript:void(0)" data-bind="click: $root.collection.rangeZoomOut"><i class="fa fa-search-minus"></i> ${ _('reset') }</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- /ko -->
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
<!-- ko if: $root.collection.getFacetById($parent.id()) -->
|
|
<!-- ko if: $root.collection.getFacetById($parent.id()) -->
|
|
|
- <div data-bind="timelineChart: {datum: {counts: counts(), extraSeries: extraSeries(), widget_id: $parent.id(), label: label()}, stacked: $root.collection.getFacetById($parent.id()).properties.stacked(), field: field, label: label(), transformer: timelineChartDataTransformer,
|
|
|
|
|
- type: $root.collection.getFacetById($parent.id()).properties.timelineChartType,
|
|
|
|
|
|
|
+ <div data-bind="barChart: {datum: {counts: counts(), widget_id: $parent.id(), label: label()}, stacked: $root.collection.getFacetById($parent.id()).properties.stacked(), field: field, label: label(),
|
|
|
fqs: $root.query.fqs,
|
|
fqs: $root.query.fqs,
|
|
|
- onSelectRange: function(from, to){ $root.collection.selectTimelineFacet({from: from, to: to, cat: field, widget_id: $parent.id()}) },
|
|
|
|
|
|
|
+ transformer: ($data.type == 'range-up' ? barChartRangeUpDataTransformer : barChartDataTransformer),
|
|
|
onStateChange: function(state){ $root.collection.getFacetById($parent.id()).properties.stacked(state.stacked); },
|
|
onStateChange: function(state){ $root.collection.getFacetById($parent.id()).properties.stacked(state.stacked); },
|
|
|
- onClick: function(d){ $root.query.selectRangeFacet({count: d.obj.value, widget_id: $parent.id(), from: d.obj.from, to: d.obj.to, cat: d.obj.field}) },
|
|
|
|
|
- onComplete: function(){ $root.getWidgetById($parent.id()).isLoading(false) }}" />
|
|
|
|
|
|
|
+ onClick: function(d) {
|
|
|
|
|
+ if (d.obj.field != undefined) {
|
|
|
|
|
+ if ($data.type == 'range-up') {
|
|
|
|
|
+ viewModel.query.selectRangeUpFacet({count: d.obj.value, widget_id: d.obj.widget_id, from: d.obj.from, to: d.obj.to, cat: d.obj.field, 'exclude': false, is_up: d.obj.is_up});
|
|
|
|
|
+ } else {
|
|
|
|
|
+ viewModel.query.selectRangeFacet({count: d.obj.value, widget_id: d.obj.widget_id, from: d.obj.from, to: d.obj.to, cat: d.obj.field});
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ viewModel.query.toggleFacet({facet: d.obj, widget_id: d.obj.widget_id});
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onSelectRange: function(from, to){ viewModel.collection.selectTimelineFacet({from: from, to: to, cat: field, widget_id: $parent.id()}) },
|
|
|
|
|
+ onComplete: function(){ viewModel.getWidgetById($parent.id()).isLoading(false) } }"
|
|
|
|
|
+ />
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
</div>
|
|
</div>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
-<script type="text/html" id="bar-widget">
|
|
|
|
|
|
|
+<script type="text/html" id="bucket-widget">
|
|
|
<div class="widget-spinner" data-bind="visible: isLoading()">
|
|
<div class="widget-spinner" data-bind="visible: isLoading()">
|
|
|
<!--[if !IE]> --><i class="fa fa-spinner fa-spin"></i><!-- <![endif]-->
|
|
<!--[if !IE]> --><i class="fa fa-spinner fa-spin"></i><!-- <![endif]-->
|
|
|
<!--[if IE]><img src="${ static('desktop/art/spinner.gif') }" /><![endif]-->
|
|
<!--[if IE]><img src="${ static('desktop/art/spinner.gif') }" /><![endif]-->
|
|
@@ -850,28 +906,33 @@ ${ dashboard.layout_skeleton() }
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div data-bind="with: $root.collection.getFacetById($parent.id())">
|
|
<div data-bind="with: $root.collection.getFacetById($parent.id())">
|
|
|
- <!-- ko if: type() == 'range' || type() == 'range-up' -->
|
|
|
|
|
|
|
+ <!-- ko if: properties.canRange -->
|
|
|
<div style="padding-bottom: 10px; text-align: right; padding-right: 20px">
|
|
<div style="padding-bottom: 10px; text-align: right; padding-right: 20px">
|
|
|
<span class="facet-field-label">${ _('Zoom') }</span>
|
|
<span class="facet-field-label">${ _('Zoom') }</span>
|
|
|
<a href="javascript:void(0)" data-bind="click: $root.collection.rangeZoomOut"><i class="fa fa-search-minus"></i> ${ _('reset') }</a>
|
|
<a href="javascript:void(0)" data-bind="click: $root.collection.rangeZoomOut"><i class="fa fa-search-minus"></i> ${ _('reset') }</a>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
-
|
|
|
|
|
-<div class="dimensions-header margin-bottom-10" data-bind="visible: $root.isEditing() && $data.properties.facets().length > 0">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div class="dimensions-header margin-bottom-10" data-bind="visible: $root.isEditing() && properties.facets().length > 0">
|
|
|
<span class="muted">${ _('Selected dimensions') }</span>
|
|
<span class="muted">${ _('Selected dimensions') }</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div data-bind="foreach: $data.properties.facets, visible: $root.isEditing">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div data-bind="foreach: properties.facets, visible: $root.isEditing">
|
|
|
<div class="filter-box">
|
|
<div class="filter-box">
|
|
|
<div class="title">
|
|
<div class="title">
|
|
|
<a data-bind="click: function() { $root.collection.removePivotFacetValue({'pivot_facet': $parent, 'value': $data}); }" class="pull-right" href="javascript:void(0)">
|
|
<a data-bind="click: function() { $root.collection.removePivotFacetValue({'pivot_facet': $parent, 'value': $data}); }" class="pull-right" href="javascript:void(0)">
|
|
|
<i class="fa fa-times"></i>
|
|
<i class="fa fa-times"></i>
|
|
|
</a>
|
|
</a>
|
|
|
<span data-bind="text: field"></span>
|
|
<span data-bind="text: field"></span>
|
|
|
- <span data-bind="text: functionz"></span>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
|
|
+ <div class="facet-field-cnt">
|
|
|
|
|
+ <span class="facet-field-label">${ _('Metric') }</span>
|
|
|
|
|
+ <select data-bind="options: HIT_OPTIONS, optionsText: 'label', optionsValue: 'value', value: aggregate"></select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<div class="facet-field-cnt">
|
|
<div class="facet-field-cnt">
|
|
|
<span class="spinedit-cnt">
|
|
<span class="spinedit-cnt">
|
|
|
<span class="facet-field-label facet-field-label-fixed-width">
|
|
<span class="facet-field-label facet-field-label-fixed-width">
|
|
@@ -892,28 +953,19 @@ ${ dashboard.layout_skeleton() }
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="clearfix"></div>
|
|
|
|
|
|
|
+ <div class="clearfix"></div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- ko if: $root.collection.getFacetById($parent.id()) -->
|
|
<!-- ko if: $root.collection.getFacetById($parent.id()) -->
|
|
|
- <div data-bind="barChart: {datum: {counts: counts(), widget_id: $parent.id(), label: label()}, stacked: $root.collection.getFacetById($parent.id()).properties.stacked(), field: field, label: label(),
|
|
|
|
|
|
|
+ <div data-bind="barChart: {datum: {counts: counts(), widget_id: $parent.id(), label: label()}, stacked: $root.collection.getFacetById($parent.id()).properties.stacked(),
|
|
|
|
|
+ isPivot: true,
|
|
|
fqs: $root.query.fqs,
|
|
fqs: $root.query.fqs,
|
|
|
- transformer: ($data.type == 'range-up' ? barChartRangeUpDataTransformer : barChartDataTransformer),
|
|
|
|
|
|
|
+ transformer: pivotChartDataTransformer,
|
|
|
onStateChange: function(state){ $root.collection.getFacetById($parent.id()).properties.stacked(state.stacked); },
|
|
onStateChange: function(state){ $root.collection.getFacetById($parent.id()).properties.stacked(state.stacked); },
|
|
|
onClick: function(d) {
|
|
onClick: function(d) {
|
|
|
- if (d.obj.field != undefined) {
|
|
|
|
|
- if ($data.type == 'range-up') {
|
|
|
|
|
- viewModel.query.selectRangeUpFacet({count: d.obj.value, widget_id: d.obj.widget_id, from: d.obj.from, to: d.obj.to, cat: d.obj.field, 'exclude': false, is_up: d.obj.is_up});
|
|
|
|
|
- } else {
|
|
|
|
|
- viewModel.query.selectRangeFacet({count: d.obj.value, widget_id: d.obj.widget_id, from: d.obj.from, to: d.obj.to, cat: d.obj.field});
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- viewModel.query.toggleFacet({facet: d.obj, widget_id: d.obj.widget_id});
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $root.query.togglePivotFacet({facet: d.obj, widget_id: id()});
|
|
|
},
|
|
},
|
|
|
- onSelectRange: function(from, to){ viewModel.collection.selectTimelineFacet({from: from, to: to, cat: field, widget_id: $parent.id()}) },
|
|
|
|
|
- onComplete: function(){ viewModel.getWidgetById($parent.id()).isLoading(false) } }"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ onComplete: function(){ viewModel.getWidgetById($parent.id()).isLoading(false) } }" />
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
</div>
|
|
</div>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
@@ -1033,6 +1085,7 @@ ${ dashboard.layout_skeleton() }
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
<div class="clearfix"></div>
|
|
<div class="clearfix"></div>
|
|
|
|
|
|
|
|
<!-- ko if: properties.scope() == 'tree' -->
|
|
<!-- ko if: properties.scope() == 'tree' -->
|
|
@@ -1047,7 +1100,6 @@ ${ dashboard.layout_skeleton() }
|
|
|
onComplete: function(){ viewModel.getWidgetById($parent.id()).isLoading(false) } }"
|
|
onComplete: function(){ viewModel.getWidgetById($parent.id()).isLoading(false) } }"
|
|
|
/>
|
|
/>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
-
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
@@ -1100,8 +1152,8 @@ ${ dashboard.layout_skeleton() }
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
<div class="clearfix"></div>
|
|
<div class="clearfix"></div>
|
|
|
|
|
|
|
|
<!-- ko if: properties.scope() == 'stack' -->
|
|
<!-- ko if: properties.scope() == 'stack' -->
|
|
@@ -1138,9 +1190,9 @@ ${ dashboard.layout_skeleton() }
|
|
|
<div data-bind="with: $root.collection.getFacetById($parent.id())">
|
|
<div data-bind="with: $root.collection.getFacetById($parent.id())">
|
|
|
<div data-bind="visible: $root.isEditing" style="margin-bottom: 20px">
|
|
<div data-bind="visible: $root.isEditing" style="margin-bottom: 20px">
|
|
|
<span class="facet-field-label">${ _('Metric') }</span>
|
|
<span class="facet-field-label">${ _('Metric') }</span>
|
|
|
- <select data-bind="options: HIT_OPTIONS, optionsText: 'label', optionsValue: 'value', value: properties.function"></select>
|
|
|
|
|
|
|
+ <select data-bind="options: HIT_OPTIONS, optionsText: 'label', optionsValue: 'value', value: properties.aggregate"></select>
|
|
|
</div>
|
|
</div>
|
|
|
- <div data-bind="visible: ! $root.isEditing(), text: getHitOption(properties.function())" class="muted"></div>
|
|
|
|
|
|
|
+ <div data-bind="visible: ! $root.isEditing(), text: getHitOption(properties.aggregate())" class="muted"></div>
|
|
|
</div>
|
|
</div>
|
|
|
<span class="big-counter" data-bind="textSqueezer: counts"></span>
|
|
<span class="big-counter" data-bind="textSqueezer: counts"></span>
|
|
|
</div>
|
|
</div>
|
|
@@ -1536,6 +1588,7 @@ var viewModel;
|
|
|
nv.dev = false;
|
|
nv.dev = false;
|
|
|
|
|
|
|
|
var HIT_OPTIONS = [
|
|
var HIT_OPTIONS = [
|
|
|
|
|
+ { value: "count", label: "${ _('Count') }" },
|
|
|
{ value: "unique", label: "${ _('Unique Count') }" },
|
|
{ value: "unique", label: "${ _('Unique Count') }" },
|
|
|
{ value: "avg", label: "${ _('Average') }" },
|
|
{ value: "avg", label: "${ _('Average') }" },
|
|
|
{ value: "sum", label: "${ _('Sum') }" },
|
|
{ value: "sum", label: "${ _('Sum') }" },
|
|
@@ -1546,7 +1599,7 @@ var HIT_OPTIONS = [
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
function getHitOption(value){
|
|
function getHitOption(value){
|
|
|
- for (var i=0;i<HIT_OPTIONS.length;i++){
|
|
|
|
|
|
|
+ for (var i=0; i < HIT_OPTIONS.length; i++){
|
|
|
if (HIT_OPTIONS[i].value == value){
|
|
if (HIT_OPTIONS[i].value == value){
|
|
|
return HIT_OPTIONS[i].label;
|
|
return HIT_OPTIONS[i].label;
|
|
|
}
|
|
}
|
|
@@ -1700,6 +1753,7 @@ function pivotChartDataTransformer(rawDatum) {
|
|
|
|
|
|
|
|
var _key = Array.isArray(item.value) ? item.value[1] : item.value;
|
|
var _key = Array.isArray(item.value) ? item.value[1] : item.value;
|
|
|
var _category = null;
|
|
var _category = null;
|
|
|
|
|
+
|
|
|
_categories.forEach(function (category) {
|
|
_categories.forEach(function (category) {
|
|
|
if (category.key == _key) {
|
|
if (category.key == _key) {
|
|
|
_category = category;
|
|
_category = category;
|