@carbon/charts 0.32.10 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/CHANGELOG.md +333 -147
  2. package/README.md +18 -8
  3. package/axis-chart.js +20 -20
  4. package/axis-chart.js.map +1 -1
  5. package/build/demo/data/area.d.ts +17 -0
  6. package/build/demo/data/bar.d.ts +32 -48
  7. package/build/demo/data/line.d.ts +29 -0
  8. package/build/src/interfaces/charts.d.ts +5 -0
  9. package/build/src/model.d.ts +1 -0
  10. package/build/src/services/scales-cartesian.d.ts +1 -1
  11. package/build/src/tools.d.ts +7 -7
  12. package/bundle.js +1 -1
  13. package/charts/area-stacked.js +3 -3
  14. package/charts/area-stacked.js.map +1 -1
  15. package/charts/area.js +3 -3
  16. package/charts/area.js.map +1 -1
  17. package/charts/bar-grouped.js +3 -3
  18. package/charts/bar-grouped.js.map +1 -1
  19. package/charts/bar-simple.js +3 -3
  20. package/charts/bar-simple.js.map +1 -1
  21. package/charts/bar-stacked.js +3 -3
  22. package/charts/bar-stacked.js.map +1 -1
  23. package/charts/bubble.js +3 -3
  24. package/charts/bubble.js.map +1 -1
  25. package/charts/donut.js +3 -3
  26. package/charts/donut.js.map +1 -1
  27. package/charts/gauge.js +2 -1
  28. package/charts/gauge.js.map +1 -1
  29. package/charts/line.js +3 -3
  30. package/charts/line.js.map +1 -1
  31. package/charts/pie.js +3 -3
  32. package/charts/pie.js.map +1 -1
  33. package/charts/radar.js +1 -1
  34. package/charts/radar.js.map +1 -1
  35. package/charts/scatter.js +3 -3
  36. package/charts/scatter.js.map +1 -1
  37. package/components/axes/axis.js +25 -23
  38. package/components/axes/axis.js.map +1 -1
  39. package/components/axes/grid.js +1 -1
  40. package/components/axes/grid.js.map +1 -1
  41. package/components/axes/ruler.js +2 -2
  42. package/components/axes/ruler.js.map +1 -1
  43. package/components/axes/two-dimensional-axes.js +3 -3
  44. package/components/axes/two-dimensional-axes.js.map +1 -1
  45. package/components/axes/zero-line.js +1 -1
  46. package/components/axes/zero-line.js.map +1 -1
  47. package/components/essentials/legend.js +20 -11
  48. package/components/essentials/legend.js.map +1 -1
  49. package/components/essentials/threshold.js +9 -9
  50. package/components/essentials/threshold.js.map +1 -1
  51. package/components/essentials/title.js +2 -2
  52. package/components/essentials/title.js.map +1 -1
  53. package/components/essentials/tooltip-bar.js +9 -7
  54. package/components/essentials/tooltip-bar.js.map +1 -1
  55. package/components/essentials/tooltip.js +7 -7
  56. package/components/essentials/tooltip.js.map +1 -1
  57. package/components/graphs/area-stacked.js +8 -7
  58. package/components/graphs/area-stacked.js.map +1 -1
  59. package/components/graphs/bar-grouped.js +7 -7
  60. package/components/graphs/bar-grouped.js.map +1 -1
  61. package/components/graphs/bar-simple.js +6 -6
  62. package/components/graphs/bar-simple.js.map +1 -1
  63. package/components/graphs/bar-stacked.js +6 -6
  64. package/components/graphs/bar-stacked.js.map +1 -1
  65. package/components/graphs/gauge.js +4 -3
  66. package/components/graphs/gauge.js.map +1 -1
  67. package/components/graphs/line.js +14 -10
  68. package/components/graphs/line.js.map +1 -1
  69. package/components/graphs/pie.js +12 -12
  70. package/components/graphs/pie.js.map +1 -1
  71. package/components/graphs/radar.js +11 -11
  72. package/components/graphs/radar.js.map +1 -1
  73. package/components/graphs/scatter-stacked.js +2 -4
  74. package/components/graphs/scatter-stacked.js.map +1 -1
  75. package/components/graphs/scatter.js +6 -8
  76. package/components/graphs/scatter.js.map +1 -1
  77. package/components/graphs/skeleton.js +3 -3
  78. package/components/graphs/skeleton.js.map +1 -1
  79. package/components/layout/layout.js +10 -4
  80. package/components/layout/layout.js.map +1 -1
  81. package/configuration.js +14 -9
  82. package/configuration.js.map +1 -1
  83. package/demo/create-codesandbox.js +19 -19
  84. package/demo/create-codesandbox.js.map +1 -1
  85. package/demo/data/area.d.ts +17 -0
  86. package/demo/data/area.js +26 -0
  87. package/demo/data/area.js.map +1 -1
  88. package/demo/data/bar.d.ts +32 -48
  89. package/demo/data/bar.js +134 -141
  90. package/demo/data/bar.js.map +1 -1
  91. package/demo/data/bubble.js +29 -29
  92. package/demo/data/bubble.js.map +1 -1
  93. package/demo/data/bundle.js +1 -1
  94. package/demo/data/index.js +21 -5
  95. package/demo/data/index.js.map +1 -1
  96. package/demo/data/line.d.ts +29 -0
  97. package/demo/data/line.js +122 -60
  98. package/demo/data/line.js.map +1 -1
  99. package/demo/data/pie.js +5 -5
  100. package/demo/data/pie.js.map +1 -1
  101. package/demo/data/radar.js +12 -12
  102. package/demo/data/radar.js.map +1 -1
  103. package/demo/data/scatter.js +48 -32
  104. package/demo/data/scatter.js.map +1 -1
  105. package/demo/data/step.js +6 -6
  106. package/demo/data/step.js.map +1 -1
  107. package/demo/data/time-series-axis.js +107 -107
  108. package/demo/data/time-series-axis.js.map +1 -1
  109. package/demo/tsconfig.tsbuildinfo +20 -20
  110. package/interfaces/a11y.js.map +1 -1
  111. package/interfaces/charts.d.ts +5 -0
  112. package/interfaces/charts.js.map +1 -1
  113. package/interfaces/enums.js.map +1 -1
  114. package/interfaces/events.js.map +1 -1
  115. package/model.d.ts +1 -0
  116. package/model.js +61 -5
  117. package/model.js.map +1 -1
  118. package/package.json +1 -1
  119. package/polyfills.js +1 -1
  120. package/polyfills.js.map +1 -1
  121. package/services/angle-utils.js +8 -8
  122. package/services/angle-utils.js.map +1 -1
  123. package/services/colorPalettes.js +2 -2
  124. package/services/colorPalettes.js.map +1 -1
  125. package/services/colors.js +1 -1
  126. package/services/colors.js.map +1 -1
  127. package/services/curves.js +2 -2
  128. package/services/curves.js.map +1 -1
  129. package/services/essentials/dom-utils.js +6 -6
  130. package/services/essentials/dom-utils.js.map +1 -1
  131. package/services/essentials/events.js +1 -1
  132. package/services/essentials/events.js.map +1 -1
  133. package/services/scales-cartesian.d.ts +1 -1
  134. package/services/scales-cartesian.js +18 -18
  135. package/services/scales-cartesian.js.map +1 -1
  136. package/services/time-series.js +2 -2
  137. package/services/time-series.js.map +1 -1
  138. package/tools.d.ts +7 -7
  139. package/tools.js +16 -14
  140. package/tools.js.map +1 -1
  141. package/tsconfig.tsbuildinfo +55 -55
