forked from iviasensio/PLSmartPivot
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from qlik-oss/DEB-177/ConditionalColoring
Replaced semaphores with Conditional Coloring
- Loading branch information
Showing
6 changed files
with
205 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
const conditionalColoring = { | ||
type: 'items', | ||
label: 'Color by condition', | ||
items: { | ||
Enabled: { | ||
ref: 'conditionalcoloring.enabled', | ||
type: 'boolean', | ||
label: 'Enabled', | ||
component: 'switch', | ||
defaultValue: false, | ||
options: [ | ||
{ | ||
value: true, | ||
label: 'On' | ||
}, | ||
{ | ||
value: false, | ||
label: 'Off' | ||
} | ||
] | ||
}, | ||
ColorAllRows: { | ||
ref: 'conditionalcoloring.colorall', | ||
type: 'boolean', | ||
label: 'Color all rows by condition', | ||
component: 'switch', | ||
defaultValue: true, | ||
options: [ | ||
{ | ||
value: true, | ||
label: 'All rows' | ||
}, | ||
{ | ||
value: false, | ||
label: 'Specified rows' | ||
} | ||
], | ||
show (data) { | ||
return data.conditionalcoloring.enabled; | ||
} | ||
}, | ||
Rows: { | ||
type: 'array', | ||
ref: 'conditionalcoloring.rows', | ||
label: 'Rows to color', | ||
itemTitleRef: function (data) { | ||
return data.rowname; | ||
}, | ||
allowAdd: true, | ||
allowRemove: true, | ||
addTranslation: 'Add row to color', | ||
items: { | ||
Row: { | ||
ref: 'rowname', | ||
label: 'Name of row', | ||
type: 'string', | ||
defaultValue: '' | ||
} | ||
}, | ||
show (data) { | ||
return data.conditionalcoloring.enabled && !data.conditionalcoloring.colorall; | ||
} | ||
}, | ||
ThresholdPoor: { | ||
ref: 'conditionalcoloring.threshold_poor', | ||
translation: 'Poor is less than', | ||
type: 'number', | ||
defaultValue: -0.1, | ||
show (data) { | ||
return data.conditionalcoloring.enabled; | ||
} | ||
}, | ||
ColorPoor: { | ||
ref: 'conditionalcoloring.color_poor', | ||
label: 'Poor color fill', | ||
type: 'object', | ||
component: 'color-picker', | ||
dualOutput: true, | ||
defaultValue: { | ||
index: 10, | ||
color: '#f93f17' | ||
}, | ||
show (data) { | ||
return data.conditionalcoloring.enabled; | ||
} | ||
}, | ||
TextColorPoor: { | ||
ref: 'conditionalcoloring.textcolor_poor', | ||
label: 'Poor text color', | ||
type: 'object', | ||
component: 'color-picker', | ||
dualOutput: true, | ||
defaultValue: { | ||
index: 1, | ||
color: '#ffffff' | ||
}, | ||
show (data) { | ||
return data.conditionalcoloring.enabled; | ||
} | ||
}, | ||
ThresholdFair: { | ||
ref: 'conditionalcoloring.threshold_fair', | ||
translation: 'Fair is less than', | ||
type: 'number', | ||
defaultValue: 0, | ||
show (data) { | ||
return data.conditionalcoloring.enabled; | ||
} | ||
}, | ||
ColorFair: { | ||
ref: 'conditionalcoloring.color_fair', | ||
label: 'Fair color fill', | ||
type: 'object', | ||
component: 'color-picker', | ||
dualOutput: true, | ||
defaultValue: { | ||
index: 8, | ||
color: '#ffcf02' | ||
}, | ||
show (data) { | ||
return data.conditionalcoloring.enabled; | ||
} | ||
}, | ||
TextColorFair: { | ||
ref: 'conditionalcoloring.textcolor_fair', | ||
label: 'Fair text color', | ||
type: 'object', | ||
component: 'color-picker', | ||
dualOutput: true, | ||
defaultValue: { | ||
index: 15, | ||
color: '#000000' | ||
}, | ||
show (data) { | ||
return data.conditionalcoloring.enabled; | ||
} | ||
}, | ||
ColorGood: { | ||
ref: 'conditionalcoloring.color_good', | ||
label: 'Good color fill', | ||
type: 'object', | ||
component: 'color-picker', | ||
dualOutput: true, | ||
defaultValue: { | ||
index: 3, | ||
color: '#276e27' | ||
}, | ||
show (data) { | ||
return data.conditionalcoloring.enabled; | ||
} | ||
}, | ||
TextColorGood: { | ||
ref: 'conditionalcoloring.textcolor_good', | ||
label: 'Good text color', | ||
type: 'object', | ||
component: 'color-picker', | ||
dualOutput: true, | ||
defaultValue: { | ||
index: 1, | ||
color: '#ffffff' | ||
}, | ||
show (data) { | ||
return data.conditionalcoloring.enabled; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default conditionalColoring; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.