From 8a86fe4a300f050da7332490b923d4dc749fe30b Mon Sep 17 00:00:00 2001 From: Kristoffer Lind Date: Wed, 30 Jan 2019 08:44:45 +0100 Subject: [PATCH] refactor entrypoint --- .eslintrc.js | 4 +- src/definition/color-library.js | 68 ++ src/definition/concept-semaphores.js | 96 +++ src/definition/formatted.js | 239 +++++++ src/definition/header.js | 144 +++++ src/definition/index.js | 41 ++ src/definition/metric-semaphores.js | 106 +++ src/definition/pagination.js | 63 ++ src/definition/pijama-color-library.js | 68 ++ src/index.js | 860 +------------------------ 10 files changed, 851 insertions(+), 838 deletions(-) create mode 100644 src/definition/color-library.js create mode 100644 src/definition/concept-semaphores.js create mode 100644 src/definition/formatted.js create mode 100644 src/definition/header.js create mode 100644 src/definition/index.js create mode 100644 src/definition/metric-semaphores.js create mode 100644 src/definition/pagination.js create mode 100644 src/definition/pijama-color-library.js diff --git a/.eslintrc.js b/.eslintrc.js index ff0eb8e..2328397 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -82,7 +82,7 @@ module.exports = { "no-lonely-if": ["warn"], "sort-keys": ["warn"], "no-implicit-coercion": ["warn"], - "no-inline-comments": ["warn"], + "no-inline-comments": ["off"], "spaced-comment": ["warn"], "require-jsdoc": ["off"], "func-style": ["off"], @@ -99,7 +99,7 @@ module.exports = { "array-element-newline": ["warn"], "object-shorthand": ["warn"], "eqeqeq": ["warn"], - "no-empty-function": ["warn"], + "no-empty-function": ["off"], "function-paren-newline": ["warn"], "no-invalid-this": ["warn"], "newline-per-chained-call": ["warn"], diff --git a/src/definition/color-library.js b/src/definition/color-library.js new file mode 100644 index 0000000..0d835f0 --- /dev/null +++ b/src/definition/color-library.js @@ -0,0 +1,68 @@ +const colorLibrary = { + type: 'items', + label: 'Primary Colors Library', + items: { + ColLibClean: { + ref: 'collibclean', + translation: 'Clean', + type: 'string', + defaultValue: '#ffffff' + }, + ColLibSoft: { + ref: 'collibsoft', + translation: 'Soft', + type: 'string', + defaultValue: '#efefef' + }, + ColLibDark: { + ref: 'collibdark', + translation: 'Dark', + type: 'string', + defaultValue: '#c4c4c4' + }, + ColLibNight: { + ref: 'collibnight', + translation: 'Night', + type: 'string', + defaultValue: '#808080' + }, + ColLibRed: { + ref: 'collibred', + translation: 'Red', + type: 'string', + defaultValue: '#d58b94' + }, + ColLibOrange: { + ref: 'colliborange', + translation: 'Orange', + type: 'string', + defaultValue: '#fd6600' + }, + ColLibViolete: { + ref: 'collibviolete', + translation: 'Violete', + type: 'string', + defaultValue: '#ccc0ff' + }, + ColLibBlue: { + ref: 'collibblue', + translation: 'Blue', + type: 'string', + defaultValue: '#4575b4' + }, + ColLibGreen: { + ref: 'collibgreen', + translation: 'Green', + type: 'string', + defaultValue: '#7bb51c' + }, + ColLibCustom: { + ref: 'collibcustom', + label: 'Custom', + type: 'string', + defaultValue: '#ffcccc' + } + } +}; + +export default colorLibrary; diff --git a/src/definition/concept-semaphores.js b/src/definition/concept-semaphores.js new file mode 100644 index 0000000..78a7bc5 --- /dev/null +++ b/src/definition/concept-semaphores.js @@ -0,0 +1,96 @@ +const conceptSemaphores = { + items: { + AllConcepts: { + component: 'switch', + defaultValue: true, + label: 'All concepts affected', + options: [ + { + label: 'On', + value: true + }, + { + label: 'Off', + value: false + } + ], + ref: 'allsemaphores', + type: 'boolean' + }, + ConceptsAffected1: { + defaultValue: '', + ref: 'conceptsemaphore1', + show: data => !data.allsemaphores, + translation: 'Concept 1', + type: 'string' + }, + ConceptsAffected2: { + defaultValue: '', + ref: 'conceptsemaphore2', + show: data => !data.allsemaphores, + translation: 'Concept 2', + type: 'string' + }, + ConceptsAffected3: { + defaultValue: '', + ref: 'conceptsemaphore3', + show: data => !data.allsemaphores, + translation: 'Concept 3', + type: 'string' + }, + ConceptsAffected4: { + defaultValue: '', + ref: 'conceptsemaphore4', + show: data => !data.allsemaphores, + translation: 'Concept 4', + type: 'string' + }, + ConceptsAffected5: { + defaultValue: '', + ref: 'conceptsemaphore5', + show: data => !data.allsemaphores, + translation: 'Concept 5', + type: 'string' + }, + ConceptsAffected6: { + defaultValue: '', + ref: 'conceptsemaphore6', + show: data => !data.allsemaphores, + translation: 'Concept 6', + type: 'string' + }, + ConceptsAffected7: { + defaultValue: '', + ref: 'conceptsemaphore7', + show: data => !data.allsemaphores, + translation: 'Concept 7', + type: 'string' + }, + ConceptsAffected8: { + defaultValue: '', + ref: 'conceptsemaphore8', + show: data => !data.allsemaphores, + translation: 'Concept 8', + type: 'string' + }, + ConceptsAffected9: { + defaultValue: '', + ref: 'conceptsemaphore9', + show: data => !data.allsemaphores, + translation: 'Concept 9', + type: 'string' + }, + // eslint-disable-next-line sort-keys + ConceptsAffected10: { + defaultValue: '', + ref: 'conceptsemaphore10', + show: data => !data.allsemaphores, + translation: 'Concept 10', + type: 'string' + } + }, + label: 'Concept Semaphores', + type: 'items' +}; + +export default conceptSemaphores; diff --git a/src/definition/formatted.js b/src/definition/formatted.js new file mode 100644 index 0000000..3e1cce6 --- /dev/null +++ b/src/definition/formatted.js @@ -0,0 +1,239 @@ +const formatted = { + type: 'items', + label: 'Table Format', + items: { + IndentBool: { + ref: 'indentbool', + type: 'boolean', + label: 'Indent', + defaultValue: true + }, + SeparatorColumns: { + ref: 'separatorcols', + type: 'boolean', + label: 'Separator Columns', + defaultValue: false + }, + CustomFileBool: { + ref: 'customfilebool', + type: 'boolean', + label: 'Include External File', + defaultValue: false + }, + CustomFile: { + ref: 'customfile', + label: 'Name of CSV file (; separated)', + type: 'string', + defaultValue: '', + show (data) { + return data.customfilebool; + } + }, + colors: { + ref: 'ColorSchema', + type: 'string', + component: 'dropdown', + label: 'BackGround Style', + options: [ + { + value: 'Clean', + label: 'Clean' + }, + { + value: 'Soft', + label: 'Soft' + }, + { + value: 'Dark', + label: 'Dark' + }, + { + value: 'Night', + label: 'Night' + }, + { + value: 'Blue', + label: 'Blue' + }, + { + value: 'Orange', + label: 'Orange' + }, + { + value: 'Red', + label: 'Red' + }, + { + value: 'Green', + label: 'Green' + }, + { + value: 'Violete', + label: 'Violete' + }, + { + value: 'Custom', + label: 'Custom' + } + ], + defaultValue: 'Clean', + show (data) { + return data.customfilebool == false; + } + }, + BodyTextColor: { + ref: 'BodyTextColorSchema', + type: 'string', + component: 'dropdown', + label: 'Text Body Color', + options: [ + { + value: 'Black', + label: 'Black' + }, + { + value: 'DimGray', + label: 'DimGray' + }, + { + value: 'ForestGreen', + label: 'ForestGreen' + }, + { + value: 'Gainsboro', + label: 'Gainsboro' + }, + { + value: 'Indigo', + label: 'Indigo' + }, + { + value: 'Navy', + label: 'Navy' + }, + { + value: 'Purple', + label: 'Purple' + }, + { + value: 'WhiteSmoke', + label: 'WhiteSmoke' + }, + { + value: 'White', + label: 'White' + }, + { + value: 'YellowGreen', + label: 'YellowGreen' + } + ], + defaultValue: 'Black', + show (data) { + return data.customfilebool == false; + } + }, + FontFamily: { + ref: 'FontFamily', + type: 'string', + component: 'dropdown', + label: 'FontFamily', + options: [ + { + value: 'Arial', + label: 'Arial' + }, + { + value: 'Calibri', + label: 'Calibri' + }, + { + value: 'Comic Sans MS', + label: 'Comic Sans MS' + }, + { + value: 'MS Sans Serif', + label: 'MS Sans Serif' + }, + { + value: 'Tahoma', + label: 'Tahoma' + }, + { + value: 'Verdana', + label: 'Verdana' + } + ], + defaultValue: 'Calibri' + }, + DataFontSize: { + ref: 'lettersize', + translation: 'Font Size', + type: 'number', + component: 'buttongroup', + options: [ + { + value: 1, + label: 'Small' + }, + { + value: 2, + label: 'Medium' + } + ], + defaultValue: 2 + }, + ColumnWidthSlider: { + type: 'number', + component: 'slider', + label: 'Column Width', + ref: 'columnwidthslider', + min: 1, + max: 3, + step: 1, + defaultValue: 2 + }, + SymbolForNulls: { + ref: 'symbolfornulls', + label: 'Symbol for Nulls', + type: 'string', + defaultValue: ' ' + }, + AllowExportXLS: { + ref: 'allowexportxls', + type: 'boolean', + component: 'switch', + label: 'Allow export to Excel', + options: [ + { + value: true, + label: 'On' + }, + { + value: false, + label: 'Off' + } + ], + defaultValue: true + }, + FilterOnCellClick: { + ref: 'filteroncellclick', + type: 'boolean', + component: 'switch', + label: 'Filter data when cell clicked', + options: [ + { + value: true, + label: 'On' + }, + { + value: false, + label: 'Off' + } + ], + defaultValue: true + } + } +}; + +export default formatted; diff --git a/src/definition/header.js b/src/definition/header.js new file mode 100644 index 0000000..ebf830a --- /dev/null +++ b/src/definition/header.js @@ -0,0 +1,144 @@ +const header = { + type: 'items', + label: 'Header Format', + items: { + Align: { + ref: 'HeaderAlign', + translation: 'Header Alignment', + type: 'number', + component: 'buttongroup', + options: [ + { + value: 1, + label: 'Left' + }, + { + value: 2, + label: 'Center' + }, + { + value: 3, + label: 'Right' + } + ], + defaultValue: 2 + }, + headercolors: { + ref: 'HeaderColorSchema', + type: 'string', + component: 'dropdown', + label: 'BackGround Header Color', + options: [ + { + value: 'Clean', + label: 'Clean' + }, + { + value: 'Soft', + label: 'Soft' + }, + { + value: 'Dark', + label: 'Dark' + }, + { + value: 'Night', + label: 'Night' + }, + { + value: 'Blue', + label: 'Blue' + }, + { + value: 'Orange', + label: 'Orange' + }, + { + value: 'Red', + label: 'Red' + }, + { + value: 'Green', + label: 'Green' + }, + { + value: 'Violete', + label: 'Violete' + }, + { + value: 'Custom', + label: 'Custom' + } + ], + defaultValue: 'Night' + }, + HeaderTextColor: { + ref: 'HeaderTextColorSchema', + type: 'string', + component: 'dropdown', + label: 'Text Header Color', + options: [ + { + value: 'Black', + label: 'Black' + }, + { + value: 'DimGray', + label: 'DimGray' + }, + { + value: 'ForestGreen', + label: 'ForestGreen' + }, + { + value: 'Gainsboro', + label: 'Gainsboro' + }, + { + value: 'Indigo', + label: 'Indigo' + }, + { + value: 'Navy', + label: 'Navy' + }, + { + value: 'Purple', + label: 'Purple' + }, + { + value: 'WhiteSmoke', + label: 'WhiteSmoke' + }, + { + value: 'White', + label: 'White' + }, + { + value: 'YellowGreen', + label: 'YellowGreen' + } + ], + defaultValue: 'WhiteSmoke' + }, + HeaderFontSize: { + ref: 'lettersizeheader', + translation: 'Font Size', + type: 'number', + component: 'buttongroup', + options: [ + { + value: 1, + label: 'Small' + }, + { + value: 2, + label: 'Medium' + } + ], + defaultValue: 2 + } + } +}; + +export default header; diff --git a/src/definition/index.js b/src/definition/index.js new file mode 100644 index 0000000..fd6a2a9 --- /dev/null +++ b/src/definition/index.js @@ -0,0 +1,41 @@ +import pagination from './pagination'; +import header from './header'; +import formatted from './formatted'; +import conceptSemaphores from './concept-semaphores'; +import metricSemaphores from './metric-semaphores'; +import colorLibrary from './color-library'; +import pijamaColorLibrary from './pijama-color-library'; + +const definition = { + component: 'accordion', + items: { + dimensions: { + max: 2, + min: 1, + uses: 'dimensions' + }, + measures: { + max: 9, + min: 1, + uses: 'measures' + }, + settings: { + items: { + ColorLibrary: colorLibrary, + ConceptSemaphores: conceptSemaphores, + Formatted: formatted, + Header: header, + MetricSemaphores: metricSemaphores, + Pagination: pagination, + PijamaColorLibrary: pijamaColorLibrary + }, + uses: 'settings' + }, + sorting: { + uses: 'sorting' + } + }, + type: 'items' +}; + +export default definition; diff --git a/src/definition/metric-semaphores.js b/src/definition/metric-semaphores.js new file mode 100644 index 0000000..73bbc61 --- /dev/null +++ b/src/definition/metric-semaphores.js @@ -0,0 +1,106 @@ +const metricSemaphores = { + type: 'items', + label: 'Metric Semaphores', + items: { + AllMetrics: { + ref: 'allmetrics', + type: 'boolean', + component: 'switch', + label: 'All metrics affected', + options: [ + { + value: true, + label: 'On' + }, + { + value: false, + label: 'Off' + } + ], + defaultValue: false + }, + MetricsAffected: { + ref: 'metricssemaphore', + translation: 'Metrics affected (1,2,4,...)', + type: 'string', + defaultValue: '0', + show (data) { + return data.allmetrics == false; + } + }, + MetricStatus1: { + ref: 'metricsstatus1', + translation: 'Critic is less than', + type: 'number', + defaultValue: -0.1 + }, + ColorStatus1: { + ref: 'colorstatus1', + label: 'Critic Color Fill', + type: 'object', + component: 'color-picker', + defaultValue: { + index: 7, + color: '#f93f17' + } + }, + ColorStatus1Text: { + ref: 'colorstatus1text', + label: 'Critic Color Text', + type: 'object', + component: 'color-picker', + defaultValue: { + index: 10, + color: '#ffffff' + } + }, + MetricStatus2: { + ref: 'metricsstatus2', + translation: 'Medium is less than', + type: 'number', + defaultValue: 0 + }, + ColorStatus2: { + ref: 'colorstatus2', + label: 'Medium Color Fill', + type: 'object', + component: 'color-picker', + defaultValue: { + index: 8, + color: '#ffcf02' + } + }, + ColorStatus2Text: { + ref: 'colorstatus2text', + label: 'Medium Color Text', + type: 'object', + component: 'color-picker', + defaultValue: { + index: 11, + color: '#000000' + } + }, + ColorStatus3: { + ref: 'colorstatus3', + label: 'Success Color Fill', + type: 'object', + component: 'color-picker', + defaultValue: { + index: 9, + color: '#276e27' + } + }, + ColorStatus3Text: { + ref: 'colorstatus3text', + label: 'Success Color Text', + type: 'object', + component: 'color-picker', + defaultValue: { + index: 10, + color: '#ffffff' + } + } + } +}; + +export default metricSemaphores; diff --git a/src/definition/pagination.js b/src/definition/pagination.js new file mode 100644 index 0000000..d050444 --- /dev/null +++ b/src/definition/pagination.js @@ -0,0 +1,63 @@ +const pagination = { + type: 'items', + label: 'Pagination', + items: { + MaxPaginationLoops: { + ref: 'maxloops', + type: 'number', + component: 'dropdown', + label: 'Max Pagination Loops', + options: [ + { + value: 1, + label: '10k cells' + }, + { + value: 2, + label: '20k cells' + }, + { + value: 3, + label: '30k cells' + }, + { + value: 4, + label: '40k cells' + }, + { + value: 5, + label: '50k cells' + }, + { + value: 6, + label: '60k cells' + }, + { + value: 7, + label: '70k cells' + }, + { + value: 8, + label: '80k cells' + }, + { + value: 9, + label: '90k cells' + }, + { + value: 10, + label: '100k cells' + } + ], + defaultValue: 2 + }, + ErrorMessage: { + ref: 'errormessage', + label: 'Default error message', + type: 'string', + defaultValue: 'Ups! It seems you asked for too many data. Please filter more to see the whole picture.' + } + } +}; + +export default pagination; diff --git a/src/definition/pijama-color-library.js b/src/definition/pijama-color-library.js new file mode 100644 index 0000000..22c56ad --- /dev/null +++ b/src/definition/pijama-color-library.js @@ -0,0 +1,68 @@ +const pijamaColorLibrary = { + type: 'items', + label: 'Pijama Colors Library', + items: { + ColLibCleanP: { + ref: 'collibcleanp', + translation: 'Clean', + type: 'string', + defaultValue: '#ffffff' + }, + ColLibSoftP: { + ref: 'collibsoftp', + translation: 'Soft', + type: 'string', + defaultValue: '#ffffff' + }, + ColLibDarkP: { + ref: 'collibdarkp', + translation: 'Dark', + type: 'string', + defaultValue: '#efefef' + }, + ColLibNightP: { + ref: 'collibnightp', + translation: 'Night', + type: 'string', + defaultValue: '#c4c4c4' + }, + ColLibRedP: { + ref: 'collibredp', + translation: 'Red', + type: 'string', + defaultValue: '#ffcccc' + }, + ColLibOrangeP: { + ref: 'colliborangep', + translation: 'Orange', + type: 'string', + defaultValue: '#ffcc66' + }, + ColLibVioleteP: { + ref: 'collibvioletep', + translation: 'Violete', + type: 'string', + defaultValue: '#e6e6ff' + }, + ColLibBlueP: { + ref: 'collibbluep', + translation: 'Blue', + type: 'string', + defaultValue: '#b3d9ff' + }, + ColLibGreenP: { + ref: 'collibgreenp', + translation: 'Green', + type: 'string', + defaultValue: '#98fb98' + }, + ColLibCustomP: { + ref: 'collibcustomp', + label: 'Custom', + type: 'string', + defaultValue: '#ffffff' + } + } +}; + +export default pijamaColorLibrary; diff --git a/src/index.js b/src/index.js index e2b1c35..e9524b1 100644 --- a/src/index.js +++ b/src/index.js @@ -1,849 +1,37 @@ -import paint from './paint'; -import './main.less'; import '@babel/polyfill'; +import paint from './paint'; +import definition from './definition'; +import './main.less'; export default { - initialProperties: { - version: 1.0, - qHyperCubeDef: { - qDimensions: [], - qMeasures: [], - qInitialDataFetch: [ - { - qWidth: 10, - qHeight: 1000 - } - ] - } - }, - // TODO: make definition folder where root of this is index.js and each settings item is a seperate file - definition: { - type: 'items', - component: 'accordion', - items: { - dimensions: { - uses: 'dimensions', - min: 1, - max: 2 - }, - measures: { - uses: 'measures', - min: 1, - max: 9 - }, - sorting: { - uses: 'sorting' - }, - settings: { - uses: 'settings', - items: { - Pagination: { - type: 'items', - label: 'Pagination', - items: { - MaxPaginationLoops: { - ref: 'maxloops', - type: 'number', - component: 'dropdown', - label: 'Max Pagination Loops', - options: [ - { - value: 1, - label: '10k cells' - }, - { - value: 2, - label: '20k cells' - }, - { - value: 3, - label: '30k cells' - }, - { - value: 4, - label: '40k cells' - }, - { - value: 5, - label: '50k cells' - }, - { - value: 6, - label: '60k cells' - }, - { - value: 7, - label: '70k cells' - }, - { - value: 8, - label: '80k cells' - }, - { - value: 9, - label: '90k cells' - }, - { - value: 10, - label: '100k cells' - } - ], - defaultValue: 2 - }, - ErrorMessage: { - ref: 'errormessage', - label: 'Default error message', - type: 'string', - defaultValue: 'Ups! It seems you asked for too many data. Please filter more to see the whole picture.' - } - } - }, - Header: { - type: 'items', - label: 'Header Format', - items: { - Align: { - ref: 'HeaderAlign', - translation: 'Header Alignment', - type: 'number', - component: 'buttongroup', - options: [ - { - value: 1, - label: 'Left' - }, - { - value: 2, - label: 'Center' - }, - { - value: 3, - label: 'Right' - } - ], - defaultValue: 2 - }, - headercolors: { - ref: 'HeaderColorSchema', - type: 'string', - component: 'dropdown', - label: 'BackGround Header Color', - options: [ - { - value: 'Clean', - label: 'Clean' - }, - { - value: 'Soft', - label: 'Soft' - }, - { - value: 'Dark', - label: 'Dark' - }, - { - value: 'Night', - label: 'Night' - }, - { - value: 'Blue', - label: 'Blue' - }, - { - value: 'Orange', - label: 'Orange' - }, - { - value: 'Red', - label: 'Red' - }, - { - value: 'Green', - label: 'Green' - }, - { - value: 'Violete', - label: 'Violete' - }, - { - value: 'Custom', - label: 'Custom' - } - ], - defaultValue: 'Night' - }, - HeaderTextColor: { - ref: 'HeaderTextColorSchema', - type: 'string', - component: 'dropdown', - label: 'Text Header Color', - options: [ - { - value: 'Black', - label: 'Black' - }, - { - value: 'DimGray', - label: 'DimGray' - }, - { - value: 'ForestGreen', - label: 'ForestGreen' - }, - { - value: 'Gainsboro', - label: 'Gainsboro' - }, - { - value: 'Indigo', - label: 'Indigo' - }, - { - value: 'Navy', - label: 'Navy' - }, - { - value: 'Purple', - label: 'Purple' - }, - { - value: 'WhiteSmoke', - label: 'WhiteSmoke' - }, - { - value: 'White', - label: 'White' - }, - { - value: 'YellowGreen', - label: 'YellowGreen' - } - ], - defaultValue: 'WhiteSmoke' - }, - HeaderFontSize: { - ref: 'lettersizeheader', - translation: 'Font Size', - type: 'number', - component: 'buttongroup', - options: [ - { - value: 1, - label: 'Small' - }, - { - value: 2, - label: 'Medium' - } - ], - defaultValue: 2 - } - } - }, - Formatted: { - type: 'items', - label: 'Table Format', - items: { - IndentBool: { - ref: 'indentbool', - type: 'boolean', - label: 'Indent', - defaultValue: true - }, - SeparatorColumns: { - ref: 'separatorcols', - type: 'boolean', - label: 'Separator Columns', - defaultValue: false - }, - CustomFileBool: { - ref: 'customfilebool', - type: 'boolean', - label: 'Include External File', - defaultValue: false - }, - CustomFile: { - ref: 'customfile', - label: 'Name of CSV file (; separated)', - type: 'string', - defaultValue: '', - show (data) { - return data.customfilebool; - } - }, - colors: { - ref: 'ColorSchema', - type: 'string', - component: 'dropdown', - label: 'BackGround Style', - options: [ - { - value: 'Clean', - label: 'Clean' - }, - { - value: 'Soft', - label: 'Soft' - }, - { - value: 'Dark', - label: 'Dark' - }, - { - value: 'Night', - label: 'Night' - }, - { - value: 'Blue', - label: 'Blue' - }, - { - value: 'Orange', - label: 'Orange' - }, - { - value: 'Red', - label: 'Red' - }, - { - value: 'Green', - label: 'Green' - }, - { - value: 'Violete', - label: 'Violete' - }, - { - value: 'Custom', - label: 'Custom' - } - ], - defaultValue: 'Clean', - show (data) { - return data.customfilebool == false; - } - }, - BodyTextColor: { - ref: 'BodyTextColorSchema', - type: 'string', - component: 'dropdown', - label: 'Text Body Color', - options: [ - { - value: 'Black', - label: 'Black' - }, - { - value: 'DimGray', - label: 'DimGray' - }, - { - value: 'ForestGreen', - label: 'ForestGreen' - }, - { - value: 'Gainsboro', - label: 'Gainsboro' - }, - { - value: 'Indigo', - label: 'Indigo' - }, - { - value: 'Navy', - label: 'Navy' - }, - { - value: 'Purple', - label: 'Purple' - }, - { - value: 'WhiteSmoke', - label: 'WhiteSmoke' - }, - { - value: 'White', - label: 'White' - }, - { - value: 'YellowGreen', - label: 'YellowGreen' - } - ], - defaultValue: 'Black', - show (data) { - return data.customfilebool == false; - } - }, - FontFamily: { - ref: 'FontFamily', - type: 'string', - component: 'dropdown', - label: 'FontFamily', - options: [ - { - value: 'Arial', - label: 'Arial' - }, - { - value: 'Calibri', - label: 'Calibri' - }, - { - value: 'Comic Sans MS', - label: 'Comic Sans MS' - }, - { - value: 'MS Sans Serif', - label: 'MS Sans Serif' - }, - { - value: 'Tahoma', - label: 'Tahoma' - }, - { - value: 'Verdana', - label: 'Verdana' - } - ], - defaultValue: 'Calibri' - }, - DataFontSize: { - ref: 'lettersize', - translation: 'Font Size', - type: 'number', - component: 'buttongroup', - options: [ - { - value: 1, - label: 'Small' - }, - { - value: 2, - label: 'Medium' - } - ], - defaultValue: 2 - }, - ColumnWidthSlider: { - type: 'number', - component: 'slider', - label: 'Column Width', - ref: 'columnwidthslider', - min: 1, - max: 3, - step: 1, - defaultValue: 2 - }, - SymbolForNulls: { - ref: 'symbolfornulls', - label: 'Symbol for Nulls', - type: 'string', - defaultValue: ' ' - }, - AllowExportXLS: { - ref: 'allowexportxls', - type: 'boolean', - component: 'switch', - label: 'Allow export to Excel', - options: [ - { - value: true, - label: 'On' - }, - { - value: false, - label: 'Off' - } - ], - defaultValue: true - }, - FilterOnCellClick: { - ref: 'filteroncellclick', - type: 'boolean', - component: 'switch', - label: 'Filter data when cell clicked', - options: [ - { - value: true, - label: 'On' - }, - { - value: false, - label: 'Off' - } - ], - defaultValue: true - } - } - }, - ConceptSemaphores: { - type: 'items', - label: 'Concept Semaphores', - items: { - AllConcepts: { - ref: 'allsemaphores', - type: 'boolean', - component: 'switch', - label: 'All concepts affected', - options: [ - { - value: true, - label: 'On' - }, - { - value: false, - label: 'Off' - } - ], - defaultValue: true - }, - ConceptsAffected1: { - ref: 'conceptsemaphore1', - translation: 'Concept 1', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - }, - ConceptsAffected2: { - ref: 'conceptsemaphore2', - translation: 'Concept 2', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - }, - ConceptsAffected3: { - ref: 'conceptsemaphore3', - translation: 'Concept 3', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - }, - ConceptsAffected4: { - ref: 'conceptsemaphore4', - translation: 'Concept 4', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - }, - ConceptsAffected5: { - ref: 'conceptsemaphore5', - translation: 'Concept 5', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - }, - ConceptsAffected6: { - ref: 'conceptsemaphore6', - translation: 'Concept 6', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - }, - ConceptsAffected7: { - ref: 'conceptsemaphore7', - translation: 'Concept 7', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - }, - ConceptsAffected8: { - ref: 'conceptsemaphore8', - translation: 'Concept 8', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - }, - ConceptsAffected9: { - ref: 'conceptsemaphore9', - translation: 'Concept 9', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - }, - ConceptsAffected10: { - ref: 'conceptsemaphore10', - translation: 'Concept 10', - type: 'string', - defaultValue: '', - show (data) { - return data.allsemaphores == false; - } - } - } - }, - MetricSemaphores: { - type: 'items', - label: 'Metric Semaphores', - items: { - AllMetrics: { - ref: 'allmetrics', - type: 'boolean', - component: 'switch', - label: 'All metrics affected', - options: [ - { - value: true, - label: 'On' - }, - { - value: false, - label: 'Off' - } - ], - defaultValue: false - }, - MetricsAffected: { - ref: 'metricssemaphore', - translation: 'Metrics affected (1,2,4,...)', - type: 'string', - defaultValue: '0', - show (data) { - return data.allmetrics == false; - } - }, - MetricStatus1: { - ref: 'metricsstatus1', - translation: 'Critic is less than', - type: 'number', - defaultValue: -0.1 - }, - ColorStatus1: { - ref: 'colorstatus1', - label: 'Critic Color Fill', - type: 'object', - component: 'color-picker', - defaultValue: { - index: 7, - color: '#f93f17' - } - }, - ColorStatus1Text: { - ref: 'colorstatus1text', - label: 'Critic Color Text', - type: 'object', - component: 'color-picker', - defaultValue: { - index: 10, - color: '#ffffff' - } - }, - MetricStatus2: { - ref: 'metricsstatus2', - translation: 'Medium is less than', - type: 'number', - defaultValue: 0 - }, - ColorStatus2: { - ref: 'colorstatus2', - label: 'Medium Color Fill', - type: 'object', - component: 'color-picker', - defaultValue: { - index: 8, - color: '#ffcf02' - } - }, - ColorStatus2Text: { - ref: 'colorstatus2text', - label: 'Medium Color Text', - type: 'object', - component: 'color-picker', - defaultValue: { - index: 11, - color: '#000000' - } - }, - ColorStatus3: { - ref: 'colorstatus3', - label: 'Success Color Fill', - type: 'object', - component: 'color-picker', - defaultValue: { - index: 9, - color: '#276e27' - } - }, - ColorStatus3Text: { - ref: 'colorstatus3text', - label: 'Success Color Text', - type: 'object', - component: 'color-picker', - defaultValue: { - index: 10, - color: '#ffffff' - } - } - } - }, - ColorLibrary: { - type: 'items', - label: 'Primary Colors Library', - items: { - ColLibClean: { - ref: 'collibclean', - translation: 'Clean', - type: 'string', - defaultValue: '#ffffff' - }, - ColLibSoft: { - ref: 'collibsoft', - translation: 'Soft', - type: 'string', - defaultValue: '#efefef' - }, - ColLibDark: { - ref: 'collibdark', - translation: 'Dark', - type: 'string', - defaultValue: '#c4c4c4' - }, - ColLibNight: { - ref: 'collibnight', - translation: 'Night', - type: 'string', - defaultValue: '#808080' - }, - ColLibRed: { - ref: 'collibred', - translation: 'Red', - type: 'string', - defaultValue: '#d58b94' - }, - ColLibOrange: { - ref: 'colliborange', - translation: 'Orange', - type: 'string', - defaultValue: '#fd6600' - }, - ColLibViolete: { - ref: 'collibviolete', - translation: 'Violete', - type: 'string', - defaultValue: '#ccc0ff' - }, - ColLibBlue: { - ref: 'collibblue', - translation: 'Blue', - type: 'string', - defaultValue: '#4575b4' - }, - ColLibGreen: { - ref: 'collibgreen', - translation: 'Green', - type: 'string', - defaultValue: '#7bb51c' - }, - ColLibCustom: { - ref: 'collibcustom', - label: 'Custom', - type: 'string', - defaultValue: '#ffcccc' - } - } - }, - PijamaColorLibrary: { - type: 'items', - label: 'Pijama Colors Library', - items: { - ColLibCleanP: { - ref: 'collibcleanp', - translation: 'Clean', - type: 'string', - defaultValue: '#ffffff' - }, - ColLibSoftP: { - ref: 'collibsoftp', - translation: 'Soft', - type: 'string', - defaultValue: '#ffffff' - }, - ColLibDarkP: { - ref: 'collibdarkp', - translation: 'Dark', - type: 'string', - defaultValue: '#efefef' - }, - ColLibNightP: { - ref: 'collibnightp', - translation: 'Night', - type: 'string', - defaultValue: '#c4c4c4' - }, - ColLibRedP: { - ref: 'collibredp', - translation: 'Red', - type: 'string', - defaultValue: '#ffcccc' - }, - ColLibOrangeP: { - ref: 'colliborangep', - translation: 'Orange', - type: 'string', - defaultValue: '#ffcc66' - }, - ColLibVioleteP: { - ref: 'collibvioletep', - translation: 'Violete', - type: 'string', - defaultValue: '#e6e6ff' - }, - ColLibBlueP: { - ref: 'collibbluep', - translation: 'Blue', - type: 'string', - defaultValue: '#b3d9ff' - }, - ColLibGreenP: { - ref: 'collibgreenp', - translation: 'Green', - type: 'string', - defaultValue: '#98fb98' - }, - ColLibCustomP: { - ref: 'collibcustomp', - label: 'Custom', - type: 'string', - defaultValue: '#ffffff' - } - } - } - } - } - } - }, - snapshot: { - canTakeSnapshot: true - }, controller: [ '$scope', '$timeout', function () { } ], + definition, + initialProperties: { + qHyperCubeDef: { + qDimensions: [], + qInitialDataFetch: [ + { + qHeight: 1000, + qWidth: 10 + } + ], + qMeasures: [] + } + }, paint ($element, layout) { try { paint($element, layout, this); - } catch (e) { - console.error(e); // eslint-disable-line no-console - throw e; + } catch (exception) { + console.error(exception); // eslint-disable-line no-console + throw exception; } - } + }, + snapshot: { + canTakeSnapshot: true + }, + version: 1.0 };