@@ -1 +1 @@
1
- {"version":3,"file":"charts.js","sourceRoot":"","sources":["charts.ts"],"names":[],"mappings":"","sourcesContent":["import {\n\tGaugeTypes,\n\tStatuses,\n\tArrowDirections\n} from \"./enums\";\nimport {\n\tLegendOptions,\n\tTooltipOptions,\n\tGridOptions,\n\tAxesOptions\n} from \"./index\";\nimport {\n\tAxisTooltipOptions,\n\tBarTooltipOptions,\n\tBarOptions,\n\tStackedBarOptions\n} from \"./components\";\nimport { TimeScaleOptions } from \"./axis-scales\";\n\n/**\n * Base chart options common to any chart\n */\nexport interface BaseChartOptions {\n\t/**\n\t * Optionally specify a title for the chart\n\t */\n\ttitle?: string;\n\t/**\n\t * boolean to disable animations (enabled by default)\n\t */\n\tanimations?: boolean;\n\t/**\n\t * boolean to prevent the container from resizing\n\t */\n\tresizable?: boolean;\n\t/**\n\t * Optionally specify a width for the chart\n\t */\n\twidth?: string;\n\t/**\n\t * Optionally specify a height for the chart\n\t */\n\theight?: string;\n\t/**\n\t * tooltip configuration\n\t */\n\ttooltip?: TooltipOptions;\n\t/**\n\t * legend configuration\n\t */\n\tlegend?: LegendOptions;\n\t/**\n\t * Optional function to determine whether is filled based on datasetLabel, label, and/or data\n\t */\n\tgetIsFilled?: (\n\t\tdatasetLabel: any,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultFilled?: boolean\n\t) => boolean;\n\t/**\n\t * Optional function to generate the fill color based on datasetLabel, label, and/or data\n\t */\n\tgetFillColor?: (\n\t\tdatasetLabel: any,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultFillColor?: string\n\t) => string;\n\t/**\n\t * Optional function to generate the stroke color based on datasetLabel, label, and/or data\n\t */\n\tgetStrokeColor?: (\n\t\tdatasetLabel: any,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultStrokeColor?: string\n\t) => string;\n\t/**\n\t * stylesheet options\n\t */\n\tstyle?: {\n\t\t/**\n\t\t * optional prefixing string for css classes (defaults to 'cc')\n\t\t */\n\t\tprefix?: string;\n\t};\n\t/**\n\t * options related to charting data\n\t */\n\tdata?: {\n\t\t/**\n\t\t * identifier for data groups\n\t\t */\n\t\tgroupMapsTo?: string;\n\t\t/**\n\t\t * used to simulate data loading\n\t\t */\n\t\tloading?: Boolean;\n\t};\n\t/**\n\t * options related to color scales\n\t */\n\tcolor?: {\n\t\t/**\n\t\t * e.g. { \"Dataset 1\": \"blue\" }\n\t\t */\n\t\tscale?: object;\n\t};\n}\n\n/**\n * Options common to any chart with an axis\n */\nexport interface AxisChartOptions extends BaseChartOptions {\n\taxes?: AxesOptions;\n\tgrid?: GridOptions;\n\ttimeScale?: TimeScaleOptions;\n\ttooltip?: AxisTooltipOptions;\n}\n\n/**\n * options specific to bar charts\n */\nexport interface BarChartOptions extends AxisChartOptions {\n\tbars?: BarOptions;\n\ttooltip?: BarTooltipOptions;\n}\n\n/**\n * options specific to stacked bar charts\n */\nexport interface StackedBarChartOptions extends BarChartOptions {\n\tbars?: StackedBarOptions;\n}\n\n/**\n * options specific to scatter charts\n */\nexport interface ScatterChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the points\n\t */\n\tpoints?: {\n\t\t/**\n\t\t * sets the radius of the point\n\t\t */\n\t\tradius: number;\n\t\tfillOpacity?: number;\n\t\tfilled?: boolean;\n\t};\n}\n\n/**\n * options specific to bubble charts\n */\nexport interface BubbleChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the individual bubbles\n\t */\n\tbubble?: {\n\t\t/**\n\t\t * the key to lookup in charting data for the bubble radius value\n\t\t */\n\t\tradiusMapsTo?: string;\n\t\t/**\n\t\t * A function that would determine the range of the bubble radius to use\n\t\t * Returns an array with the 1st value being the min and the 2nd value being the max radius\n\t\t */\n\t\tradiusRange?: Function;\n\t\t/**\n\t\t * Opacity of the fills used within each circle\n\t\t */\n\t\tfillOpacity?: number;\n\t};\n}\n\n/**\n * options specific to line charts\n */\nexport interface LineChartOptions extends ScatterChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?:\n\t| string\n\t| {\n\t\tname: string;\n\t};\n}\n\n/**\n * options specific to area charts\n */\nexport interface AreaChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?:\n\t\t| string\n\t\t| {\n\t\t\t\tname: string;\n\t\t };\n}\n\n/**\n * options specific to area charts\n */\nexport interface StackedAreaChartOptions extends ScatterChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?:\n\t\t| string\n\t\t| {\n\t\t\t\tname: string;\n\t\t };\n}\n\n/**\n * options specific to pie charts\n */\nexport interface PieChartOptions extends BaseChartOptions {\n\tpie?: {\n\t\tradiusOffset?: number;\n\t\tinnerRadius?: number;\n\t\tpadAngle?: number;\n\t\thoverArc?: {\n\t\t\touterRadiusOffset?: number;\n\t\t};\n\t\txOffset?: number;\n\t\tyOffset?: number;\n\t\tyOffsetCallout?: number;\n\t\tcallout?: {\n\t\t\tminSliceDegree?: number;\n\t\t\toffsetX?: number;\n\t\t\toffsetY?: number;\n\t\t\thorizontalLineLength?: number;\n\t\t\ttextMargin?: number;\n\t\t};\n\t\tlabels?: {\n\t\t\tformatter?: Function;\n\t\t};\n\t};\n}\n\n/**\n * options specific to gauge charts\n */\nexport interface GaugeChartOptions extends PieChartOptions {\n\tgauge?: {\n\t\tarcWidth?: number;\n\t\tdeltaArrow?: {\n\t\t\tdirection?: ArrowDirections;\n\t\t\tsize?: Function;\n\t\t\tenabled: Boolean;\n\t\t}\n\t\tstatus?: Statuses;\n\t\tdeltaFontSize?: Function;\n\t\tnumberSpacing?: number;\n\t\tnumberFormatter?: Function;\n\t\tvalueFontSize?: Function;\n\t\ttype?: GaugeTypes;\n\t};\n}\n\n/**\n * options specific to donut charts\n */\nexport interface DonutChartOptions extends PieChartOptions {\n\tdonut?: {\n\t\tcenter?: {\n\t\t\tlabel?: string;\n\t\t\tnumberFontSize?: Function;\n\t\t\ttitleFontSize?: Function;\n\t\t\ttitleYPosition?: Function;\n\t\t\tnumberFormatter?: Function;\n\t\t};\n\t};\n}\n\n/**\n * options specific to radar charts\n */\nexport interface RadarChartOptions extends BaseChartOptions {\n\tradar?: {\n\t\topacity: {\n\t\t\tunselected: number;\n\t\t\tselected: number;\n\t\t};\n\t\taxes: {\n\t\t\tangle: string;\n\t\t\tvalue: string;\n\t\t};\n\t\txLabelPadding: number;\n\t\tyLabelPadding: number;\n\t\tyTicksNumber: number;\n\t\tminRange: number;\n\t\txAxisRectHeight: number;\n\t\tdotsRadius: number;\n\t};\n}\n"]}
1
+ {"version":3,"file":"charts.js","sourceRoot":"","sources":["charts.ts"],"names":[],"mappings":"","sourcesContent":["import { GaugeTypes, Statuses, ArrowDirections } from \"./enums\";\nimport {\n\tLegendOptions,\n\tTooltipOptions,\n\tGridOptions,\n\tAxesOptions\n} from \"./index\";\nimport {\n\tAxisTooltipOptions,\n\tBarTooltipOptions,\n\tBarOptions,\n\tStackedBarOptions\n} from \"./components\";\nimport { TimeScaleOptions } from \"./axis-scales\";\n\n/**\n * Base chart options common to any chart\n */\nexport interface BaseChartOptions {\n\t/**\n\t * Optionally specify a title for the chart\n\t */\n\ttitle?: string;\n\t/**\n\t * boolean to disable animations (enabled by default)\n\t */\n\tanimations?: boolean;\n\t/**\n\t * boolean to prevent the container from resizing\n\t */\n\tresizable?: boolean;\n\t/**\n\t * Optionally specify a width for the chart\n\t */\n\twidth?: string;\n\t/**\n\t * Optionally specify a height for the chart\n\t */\n\theight?: string;\n\t/**\n\t * tooltip configuration\n\t */\n\ttooltip?: TooltipOptions;\n\t/**\n\t * legend configuration\n\t */\n\tlegend?: LegendOptions;\n\t/**\n\t * Optional function to determine whether is filled based on datasetLabel, label, and/or data\n\t */\n\tgetIsFilled?: (\n\t\tdatasetLabel: any,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultFilled?: boolean\n\t) => boolean;\n\t/**\n\t * Optional function to generate the fill color based on datasetLabel, label, and/or data\n\t */\n\tgetFillColor?: (\n\t\tdatasetLabel: any,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultFillColor?: string\n\t) => string;\n\t/**\n\t * Optional function to generate the stroke color based on datasetLabel, label, and/or data\n\t */\n\tgetStrokeColor?: (\n\t\tdatasetLabel: any,\n\t\tlabel?: any,\n\t\tdata?: any,\n\t\tdefaultStrokeColor?: string\n\t) => string;\n\t/**\n\t * stylesheet options\n\t */\n\tstyle?: {\n\t\t/**\n\t\t * optional prefixing string for css classes (defaults to 'cc')\n\t\t */\n\t\tprefix?: string;\n\t};\n\t/**\n\t * options related to charting data\n\t */\n\tdata?: {\n\t\t/**\n\t\t * identifier for data groups\n\t\t */\n\t\tgroupMapsTo?: string;\n\t\t/**\n\t\t * used to simulate data loading\n\t\t */\n\t\tloading?: Boolean;\n\t\t/**\n\t\t * options related to pre-selected data groups\n\t\t * Remains empty if every legend item is active or dataset doesn't have the data groups.\n\t\t */\n\t\tselectedGroups?: string[];\n\t};\n\t/**\n\t * options related to color scales\n\t */\n\tcolor?: {\n\t\t/**\n\t\t * e.g. { \"Dataset 1\": \"blue\" }\n\t\t */\n\t\tscale?: object;\n\t};\n}\n\n/**\n * Options common to any chart with an axis\n */\nexport interface AxisChartOptions extends BaseChartOptions {\n\taxes?: AxesOptions;\n\tgrid?: GridOptions;\n\ttimeScale?: TimeScaleOptions;\n\ttooltip?: AxisTooltipOptions;\n}\n\n/**\n * options specific to bar charts\n */\nexport interface BarChartOptions extends AxisChartOptions {\n\tbars?: BarOptions;\n\ttooltip?: BarTooltipOptions;\n}\n\n/**\n * options specific to stacked bar charts\n */\nexport interface StackedBarChartOptions extends BarChartOptions {\n\tbars?: StackedBarOptions;\n}\n\n/**\n * options specific to scatter charts\n */\nexport interface ScatterChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the points\n\t */\n\tpoints?: {\n\t\t/**\n\t\t * sets the radius of the point\n\t\t */\n\t\tradius: number;\n\t\tfillOpacity?: number;\n\t\tfilled?: boolean;\n\t};\n}\n\n/**\n * options specific to bubble charts\n */\nexport interface BubbleChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the individual bubbles\n\t */\n\tbubble?: {\n\t\t/**\n\t\t * the key to lookup in charting data for the bubble radius value\n\t\t */\n\t\tradiusMapsTo?: string;\n\t\t/**\n\t\t * A function that would determine the range of the bubble radius to use\n\t\t * Returns an array with the 1st value being the min and the 2nd value being the max radius\n\t\t */\n\t\tradiusRange?: Function;\n\t\t/**\n\t\t * Opacity of the fills used within each circle\n\t\t */\n\t\tfillOpacity?: number;\n\t};\n}\n\n/**\n * options specific to line charts\n */\nexport interface LineChartOptions extends ScatterChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?:\n\t\t| string\n\t\t| {\n\t\t\t\tname: string;\n\t\t };\n}\n\n/**\n * options specific to area charts\n */\nexport interface AreaChartOptions extends AxisChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?:\n\t\t| string\n\t\t| {\n\t\t\t\tname: string;\n\t\t };\n}\n\n/**\n * options specific to area charts\n */\nexport interface StackedAreaChartOptions extends ScatterChartOptions {\n\t/**\n\t * options for the curve of the line\n\t */\n\tcurve?:\n\t\t| string\n\t\t| {\n\t\t\t\tname: string;\n\t\t };\n}\n\n/**\n * options specific to pie charts\n */\nexport interface PieChartOptions extends BaseChartOptions {\n\tpie?: {\n\t\tradiusOffset?: number;\n\t\tinnerRadius?: number;\n\t\tpadAngle?: number;\n\t\thoverArc?: {\n\t\t\touterRadiusOffset?: number;\n\t\t};\n\t\txOffset?: number;\n\t\tyOffset?: number;\n\t\tyOffsetCallout?: number;\n\t\tcallout?: {\n\t\t\tminSliceDegree?: number;\n\t\t\toffsetX?: number;\n\t\t\toffsetY?: number;\n\t\t\thorizontalLineLength?: number;\n\t\t\ttextMargin?: number;\n\t\t};\n\t\tlabels?: {\n\t\t\tformatter?: Function;\n\t\t};\n\t};\n}\n\n/**\n * options specific to gauge charts\n */\nexport interface GaugeChartOptions extends PieChartOptions {\n\tgauge?: {\n\t\tarcWidth?: number;\n\t\tdeltaArrow?: {\n\t\t\tdirection?: ArrowDirections;\n\t\t\tsize?: Function;\n\t\t\tenabled: Boolean;\n\t\t};\n\t\tstatus?: Statuses;\n\t\tdeltaFontSize?: Function;\n\t\tnumberSpacing?: number;\n\t\tnumberFormatter?: Function;\n\t\tvalueFontSize?: Function;\n\t\ttype?: GaugeTypes;\n\t};\n}\n\n/**\n * options specific to donut charts\n */\nexport interface DonutChartOptions extends PieChartOptions {\n\tdonut?: {\n\t\tcenter?: {\n\t\t\tlabel?: string;\n\t\t\tnumberFontSize?: Function;\n\t\t\ttitleFontSize?: Function;\n\t\t\ttitleYPosition?: Function;\n\t\t\tnumberFormatter?: Function;\n\t\t};\n\t};\n}\n\n/**\n * options specific to radar charts\n */\nexport interface RadarChartOptions extends BaseChartOptions {\n\tradar?: {\n\t\topacity: {\n\t\t\tunselected: number;\n\t\t\tselected: number;\n\t\t};\n\t\taxes: {\n\t\t\tangle: string;\n\t\t\tvalue: string;\n\t\t};\n\t\txLabelPadding: number;\n\t\tyLabelPadding: number;\n\t\tyTicksNumber: number;\n\t\tminRange: number;\n\t\txAxisRectHeight: number;\n\t\tdotsRadius: number;\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["enums.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AACvC,MAAM,CAAC,IAAM,MAAM,GAAG,UAAU,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,yBAAW,CAAA;AACZ,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,aAKX;AALD,WAA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ED;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,4BAAS,CAAA;IACT,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IACnB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;AAClB,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB","sourcesContent":["import * as EventEnums from \"./events\";\nexport const Events = EventEnums;\n\n/**\n * enum of all supported chart themes\n */\nexport enum ChartTheme {\n\tDEFAULT = \"default\",\n\tG100 = \"g100\",\n\tG90 = \"g90\",\n\tG10 = \"g10\"\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum AxisPositions {\n\tLEFT = \"left\",\n\tRIGHT = \"right\",\n\tTOP = \"top\",\n\tBOTTOM = \"bottom\"\n}\n\n/**\n * enum of all possible truncation types\n */\nexport enum TruncationTypes {\n\tEND_LINE = \"end_line\",\n\tMID_LINE = \"mid_line\",\n\tFRONT_LINE = \"front_line\",\n\tNONE = \"none\",\n}\n\n/**\n * enum of all possible cartesian orientations\n * to be used for determining the orientation\n * of graphs being draw over\n * cartesian scales\n */\nexport enum CartesianOrientations {\n\tVERTICAL = \"vertical\",\n\tHORIZONTAL = \"horizontal\"\n}\n\n/**\n * enum of all possible scale types\n */\nexport enum ScaleTypes {\n\tTIME = \"time\",\n\tLINEAR = \"linear\",\n\tLOG = \"log\",\n\tLABELS = \"labels\"\n}\n\n/**\n * enum of supported tooltip position relative to\n */\nexport enum TooltipPosition {\n\tMOUSE = \"mouse\",\n\tTOP = \"top\",\n\tBOTTOM = \"bottom\"\n}\n\n/**\n * enum of tooltip types for custom tooltip event\n */\nexport enum TooltipTypes {\n\tDATAPOINT = \"datapoint\",\n\tGRIDLINE = \"gridline\",\n\tTITLE = \"title\",\n\tLEGEND = \"legend\",\n\tAXISLABEL = \"axislabel\",\n}\n\n/**\n * enum of all possible legend positions\n */\nexport enum LegendPositions {\n\tRIGHT = \"right\",\n\tLEFT = \"left\",\n\tTOP = \"top\",\n\tBOTTOM = \"bottom\"\n}\n\n/**\n * enum of all possible legend orientations\n */\nexport enum LegendOrientations {\n\tHORIZONTAL = \"horizontal\",\n\tVERTICAL = \"vertical\"\n}\n\n/**\n * enum of all possible layout directions\n */\nexport enum LayoutDirection {\n\tROW = \"row\",\n\tCOLUMN = \"column\",\n\tROW_REVERSE = \"row-reverse\",\n\tCOLUMN_REVERSE = \"column-reverse\"\n}\n\n/**\n * enum of all possible layout growth values\n */\nexport enum LayoutGrowth {\n\tFIXED = \"fixed\",\n\tPREFERRED = \"preferred\",\n\tSTRETCH = \"stretch\"\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum CalloutDirections {\n\tLEFT = \"left\",\n\tRIGHT = \"right\"\n}\n\n/**\n * enum of all possible skeleton/empty state types\n */\nexport enum Skeletons {\n\tGRID = \"grid\",\n\tVERT_OR_HORIZ = \"vertOrHoriz\",\n\tPIE = \"pie\",\n\tDONUT = \"donut\"\n}\n\n/**\n * enum of all possible attributes used to aling text horizontally\n */\nexport enum TextAnchor {\n\tSTART = \"start\",\n\tMIDDLE = \"middle\",\n\tEND = \"end\"\n}\n\n/**\n * enum of all possible attributes used to aling text vertically\n */\nexport enum DominantBaseline {\n\tBASELINE = \"baseline\",\n\tMIDDLE = \"middle\",\n\tHANGING = \"hanging\"\n}\n\nexport enum GaugeTypes {\n\tSEMI = \"semi\",\n\tFULL = \"full\"\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum ArrowDirections {\n\tUP = \"up\",\n\tDOWN = \"down\"\n}\n\n/**\n * enum of carbon statuses\n */\nexport enum Statuses {\n\tSUCCESS = \"success\",\n\tWARNING = \"warning\",\n\tDANGER = \"danger\"\n}\n"]}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["enums.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MA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AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC3B,yCAAqB,CAAA;IACrB,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;AACpB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACrB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACd,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,4BAAS,CAAA;IACT,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IACnB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;AAClB,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB","sourcesContent":["import * as EventEnums from \"./events\";\nexport const Events = EventEnums;\n\n/**\n * enum of all supported chart themes\n */\nexport enum ChartTheme {\n\tDEFAULT = \"default\",\n\tG100 = \"g100\",\n\tG90 = \"g90\",\n\tG10 = \"g10\"\n}\n\n/**\n * enum of all possible axis positions\n */\nexport enum AxisPositions {\n\tLEFT = \"left\",\n\tRIGHT = \"right\",\n\tTOP = \"top\",\n\tBOTTOM = \"bottom\"\n}\n\n/**\n * enum of all possible truncation types\n */\nexport enum TruncationTypes {\n\tEND_LINE = \"end_line\",\n\tMID_LINE = \"mid_line\",\n\tFRONT_LINE = \"front_line\",\n\tNONE = \"none\"\n}\n\n/**\n * enum of all possible cartesian orientations\n * to be used for determining the orientation\n * of graphs being draw over\n * cartesian scales\n */\nexport enum CartesianOrientations {\n\tVERTICAL = \"vertical\",\n\tHORIZONTAL = \"horizontal\"\n}\n\n/**\n * enum of all possible scale types\n */\nexport enum ScaleTypes {\n\tTIME = \"time\",\n\tLINEAR = \"linear\",\n\tLOG = \"log\",\n\tLABELS = \"labels\"\n}\n\n/**\n * enum of supported tooltip position relative to\n */\nexport enum TooltipPosition {\n\tMOUSE = \"mouse\",\n\tTOP = \"top\",\n\tBOTTOM = \"bottom\"\n}\n\n/**\n * enum of tooltip types for custom tooltip event\n */\nexport enum TooltipTypes {\n\tDATAPOINT = \"datapoint\",\n\tGRIDLINE = \"gridline\",\n\tTITLE = \"title\",\n\tLEGEND = \"legend\",\n\tAXISLABEL = \"axislabel\"\n}\n\n/**\n * enum of all possible legend positions\n */\nexport enum LegendPositions {\n\tRIGHT = \"right\",\n\tLEFT = \"left\",\n\tTOP = \"top\",\n\tBOTTOM = \"bottom\"\n}\n\n/**\n * enum of all possible legend orientations\n */\nexport enum LegendOrientations {\n\tHORIZONTAL = \"horizontal\",\n\tVERTICAL = \"vertical\"\n}\n\n/**\n * enum of all possible layout directions\n */\nexport enum LayoutDirection {\n\tROW = \"row\",\n\tCOLUMN = \"column\",\n\tROW_REVERSE = \"row-reverse\",\n\tCOLUMN_REVERSE = \"column-reverse\"\n}\n\n/**\n * enum of all possible layout growth values\n */\nexport enum LayoutGrowth {\n\tFIXED = \"fixed\",\n\tPREFERRED = \"preferred\",\n\tSTRETCH = \"stretch\"\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum CalloutDirections {\n\tLEFT = \"left\",\n\tRIGHT = \"right\"\n}\n\n/**\n * enum of all possible skeleton/empty state types\n */\nexport enum Skeletons {\n\tGRID = \"grid\",\n\tVERT_OR_HORIZ = \"vertOrHoriz\",\n\tPIE = \"pie\",\n\tDONUT = \"donut\"\n}\n\n/**\n * enum of all possible attributes used to aling text horizontally\n */\nexport enum TextAnchor {\n\tSTART = \"start\",\n\tMIDDLE = \"middle\",\n\tEND = \"end\"\n}\n\n/**\n * enum of all possible attributes used to aling text vertically\n */\nexport enum DominantBaseline {\n\tBASELINE = \"baseline\",\n\tMIDDLE = \"middle\",\n\tHANGING = \"hanging\"\n}\n\nexport enum GaugeTypes {\n\tSEMI = \"semi\",\n\tFULL = \"full\"\n}\n\n/**\n * enum of all possible callout directions\n */\nexport enum ArrowDirections {\n\tUP = \"up\",\n\tDOWN = \"down\"\n}\n\n/**\n * enum of carbon statuses\n */\nexport enum Statuses {\n\tSUCCESS = \"success\",\n\tWARNING = \"warning\",\n\tDANGER = \"danger\"\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,KAOX;AAPD,WAAY,KAAK;IAChB,4CAAmC,CAAA;IACnC,gCAAuB,CAAA;IACvB,sCAA6B,CAAA;IAC7B,iCAAiC;IACjC,yBAAyB;IACzB,oCAA2B,CAAA;AAC5B,CAAC,EAPW,KAAK,KAAL,KAAK,QAOhB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,KAEX;AAFD,WAAY,KAAK;IAChB,gCAAuB,CAAA;AACxB,CAAC,EAFW,KAAK,KAAL,KAAK,QAEhB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,IAKX;AALD,WAAY,IAAI;IACf,gDAAwC,CAAA;IACxC,gDAAwC,CAAA;IACxC,wCAAgC,CAAA;IAChC,8CAAsC,CAAA;AACvC,CAAC,EALW,IAAI,KAAJ,IAAI,QAKf;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,IAKX;AALD,WAAY,IAAI;IACf,yCAAiC,CAAA;IACjC,yCAAiC,CAAA;IACjC,iCAAyB,CAAA;IACzB,uCAA+B,CAAA;AAChC,CAAC,EALW,IAAI,KAAJ,IAAI,QAKf;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,GAKX;AALD,WAAY,GAAG;IACd,8CAAuC,CAAA;IACvC,8CAAuC,CAAA;IACvC,sCAA+B,CAAA;IAC/B,4CAAqC,CAAA;AACtC,CAAC,EALW,GAAG,KAAH,GAAG,QAKd;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,KAKX;AALD,WAAY,KAAK;IAChB,8CAAqC,CAA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DAAwC,CAAA;IACxC,8CAAoC,CAAA;AACrC,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB","sourcesContent":["/**\n * enum of all events related to the chart on the DOM\n */\nexport enum Chart {\n\tRENDER_FINISHED = \"render-finished\",\n\tRESIZE = \"chart-resize\",\n\tMOUSEOVER = \"chart-mouseover\",\n\t// MOUSEMOVE = \"chart-mousemove\",\n\t// CLICK = \"chart-click\",\n\tMOUSEOUT = \"chart-mouseout\",\n}\n\n/**\n * enum of all events related to the chart model\n */\nexport enum Model {\n\tUPDATE = \"model-update\",\n}\n\n/**\n * enum of all axis-related events\n */\nexport enum Axis {\n\tLABEL_MOUSEOVER = \"axis-label-mouseover\",\n\tLABEL_MOUSEMOVE = \"axis-label-mousemove\",\n\tLABEL_CLICK = \"axis-label-click\",\n\tLABEL_MOUSEOUT = \"axis-label-mouseout\",\n}\n\n/**\n * enum of all area graph events\n */\nexport enum Area {\n\tAREA_MOUSEOVER = \"area-mouseover\",\n\tAREA_MOUSEMOVE = \"area-mousemove\",\n\tAREA_CLICK = \"area-click\",\n\tAREA_MOUSEOUT = \"area-mouseout\",\n}\n\n/**\n * enum of all pie graph events\n */\nexport enum Pie {\n\tSLICE_MOUSEOVER = \"pie-slice-mouseover\",\n\tSLICE_MOUSEMOVE = \"pie-slice-mousemove\",\n\tSLICE_CLICK = \"pie-slice-click\",\n\tSLICE_MOUSEOUT = \"pie-slice-mouseout\",\n}\n\n/**\n * enum of all gauge graph events\n */\nexport enum Gauge {\n\tARC_MOUSEOVER = \"gauge-arc-mouseover\",\n\tARC_MOUSEMOVE = \"gauge-arc-mousemove\",\n\tARC_CLICK = \"gauge-arc-click\",\n\tARC_MOUSEOUT = \"gauge-arc-mouseout\",\n}\n\n/**\n * enum of all bar graph events\n */\nexport enum Bar {\n\tBAR_MOUSEOVER = \"bar-mouseover\",\n\tBAR_MOUSEMOVE = \"bar-mousemove\",\n\tBAR_CLICK = \"bar-click\",\n\tBAR_MOUSEOUT = \"bar-mouseout\",\n}\n\n/**\n * enum of all scatter graph events\n */\nexport enum Scatter {\n\tSCATTER_MOUSEOVER = \"scatter-mouseover\",\n\tSCATTER_MOUSEMOVE = \"scatter-mousemove\",\n\tSCATTER_CLICK = \"scatter-click\",\n\tSCATTER_MOUSEOUT = \"scatter-mouseout\",\n}\n\n/**\n * enum of all line graph events\n */\nexport enum Line {\n\tPOINT_MOUSEOVER = \"scatter-mouseover\",\n\tPOINT_MOUSEMOVE = \"scatter-mousemove\",\n\tPOINT_CLICK = \"scatter-click\",\n\tPOINT_MOUSEOUT = \"scatter-mouseout\",\n}\n\n/**\n * enum of all radar graph events\n */\nexport enum Radar {\n\tX_AXIS_MOUSEOVER = \"radar-x-axis-mouseover\",\n\tX_AXIS_MOUSEMOVE = \"radar-x-axis-mousemove\",\n\tX_AXIS_CLICK = \"radar-x-axis-click\",\n\tX_AXIS_MOUSEOUT = \"radar-x-axis-mouseout\",\n}\n\n/**\n * enum of all tooltip events\n */\nexport enum Tooltip {\n\tSHOW = \"show-tooltip\",\n\tHIDE = \"hide-tooltip\",\n}\n\n/**\n * enum of all threshold events\n */\nexport enum Threshold {\n\tSHOW = \"show-threshold\",\n\tHIDE = \"hide-threshold\",\n}\n\n/**\n * enum of all legend related events\n */\nexport enum Legend {\n\tITEM_HOVER = \"legend-item-onhover\",\n\tITEM_CLICK = \"legend-item-onclick\",\n\tITEM_MOUSEOUT = \"legend-item-onmouseout\",\n\tITEMS_UPDATE = \"legend-items-update\",\n}\n"]}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["events.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,KAOX;AAPD,WAAY,KAAK;IAChB,4CAAmC,CAAA;IACnC,gCAAuB,CAAA;IACvB,sCAA6B,CAAA;IAC7B,iCAAiC;IACjC,yBAAyB;IACzB,oCAA2B,CAAA;AAC5B,CAAC,EAPW,KAAK,KAAL,KAAK,QAOhB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY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AAI;IACf,6CAAqC,CAAA;IACrC,6CAAqC,CAAA;IACrC,qCAA6B,CAAA;IAC7B,2CAAmC,CAAA;AACpC,CAAC,EALW,IAAI,KAAJ,IAAI,QAKf;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,KAKX;AALD,WAAY,KAAK;IAChB,oDAA2C,CAAA;IAC3C,oDAA2C,CAAA;IAC3C,4CAAmC,CAAA;IACnC,kDAAyC,CAAA;AAC1C,CAAC,EALW,KAAK,KAAL,KAAK,QAKhB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IAClB,gCAAqB,CAAA;IACrB,gCAAqB,CAAA;AACtB,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACpB,oCAAuB,CAAA;IACvB,oCAAuB,CAAA;AACxB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IACjB,4CAAkC,CAAA;IAClC,4CAAkC,CAAA;IAClC,kDAAwC,CAAA;IACxC,8CAAoC,CAAA;AACrC,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB","sourcesContent":["/**\n * enum of all events related to the chart on the DOM\n */\nexport enum Chart {\n\tRENDER_FINISHED = \"render-finished\",\n\tRESIZE = \"chart-resize\",\n\tMOUSEOVER = \"chart-mouseover\",\n\t// MOUSEMOVE = \"chart-mousemove\",\n\t// CLICK = \"chart-click\",\n\tMOUSEOUT = \"chart-mouseout\"\n}\n\n/**\n * enum of all events related to the chart model\n */\nexport enum Model {\n\tUPDATE = \"model-update\"\n}\n\n/**\n * enum of all axis-related events\n */\nexport enum Axis {\n\tLABEL_MOUSEOVER = \"axis-label-mouseover\",\n\tLABEL_MOUSEMOVE = \"axis-label-mousemove\",\n\tLABEL_CLICK = \"axis-label-click\",\n\tLABEL_MOUSEOUT = \"axis-label-mouseout\"\n}\n\n/**\n * enum of all area graph events\n */\nexport enum Area {\n\tAREA_MOUSEOVER = \"area-mouseover\",\n\tAREA_MOUSEMOVE = \"area-mousemove\",\n\tAREA_CLICK = \"area-click\",\n\tAREA_MOUSEOUT = \"area-mouseout\"\n}\n\n/**\n * enum of all pie graph events\n */\nexport enum Pie {\n\tSLICE_MOUSEOVER = \"pie-slice-mouseover\",\n\tSLICE_MOUSEMOVE = \"pie-slice-mousemove\",\n\tSLICE_CLICK = \"pie-slice-click\",\n\tSLICE_MOUSEOUT = \"pie-slice-mouseout\"\n}\n\n/**\n * enum of all gauge graph events\n */\nexport enum Gauge {\n\tARC_MOUSEOVER = \"gauge-arc-mouseover\",\n\tARC_MOUSEMOVE = \"gauge-arc-mousemove\",\n\tARC_CLICK = \"gauge-arc-click\",\n\tARC_MOUSEOUT = \"gauge-arc-mouseout\"\n}\n\n/**\n * enum of all bar graph events\n */\nexport enum Bar {\n\tBAR_MOUSEOVER = \"bar-mouseover\",\n\tBAR_MOUSEMOVE = \"bar-mousemove\",\n\tBAR_CLICK = \"bar-click\",\n\tBAR_MOUSEOUT = \"bar-mouseout\"\n}\n\n/**\n * enum of all scatter graph events\n */\nexport enum Scatter {\n\tSCATTER_MOUSEOVER = \"scatter-mouseover\",\n\tSCATTER_MOUSEMOVE = \"scatter-mousemove\",\n\tSCATTER_CLICK = \"scatter-click\",\n\tSCATTER_MOUSEOUT = \"scatter-mouseout\"\n}\n\n/**\n * enum of all line graph events\n */\nexport enum Line {\n\tPOINT_MOUSEOVER = \"scatter-mouseover\",\n\tPOINT_MOUSEMOVE = \"scatter-mousemove\",\n\tPOINT_CLICK = \"scatter-click\",\n\tPOINT_MOUSEOUT = \"scatter-mouseout\"\n}\n\n/**\n * enum of all radar graph events\n */\nexport enum Radar {\n\tX_AXIS_MOUSEOVER = \"radar-x-axis-mouseover\",\n\tX_AXIS_MOUSEMOVE = \"radar-x-axis-mousemove\",\n\tX_AXIS_CLICK = \"radar-x-axis-click\",\n\tX_AXIS_MOUSEOUT = \"radar-x-axis-mouseout\"\n}\n\n/**\n * enum of all tooltip events\n */\nexport enum Tooltip {\n\tSHOW = \"show-tooltip\",\n\tHIDE = \"hide-tooltip\"\n}\n\n/**\n * enum of all threshold events\n */\nexport enum Threshold {\n\tSHOW = \"show-threshold\",\n\tHIDE = \"hide-threshold\"\n}\n\n/**\n * enum of all legend related events\n */\nexport enum Legend {\n\tITEM_HOVER = \"legend-item-onhover\",\n\tITEM_CLICK = \"legend-item-onclick\",\n\tITEM_MOUSEOUT = \"legend-item-onmouseout\",\n\tITEMS_UPDATE = \"legend-items-update\"\n}\n"]}
package/model.d.ts CHANGED
@@ -15,6 +15,7 @@ export declare class ChartModel {
15
15
  protected allDataGroups: string[];
16
16
  protected colorScale: any;
17
17
  constructor(services: any);
18
+ getAllDataFromDomain(): any;
18
19
  getDisplayData(): any;
19
20
  getData(): any;
20
21
  isDataEmpty(): boolean;
package/model.js CHANGED
@@ -19,11 +19,10 @@ var ChartModel = /** @class */ (function () {
19
19
  this.colorScale = {};
20
20
  this.services = services;
21
21
  }
22
- ChartModel.prototype.getDisplayData = function () {
22
+ ChartModel.prototype.getAllDataFromDomain = function () {
23
23
  if (!this.get("data")) {
24
24
  return null;
25
25
  }
26
- var ACTIVE = Configuration.legend.items.status.ACTIVE;
27
26
  var dataGroups = this.getDataGroups();
28
27
  // Remove datasets that have been disabled
29
28
  var displayData = Tools.clone(this.get("data"));
@@ -42,12 +41,26 @@ var ChartModel = /** @class */ (function () {
42
41
  else {
43
42
  var _a = axesOptions[axis].domain, start_1 = _a[0], end_1 = _a[1];
44
43
  // Filter out data outside domain
45
- displayData = displayData.filter(function (datum) { return datum[mapsTo_1] >= start_1 && datum[mapsTo_1] <= end_1; });
44
+ displayData = displayData.filter(function (datum) {
45
+ return datum[mapsTo_1] >= start_1 && datum[mapsTo_1] <= end_1;
46
+ });
46
47
  }
47
48
  }
48
49
  });
49
50
  }
50
51
  return displayData.filter(function (datum) {
52
+ return dataGroups.find(function (group) { return group.name === datum[groupMapsTo]; });
53
+ });
54
+ };
55
+ ChartModel.prototype.getDisplayData = function () {
56
+ if (!this.get("data")) {
57
+ return null;
58
+ }
59
+ var ACTIVE = Configuration.legend.items.status.ACTIVE;
60
+ var dataGroups = this.getDataGroups();
61
+ var groupMapsTo = this.getOptions().data.groupMapsTo;
62
+ var allDataFromDomain = this.getAllDataFromDomain();
63
+ return allDataFromDomain.filter(function (datum) {
51
64
  var group = dataGroups.find(function (group) { return group.name === datum[groupMapsTo]; });
52
65
  return group.status === ACTIVE;
53
66
  });
@@ -110,6 +123,20 @@ var ChartModel = /** @class */ (function () {
110
123
  var domainIdentifier = this.services.cartesianScales.getDomainIdentifier();
111
124
  var rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();
112
125
  var stackKeys = map(displayData, function (datum) { return datum[domainIdentifier]; }).keys();
126
+ var axisPosition = this.services.cartesianScales.domainAxisPosition;
127
+ var scaleType = options.axes[axisPosition].scaleType;
128
+ // Sort keys
129
+ if (scaleType === ScaleTypes.TIME) {
130
+ stackKeys.sort(function (a, b) {
131
+ var dateA = new Date(a);
132
+ var dateB = new Date(b);
133
+ return dateA - dateB;
134
+ });
135
+ }
136
+ else if (scaleType === ScaleTypes.LOG ||
137
+ scaleType === ScaleTypes.LINEAR) {
138
+ stackKeys.sort(function (a, b) { return a - b; });
139
+ }
113
140
  var dataGroupNames = this.getDataGroupNames();
114
141
  return stackKeys.map(function (key) {
115
142
  var correspondingValues = { sharedStackKey: key };
@@ -238,6 +265,19 @@ var ChartModel = /** @class */ (function () {
238
265
  group.name === changedLabel ? ACTIVE : DISABLED;
239
266
  });
240
267
  }
268
+ // Updates selected groups
269
+ var updatedActiveItems = dataGroups.filter(function (group) { return group.status === ACTIVE; });
270
+ var options = this.getOptions();
271
+ var hasUpdatedDeactivatedItems = dataGroups.some(function (group) { return group.status === DISABLED; });
272
+ // If there are deactivated items, map the item name into selected groups
273
+ if (hasUpdatedDeactivatedItems) {
274
+ options.data.selectedGroups = updatedActiveItems.map(function (activeItem) { return activeItem.name; });
275
+ }
276
+ else {
277
+ // If every item is active, clear array
278
+ options.data.selectedGroups = [];
279
+ }
280
+ ;
241
281
  // dispatch legend filtering event with the status of all the dataLabels
242
282
  this.services.events.dispatchEvent(Events.Legend.ITEMS_UPDATE, {
243
283
  dataGroups: dataGroups
@@ -365,11 +405,27 @@ var ChartModel = /** @class */ (function () {
365
405
  };
366
406
  ChartModel.prototype.generateDataGroups = function (data) {
367
407
  var groupMapsTo = this.getOptions().data.groupMapsTo;
368
- var ACTIVE = Configuration.legend.items.status.ACTIVE;
408
+ var _a = Configuration.legend.items.status, ACTIVE = _a.ACTIVE, DISABLED = _a.DISABLED;
409
+ var options = this.getOptions();
369
410
  var uniqueDataGroups = map(data, function (datum) { return datum[groupMapsTo]; }).keys();
411
+ // check if selectedGroups can be applied to chart with current data groups
412
+ if (options.data.selectedGroups.length) {
413
+ var hasAllSelectedGroups = options.data.selectedGroups
414
+ .every(function (groupName) { return uniqueDataGroups.includes(groupName); });
415
+ if (!hasAllSelectedGroups) {
416
+ options.data.selectedGroups = [];
417
+ }
418
+ ;
419
+ }
420
+ // Get group status based on items in selected groups
421
+ var getStatus = function (groupName) {
422
+ return !options.data.selectedGroups.length || options.data.selectedGroups.includes(groupName)
423
+ ? ACTIVE
424
+ : DISABLED;
425
+ };
370
426
  return uniqueDataGroups.map(function (groupName) { return ({
371
427
  name: groupName,
372
- status: ACTIVE
428
+ status: getStatus(groupName)
373
429
  }); });
374
430
  };
375
431
  /*
package/model.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["model.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,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B,CAAC;IACF,iBAAC;AAAD,CAAC,AA3fD,IA2fC","sourcesContent":["// Internal Imports\nimport * as Configuration from \"./configuration\";\nimport { Tools } from \"./tools\";\nimport * as colorPalettes from \"./services/colorPalettes\";\nimport { Events, ScaleTypes } from \"./interfaces\";\n\n// D3\nimport { scaleOrdinal } from \"d3-scale\";\nimport { map } from \"d3-collection\";\nimport { stack } from \"d3-shape\";\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class ChartModel {\n\t// Callbacks\n\t/**\n\t * Function to be called when data or options update within the model\n\t * @type Function\n\t */\n\tprotected updateCallback: Function;\n\tprotected services: any;\n\n\t// Internal Model state\n\tprotected state: any = {\n\t\toptions: {}\n\t};\n\n\t// Data labels\n\t/**\n\t * A list of all the data groups that have existed within the lifetime of the chart\n\t * @type string[]\n\t */\n\tprotected allDataGroups: string[];\n\n\t// Fill scales & fill related objects\n\tprotected colorScale: any = {};\n\n\tconstructor(services: any) {\n\t\tthis.services = services;\n\t}\n\n\tgetDisplayData() {\n\t\tif (!this.get(\"data\")) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { ACTIVE } = Configuration.legend.items.status;\n\t\tconst dataGroups = this.getDataGroups();\n\n\t\t// Remove datasets that have been disabled\n\t\tlet displayData = Tools.clone(this.get(\"data\"));\n\t\tconst { groupMapsTo } = this.getOptions().data;\n\n\t\tconst axesOptions = this.getOptions().axes;\n\n\t\t// Check for custom domain\n\t\tif (axesOptions) {\n\t\t\tObject.keys(axesOptions).forEach((axis) => {\n\t\t\t\tif (axesOptions[axis].mapsTo && axesOptions[axis].domain) {\n\t\t\t\t\tconst mapsTo = axesOptions[axis].mapsTo;\n\n\t\t\t\t\tif (axesOptions[axis].scaleType === ScaleTypes.LABELS) {\n\t\t\t\t\t\tdisplayData = displayData.filter((datum) =>\n\t\t\t\t\t\t\taxesOptions[axis].domain.includes(datum[mapsTo])\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst [start, end] = axesOptions[axis].domain;\n\n\t\t\t\t\t\t// Filter out data outside domain\n\t\t\t\t\t\tdisplayData = displayData.filter(\n\t\t\t\t\t\t\t(datum) => datum[mapsTo] >= start && datum[mapsTo] <= end\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn displayData.filter((datum) => {\n\t\t\tconst group = dataGroups.find(\n\t\t\t\t(group) => group.name === datum[groupMapsTo]\n\t\t\t);\n\n\t\t\treturn group.status === ACTIVE;\n\t\t});\n\t}\n\n\tgetData() {\n\t\treturn this.get(\"data\");\n\t}\n\n\tisDataEmpty() {\n\t\treturn !this.getData().length;\n\t}\n\n\t/**\n\t *\n\t * @param newData The new raw data to be set\n\t */\n\tsetData(newData) {\n\t\tconst sanitizedData = this.sanitize(Tools.clone(newData));\n\t\tconst dataGroups = this.generateDataGroups(sanitizedData);\n\n\t\tthis.set({\n\t\t\tdata: sanitizedData,\n\t\t\tdataGroups\n\t\t});\n\n\t\treturn sanitizedData;\n\t}\n\n\tgetDataGroups() {\n\t\treturn this.get(\"dataGroups\");\n\t}\n\n\tgetActiveDataGroups() {\n\t\tconst { ACTIVE } = Configuration.legend.items.status;\n\n\t\treturn this.getDataGroups().filter(\n\t\t\t(dataGroup) => dataGroup.status === ACTIVE\n\t\t);\n\t}\n\n\tgetDataGroupNames() {\n\t\treturn this.getDataGroups().map((dataGroup) => dataGroup.name);\n\t}\n\n\tgetActiveDataGroupNames() {\n\t\treturn this.getActiveDataGroups().map((dataGroup) => dataGroup.name);\n\t}\n\n\tgetGroupedData() {\n\t\tconst displayData = this.getDisplayData();\n\t\tconst groupedData = {};\n\t\tconst { groupMapsTo } = this.getOptions().data;\n\n\t\tdisplayData.map((datum) => {\n\t\t\tconst group = datum[groupMapsTo];\n\t\t\tif (\n\t\t\t\tgroupedData[group] !== null &&\n\t\t\t\tgroupedData[group] !== undefined\n\t\t\t) {\n\t\t\t\tgroupedData[group].push(datum);\n\t\t\t} else {\n\t\t\t\tgroupedData[group] = [datum];\n\t\t\t}\n\t\t});\n\n\t\treturn Object.keys(groupedData).map((groupName) => ({\n\t\t\tname: groupName,\n\t\t\tdata: groupedData[groupName]\n\t\t}));\n\t}\n\n\tgetDataValuesGroupedByKeys() {\n\t\tconst options = this.getOptions();\n\t\tconst { groupMapsTo } = options.data;\n\n\t\tconst displayData = this.getDisplayData();\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier();\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();\n\n\t\tconst stackKeys = map(\n\t\t\tdisplayData,\n\t\t\t(datum) => datum[domainIdentifier]\n\t\t).keys();\n\t\tconst dataGroupNames = this.getDataGroupNames();\n\n\t\treturn stackKeys.map((key) => {\n\t\t\tconst correspondingValues = { sharedStackKey: key };\n\t\t\tdataGroupNames.forEach((dataGroupName) => {\n\t\t\t\tconst correspondingDatum = displayData.find((datum) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tdatum[groupMapsTo] === dataGroupName &&\n\t\t\t\t\t\tdatum[domainIdentifier].toString() === key\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tcorrespondingValues[dataGroupName] = correspondingDatum\n\t\t\t\t\t? correspondingDatum[rangeIdentifier]\n\t\t\t\t\t: null;\n\t\t\t});\n\t\t\treturn correspondingValues;\n\t\t}) as any;\n\t}\n\n\tgetStackedData({ percentage } = { percentage: false }) {\n\t\tconst options = this.getOptions();\n\t\tconst { groupMapsTo } = options.data;\n\n\t\tconst dataGroupNames = this.getDataGroupNames();\n\t\tconst dataValuesGroupedByKeys = this.getDataValuesGroupedByKeys();\n\n\t\tif (percentage) {\n\t\t\tconst maxByKey = Tools.fromPairs(\n\t\t\t\tdataValuesGroupedByKeys.map((d: any) => [d.sharedStackKey, 0])\n\t\t\t);\n\n\t\t\tdataValuesGroupedByKeys.forEach((d: any) => {\n\t\t\t\tdataGroupNames.forEach((name) => {\n\t\t\t\t\tmaxByKey[d.sharedStackKey] += d[name];\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// cycle through data values to get percentage\n\t\t\tdataValuesGroupedByKeys.forEach((d: any) => {\n\t\t\t\tdataGroupNames.forEach((name) => {\n\t\t\t\t\td[name] = (d[name] / maxByKey[d.sharedStackKey]) * 100;\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn stack()\n\t\t\t.keys(dataGroupNames)(dataValuesGroupedByKeys)\n\t\t\t.map((series, i) => {\n\t\t\t\t// Add data group names to each series\n\t\t\t\treturn Object.keys(series)\n\t\t\t\t\t.filter((key: any) => !isNaN(key))\n\t\t\t\t\t.map((key) => {\n\t\t\t\t\t\tconst element = series[key];\n\t\t\t\t\t\telement[groupMapsTo] = dataGroupNames[i];\n\n\t\t\t\t\t\treturn element;\n\t\t\t\t\t});\n\t\t\t});\n\t}\n\n\t/**\n\t * @return {Object} The chart's options\n\t */\n\tgetOptions() {\n\t\treturn this.state.options;\n\t}\n\n\tset(newState: any, skipUpdate = false) {\n\t\tthis.state = Object.assign({}, this.state, newState);\n\n\t\tif (!skipUpdate) {\n\t\t\tthis.update();\n\t\t}\n\t}\n\n\tget(property?: string) {\n\t\tif (property) {\n\t\t\treturn this.state[property];\n\t\t} else {\n\t\t\treturn this.state;\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * @param newOptions New options to be set\n\t */\n\tsetOptions(newOptions) {\n\t\tthis.set({\n\t\t\toptions: Tools.merge(this.getOptions(), newOptions)\n\t\t});\n\t}\n\n\t/**\n\t *\n\t * Updates miscellanous information within the model\n\t * such as the color scales, or the legend data labels\n\t */\n\tupdate() {\n\t\tif (!this.getDisplayData()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateAllDataGroups();\n\n\t\tthis.setColorScale();\n\t\tthis.services.events.dispatchEvent(Events.Model.UPDATE);\n\t}\n\n\tsetUpdateCallback(cb: Function) {\n\t\tthis.updateCallback = cb;\n\t}\n\n\t/*\n\t * Data labels\n\t */\n\ttoggleDataLabel(changedLabel: string) {\n\t\tconst { ACTIVE, DISABLED } = Configuration.legend.items.status;\n\t\tconst dataGroups = this.getDataGroups();\n\n\t\tconst hasDeactivatedItems = dataGroups.some(\n\t\t\t(group) => group.status === DISABLED\n\t\t);\n\t\tconst activeItems = dataGroups.filter(\n\t\t\t(group) => group.status === ACTIVE\n\t\t);\n\n\t\t// If there are deactivated items, toggle \"changedLabel\"\n\t\tif (hasDeactivatedItems) {\n\t\t\t// If the only active item is being toggled\n\t\t\t// Activate all items\n\t\t\tif (\n\t\t\t\tactiveItems.length === 1 &&\n\t\t\t\tactiveItems[0].name === changedLabel\n\t\t\t) {\n\t\t\t\t// If every item is active, then enable \"changedLabel\" and disable all other items\n\t\t\t\tdataGroups.forEach((group, i) => {\n\t\t\t\t\tdataGroups[i].status = ACTIVE;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst indexToChange = dataGroups.findIndex(\n\t\t\t\t\t(group) => group.name === changedLabel\n\t\t\t\t);\n\t\t\t\tdataGroups[indexToChange].status =\n\t\t\t\t\tdataGroups[indexToChange].status === DISABLED\n\t\t\t\t\t\t? ACTIVE\n\t\t\t\t\t\t: DISABLED;\n\t\t\t}\n\t\t} else {\n\t\t\t// If every item is active, then enable \"changedLabel\" and disable all other items\n\t\t\tdataGroups.forEach((group, i) => {\n\t\t\t\tdataGroups[i].status =\n\t\t\t\t\tgroup.name === changedLabel ? ACTIVE : DISABLED;\n\t\t\t});\n\t\t}\n\n\t\t// dispatch legend filtering event with the status of all the dataLabels\n\t\tthis.services.events.dispatchEvent(Events.Legend.ITEMS_UPDATE, {\n\t\t\tdataGroups\n\t\t});\n\n\t\t// Update model\n\t\tthis.set({\n\t\t\tdataGroups\n\t\t});\n\t}\n\n\t/**\n\t * Should the data point be filled?\n\t * @param group\n\t * @param key\n\t * @param value\n\t * @param defaultFilled the default for this chart\n\t */\n\tgetIsFilled(group: any, key?: any, data?: any, defaultFilled?: boolean) {\n\t\tconst options = this.getOptions();\n\t\tif (options.getIsFilled) {\n\t\t\treturn options.getIsFilled(group, key, data, defaultFilled);\n\t\t} else {\n\t\t\treturn defaultFilled;\n\t\t}\n\t}\n\n\tgetFillColor(group: any, key?: any, data?: any) {\n\t\tconst options = this.getOptions();\n\t\tconst defaultFillColor = this.getFillScale()(group);\n\t\tif (options.getFillColor) {\n\t\t\treturn options.getFillColor(group, key, data, defaultFillColor);\n\t\t} else {\n\t\t\treturn defaultFillColor;\n\t\t}\n\t}\n\n\tgetStrokeColor(group: any, key?: any, data?: any) {\n\t\tconst options = this.getOptions();\n\t\tconst defaultStrokeColor = this.colorScale(group);\n\t\tif (options.getStrokeColor) {\n\t\t\treturn options.getStrokeColor(group, key, data, defaultStrokeColor);\n\t\t} else {\n\t\t\treturn defaultStrokeColor;\n\t\t}\n\t}\n\n\tgetFillScale() {\n\t\treturn this.colorScale;\n\t}\n\n\t/**\n\t * Converts data provided in the older format to tabular\n\t *\n\t */\n\tprotected transformToTabularData(data) {\n\t\tconsole.warn(\n\t\t\t\"We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials--tabular-data-format\"\n\t\t);\n\t\tconst tabularData = [];\n\t\tconst { datasets, labels } = data;\n\n\t\t// Loop through all datasets\n\t\tdatasets.forEach((dataset) => {\n\t\t\t// Update each data point to the new format\n\t\t\tdataset.data.forEach((datum, i) => {\n\t\t\t\tlet group;\n\n\t\t\t\tconst datasetLabel = Tools.getProperty(dataset, \"label\");\n\t\t\t\tif (datasetLabel === null) {\n\t\t\t\t\tconst correspondingLabel = Tools.getProperty(labels, i);\n\t\t\t\t\tif (correspondingLabel) {\n\t\t\t\t\t\tgroup = correspondingLabel;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgroup = \"Ungrouped\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tgroup = datasetLabel;\n\t\t\t\t}\n\n\t\t\t\tconst updatedDatum = {\n\t\t\t\t\tgroup,\n\t\t\t\t\tkey: labels[i]\n\t\t\t\t};\n\n\t\t\t\tif (isNaN(datum)) {\n\t\t\t\t\tupdatedDatum[\"value\"] = datum.value;\n\t\t\t\t\tupdatedDatum[\"date\"] = datum.date;\n\t\t\t\t} else {\n\t\t\t\t\tupdatedDatum[\"value\"] = datum;\n\t\t\t\t}\n\n\t\t\t\ttabularData.push(updatedDatum);\n\t\t\t});\n\t\t});\n\n\t\treturn tabularData;\n\t}\n\n\tprotected getTabularData(data) {\n\t\t// if data is not an array\n\t\tif (!Array.isArray(data)) {\n\t\t\treturn this.transformToTabularData(data);\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tprotected sanitize(data) {\n\t\treturn this.getTabularData(data);\n\t}\n\n\t/*\n\t * Data groups\n\t */\n\tprotected updateAllDataGroups() {\n\t\t// allDataGroups is used to generate a color scale that applies\n\t\t// to all the groups. Now when the data updates, you might remove a group,\n\t\t// and then bring it back in a newer data update, therefore\n\t\t// the order of the groups in allDataGroups matters so that you'd never\n\t\t// have an incorrect color assigned to a group.\n\n\t\t// Also, a new group should only be added to allDataGroups if\n\t\t// it doesn't currently exist\n\n\t\tif (!this.allDataGroups) {\n\t\t\tthis.allDataGroups = this.getDataGroupNames();\n\t\t} else {\n\t\t\t// Loop through current data groups\n\t\t\tthis.getDataGroupNames().forEach((dataGroupName) => {\n\t\t\t\t// If group name hasn't been stored yet, store it\n\t\t\t\tif (this.allDataGroups.indexOf(dataGroupName) === -1) {\n\t\t\t\t\tthis.allDataGroups.push(dataGroupName);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected generateDataGroups(data) {\n\t\tconst { groupMapsTo } = this.getOptions().data;\n\t\tconst { ACTIVE } = Configuration.legend.items.status;\n\n\t\tconst uniqueDataGroups = map(\n\t\t\tdata,\n\t\t\t(datum) => datum[groupMapsTo]\n\t\t).keys();\n\t\treturn uniqueDataGroups.map((groupName) => ({\n\t\t\tname: groupName,\n\t\t\tstatus: ACTIVE\n\t\t}));\n\t}\n\n\t/*\n\t * Fill scales\n\t */\n\tprotected setColorScale() {\n\t\tlet defaultColors = colorPalettes.DEFAULT;\n\n\t\tconst options = this.getOptions();\n\t\tconst userProvidedScale = Tools.getProperty(options, \"color\", \"scale\");\n\n\t\t// If there is no valid user provided scale, use the default set of colors\n\t\tif (\n\t\t\tuserProvidedScale === null ||\n\t\t\tObject.keys(userProvidedScale).length === 0\n\t\t) {\n\t\t\tthis.colorScale = scaleOrdinal()\n\t\t\t\t.range(defaultColors)\n\t\t\t\t.domain(this.allDataGroups);\n\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Go through allDataGroups. If a data group has a color value provided\n\t\t * by the user, add that to the color range\n\t\t * If not, add a default color\n\t\t */\n\t\tconst colorRange = [];\n\t\tlet colorIndex = 0;\n\t\tthis.allDataGroups.forEach((dataGroup) => {\n\t\t\tif (userProvidedScale[dataGroup]) {\n\t\t\t\tcolorRange.push(userProvidedScale[dataGroup]);\n\t\t\t} else {\n\t\t\t\tcolorRange.push(defaultColors[colorIndex]);\n\t\t\t}\n\n\t\t\tif (colorIndex === defaultColors.length - 1) {\n\t\t\t\tcolorIndex = 0;\n\t\t\t} else {\n\t\t\t\tcolorIndex++;\n\t\t\t}\n\t\t});\n\n\t\tthis.colorScale = scaleOrdinal()\n\t\t\t.range(colorRange)\n\t\t\t.domain(this.allDataGroups);\n\t}\n}\n"]}
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["model.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAElD,KAAK;AACL,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAA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;;OAEG;IACO,kCAAa,GAAvB;QACC,IAAI,aAAa,GAAG,aAAa,CAAC,OAAO,CAAC;QAE1C,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,IAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAEvE,0EAA0E;QAC1E,IACC,iBAAiB,KAAK,IAAI;YAC1B,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,KAAK,CAAC,EAC1C;YACD,IAAI,CAAC,UAAU,GAAG,YAAY,EAAE;iBAC9B,KAAK,CAAC,aAAa,CAAC;iBACpB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAE7B,OAAO;SACP;QAED;;;;WAIG;QACH,IAAM,UAAU,GAAG,EAAE,CAAC;QACtB,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAC,SAAS;YACpC,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAAE;gBACjC,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;aAC9C;iBAAM;gBACN,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;aAC3C;YAED,IAAI,UAAU,KAAK,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC5C,UAAU,GAAG,CAAC,CAAC;aACf;iBAAM;gBACN,UAAU,EAAE,CAAC;aACb;QACF,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,GAAG,YAAY,EAAE;aAC9B,KAAK,CAAC,UAAU,CAAC;aACjB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9B,CAAC;IACF,iBAAC;AAAD,CAAC,AAhkBD,IAgkBC","sourcesContent":["// Internal Imports\nimport * as Configuration from \"./configuration\";\nimport { Tools } from \"./tools\";\nimport * as colorPalettes from \"./services/colorPalettes\";\nimport { Events, ScaleTypes } from \"./interfaces\";\n\n// D3\nimport { scaleOrdinal } from \"d3-scale\";\nimport { map } from \"d3-collection\";\nimport { stack } from \"d3-shape\";\n\n/** The charting model layer which includes mainly the chart data and options,\n * as well as some misc. information to be shared among components */\nexport class ChartModel {\n\t// Callbacks\n\t/**\n\t * Function to be called when data or options update within the model\n\t * @type Function\n\t */\n\tprotected updateCallback: Function;\n\tprotected services: any;\n\n\t// Internal Model state\n\tprotected state: any = {\n\t\toptions: {}\n\t};\n\n\t// Data labels\n\t/**\n\t * A list of all the data groups that have existed within the lifetime of the chart\n\t * @type string[]\n\t */\n\tprotected allDataGroups: string[];\n\n\t// Fill scales & fill related objects\n\tprotected colorScale: any = {};\n\n\tconstructor(services: any) {\n\t\tthis.services = services;\n\t}\n\n\tgetAllDataFromDomain() {\n\t\tif (!this.get(\"data\")) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst dataGroups = this.getDataGroups();\n\n\t\t// Remove datasets that have been disabled\n\t\tlet displayData = Tools.clone(this.get(\"data\"));\n\t\tconst { groupMapsTo } = this.getOptions().data;\n\n\t\tconst axesOptions = this.getOptions().axes;\n\n\t\t// Check for custom domain\n\t\tif (axesOptions) {\n\t\t\tObject.keys(axesOptions).forEach((axis) => {\n\t\t\t\tif (axesOptions[axis].mapsTo && axesOptions[axis].domain) {\n\t\t\t\t\tconst mapsTo = axesOptions[axis].mapsTo;\n\n\t\t\t\t\tif (axesOptions[axis].scaleType === ScaleTypes.LABELS) {\n\t\t\t\t\t\tdisplayData = displayData.filter((datum) =>\n\t\t\t\t\t\t\taxesOptions[axis].domain.includes(datum[mapsTo])\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst [start, end] = axesOptions[axis].domain;\n\n\t\t\t\t\t\t// Filter out data outside domain\n\t\t\t\t\t\tdisplayData = displayData.filter(\n\t\t\t\t\t\t\t(datum) =>\n\t\t\t\t\t\t\t\tdatum[mapsTo] >= start && datum[mapsTo] <= end\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn displayData.filter((datum) => {\n\t\t\treturn dataGroups.find(\n\t\t\t\t(group) => group.name === datum[groupMapsTo]\n\t\t\t);\n\t\t});\n\t}\n\n\tgetDisplayData() {\n\t\tif (!this.get(\"data\")) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { ACTIVE } = Configuration.legend.items.status;\n\t\tconst dataGroups = this.getDataGroups();\n\t\tconst { groupMapsTo } = this.getOptions().data;\n\n\t\tconst allDataFromDomain = this.getAllDataFromDomain();\n\n\t\treturn allDataFromDomain.filter((datum) => {\n\t\t\tconst group = dataGroups.find(\n\t\t\t\t(group) => group.name === datum[groupMapsTo]\n\t\t\t);\n\n\t\t\treturn group.status === ACTIVE;\n\t\t});\n\t}\n\n\tgetData() {\n\t\treturn this.get(\"data\");\n\t}\n\n\tisDataEmpty() {\n\t\treturn !this.getData().length;\n\t}\n\n\t/**\n\t *\n\t * @param newData The new raw data to be set\n\t */\n\tsetData(newData) {\n\t\tconst sanitizedData = this.sanitize(Tools.clone(newData));\n\t\tconst dataGroups = this.generateDataGroups(sanitizedData);\n\n\t\tthis.set({\n\t\t\tdata: sanitizedData,\n\t\t\tdataGroups\n\t\t});\n\n\t\treturn sanitizedData;\n\t}\n\n\tgetDataGroups() {\n\t\treturn this.get(\"dataGroups\");\n\t}\n\n\tgetActiveDataGroups() {\n\t\tconst { ACTIVE } = Configuration.legend.items.status;\n\n\t\treturn this.getDataGroups().filter(\n\t\t\t(dataGroup) => dataGroup.status === ACTIVE\n\t\t);\n\t}\n\n\tgetDataGroupNames() {\n\t\treturn this.getDataGroups().map((dataGroup) => dataGroup.name);\n\t}\n\n\tgetActiveDataGroupNames() {\n\t\treturn this.getActiveDataGroups().map((dataGroup) => dataGroup.name);\n\t}\n\n\tgetGroupedData() {\n\t\tconst displayData = this.getDisplayData();\n\t\tconst groupedData = {};\n\t\tconst { groupMapsTo } = this.getOptions().data;\n\n\t\tdisplayData.map((datum) => {\n\t\t\tconst group = datum[groupMapsTo];\n\t\t\tif (\n\t\t\t\tgroupedData[group] !== null &&\n\t\t\t\tgroupedData[group] !== undefined\n\t\t\t) {\n\t\t\t\tgroupedData[group].push(datum);\n\t\t\t} else {\n\t\t\t\tgroupedData[group] = [datum];\n\t\t\t}\n\t\t});\n\n\t\treturn Object.keys(groupedData).map((groupName) => ({\n\t\t\tname: groupName,\n\t\t\tdata: groupedData[groupName]\n\t\t}));\n\t}\n\n\tgetDataValuesGroupedByKeys() {\n\t\tconst options = this.getOptions();\n\t\tconst { groupMapsTo } = options.data;\n\n\t\tconst displayData = this.getDisplayData();\n\t\tconst domainIdentifier = this.services.cartesianScales.getDomainIdentifier();\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();\n\n\t\tconst stackKeys = map(\n\t\t\tdisplayData,\n\t\t\t(datum) => datum[domainIdentifier]\n\t\t).keys();\n\n\t\tconst axisPosition = this.services.cartesianScales.domainAxisPosition;\n\t\tconst scaleType = options.axes[axisPosition].scaleType;\n\n\t\t// Sort keys\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tstackKeys.sort((a: any, b: any) => {\n\t\t\t\tconst dateA: any = new Date(a);\n\t\t\t\tconst dateB: any = new Date(b);\n\t\t\t\treturn dateA - dateB;\n\t\t\t});\n\t\t} else if (\n\t\t\tscaleType === ScaleTypes.LOG ||\n\t\t\tscaleType === ScaleTypes.LINEAR\n\t\t) {\n\t\t\tstackKeys.sort((a: any, b: any) => a - b);\n\t\t}\n\n\t\tconst dataGroupNames = this.getDataGroupNames();\n\n\t\treturn stackKeys.map((key) => {\n\t\t\tconst correspondingValues = { sharedStackKey: key };\n\t\t\tdataGroupNames.forEach((dataGroupName) => {\n\t\t\t\tconst correspondingDatum = displayData.find((datum) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tdatum[groupMapsTo] === dataGroupName &&\n\t\t\t\t\t\tdatum[domainIdentifier].toString() === key\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tcorrespondingValues[dataGroupName] = correspondingDatum\n\t\t\t\t\t? correspondingDatum[rangeIdentifier]\n\t\t\t\t\t: null;\n\t\t\t});\n\t\t\treturn correspondingValues;\n\t\t}) as any;\n\t}\n\n\tgetStackedData({ percentage } = { percentage: false }) {\n\t\tconst options = this.getOptions();\n\t\tconst { groupMapsTo } = options.data;\n\n\t\tconst dataGroupNames = this.getDataGroupNames();\n\t\tconst dataValuesGroupedByKeys = this.getDataValuesGroupedByKeys();\n\n\t\tif (percentage) {\n\t\t\tconst maxByKey = Tools.fromPairs(\n\t\t\t\tdataValuesGroupedByKeys.map((d: any) => [d.sharedStackKey, 0])\n\t\t\t);\n\n\t\t\tdataValuesGroupedByKeys.forEach((d: any) => {\n\t\t\t\tdataGroupNames.forEach((name) => {\n\t\t\t\t\tmaxByKey[d.sharedStackKey] += d[name];\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// cycle through data values to get percentage\n\t\t\tdataValuesGroupedByKeys.forEach((d: any) => {\n\t\t\t\tdataGroupNames.forEach((name) => {\n\t\t\t\t\td[name] = (d[name] / maxByKey[d.sharedStackKey]) * 100;\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn stack()\n\t\t\t.keys(dataGroupNames)(dataValuesGroupedByKeys)\n\t\t\t.map((series, i) => {\n\t\t\t\t// Add data group names to each series\n\t\t\t\treturn Object.keys(series)\n\t\t\t\t\t.filter((key: any) => !isNaN(key))\n\t\t\t\t\t.map((key) => {\n\t\t\t\t\t\tconst element = series[key];\n\t\t\t\t\t\telement[groupMapsTo] = dataGroupNames[i];\n\n\t\t\t\t\t\treturn element;\n\t\t\t\t\t});\n\t\t\t});\n\t}\n\n\t/**\n\t * @return {Object} The chart's options\n\t */\n\tgetOptions() {\n\t\treturn this.state.options;\n\t}\n\n\tset(newState: any, skipUpdate = false) {\n\t\tthis.state = Object.assign({}, this.state, newState);\n\n\t\tif (!skipUpdate) {\n\t\t\tthis.update();\n\t\t}\n\t}\n\n\tget(property?: string) {\n\t\tif (property) {\n\t\t\treturn this.state[property];\n\t\t} else {\n\t\t\treturn this.state;\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * @param newOptions New options to be set\n\t */\n\tsetOptions(newOptions) {\n\t\tthis.set({\n\t\t\toptions: Tools.merge(this.getOptions(), newOptions)\n\t\t});\n\t}\n\n\t/**\n\t *\n\t * Updates miscellanous information within the model\n\t * such as the color scales, or the legend data labels\n\t */\n\tupdate() {\n\t\tif (!this.getDisplayData()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateAllDataGroups();\n\n\t\tthis.setColorScale();\n\t\tthis.services.events.dispatchEvent(Events.Model.UPDATE);\n\t}\n\n\tsetUpdateCallback(cb: Function) {\n\t\tthis.updateCallback = cb;\n\t}\n\n\t/*\n\t * Data labels\n\t */\n\ttoggleDataLabel(changedLabel: string) {\n\t\tconst { ACTIVE, DISABLED } = Configuration.legend.items.status;\n\t\tconst dataGroups = this.getDataGroups();\n\n\t\tconst hasDeactivatedItems = dataGroups.some(\n\t\t\t(group) => group.status === DISABLED\n\t\t);\n\t\tconst activeItems = dataGroups.filter(\n\t\t\t(group) => group.status === ACTIVE\n\t\t);\n\n\t\t// If there are deactivated items, toggle \"changedLabel\"\n\t\tif (hasDeactivatedItems) {\n\t\t\t// If the only active item is being toggled\n\t\t\t// Activate all items\n\t\t\tif (\n\t\t\t\tactiveItems.length === 1 &&\n\t\t\t\tactiveItems[0].name === changedLabel\n\t\t\t) {\n\t\t\t\t// If every item is active, then enable \"changedLabel\" and disable all other items\n\t\t\t\tdataGroups.forEach((group, i) => {\n\t\t\t\t\tdataGroups[i].status = ACTIVE;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst indexToChange = dataGroups.findIndex(\n\t\t\t\t\t(group) => group.name === changedLabel\n\t\t\t\t);\n\t\t\t\tdataGroups[indexToChange].status =\n\t\t\t\t\tdataGroups[indexToChange].status === DISABLED\n\t\t\t\t\t\t? ACTIVE\n\t\t\t\t\t\t: DISABLED;\n\t\t\t}\n\t\t} else {\n\t\t\t// If every item is active, then enable \"changedLabel\" and disable all other items\n\t\t\tdataGroups.forEach((group, i) => {\n\t\t\t\tdataGroups[i].status =\n\t\t\t\t\tgroup.name === changedLabel ? ACTIVE : DISABLED;\n\t\t\t});\n\t\t}\n\n\t\t// Updates selected groups\n\t\tconst updatedActiveItems = dataGroups.filter(group => group.status === ACTIVE);\n\t\tconst options = this.getOptions();\n\n\t\tconst hasUpdatedDeactivatedItems = dataGroups.some(\n\t\t\tgroup => group.status === DISABLED\n\t\t);\n\n\t\t// If there are deactivated items, map the item name into selected groups\n\t\tif (hasUpdatedDeactivatedItems) {\n\t\t\toptions.data.selectedGroups = updatedActiveItems.map(activeItem => activeItem.name);\n\t\t} else {\n\t\t\t// If every item is active, clear array\n\t\t\toptions.data.selectedGroups = [];\n\t\t};\n\n\t\t// dispatch legend filtering event with the status of all the dataLabels\n\t\tthis.services.events.dispatchEvent(Events.Legend.ITEMS_UPDATE, {\n\t\t\tdataGroups\n\t\t});\n\n\t\t// Update model\n\t\tthis.set({\n\t\t\tdataGroups\n\t\t});\n\t}\n\n\t/**\n\t * Should the data point be filled?\n\t * @param group\n\t * @param key\n\t * @param value\n\t * @param defaultFilled the default for this chart\n\t */\n\tgetIsFilled(group: any, key?: any, data?: any, defaultFilled?: boolean) {\n\t\tconst options = this.getOptions();\n\t\tif (options.getIsFilled) {\n\t\t\treturn options.getIsFilled(group, key, data, defaultFilled);\n\t\t} else {\n\t\t\treturn defaultFilled;\n\t\t}\n\t}\n\n\tgetFillColor(group: any, key?: any, data?: any) {\n\t\tconst options = this.getOptions();\n\t\tconst defaultFillColor = this.getFillScale()(group);\n\t\tif (options.getFillColor) {\n\t\t\treturn options.getFillColor(group, key, data, defaultFillColor);\n\t\t} else {\n\t\t\treturn defaultFillColor;\n\t\t}\n\t}\n\n\tgetStrokeColor(group: any, key?: any, data?: any) {\n\t\tconst options = this.getOptions();\n\t\tconst defaultStrokeColor = this.colorScale(group);\n\t\tif (options.getStrokeColor) {\n\t\t\treturn options.getStrokeColor(group, key, data, defaultStrokeColor);\n\t\t} else {\n\t\t\treturn defaultStrokeColor;\n\t\t}\n\t}\n\n\tgetFillScale() {\n\t\treturn this.colorScale;\n\t}\n\n\t/**\n\t * Converts data provided in the older format to tabular\n\t *\n\t */\n\tprotected transformToTabularData(data) {\n\t\tconsole.warn(\n\t\t\t\"We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials--tabular-data-format\"\n\t\t);\n\t\tconst tabularData = [];\n\t\tconst { datasets, labels } = data;\n\n\t\t// Loop through all datasets\n\t\tdatasets.forEach((dataset) => {\n\t\t\t// Update each data point to the new format\n\t\t\tdataset.data.forEach((datum, i) => {\n\t\t\t\tlet group;\n\n\t\t\t\tconst datasetLabel = Tools.getProperty(dataset, \"label\");\n\t\t\t\tif (datasetLabel === null) {\n\t\t\t\t\tconst correspondingLabel = Tools.getProperty(labels, i);\n\t\t\t\t\tif (correspondingLabel) {\n\t\t\t\t\t\tgroup = correspondingLabel;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgroup = \"Ungrouped\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tgroup = datasetLabel;\n\t\t\t\t}\n\n\t\t\t\tconst updatedDatum = {\n\t\t\t\t\tgroup,\n\t\t\t\t\tkey: labels[i]\n\t\t\t\t};\n\n\t\t\t\tif (isNaN(datum)) {\n\t\t\t\t\tupdatedDatum[\"value\"] = datum.value;\n\t\t\t\t\tupdatedDatum[\"date\"] = datum.date;\n\t\t\t\t} else {\n\t\t\t\t\tupdatedDatum[\"value\"] = datum;\n\t\t\t\t}\n\n\t\t\t\ttabularData.push(updatedDatum);\n\t\t\t});\n\t\t});\n\n\t\treturn tabularData;\n\t}\n\n\tprotected getTabularData(data) {\n\t\t// if data is not an array\n\t\tif (!Array.isArray(data)) {\n\t\t\treturn this.transformToTabularData(data);\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tprotected sanitize(data) {\n\t\treturn this.getTabularData(data);\n\t}\n\n\t/*\n\t * Data groups\n\t */\n\tprotected updateAllDataGroups() {\n\t\t// allDataGroups is used to generate a color scale that applies\n\t\t// to all the groups. Now when the data updates, you might remove a group,\n\t\t// and then bring it back in a newer data update, therefore\n\t\t// the order of the groups in allDataGroups matters so that you'd never\n\t\t// have an incorrect color assigned to a group.\n\n\t\t// Also, a new group should only be added to allDataGroups if\n\t\t// it doesn't currently exist\n\n\t\tif (!this.allDataGroups) {\n\t\t\tthis.allDataGroups = this.getDataGroupNames();\n\t\t} else {\n\t\t\t// Loop through current data groups\n\t\t\tthis.getDataGroupNames().forEach((dataGroupName) => {\n\t\t\t\t// If group name hasn't been stored yet, store it\n\t\t\t\tif (this.allDataGroups.indexOf(dataGroupName) === -1) {\n\t\t\t\t\tthis.allDataGroups.push(dataGroupName);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected generateDataGroups(data) {\n\t\tconst { groupMapsTo } = this.getOptions().data;\n\t\tconst { ACTIVE, DISABLED } = Configuration.legend.items.status;\n\t\tconst options = this.getOptions();\n\n\t\tconst uniqueDataGroups = map(\n\t\t\tdata,\n\t\t\t(datum) => datum[groupMapsTo]\n\t\t).keys();\n\n\t\t// check if selectedGroups can be applied to chart with current data groups\n\t\tif (options.data.selectedGroups.length) {\n\t\t\tconst hasAllSelectedGroups = options.data.selectedGroups\n\t\t\t\t.every(groupName => uniqueDataGroups.includes(groupName));\n\t\t\tif (!hasAllSelectedGroups) {\n\t\t\t\toptions.data.selectedGroups = [];\n\t\t\t};\n\t\t}\n\n\t\t// Get group status based on items in selected groups\n\t\tconst getStatus = (groupName) => \n\t\t\t!options.data.selectedGroups.length || options.data.selectedGroups.includes(groupName)\n\t\t\t\t? ACTIVE\n\t\t\t\t: DISABLED;\n\n\t\treturn uniqueDataGroups.map(groupName => ({\n\t\t\tname: groupName,\n\t\t\tstatus: getStatus(groupName)\n\t\t}));\n\t}\n\n\t/*\n\t * Fill scales\n\t */\n\tprotected setColorScale() {\n\t\tlet defaultColors = colorPalettes.DEFAULT;\n\n\t\tconst options = this.getOptions();\n\t\tconst userProvidedScale = Tools.getProperty(options, \"color\", \"scale\");\n\n\t\t// If there is no valid user provided scale, use the default set of colors\n\t\tif (\n\t\t\tuserProvidedScale === null ||\n\t\t\tObject.keys(userProvidedScale).length === 0\n\t\t) {\n\t\t\tthis.colorScale = scaleOrdinal()\n\t\t\t\t.range(defaultColors)\n\t\t\t\t.domain(this.allDataGroups);\n\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Go through allDataGroups. If a data group has a color value provided\n\t\t * by the user, add that to the color range\n\t\t * If not, add a default color\n\t\t */\n\t\tconst colorRange = [];\n\t\tlet colorIndex = 0;\n\t\tthis.allDataGroups.forEach((dataGroup) => {\n\t\t\tif (userProvidedScale[dataGroup]) {\n\t\t\t\tcolorRange.push(userProvidedScale[dataGroup]);\n\t\t\t} else {\n\t\t\t\tcolorRange.push(defaultColors[colorIndex]);\n\t\t\t}\n\n\t\t\tif (colorIndex === defaultColors.length - 1) {\n\t\t\t\tcolorIndex = 0;\n\t\t\t} else {\n\t\t\t\tcolorIndex++;\n\t\t\t}\n\t\t});\n\n\t\tthis.colorScale = scaleOrdinal()\n\t\t\t.range(colorRange)\n\t\t\t.domain(this.allDataGroups);\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon/charts",
3
- "version": "0.32.10",
3
+ "version": "0.33.1",
4
4
  "description": "Carbon charting components",
5
5
  "main": "./bundle.js",
6
6
  "module": "./index.js",
package/polyfills.js CHANGED
@@ -7,7 +7,7 @@ if (typeof window !== "undefined") {
7
7
  params = params || {
8
8
  bubbles: false,
9
9
  cancelable: false,
10
- detail: undefined,
10
+ detail: undefined
11
11
  };
12
12
  var evt = document.createEvent("CustomEvent");
13
13
  evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
package/polyfills.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"polyfills.js","sourceRoot":"","sources":["polyfills.ts"],"names":[],"mappings":"AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAClC,CAAC;QACA,IAAI,OAAO,MAAM,CAAC,aAAa,CAAC,KAAK,UAAU,EAAE;YAChD,OAAO,KAAK,CAAC;SACb;QAED,SAAS,WAAW,CAAC,KAAK,EAAE,MAAM;YACjC,MAAM,GAAG,MAAM,IAAI;gBAClB,OAAO,EAAE,KAAK;gBACd,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE,SAAS;aACjB,CAAC;YACF,IAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAChD,GAAG,CAAC,eAAe,CAClB,KAAK,EACL,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,MAAM,CACb,CAAC;YACF,OAAO,GAAG,CAAC;QACZ,CAAC;QAED,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC;QAClD,MAAM,CAAC,aAAa,CAAC,GAAG,WAAkB,CAAC;IAC5C,CAAC,CAAC,EAAE,CAAC;IAEL,6CAA6C;IAC7C,SAAS,uBAAuB;QAC/B,IACC,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAC5D,CAAC,MAAM,CAAC,gBAAgB,CAAC,EACxB;YACD,OAAO,OAAO,CAAC,gBAAgB,CAAC,CAAC;SACjC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAED,uBAAuB,EAAE,CAAC;CAC1B","sourcesContent":["if (typeof window !== \"undefined\") {\n\t(function () {\n\t\tif (typeof window[\"CustomEvent\"] === \"function\") {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction CustomEvent(event, params) {\n\t\t\tparams = params || {\n\t\t\t\tbubbles: false,\n\t\t\t\tcancelable: false,\n\t\t\t\tdetail: undefined,\n\t\t\t};\n\t\t\tconst evt = document.createEvent(\"CustomEvent\");\n\t\t\tevt.initCustomEvent(\n\t\t\t\tevent,\n\t\t\t\tparams.bubbles,\n\t\t\t\tparams.cancelable,\n\t\t\t\tparams.detail\n\t\t\t);\n\t\t\treturn evt;\n\t\t}\n\n\t\tCustomEvent.prototype = window[\"Event\"].prototype;\n\t\twindow[\"CustomEvent\"] = CustomEvent as any;\n\t})();\n\n\t// Avoid multiple instances of babel-polyfill\n\tfunction idempotentBabelPolyfill() {\n\t\tif (\n\t\t\t(typeof global !== \"undefined\" && !global[\"_babelPolyfill\"]) ||\n\t\t\t!window[\"_babelPolyfill\"]\n\t\t) {\n\t\t\treturn require(\"babel-polyfill\");\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tidempotentBabelPolyfill();\n}\n"]}
1
+ {"version":3,"file":"polyfills.js","sourceRoot":"","sources":["polyfills.ts"],"names":[],"mappings":"AAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAClC,CAAC;QACA,IAAI,OAAO,MAAM,CAAC,aAAa,CAAC,KAAK,UAAU,EAAE;YAChD,OAAO,KAAK,CAAC;SACb;QAED,SAAS,WAAW,CAAC,KAAK,EAAE,MAAM;YACjC,MAAM,GAAG,MAAM,IAAI;gBAClB,OAAO,EAAE,KAAK;gBACd,UAAU,EAAE,KAAK;gBACjB,MAAM,EAAE,SAAS;aACjB,CAAC;YACF,IAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAChD,GAAG,CAAC,eAAe,CAClB,KAAK,EACL,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,MAAM,CACb,CAAC;YACF,OAAO,GAAG,CAAC;QACZ,CAAC;QAED,WAAW,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC;QAClD,MAAM,CAAC,aAAa,CAAC,GAAG,WAAkB,CAAC;IAC5C,CAAC,CAAC,EAAE,CAAC;IAEL,6CAA6C;IAC7C,SAAS,uBAAuB;QAC/B,IACC,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAC5D,CAAC,MAAM,CAAC,gBAAgB,CAAC,EACxB;YACD,OAAO,OAAO,CAAC,gBAAgB,CAAC,CAAC;SACjC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAED,uBAAuB,EAAE,CAAC;CAC1B","sourcesContent":["if (typeof window !== \"undefined\") {\n\t(function () {\n\t\tif (typeof window[\"CustomEvent\"] === \"function\") {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction CustomEvent(event, params) {\n\t\t\tparams = params || {\n\t\t\t\tbubbles: false,\n\t\t\t\tcancelable: false,\n\t\t\t\tdetail: undefined\n\t\t\t};\n\t\t\tconst evt = document.createEvent(\"CustomEvent\");\n\t\t\tevt.initCustomEvent(\n\t\t\t\tevent,\n\t\t\t\tparams.bubbles,\n\t\t\t\tparams.cancelable,\n\t\t\t\tparams.detail\n\t\t\t);\n\t\t\treturn evt;\n\t\t}\n\n\t\tCustomEvent.prototype = window[\"Event\"].prototype;\n\t\twindow[\"CustomEvent\"] = CustomEvent as any;\n\t})();\n\n\t// Avoid multiple instances of babel-polyfill\n\tfunction idempotentBabelPolyfill() {\n\t\tif (\n\t\t\t(typeof global !== \"undefined\" && !global[\"_babelPolyfill\"]) ||\n\t\t\t!window[\"_babelPolyfill\"]\n\t\t) {\n\t\t\treturn require(\"babel-polyfill\");\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tidempotentBabelPolyfill();\n}\n"]}
@@ -4,50 +4,50 @@ export function radialLabelPlacement(angleRadians) {
4
4
  if (isInRange(angle, [0, 10]) || isInRange(angle, [350, 0])) {
5
5
  return {
6
6
  textAnchor: TextAnchor.START,
7
- dominantBaseline: DominantBaseline.MIDDLE,
7
+ dominantBaseline: DominantBaseline.MIDDLE
8
8
  };
9
9
  }
10
10
  else if (isInRange(angle, [10, 80])) {
11
11
  return {
12
12
  textAnchor: TextAnchor.START,
13
- dominantBaseline: DominantBaseline.HANGING,
13
+ dominantBaseline: DominantBaseline.HANGING
14
14
  };
15
15
  }
16
16
  else if (isInRange(angle, [80, 100])) {
17
17
  return {
18
18
  textAnchor: TextAnchor.MIDDLE,
19
- dominantBaseline: DominantBaseline.HANGING,
19
+ dominantBaseline: DominantBaseline.HANGING
20
20
  };
21
21
  }
22
22
  else if (isInRange(angle, [100, 170])) {
23
23
  return {
24
24
  textAnchor: TextAnchor.END,
25
- dominantBaseline: DominantBaseline.HANGING,
25
+ dominantBaseline: DominantBaseline.HANGING
26
26
  };
27
27
  }
28
28
  else if (isInRange(angle, [170, 190])) {
29
29
  return {
30
30
  textAnchor: TextAnchor.END,
31
- dominantBaseline: DominantBaseline.MIDDLE,
31
+ dominantBaseline: DominantBaseline.MIDDLE
32
32
  };
33
33
  }
34
34
  else if (isInRange(angle, [190, 260])) {
35
35
  return {
36
36
  textAnchor: TextAnchor.END,
37
- dominantBaseline: DominantBaseline.BASELINE,
37
+ dominantBaseline: DominantBaseline.BASELINE
38
38
  };
39
39
  }
40
40
  else if (isInRange(angle, [260, 280])) {
41
41
  return {
42
42
  textAnchor: TextAnchor.MIDDLE,
43
- dominantBaseline: DominantBaseline.BASELINE,
43
+ dominantBaseline: DominantBaseline.BASELINE
44
44
  };
45
45
  }
46
46
  else {
47
47
  // 280 - 350
48
48
  return {
49
49
  textAnchor: TextAnchor.START,
50
- dominantBaseline: DominantBaseline.BASELINE,
50
+ dominantBaseline: DominantBaseline.BASELINE
51
51
  };
52
52
  }
53
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"angle-utils.js","sourceRoot":"","sources":["angle-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBA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AAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChC,OAAO,EAAE,CAAC,GAAA,EAAE,CAAC,GAAA,EAAE,CAAC;AACjB,CAAC;AAED,yEAAyE;AACzE,gDAAgD;AAChD,yEAAyE;AACzE,mEAAmE;AACnE,MAAM,UAAU,6CAA6C,CAC5D,CAAQ,EACR,CAAS;IAET,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { TextAnchor, DominantBaseline } from \"../interfaces/enums\";\n\nexport interface Point {\n\tx: number;\n\ty: number;\n}\n\nexport type Angle = number;\n\ninterface LabelAlignment {\n\ttextAnchor: TextAnchor;\n\tdominantBaseline: DominantBaseline;\n}\n\nexport function radialLabelPlacement(angleRadians: Angle): LabelAlignment {\n\tconst angle = mod(radToDeg(angleRadians), 360);\n\n\tif (isInRange(angle, [0, 10]) || isInRange(angle, [350, 0])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.MIDDLE,\n\t\t};\n\t} else if (isInRange(angle, [10, 80])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.HANGING,\n\t\t};\n\t} else if (isInRange(angle, [80, 100])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.MIDDLE,\n\t\t\tdominantBaseline: DominantBaseline.HANGING,\n\t\t};\n\t} else if (isInRange(angle, [100, 170])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.HANGING,\n\t\t};\n\t} else if (isInRange(angle, [170, 190])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.MIDDLE,\n\t\t};\n\t} else if (isInRange(angle, [190, 260])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE,\n\t\t};\n\t} else if (isInRange(angle, [260, 280])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.MIDDLE,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE,\n\t\t};\n\t} else {\n\t\t// 280 - 350\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE,\n\t\t};\n\t}\n}\n\nfunction mod(n: number, m: number) {\n\treturn ((n % m) + m) % m;\n}\n\nfunction isInRange(x: number, [min, max]: [number, number]) {\n\treturn x >= min && x <= max;\n}\n\nexport function radToDeg(rad: Angle): Angle {\n\treturn rad * (180 / Math.PI);\n}\n\nexport function degToRad(deg: Angle): Angle {\n\treturn deg * (Math.PI / 180);\n}\n\nexport function polarToCartesianCoords(\n\ta: Angle,\n\tr: number,\n\tt: Point = { x: 0, y: 0 }\n): Point {\n\tconst x = r * Math.cos(a) + t.x;\n\tconst y = r * Math.sin(a) + t.y;\n\treturn { x, y };\n}\n\n// Return the distance between a point (described with polar coordinates)\n// on a circumference and the vertical diameter.\n// If the point is on the left if the diameter, its distance is positive,\n// if it is on the right of the diameter, its distance is negative.\nexport function distanceBetweenPointOnCircAndVerticalDiameter(\n\ta: Angle,\n\tr: number\n) {\n\treturn r * Math.sin(a - Math.PI / 2);\n}\n"]}
1
+ {"version":3,"file":"angle-utils.js","sourceRoot":"","sources":["angle-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAcnE,MAAM,UAAU,oBAAoB,CAAC,YAAmB;IACvD,IAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,CAAC;IAE/C,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,SAAS,CAAC,KAAK,EAAE,CAA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AI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { TextAnchor, DominantBaseline } from \"../interfaces/enums\";\n\nexport interface Point {\n\tx: number;\n\ty: number;\n}\n\nexport type Angle = number;\n\ninterface LabelAlignment {\n\ttextAnchor: TextAnchor;\n\tdominantBaseline: DominantBaseline;\n}\n\nexport function radialLabelPlacement(angleRadians: Angle): LabelAlignment {\n\tconst angle = mod(radToDeg(angleRadians), 360);\n\n\tif (isInRange(angle, [0, 10]) || isInRange(angle, [350, 0])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.MIDDLE\n\t\t};\n\t} else if (isInRange(angle, [10, 80])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.HANGING\n\t\t};\n\t} else if (isInRange(angle, [80, 100])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.MIDDLE,\n\t\t\tdominantBaseline: DominantBaseline.HANGING\n\t\t};\n\t} else if (isInRange(angle, [100, 170])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.HANGING\n\t\t};\n\t} else if (isInRange(angle, [170, 190])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.MIDDLE\n\t\t};\n\t} else if (isInRange(angle, [190, 260])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.END,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE\n\t\t};\n\t} else if (isInRange(angle, [260, 280])) {\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.MIDDLE,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE\n\t\t};\n\t} else {\n\t\t// 280 - 350\n\t\treturn {\n\t\t\ttextAnchor: TextAnchor.START,\n\t\t\tdominantBaseline: DominantBaseline.BASELINE\n\t\t};\n\t}\n}\n\nfunction mod(n: number, m: number) {\n\treturn ((n % m) + m) % m;\n}\n\nfunction isInRange(x: number, [min, max]: [number, number]) {\n\treturn x >= min && x <= max;\n}\n\nexport function radToDeg(rad: Angle): Angle {\n\treturn rad * (180 / Math.PI);\n}\n\nexport function degToRad(deg: Angle): Angle {\n\treturn deg * (Math.PI / 180);\n}\n\nexport function polarToCartesianCoords(\n\ta: Angle,\n\tr: number,\n\tt: Point = { x: 0, y: 0 }\n): Point {\n\tconst x = r * Math.cos(a) + t.x;\n\tconst y = r * Math.sin(a) + t.y;\n\treturn { x, y };\n}\n\n// Return the distance between a point (described with polar coordinates)\n// on a circumference and the vertical diameter.\n// If the point is on the left if the diameter, its distance is positive,\n// if it is on the right of the diameter, its distance is negative.\nexport function distanceBetweenPointOnCircAndVerticalDiameter(\n\ta: Angle,\n\tr: number\n) {\n\treturn r * Math.sin(a - Math.PI / 2);\n}\n"]}
@@ -16,7 +16,7 @@ export var WHITE = [
16
16
  colors.teal(50),
17
17
  colors.cyan(90),
18
18
  "#8a3800",
19
- colors.purple(50),
19
+ colors.purple(50)
20
20
  ];
21
21
  export var DARK = [
22
22
  colors.purple(60),
@@ -32,7 +32,7 @@ export var DARK = [
32
32
  colors.teal(40),
33
33
  colors.cyan(20),
34
34
  "#ba4e00",
35
- colors.purple(30),
35
+ colors.purple(30)
36
36
  ];
37
37
  export var G10 = WHITE;
38
38
  export var G90 = DARK;
@@ -1 +1 @@
1
- {"version":3,"file":"colorPalettes.js","sourceRoot":"","sources":["colorPalettes.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,gDAAgD;AAChD,wDAAwD;AACxD,SAAS;AACT,MAAM,CAAC,IAAM,KAAK,GAAG;IACpB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAClB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACd,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACd,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAChB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAClB,SAAS;IACT,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,SAAS;IACT,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,IAAM,IAAI,GAAG;IACnB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAClB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACd,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACd,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAChB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAClB,SAAS;IACT,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,SAAS;IACT,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,IAAM,GAAG,GAAG,KAAK,CAAC;AACzB,MAAM,CAAC,IAAM,GAAG,GAAG,IAAI,CAAC;AACxB,MAAM,CAAC,IAAM,IAAI,GAAG,IAAI,CAAC;AAEzB,MAAM,CAAC,IAAM,OAAO,GAAG,KAAK,CAAC","sourcesContent":["import colors from \"./colors\";\n\n// TODO - Some hardcoded values aren't available\n// in @carbon/colors yet. We should look at adding those\n// colors\nexport const WHITE = [\n\tcolors.purple(70),\n\tcolors.cyan(50),\n\tcolors.teal(70),\n\tcolors.magenta(70),\n\tcolors.red(50),\n\tcolors.red(90),\n\tcolors.green(60),\n\tcolors.blue(80),\n\tcolors.magenta(50),\n\t\"#b28600\", // Yellow 50\n\tcolors.teal(50),\n\tcolors.cyan(90),\n\t\"#8a3800\", // Orange 70\n\tcolors.purple(50),\n];\n\nexport const DARK = [\n\tcolors.purple(60),\n\tcolors.cyan(40),\n\tcolors.teal(60),\n\tcolors.magenta(40),\n\tcolors.red(50),\n\tcolors.red(10),\n\tcolors.green(30),\n\tcolors.blue(50),\n\tcolors.magenta(60),\n\t\"#d2a106\", // Yellow 40\n\tcolors.teal(40),\n\tcolors.cyan(20),\n\t\"#ba4e00\", // Orange 60\n\tcolors.purple(30),\n];\n\nexport const G10 = WHITE;\nexport const G90 = DARK;\nexport const G100 = DARK;\n\nexport const DEFAULT = WHITE;\n"]}
1
+ {"version":3,"file":"colorPalettes.js","sourceRoot":"","sources":["colorPalettes.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,gDAAgD;AAChD,wDAAwD;AACxD,SAAS;AACT,MAAM,CAAC,IAAM,KAAK,GAAG;IACpB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAClB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACd,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACd,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAChB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAClB,SAAS;IACT,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,SAAS;IACT,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,IAAM,IAAI,GAAG;IACnB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAClB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACd,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACd,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAChB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAClB,SAAS;IACT,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACf,SAAS;IACT,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,IAAM,GAAG,GAAG,KAAK,CAAC;AACzB,MAAM,CAAC,IAAM,GAAG,GAAG,IAAI,CAAC;AACxB,MAAM,CAAC,IAAM,IAAI,GAAG,IAAI,CAAC;AAEzB,MAAM,CAAC,IAAM,OAAO,GAAG,KAAK,CAAC","sourcesContent":["import colors from \"./colors\";\n\n// TODO - Some hardcoded values aren't available\n// in @carbon/colors yet. We should look at adding those\n// colors\nexport const WHITE = [\n\tcolors.purple(70),\n\tcolors.cyan(50),\n\tcolors.teal(70),\n\tcolors.magenta(70),\n\tcolors.red(50),\n\tcolors.red(90),\n\tcolors.green(60),\n\tcolors.blue(80),\n\tcolors.magenta(50),\n\t\"#b28600\", // Yellow 50\n\tcolors.teal(50),\n\tcolors.cyan(90),\n\t\"#8a3800\", // Orange 70\n\tcolors.purple(50)\n];\n\nexport const DARK = [\n\tcolors.purple(60),\n\tcolors.cyan(40),\n\tcolors.teal(60),\n\tcolors.magenta(40),\n\tcolors.red(50),\n\tcolors.red(10),\n\tcolors.green(30),\n\tcolors.blue(50),\n\tcolors.magenta(60),\n\t\"#d2a106\", // Yellow 40\n\tcolors.teal(40),\n\tcolors.cyan(20),\n\t\"#ba4e00\", // Orange 60\n\tcolors.purple(30)\n];\n\nexport const G10 = WHITE;\nexport const G90 = DARK;\nexport const G100 = DARK;\n\nexport const DEFAULT = WHITE;\n"]}
@@ -7,6 +7,6 @@ export default {
7
7
  magenta: function (shade) { return getColor(magenta, shade); },
8
8
  purple: function (shade) { return getColor(purple, shade); },
9
9
  red: function (shade) { return getColor(red, shade); },
10
- teal: function (shade) { return getColor(teal, shade); },
10
+ teal: function (shade) { return getColor(teal, shade); }
11
11
  };
12
12
  //# sourceMappingURL=../../src/services/colors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.js","sourceRoot":"","sources":["colors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE/E,IAAM,QAAQ,GAAG,UAAC,GAAG,EAAE,KAAK,IAAK,OAAA,GAAG,CAAC,KAAK,CAAC,EAAV,CAAU,CAAC;AAE5C,eAAe;IACd,IAAI,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAArB,CAAqB;IACtC,IAAI,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAArB,CAAqB;IACtC,KAAK,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,EAAtB,CAAsB;IACxC,OAAO,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,EAAxB,CAAwB;IAC5C,MAAM,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,EAAvB,CAAuB;IAC1C,GAAG,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,EAApB,CAAoB;IACpC,IAAI,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAArB,CAAqB;CACtC,CAAC","sourcesContent":["import { blue, cyan, green, magenta, purple, red, teal } from \"@carbon/colors\";\n\nconst getColor = (obj, shade) => obj[shade];\n\nexport default {\n\tblue: (shade) => getColor(blue, shade),\n\tcyan: (shade) => getColor(cyan, shade),\n\tgreen: (shade) => getColor(green, shade),\n\tmagenta: (shade) => getColor(magenta, shade),\n\tpurple: (shade) => getColor(purple, shade),\n\tred: (shade) => getColor(red, shade),\n\tteal: (shade) => getColor(teal, shade),\n};\n"]}
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["colors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE/E,IAAM,QAAQ,GAAG,UAAC,GAAG,EAAE,KAAK,IAAK,OAAA,GAAG,CAAC,KAAK,CAAC,EAAV,CAAU,CAAC;AAE5C,eAAe;IACd,IAAI,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAArB,CAAqB;IACtC,IAAI,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAArB,CAAqB;IACtC,KAAK,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,EAAtB,CAAsB;IACxC,OAAO,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,EAAxB,CAAwB;IAC5C,MAAM,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,EAAvB,CAAuB;IAC1C,GAAG,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,EAApB,CAAoB;IACpC,IAAI,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAArB,CAAqB;CACtC,CAAC","sourcesContent":["import { blue, cyan, green, magenta, purple, red, teal } from \"@carbon/colors\";\n\nconst getColor = (obj, shade) => obj[shade];\n\nexport default {\n\tblue: (shade) => getColor(blue, shade),\n\tcyan: (shade) => getColor(cyan, shade),\n\tgreen: (shade) => getColor(green, shade),\n\tmagenta: (shade) => getColor(magenta, shade),\n\tpurple: (shade) => getColor(purple, shade),\n\tred: (shade) => getColor(red, shade),\n\tteal: (shade) => getColor(teal, shade)\n};\n"]}
@@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || (function () {
11
11
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
12
  };
13
13
  })();
14
- import { curveBasis, curveBasisClosed, curveBasisOpen, curveBundle, curveCardinal, curveCardinalClosed, curveCardinalOpen, curveCatmullRom, curveCatmullRomClosed, curveCatmullRomOpen, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore, } from "d3-shape";
14
+ import { curveBasis, curveBasisClosed, curveBasisOpen, curveBundle, curveCardinal, curveCardinalClosed, curveCardinalOpen, curveCatmullRom, curveCatmullRomClosed, curveCatmullRomOpen, curveLinear, curveLinearClosed, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore } from "d3-shape";
15
15
  // Internal Imports
16
16
  import { Service } from "./service";
17
17
  var Curves = /** @class */ (function (_super) {
@@ -36,7 +36,7 @@ var Curves = /** @class */ (function (_super) {
36
36
  curveNatural: curveNatural,
37
37
  curveStep: curveStep,
38
38
  curveStepAfter: curveStepAfter,
39
- curveStepBefore: curveStepBefore,
39
+ curveStepBefore: curveStepBefore
40
40
  };
41
41
  return _this;
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"curves.js","sourceRoot":"","sources":["curves.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EACN,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,SAAS,EACT,cAAc,EACd,eAAe,GAMf,MAAM,UAAU,CAAC;AAKlB,mBAAmB;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;IAA4B,0BAAO;IAAnC;QAAA,qEA2DC;QA1DA,gBAAU,GAAG;YACZ,WAAW,aAAA;YACX,iBAAiB,mBAAA;YACjB,UAAU,YAAA;YACV,gBAAgB,kBAAA;YAChB,cAAc,gBAAA;YACd,WAAW,aAAA;YACX,aAAa,eAAA;YACb,mBAAmB,qBAAA;YACnB,iBAAiB,mBAAA;YACjB,eAAe,iBAAA;YACf,qBAAqB,uBAAA;YACrB,mBAAmB,qBAAA;YACnB,cAAc,gBAAA;YACd,cAAc,gBAAA;YACd,YAAY,cAAA;YACZ,SAAS,WAAA;YACT,cAAc,gBAAA;YACd,eAAe,iBAAA;SACf,CAAC;;IAuCH,CAAC;IArCA,2BAAU,GAAV;QACC,IAAI,SAAS,GAAG,aAAa,CAAC;QAC9B,IAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC;QAEnD,sDAAsD;QACtD,iCAAiC;QACjC,IAAI,YAAY,EAAE;YACjB,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;gBACrC,kBAAkB;gBAClB,SAAS,GAAG,YAAY,CAAC;aACzB;iBAAM;gBACN,4BAA4B;gBAC5B,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC;aAC9B;SACD;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YAC/B,iCAAiC;YACjC,IAAI,OAAK,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YAEvC,8CAA8C;YAC9C,IAAI,YAAY,EAAE;gBACjB,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,UAAC,UAAU;oBAC5C,IAAI,OAAK,CAAC,UAAU,CAAC,EAAE;wBACtB,OAAK,GAAG,OAAK,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;qBACpD;gBACF,CAAC,CAAC,CAAC;aACH;YAED,OAAO,OAAK,CAAC;SACb;QAED,OAAO,CAAC,IAAI,CACX,qBAAmB,SAAS,8CAA2C,CACvE,CAAC;QACF,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC;IACF,aAAC;AAAD,CAAC,AA3DD,CAA4B,OAAO,GA2DlC","sourcesContent":["import {\n\tcurveBasis,\n\tcurveBasisClosed,\n\tcurveBasisOpen,\n\tcurveBundle,\n\tcurveCardinal,\n\tcurveCardinalClosed,\n\tcurveCardinalOpen,\n\tcurveCatmullRom,\n\tcurveCatmullRomClosed,\n\tcurveCatmullRomOpen,\n\tcurveLinear,\n\tcurveLinearClosed,\n\tcurveMonotoneX,\n\tcurveMonotoneY,\n\tcurveNatural,\n\tcurveStep,\n\tcurveStepAfter,\n\tcurveStepBefore,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tCurveBundleFactory,\n\tCurveCardinalFactory,\n\tCurveCatmullRomFactory,\n\tCurveGenerator,\n} from \"d3-shape\";\n\n// this import is needed because of typescript bug (error TS4029)\nimport { Path } from \"d3-path\";\n\n// Internal Imports\nimport { Service } from \"./service\";\n\nexport class Curves extends Service {\n\tcurveTypes = {\n\t\tcurveLinear,\n\t\tcurveLinearClosed,\n\t\tcurveBasis,\n\t\tcurveBasisClosed,\n\t\tcurveBasisOpen,\n\t\tcurveBundle,\n\t\tcurveCardinal,\n\t\tcurveCardinalClosed,\n\t\tcurveCardinalOpen,\n\t\tcurveCatmullRom,\n\t\tcurveCatmullRomClosed,\n\t\tcurveCatmullRomOpen,\n\t\tcurveMonotoneX,\n\t\tcurveMonotoneY,\n\t\tcurveNatural,\n\t\tcurveStep,\n\t\tcurveStepAfter,\n\t\tcurveStepBefore,\n\t};\n\n\tgetD3Curve() {\n\t\tlet curveName = \"curveLinear\";\n\t\tconst curveOptions = this.model.getOptions().curve;\n\n\t\t// Parse curve type whether the user provided a string\n\t\t// Or an object with more options\n\t\tif (curveOptions) {\n\t\t\tif (typeof curveOptions === \"string\") {\n\t\t\t\t// curve: 'string'\n\t\t\t\tcurveName = curveOptions;\n\t\t\t} else {\n\t\t\t\t// curve: { name: 'string' }\n\t\t\t\tcurveName = curveOptions.name;\n\t\t\t}\n\t\t}\n\n\t\tif (this.curveTypes[curveName]) {\n\t\t\t// Grab correct d3 curve function\n\t\t\tlet curve = this.curveTypes[curveName];\n\n\t\t\t// Apply user-provided options to the d3 curve\n\t\t\tif (curveOptions) {\n\t\t\t\tObject.keys(curveOptions).forEach((optionName) => {\n\t\t\t\t\tif (curve[optionName]) {\n\t\t\t\t\t\tcurve = curve[optionName](curveOptions[optionName]);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn curve;\n\t\t}\n\n\t\tconsole.warn(\n\t\t\t`The curve type '${curveName}' is invalid, using 'curveLinear' instead`\n\t\t);\n\t\treturn this.curveTypes[\"curveLinear\"];\n\t}\n}\n"]}
1
+ {"version":3,"file":"curves.js","sourceRoot":"","sources":["curves.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EACN,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,q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UAAC,UAAU;oBAC5C,IAAI,OAAK,CAAC,UAAU,CAAC,EAAE;wBACtB,OAAK,GAAG,OAAK,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;qBACpD;gBACF,CAAC,CAAC,CAAC;aACH;YAED,OAAO,OAAK,CAAC;SACb;QAED,OAAO,CAAC,IAAI,CACX,qBAAmB,SAAS,8CAA2C,CACvE,CAAC;QACF,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC;IACF,aAAC;AAAD,CAAC,AA3DD,CAA4B,OAAO,GA2DlC","sourcesContent":["import {\n\tcurveBasis,\n\tcurveBasisClosed,\n\tcurveBasisOpen,\n\tcurveBundle,\n\tcurveCardinal,\n\tcurveCardinalClosed,\n\tcurveCardinalOpen,\n\tcurveCatmullRom,\n\tcurveCatmullRomClosed,\n\tcurveCatmullRomOpen,\n\tcurveLinear,\n\tcurveLinearClosed,\n\tcurveMonotoneX,\n\tcurveMonotoneY,\n\tcurveNatural,\n\tcurveStep,\n\tcurveStepAfter,\n\tcurveStepBefore,\n\t// the imports below are needed because of typescript bug (error TS4029)\n\tCurveBundleFactory,\n\tCurveCardinalFactory,\n\tCurveCatmullRomFactory,\n\tCurveGenerator\n} from \"d3-shape\";\n\n// this import is needed because of typescript bug (error TS4029)\nimport { Path } from \"d3-path\";\n\n// Internal Imports\nimport { Service } from \"./service\";\n\nexport class Curves extends Service {\n\tcurveTypes = {\n\t\tcurveLinear,\n\t\tcurveLinearClosed,\n\t\tcurveBasis,\n\t\tcurveBasisClosed,\n\t\tcurveBasisOpen,\n\t\tcurveBundle,\n\t\tcurveCardinal,\n\t\tcurveCardinalClosed,\n\t\tcurveCardinalOpen,\n\t\tcurveCatmullRom,\n\t\tcurveCatmullRomClosed,\n\t\tcurveCatmullRomOpen,\n\t\tcurveMonotoneX,\n\t\tcurveMonotoneY,\n\t\tcurveNatural,\n\t\tcurveStep,\n\t\tcurveStepAfter,\n\t\tcurveStepBefore\n\t};\n\n\tgetD3Curve() {\n\t\tlet curveName = \"curveLinear\";\n\t\tconst curveOptions = this.model.getOptions().curve;\n\n\t\t// Parse curve type whether the user provided a string\n\t\t// Or an object with more options\n\t\tif (curveOptions) {\n\t\t\tif (typeof curveOptions === \"string\") {\n\t\t\t\t// curve: 'string'\n\t\t\t\tcurveName = curveOptions;\n\t\t\t} else {\n\t\t\t\t// curve: { name: 'string' }\n\t\t\t\tcurveName = curveOptions.name;\n\t\t\t}\n\t\t}\n\n\t\tif (this.curveTypes[curveName]) {\n\t\t\t// Grab correct d3 curve function\n\t\t\tlet curve = this.curveTypes[curveName];\n\n\t\t\t// Apply user-provided options to the d3 curve\n\t\t\tif (curveOptions) {\n\t\t\t\tObject.keys(curveOptions).forEach((optionName) => {\n\t\t\t\t\tif (curve[optionName]) {\n\t\t\t\t\t\tcurve = curve[optionName](curveOptions[optionName]);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn curve;\n\t\t}\n\n\t\tconsole.warn(\n\t\t\t`The curve type '${curveName}' is invalid, using 'curveLinear' instead`\n\t\t);\n\t\treturn this.curveTypes[\"curveLinear\"];\n\t}\n}\n"]}