ThemeDefinitionAPI.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. "use strict";
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. /**
  4. * Licensed Materials - Property of IBM
  5. * IBM Business Analytics (C) Copyright IBM Corp. 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define([], function () {
  9. /**
  10. * @interface ThemeDefinitionAPI
  11. * @classdesc API class that defines the user profile info accessible in a dashboard
  12. */
  13. var ThemeDefinitionAPI = function () {
  14. function ThemeDefinitionAPI() {
  15. _classCallCheck(this, ThemeDefinitionAPI);
  16. }
  17. /**
  18. * Gets the css colors for the specified variable
  19. * @param {string} variableName - the variable to get the css colors for
  20. * @return {Object} the css colors for the variableName arg
  21. */
  22. ThemeDefinitionAPI.prototype.getCSSColors = function getCSSColors() {};
  23. /**
  24. * Gets the default palette name
  25. * @param {String} paletteType - the type of palette, currently only options are 'ColorPalette', 'HeatPalette' and 'ConditionalPalette'
  26. * @returns default color palette name ('colorPalette0' for instance)
  27. */
  28. ThemeDefinitionAPI.prototype.getDefaultPaletteName = function getDefaultPaletteName() {};
  29. /**
  30. * Gets the id of the theme definition
  31. * @returns {String} - id of ThemeDefinition
  32. */
  33. ThemeDefinitionAPI.prototype.getId = function getId() {};
  34. /**
  35. * Gets the mapped theme
  36. * @param {String} id - the id of the mapped themes
  37. * @returns {String} the group of the mapped theme corresponding to the id ex. axisLineColor, axisGridLineColor
  38. */
  39. ThemeDefinitionAPI.prototype.getMappedId = function getMappedId() {};
  40. /**
  41. * Get a specific palette
  42. * @param {String} paletteId - the ID of the palette
  43. * @param {String} paletteVariableName - the theme variable name for the list of palettes ('ColorPalette', 'HeatPalette', 'ContinuousPalette')
  44. * @param {Boolean} forProperties - boolean if the response is to be used for the properties.
  45. * @return {Array} all palettes defined in the theme
  46. */
  47. ThemeDefinitionAPI.prototype.getPalette = function getPalette() {};
  48. /**
  49. * Get all the palettes defined in the theme
  50. * @param {String} paletteVariableName - the theme variable name for the list of palettes ('ColorPalette', 'HeatPalette', 'ContinuousPalette')
  51. * @param {Boolean} forProperties - boolean if the response is to be used for the properties
  52. * @param {Boolean} includePatternPalettes - Should pattern palettes be included in the list of returned palettes.
  53. * @return {Array} all palettes defined in the theme
  54. */
  55. ThemeDefinitionAPI.prototype.getPalettes = function getPalettes() {};
  56. /**
  57. * Get the property value for the UIElement and Property ID specified
  58. * @param {String} uiElement - UIElement as described in the theme
  59. * @param {String} propertyId - property within the specified UIElement
  60. * @returns {Object} - value for the property if it exists, undefined otherwise
  61. */
  62. ThemeDefinitionAPI.prototype.getPropertyForUIElement = function getPropertyForUIElement() {};
  63. /**
  64. * Gets all the mapped themes
  65. * @returns {Object} - all the mapped themes.
  66. */
  67. ThemeDefinitionAPI.prototype.getThemeMapping = function getThemeMapping() {};
  68. /**
  69. * Get the property value for the UIElement and Property ID specified
  70. * @param {String} uiElement - UIElement as described in the theme
  71. * @param {String} propertyId - property within the specified UIElement
  72. * @returns {Object} - value for the property if it exists, undefined otherwise
  73. */
  74. ThemeDefinitionAPI.prototype.getValueForPropertyOfUIElement = function getValueForPropertyOfUIElement() {};
  75. /**
  76. * Given the variable type (such as 'Color' or 'Font') and the variable ID
  77. * (such as 'color1' or 'font1') return the value for the corresponding mapping
  78. * @param {String} variableType - Variable type (such as 'Color' or 'Font')
  79. * @param {String} variableId - id of a variable found within the specified variableType (such as 'color1')
  80. * @returns {Object} value if the specified variable exists.
  81. */
  82. ThemeDefinitionAPI.prototype.getValueForVariable = function getValueForVariable() {};
  83. /**
  84. * Generates an array of id and foreground color pairs
  85. * @param {String} bgColor - String defining the background color eg. color3¿
  86. * @param {String} uiElement - UIElement as described in the theme eg. visualization
  87. * @returns {Array} array of id and foreground color pairs that are type is one of FOREGROUND_PALETTES in given elements
  88. */
  89. ThemeDefinitionAPI.prototype.getForegroundColorPropertiesForUIElement = function getForegroundColorPropertiesForUIElement() {};
  90. /**
  91. * Generates an array of id and foreground color pairs
  92. * @param {String} uiElement - UIElement as described in the theme eg. visualization
  93. * @returns {Array} array of properties for ui elements
  94. */
  95. ThemeDefinitionAPI.prototype.getForegroundPropertiesForUIElement = function getForegroundPropertiesForUIElement() {};
  96. /**
  97. * Updates the mapping of the themes
  98. * @param {Object} themeMapping - json description of which properties map to which super property
  99. * For example:
  100. * {
  101. * "id": "axisLineColor",
  102. * "mapping": [
  103. * "valAxisLineColor",
  104. * "catAxisLineColor"
  105. * ]
  106. * }
  107. */
  108. ThemeDefinitionAPI.prototype.updateThemeMapping = function updateThemeMapping() {};
  109. /**
  110. * Sets the themeMapping
  111. * @param {Object} themeMapping - An object containing all the mapping of the themes
  112. */
  113. ThemeDefinitionAPI.prototype.setThemeMapping = function setThemeMapping() {};
  114. return ThemeDefinitionAPI;
  115. }();
  116. return ThemeDefinitionAPI;
  117. });
  118. //# sourceMappingURL=ThemeDefinitionAPI.js.map