Skip to content

Commit

Permalink
Merge pull request #52 from qlik-oss/dmh/bugFix-revert
Browse files Browse the repository at this point in the history
revert: bug fix QB-21289
  • Loading branch information
Donya-qlik authored Nov 15, 2023
2 parents bc46cff + 8665204 commit d9f6bed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 40 deletions.
25 changes: 1 addition & 24 deletions src/bridgepicassospec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ThemeManager from './theme';
import { interactionsSetup } from './interactions.js';

export default function (element, layout, direction, isInteractable, ds) {
export default function (element, layout, direction, isInteractable) {
let labels = {
startvalue: layout.labelsshow ? "Start Value" : layout.startName,
endvalue: layout.labelsshow ? "End Value" : layout.endName,
Expand Down Expand Up @@ -33,26 +33,6 @@ export default function (element, layout, direction, isInteractable, ds) {
dockRight = 'left';
}

const shouldUseFormat = (measureInfo) => !measureInfo.isCustomFormatted && (measureInfo.qIsAutoFormat || measureInfo.qNumFormat.qType === 'U');

const setFormatCell = (cell, field) => {
const measureInfo = ds.field(field).raw();
const formatter = ds.field(field).formatter();
const useFormatter = shouldUseFormat(measureInfo);
const formatCell = (cell) => (cell.qNum === 'NaN' ? '-' : formatter(cell.qNum));
return (useFormatter ? formatCell(cell) : cell.qText);
};

const startLabelFn = (cell) => {
const field = 'qMeasureInfo/1';
return setFormatCell(cell, field);
};

const endLabelFn = (cell) => {
const field = 'qMeasureInfo/0';
return setFormatCell(cell, field);
};

return {
interactions: (!isInteractable ? [] : interactionsSetup()),
scales: {
Expand Down Expand Up @@ -191,15 +171,12 @@ export default function (element, layout, direction, isInteractable, ds) {
props: {
start: {
field: 'qMeasureInfo/0',
label: startLabelFn
},
end: {
field: 'qMeasureInfo/1',
label: endLabelFn
},
var: {
field: 'qMeasureInfo/2',
label: endLabelFn
}
}
}
Expand Down
21 changes: 6 additions & 15 deletions src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export default ['$scope', '$element', function($scope, $element) {
$scope.updated = false;

$scope.app = qlik.currApp(this);
const localeInfo = $scope.app.model.layout.qLocaleInfo;

picasso.use(pq);
picasso.use(picassoHammer);

Expand All @@ -44,29 +42,22 @@ export default ['$scope', '$element', function($scope, $element) {
$scope.chartBrush
= enableSelectionOnFirstDimension($scope, $scope.chart, 'highlight', $scope.layout);
$scope.updatedData = async function(layout, isEditMode, dataUpdate) {
const data = {
type: 'q',
key: 'qHyperCube',
config: {
localeInfo,
},
data: await initVarianceCube($scope, layout)
};
const ds = picasso.data('q')(data);

let up = {};

if (dataUpdate) {
up.data = [data];
up.data = [{
type: 'q',
key: 'qHyperCube',
data: await initVarianceCube($scope, layout)
}];
}

if (isEditMode || typeof $scope.chart.settings === 'undefined') {
up.settings = bridgepicassospec(
$scope.chart.element,
layout,
$scope.$parent.options.direction,
!isEditMode && !$scope.backendApi.isSnapshot && !layout.qHyperCube.qDimensionInfo[0].qLocked,
ds);
!isEditMode && !$scope.backendApi.isSnapshot && !layout.qHyperCube.qDimensionInfo[0].qLocked);
}

$scope.chart.update(up);
Expand Down
1 change: 0 additions & 1 deletion src/converthypercube.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class ConvertHypercube {
qAttrExprInfo: mesInfo.qAttrExprInfo.map(i => i),
qCardinal: mesInfo.qCardinal,
qFallbackTitle: mesInfo.qFallbackTitle,
qIsAutoFormat: mesInfo.qIsAutoFormat,
qMax: max, //mesInfo.qMax,
qMin: min, //mesInfo.qMin,
qSortIndicator: mesInfo.qSortIndicator,
Expand Down

0 comments on commit d9f6bed

Please sign in to comment.