@sapui5/sap.viz 1.140.0 → 1.141.0

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.
@@ -1688,6 +1688,7 @@ define('sap/viz/chart/components/util/TextUtils',['sap/viz/framework/common/util
1688
1688
  });
1689
1689
 
1690
1690
  define('sap/viz/chart/components/title/Title',[
1691
+ 'sap/viz/framework/common/util/Constants',
1691
1692
  'sap/viz/framework/common/util/oo',
1692
1693
  'sap/viz/chart/components/UIComponent',
1693
1694
  'sap/viz/framework/common/lang/LangManager',
@@ -1697,7 +1698,8 @@ define('sap/viz/chart/components/title/Title',[
1697
1698
  'sap/viz/framework/common/util/UADetector',
1698
1699
  'sap/viz/framework/common/util/PropertyZoneUtil',
1699
1700
  'sap/viz/framework/common/util/TitleUtil'
1700
- ], function(oo, UIComponent, langManager, BoundUtil, TextUtils, StyleUtils, UADetector, PropertyZoneUtil,TitleUtil) {
1701
+ ], function(Constants,oo, UIComponent,langManager, BoundUtil, TextUtils,
1702
+ StyleUtils,UADetector,PropertyZoneUtil,TitleUtil) {
1701
1703
 
1702
1704
  var Title = function(runtime, options) {
1703
1705
  Title.superclass.constructor.apply(this, arguments);
@@ -1938,12 +1940,20 @@ define('sap/viz/chart/components/title/Title',[
1938
1940
  var fill = this.runtime().effectManager().register({
1939
1941
  fillColor: style.color
1940
1942
  });
1943
+ /**
1944
+ * role="heading":
1945
+ * A semantic attribute that helps screen readers,
1946
+ * better understand and announce the content structure.
1947
+ * aria-level="1" : Indicates the heading level.
1948
+ **/
1949
+ var ariaLevel = parseInt(this._properties.get('ariaLevel'));
1950
+ ariaLevel = ariaLevel > 0 ? ariaLevel : Constants.TITLE.ARIALEVEL;
1941
1951
  wrapper.attr('fill', fill).attr('font-family', style.fontFamily).attr('font-size', style.fontSize).attr(
1942
1952
  'font-weight', style.fontWeight).attr('font-style', style.fontStyle)
1943
1953
  .attr('text-anchor', textAnchor).attr('x', xPos)
1944
1954
  .attr('y', 'top' == this.getPosition() ? this._pfSize.height/2 : height - this._pfSize.height/2)
1945
- .attr('dominant-baseline', 'central');
1946
-
1955
+ .attr('dominant-baseline', 'central').attr('role', 'heading').attr('aria-level', ariaLevel);
1956
+
1947
1957
  if (UADetector.isIE()) {
1948
1958
  wrapper.attr('y', 'top' == this.getPosition() ? this._pfSize.height : height)
1949
1959
  .attr('dominant-baseline', 'auto');
@@ -4214,6 +4224,79 @@ define('sap/viz/chart/components/util/ColorUtil',["sap/viz/framework/common/util
4214
4224
  return bgColor;
4215
4225
  };
4216
4226
 
4227
+ function parseColorToRgbArray(color) {
4228
+ if (color === null || typeof color === 'undefined') { return null; }
4229
+ try {
4230
+ var c = d3.rgb(String(color).trim());
4231
+ // d3.rgb returns NaN components for invalid input; guard against that
4232
+ if (isNaN(c.r) || isNaN(c.g) || isNaN(c.b)) { return null; }
4233
+ return [c.r, c.g, c.b];
4234
+ } catch (e) {
4235
+ return null;
4236
+ }
4237
+ }
4238
+
4239
+ /**
4240
+ * Calculates the relative luminance of an RGB color, as per WCAG 2.1.
4241
+ * @param {number[]} rgb - An array of [R, G, B] values.
4242
+ * @returns {number} The relative luminance value (0-1).
4243
+ */
4244
+ function getLuminance(rgb) {
4245
+ var r = rgb[0];
4246
+ var g = rgb[1];
4247
+ var b = rgb[2];
4248
+ // Convert RGB values from 0-255 to 0-1
4249
+ function gammaCorrection(v) {
4250
+ v /= 255;
4251
+ // Apply gamma correction formula
4252
+ return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
4253
+ }
4254
+
4255
+ r = gammaCorrection(r);
4256
+ g = gammaCorrection(g);
4257
+ b = gammaCorrection(b);
4258
+
4259
+ // Calculate luminance with specified weights
4260
+ // https://www.w3.org/WAI/GL/wiki/Relative_luminance#:~:text=Note%201:%20For%20the%20sRGB,+0.055)/1.055)%20%5E%202.4
4261
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
4262
+ }
4263
+
4264
+ /**
4265
+ * Calculates the contrast ratio between two hex colors and checks if it meets a given threshold.
4266
+ * Defaults follow WCAG guidance:
4267
+ * - text (normal text) minimum: 4.5
4268
+ * - non-text / large-text / graphics minimum: 3.0
4269
+ * - High contrast mode minimum: 7.0
4270
+ * @param {string} color1 - The first hex color string (e.g., '#333333').
4271
+ * @param {string} color2 - The second hex color string (e.g., '#F0F0F0').
4272
+ * @param {number} [threshold=3] - The minimum contrast ratio required. Defaults to 3.
4273
+ * @returns {{ratio: number, meetsThreshold: boolean}} An object containing the calculated ratio and a boolean.
4274
+ */
4275
+ ColorUtil.checkColorContrast = function (color1, color2, threshold) {
4276
+ // keep existing behavior: if threshold not provided, fallback to 3
4277
+ if (typeof threshold !== 'number') { threshold = 3; }
4278
+
4279
+ var rgbArr1 = parseColorToRgbArray(color1);
4280
+ var rgbArr2 = parseColorToRgbArray(color2);
4281
+ if (!rgbArr1 || !rgbArr2) {
4282
+ return { ratio: 0, meetsThreshold: false };
4283
+ }
4284
+
4285
+ var luminance1 = getLuminance(rgbArr1);
4286
+ var luminance2 = getLuminance(rgbArr2);
4287
+
4288
+ var lighter = Math.max(luminance1, luminance2);
4289
+ var darker = Math.min(luminance1, luminance2);
4290
+ // +0.05 in WCAG for preventing division by zero. eg. black (#000000) has luminance of 0.
4291
+ var ratio = (lighter + 0.05) / (darker + 0.05);
4292
+ var meetsThreshold = ratio >= threshold;
4293
+
4294
+ return {
4295
+ ratio: parseFloat(ratio.toFixed(2)),
4296
+ meetsThreshold: meetsThreshold
4297
+ };
4298
+ };
4299
+
4217
4300
  return ColorUtil;
4218
4301
  });
4219
4302
 
@@ -9944,6 +10027,7 @@ return {
9944
10027
  "plotArea.dataPoint.stroke.color": "#000000",
9945
10028
  "plotArea.dataPoint.stroke.visible": false,
9946
10029
  "title.alignment": "center",
10030
+ "title.ariaLevel": 2,
9947
10031
  "title.layout.height": null,
9948
10032
  "title.layout.maxHeight": 0.2,
9949
10033
  "title.layout.respectPlotPosition": true,
@@ -10047,6 +10131,7 @@ return {
10047
10131
  "interaction.hover.stroke.width": "2px",
10048
10132
  "interaction.keyboard.color": "#000000",
10049
10133
  "interaction.keyboard.width": "1px",
10134
+ "interaction.keyboard.style": "solid",
10050
10135
  "interaction.noninteractiveMode": false,
10051
10136
  "interaction.selectability.axisLabelSelection": true,
10052
10137
  "interaction.selectability.behavior": {
@@ -10277,6 +10362,7 @@ return {
10277
10362
  "interaction.hover.stroke.width": "2px",
10278
10363
  "interaction.keyboard.color": "#000000",
10279
10364
  "interaction.keyboard.width": "1px",
10365
+ "interaction.keyboard.style": "solid",
10280
10366
  "interaction.noninteractiveMode": false,
10281
10367
  "interaction.selectability.axisLabelSelection": true,
10282
10368
  "interaction.selectability.behavior": {
@@ -10540,6 +10626,7 @@ return {
10540
10626
  "interaction.hover.stroke.width": "2px",
10541
10627
  "interaction.keyboard.color": "#000000",
10542
10628
  "interaction.keyboard.width": "1px",
10629
+ "interaction.keyboard.style": "solid",
10543
10630
  "interaction.noninteractiveMode": false,
10544
10631
  "interaction.selectability.behavior": {
10545
10632
  "access": "internal",
@@ -10716,6 +10803,7 @@ return {
10716
10803
  "interaction.hover.stroke.width": "2px",
10717
10804
  "interaction.keyboard.color": "#000000",
10718
10805
  "interaction.keyboard.width": "1px",
10806
+ "interaction.keyboard.style": "solid",
10719
10807
  "interaction.noninteractiveMode": false,
10720
10808
  "interaction.selectability.behavior": {
10721
10809
  "access": "internal",
@@ -10977,6 +11065,7 @@ return {
10977
11065
  "interaction.hover.stroke.width": "2px",
10978
11066
  "interaction.keyboard.color": "#000000",
10979
11067
  "interaction.keyboard.width": "1px",
11068
+ "interaction.keyboard.style": "solid",
10980
11069
  "interaction.noninteractiveMode": false,
10981
11070
  "interaction.selectability.axisLabelSelection": true,
10982
11071
  "interaction.selectability.behavior": {
@@ -12105,6 +12194,7 @@ return {
12105
12194
  "interaction.hover.stroke.width": "2px",
12106
12195
  "interaction.keyboard.color": "#000000",
12107
12196
  "interaction.keyboard.width": "1px",
12197
+ "interaction.keyboard.style": "solid",
12108
12198
  "interaction.noninteractiveMode": false,
12109
12199
  "interaction.selectability.axisLabelSelection": true,
12110
12200
  "interaction.selectability.behavior": {
@@ -14115,6 +14205,7 @@ return {
14115
14205
  "interaction.hover.stroke.width": "2px",
14116
14206
  "interaction.keyboard.color": "#000000",
14117
14207
  "interaction.keyboard.width": "1px",
14208
+ "interaction.keyboard.style": "solid",
14118
14209
  "interaction.noninteractiveMode": false,
14119
14210
  "interaction.selectability.axisLabelSelection": true,
14120
14211
  "interaction.selectability.behavior": {
@@ -14714,6 +14805,7 @@ return {
14714
14805
  "interaction.hover.stroke.width": "2px",
14715
14806
  "interaction.keyboard.color": "#000000",
14716
14807
  "interaction.keyboard.width": "1px",
14808
+ "interaction.keyboard.style": "solid",
14717
14809
  "interaction.noninteractiveMode": false,
14718
14810
  "interaction.selectability.axisLabelSelection": true,
14719
14811
  "interaction.selectability.behavior": {
@@ -15107,6 +15199,7 @@ return {
15107
15199
  "interaction.hover.stroke.width": "2px",
15108
15200
  "interaction.keyboard.color": "#000000",
15109
15201
  "interaction.keyboard.width": "1px",
15202
+ "interaction.keyboard.style": "solid",
15110
15203
  "interaction.noninteractiveMode": false,
15111
15204
  "interaction.selectability.axisLabelSelection": true,
15112
15205
  "interaction.selectability.behavior": {
@@ -16541,6 +16634,7 @@ return {
16541
16634
  "interaction.hover.stroke.width": "2px",
16542
16635
  "interaction.keyboard.color": "#000000",
16543
16636
  "interaction.keyboard.width": "1px",
16637
+ "interaction.keyboard.style": "solid",
16544
16638
  "interaction.noninteractiveMode": false,
16545
16639
  "interaction.selectByTimeAxisGroup": {
16546
16640
  "access": "internal",
@@ -16853,6 +16947,7 @@ return {
16853
16947
  "interaction.hover.stroke.width": "2px",
16854
16948
  "interaction.keyboard.color": "#000000",
16855
16949
  "interaction.keyboard.width": "1px",
16950
+ "interaction.keyboard.style": "solid",
16856
16951
  "interaction.noninteractiveMode": false,
16857
16952
  "interaction.selectability.axisLabelSelection": true,
16858
16953
  "interaction.selectability.behavior": {
@@ -17142,6 +17237,7 @@ return {
17142
17237
  "interaction.hover.stroke.width": "2px",
17143
17238
  "interaction.keyboard.color": "#000000",
17144
17239
  "interaction.keyboard.width": "1px",
17240
+ "interaction.keyboard.style": "solid",
17145
17241
  "interaction.noninteractiveMode": false,
17146
17242
  "interaction.selectability.axisLabelSelection": true,
17147
17243
  "interaction.selectability.behavior": {
@@ -17942,16 +18038,22 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
17942
18038
  if (!isTriggerable(service) || isOnFirstLastOnlyAxis(event, service)) {
17943
18039
  return;
17944
18040
  }
17945
-
18041
+ var isAccEnable = service && service.getProperties().get("interaction.enableAccUpdates");
17946
18042
  var isRadarChart = service._getRenderType().indexOf("radar") > -1;
17947
18043
  var polarAxis = "plotArea.polarAxis";
17948
18044
  var axisName = isRadarChart ? polarAxis : getAxisName(event);
17949
18045
  service.fireEvent("processUnhighlight");
17950
18046
  var color = service.getProperties().get(axisName + ".hoverShadow.color");
17951
18047
  if (color) {
17952
- d3.select(event.data.currentTarget).select("rect")
17953
- .attr("fill", event.data.byKeyboard ? "transparent" : color)
17954
- .classed(CSS_CLASS.HOVER_SHADOW, true);
18048
+ if(isAccEnable){
18049
+ d3.select(event.data.currentTarget).select("polygon")
18050
+ .attr("fill", event.data.byKeyboard ? "transparent" : color)
18051
+ .classed(CSS_CLASS.HOVER_SHADOW, true);
18052
+ }else{
18053
+ d3.select(event.data.currentTarget).select("rect")
18054
+ .attr("fill", event.data.byKeyboard ? "transparent" : color)
18055
+ .classed(CSS_CLASS.HOVER_SHADOW, true);
18056
+ }
17955
18057
  }
17956
18058
 
17957
18059
  //get targets. Hovering on data points does not support trellis.
@@ -18100,9 +18202,19 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
18100
18202
  }
18101
18203
 
18102
18204
  var color;
18205
+ var lineColor = service.getProperties().get("interaction.selected.stroke.color");
18206
+ var outlineWidth = service.getProperties().get("interaction.keyboard.width");
18207
+
18103
18208
  if(isTriggerable(service)) {
18209
+ var radar = service._getChartType().toLowerCase() === 'radar';
18104
18210
  var axisName = getAxisName(event);
18211
+
18212
+ if(radar){
18213
+ axisName = 'plotArea.polarAxis';
18214
+ }
18215
+
18105
18216
  color = service.getProperties().get(axisName+".mouseDownShadow.color");
18217
+
18106
18218
  }
18107
18219
  else if(isTimeAxisTriggerable(service)) {
18108
18220
  color = service.getProperties().get("timeAxis"+".mouseDownShadow.color");
@@ -18110,13 +18222,19 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
18110
18222
  else {
18111
18223
  return;
18112
18224
  }
18225
+
18113
18226
  service.getNodes(service.NodeType.AXIS_ITEM_BACKGROUND)
18114
18227
  .attr("fill", "transparent")
18115
18228
  .classed(CSS_CLASS.HOVER_SHADOW, false);
18229
+
18230
+ var label_selector = service.NodeType.AXIS_ITEM_BACKGROUND.get('value');
18231
+
18116
18232
  if (color) {
18117
- d3.select(event.data.currentTarget).select("rect")
18233
+ d3.select(event.data.currentTarget).select(label_selector)
18118
18234
  .attr("fill", color)
18119
- .classed(CSS_CLASS.FOCUS_SHADOW, true);
18235
+ .classed(CSS_CLASS.FOCUS_SHADOW, true)
18236
+ .attr("stroke", lineColor)
18237
+ .attr("stroke-width", outlineWidth);
18120
18238
  }
18121
18239
  };
18122
18240
 
@@ -18126,7 +18244,13 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
18126
18244
  }
18127
18245
  var color;
18128
18246
  if(isTriggerable(service)) {
18247
+ var radar = service._getChartType().toLowerCase() === 'radar';
18129
18248
  var axisName = getAxisName(event);
18249
+
18250
+ if(radar){
18251
+ axisName = 'plotArea.polarAxis';
18252
+ }
18253
+
18130
18254
  color = service.getProperties().get(axisName+".hoverShadow.color");
18131
18255
  }
18132
18256
  else if(isTimeAxisTriggerable(service)) {
@@ -18141,10 +18265,13 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
18141
18265
  if (UADetector.isMobile()) {
18142
18266
  axisBackground.classed(CSS_CLASS.HOVER_SHADOW, false);
18143
18267
  } else {
18268
+ var label_selector = service.NodeType.AXIS_ITEM_BACKGROUND.get('value');
18144
18269
  if (color) {
18145
- d3.select(event.data.currentTarget).select("rect")
18270
+ d3.select(event.data.currentTarget).select(label_selector)
18146
18271
  .attr("fill", color)
18147
- .classed(CSS_CLASS.HOVER_SHADOW, true);
18272
+ .classed(CSS_CLASS.HOVER_SHADOW, true)
18273
+ .attr("stroke", null)
18274
+ .attr("stroke-width", null);
18148
18275
  }
18149
18276
  }
18150
18277
  };
@@ -20433,7 +20560,9 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
20433
20560
  'sap/viz/framework/common/util/DOM',
20434
20561
  "sap/viz/framework/common/util/DataGraphics",
20435
20562
  "sap/viz/framework/common/util/TypeUtils",
20436
- "sap/viz/chart/behavior/config/ContextualDataUtil"
20563
+ "sap/viz/chart/behavior/config/ContextualDataUtil",
20564
+ "sap/viz/framework/common/util/ACCStyleUtils",
20565
+ "sap/viz/chart/components/util/ColorUtil"
20437
20566
  ], function(
20438
20567
  Constants,
20439
20568
  SDKConstants,
@@ -20446,7 +20575,9 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
20446
20575
  DOM,
20447
20576
  DataGraphics,
20448
20577
  TypeUtils,
20449
- ContextualDataUtil
20578
+ ContextualDataUtil,
20579
+ ACCStyleUtils,
20580
+ ColorUtil
20450
20581
  ) {
20451
20582
  var BehaviorConstants = SDKConstants.BEHAVIOR;
20452
20583
  var CSS_CLASS = Constants.CSS.CLASS;
@@ -21458,7 +21589,7 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
21458
21589
 
21459
21590
  var plot = service.getModule("main.plot");
21460
21591
  var dataModel = service.getDataModel();
21461
-
21592
+
21462
21593
  elements.forEach(function (e) {
21463
21594
  if(service.isTrellis()){
21464
21595
  //bar
@@ -21473,7 +21604,6 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
21473
21604
  HighlightHelper.drawStroke(service, e, 'path, rect', prop.stroke, 2);
21474
21605
  HighlightHelper.drawFill(service, e, 'path, rect', prop, isMarkerRendererExist, true);
21475
21606
  } else {
21476
- //bar
21477
21607
  if (!event.data.byKeyboard) {
21478
21608
  var extraData = DataGraphics.getData(e);
21479
21609
  HighlightHelper.drawStroke(service, e, 'rect', prop.stroke, 2, undefined, extraData);
@@ -21508,7 +21638,7 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
21508
21638
 
21509
21639
  var plot = service.getModule("main.plot");
21510
21640
  var dataModel = service.getDataModel();
21511
-
21641
+ var isAccEnable = service.getProperties().get("interaction.enableAccUpdates");
21512
21642
  elements.forEach(function (e) {
21513
21643
  var dataId = DataPointUtils.getDataPointId(e);
21514
21644
  var dataPoint = dataModel.getDataPoint(dataId);
@@ -21542,6 +21672,29 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
21542
21672
  }
21543
21673
  }else{
21544
21674
  extraData = DataGraphics.getData(e);
21675
+ if (isAccEnable) {
21676
+ var BGCOLORPROPS = [ "plotArea.grid.background.color",
21677
+ "plotArea.background.color",
21678
+ "general.background.color"];
21679
+ var propMgr = service.getProperties();
21680
+ var textVisible = propMgr.get('plotArea.dataLabel.visible');
21681
+ var template = service.getEffectManager()._getTemplate().name;
21682
+ var theme = ACCStyleUtils.getTheme(template);
21683
+ var chartType = service._getChartType();
21684
+ var threshold = ACCStyleUtils.getThreshold(theme, chartType, textVisible);
21685
+ var strokeColor = "plotArea.dataPoint.stroke.color";
21686
+ var strokeVisible = "plotArea.dataPoint.stroke.visible";
21687
+ var bgcolor = ColorUtil.getBgColor(propMgr,
21688
+ propMgr.get(strokeVisible) ? BGCOLORPROPS.concat(strokeColor) : BGCOLORPROPS);
21689
+ var fill = extraData.color;
21690
+ if (fill && bgcolor) {
21691
+ var ratioObj = ColorUtil.checkColorContrast(bgcolor, fill, threshold);
21692
+ if (!ratioObj.meetsThreshold) {
21693
+ var stroke = ACCStyleUtils.getBorderColor(extraData.color);
21694
+ prop.stroke.color = stroke ? stroke : prop.stroke.color;
21695
+ }
21696
+ }
21697
+ }
21545
21698
  HighlightHelper.drawStroke(service, e, 'rect', prop.stroke, width, undefined, extraData);
21546
21699
  HighlightHelper.drawFill(service, e, 'rect, path', prop, isMarkerRendererExist);
21547
21700
  }
@@ -27422,6 +27575,7 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
27422
27575
  var HOURS = "hours";
27423
27576
  var MINUTES = "minutes";
27424
27577
  var SENCONDS = "senconds";
27578
+ var CATEGORY_LABEL_ID = "categorylabel-id";
27425
27579
  var LEGEND_ITEM = Constants.CSS.CLASS.LEGENDITEM;
27426
27580
  var MBC_LEGEND_ITEM = Constants.CSS.CLASS.MBCLEGENDITEM;
27427
27581
  var SELECTED = Constants.CSS.CLASS.SELECTED;
@@ -27619,7 +27773,10 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
27619
27773
  // .attr('aria-setsize', service.getDataModel().getDataPointCount())
27620
27774
  if (!isNonInteractive) {
27621
27775
  var parent = d3.select(target).node().parentNode;
27622
- d3.select(target).attr("role", "option");
27776
+ var dataId = parseInt(DataPointUtils.getDataId(target)) + 1;
27777
+ var dataSize = service.getDataModel().getDataPointCount();
27778
+ d3.select(target).attr("role", "option").attr('aria-posinset', dataId)
27779
+ .attr('aria-setsize', dataSize);
27623
27780
  d3.select(parent).attr("role", "listbox");
27624
27781
  }
27625
27782
  break;
@@ -27629,7 +27786,10 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
27629
27786
  text = (isTimeseries ? ' Time Axis Item ' : ' Category Axis Item ') + text;
27630
27787
  text += DataGraphics.getContext(target).text;
27631
27788
  if (!isNonInteractive) {
27632
- d3.select(target).attr("role", "option");
27789
+ var categorySize = d3.select(target.parentNode).selectAll('.v-axis-item').size();
27790
+ var categoryId = parseInt(d3.select(target).attr(CATEGORY_LABEL_ID) || 0)+1;
27791
+ d3.select(target).attr("role", "option").attr('aria-posinset', categoryId)
27792
+ .attr('aria-setsize', categorySize);
27633
27793
  }
27634
27794
  break;
27635
27795
  case 3:
@@ -27783,7 +27943,7 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
27783
27943
  }
27784
27944
  text += ". ";
27785
27945
  if(!isNonInteractive) {
27786
- d3.select(target).attr('aria-label', text).attr('tabindex', 0).attr("focusable", true)
27946
+ d3.select(target).attr('aria-label', text).attr("tabindex", 0).attr("focusable", true)
27787
27947
  .style('outline', 'none');
27788
27948
  if(isSelectionFeedback){
27789
27949
  var isLegendItemSelected = d3.select(target).attr('class').indexOf(LEGEND_ITEM + SELECTED);
@@ -27795,7 +27955,6 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
27795
27955
  d3.select(target).attr('aria-label', text + ' Selected');
27796
27956
  }
27797
27957
  }
27798
-
27799
27958
  if (typeof target.focus === "function") {
27800
27959
  target.focus();
27801
27960
  } else {
@@ -27957,11 +28116,13 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
27957
28116
  var LEGEND_NODE_BOUND = Constants.CSS.CLASS.LEGEND_BOUND_SELECTION;
27958
28117
  var PLOT_NODE_BOUND = Constants.CSS.CLASS.PLOT_BOUND_SELECTION;
27959
28118
  var LEGEND_ITEM_BOUND = Constants.CSS.CLASS.LEGEND_ITEM_BOUND_SELECTION;
28119
+ var AXIS_ITEM_NODE_BOUND_ACC = Constants.CSS.CLASS.AXIS_ITEM_BOUND_SELECTION_ACC;
27960
28120
  var AXIS_ITEM_NODE_BOUND = Constants.CSS.CLASS.AXIS_ITEM_BOUND_SELECTION;
27961
28121
  var DATAPOINTHOVER = Constants.CSS.CLASS.DATAPOINTHOVER;
27962
28122
  var ZEROVALUEHOVER = Constants.CSS.CLASS.ZEROVALUEHOVER;
27963
28123
  var ZERO_LINE_GROUP = Constants.CSS.CLASS.ZERO_LINE_GROUP;
27964
28124
  var STACK = Constants.CSS.CLASS.STACK;
28125
+ var CLIPPATH = Constants.CSS.CLASS.CLIPPATH;
27965
28126
  var FOCUS_INSIDE_CLASS = "v-focusInside";
27966
28127
  var ZERO_FOCUS = {
27967
28128
  RECT: 2,
@@ -28357,13 +28518,13 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28357
28518
  if (dps) {
28358
28519
  dps.forEach(function(target) {
28359
28520
  highlightNode(mainBoundNode,
28360
- d3.select(target), boundNode, highlightProps);
28521
+ d3.select(target), boundNode, highlightProps, service);
28361
28522
  });
28362
28523
  }
28363
28524
  } else {
28364
28525
  highlightNode(mainBoundNode, isTreeMapHeader ?
28365
28526
  d3.select(hoveredTargetNode.parentNode) :
28366
- d3.select(hoveredTargetNode), boundNode, highlightProps);
28527
+ d3.select(hoveredTargetNode), boundNode, highlightProps, service);
28367
28528
  }
28368
28529
  }
28369
28530
  };
@@ -28468,7 +28629,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28468
28629
  return closestNode;
28469
28630
  };
28470
28631
 
28471
- var highlightNode = function(mainBoundNode, hoverNode, selectBound, properties) {
28632
+ var highlightNode = function (mainBoundNode, hoverNode, selectBound, properties, service) {
28472
28633
  blurNode(hoverNode);
28473
28634
  var d3Node = hoverNode.select(selectBound),
28474
28635
  currentNode = d3Node.node();
@@ -28476,7 +28637,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28476
28637
  return;
28477
28638
  }
28478
28639
  var stackNode = d3.select(hoverNode.node().parentNode).node();
28479
- var stackPos = TypeUtils.isExist(stackNode) ?
28640
+ var stackPos = TypeUtils.isExist(stackNode) ?
28480
28641
  stackNode.getBoundingClientRect() : {};
28481
28642
  var data = DataGraphics.getData(currentNode);
28482
28643
  if (TypeUtils.isExist(data)) {
@@ -28485,63 +28646,87 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28485
28646
  var svgRect = currentNode.getBoundingClientRect(),
28486
28647
  digitalWidth = parseFloat(properties.width) || 1,
28487
28648
  dasharray = digitalWidth + ', ' + digitalWidth;
28649
+
28650
+ if(properties.style && properties.style.toLowerCase() === 'solid'){
28651
+ dasharray = 'none';
28652
+ }
28653
+
28488
28654
  var boundNode = hoverNode.append("g").attr("class", "v-m-highlight");
28489
28655
  var bound = {
28490
28656
  rect: null,
28491
- line: null
28657
+ line: null,
28658
+ polygon: null
28492
28659
  };
28493
-
28494
28660
  var isStackedChart;
28495
28661
  if (properties.renderType) {
28496
28662
  isStackedChart = properties.renderType.indexOf('stacked') > -1;
28497
28663
  }
28498
-
28499
28664
  var angle = properties.angle;
28500
-
28665
+ var isAccEnable = service && service.getProperties().get("interaction.enableAccUpdates");
28666
+ properties.width = properties.width ? parseFloat(properties.width.split('px')[0]) : 1;
28501
28667
  if (isStackedChart && properties.isZeroValueInStack && properties.isZeroOnFirstTab) {
28502
28668
  bound.line = boundNode.append('line').attr('class', 'v-highlight-bound')
28503
28669
  .attr("stroke", properties.color)
28504
28670
  .attr("stroke-width", properties.width).attr("stroke-dasharray", dasharray)
28505
28671
  .style("pointer-events", "none" );
28506
28672
  } else {
28507
- bound.rect = boundNode.append("rect").attr("class", "v-highlight-bound")
28508
- .attr("transform", d3Node.attr("transform"))
28509
- .attr("width", d3Node.attr("width")).attr("height", d3Node.attr("height"))
28510
- .attr("x", d3Node.attr("x")).attr("y", d3Node.attr("y"))
28511
- .attr("fill", "transparent").attr("fill-opacity", 0)
28512
- .attr("stroke", properties.color)
28513
- .attr("stroke-width", properties.width).attr("stroke-dasharray", dasharray)
28514
- .attr("shape-rendering", "crispEdges").style("pointer-events", "none");
28673
+ if(isAccEnable && selectBound === AXIS_ITEM_NODE_BOUND_ACC){
28674
+ var id = "clip-path=" + Math.random().toString(36).slice(2);
28675
+ boundNode.append('clipPath')
28676
+ .attr("class", CLIPPATH)
28677
+ .attr("id", id)
28678
+ .append("polygon")
28679
+ .attr("points", d3Node.attr("points"));
28680
+ bound.polygon = boundNode.append("polygon").attr("class", "v-highlight-bound")
28681
+ .attr("points", d3Node.attr("points"))
28682
+ .attr("fill", "transparent")
28683
+ .attr("fill-opacity", 0)
28684
+ .attr("stroke", properties.color)
28685
+ .attr("stroke-width", properties.width * 2)
28686
+ .attr("stroke-dasharray", dasharray)
28687
+ .attr("shape-rendering", "crispEdges")
28688
+ .style("pointer-events", "none")
28689
+ .attr("clip-path", "url(#" + id + ")");
28690
+ }else{
28691
+ bound.rect = boundNode.append("rect").attr("class", "v-highlight-bound")
28692
+ .attr("transform", d3Node.attr("transform"))
28693
+ .attr("width", d3Node.attr("width")).attr("height", d3Node.attr("height"))
28694
+ .attr("x", d3Node.attr("x")).attr("y", d3Node.attr("y"))
28695
+ .attr("fill", "transparent").attr("fill-opacity", 0)
28696
+ .attr("stroke", properties.color)
28697
+ .attr("stroke-width", properties.width).attr("stroke-dasharray", dasharray)
28698
+ .attr("shape-rendering", "crispEdges").style("pointer-events", "none");
28699
+ }
28515
28700
  }
28516
28701
 
28517
28702
  if (selectBound === "rect" || selectBound === "path") {
28518
28703
  var transform = SVG.getTransformToElement(currentNode, hoverNode.node());
28519
- var axisNode = d3.select(CATEGORYAXIS_NODE_BOUND).node() ||
28704
+ var axisNode = d3.select(CATEGORYAXIS_NODE_BOUND).node() ||
28520
28705
  d3.select(CATEGORYAXIS2_NODE_BOUND).node() || d3.select(TIMEAXIS_NODE_BOUND).node();
28521
- var axisPos = TypeUtils.isExist(axisNode) ?
28706
+ var axisPos = TypeUtils.isExist(axisNode) ?
28522
28707
  axisNode.getBoundingClientRect() : {};
28523
28708
  var plotNode = d3.select(PLOT_NODE_BOUND).node();
28524
- var plotPos = TypeUtils.isExist(plotNode) ?
28709
+ var plotPos = TypeUtils.isExist(plotNode) ?
28525
28710
  plotNode.getBoundingClientRect() : {};
28526
28711
  var zeroLineNode = d3.select('.' + ZERO_LINE_GROUP).node();
28527
- var zeroLinePos = TypeUtils.isExist(zeroLineNode) ?
28712
+ var zeroLinePos = TypeUtils.isExist(zeroLineNode) ?
28528
28713
  zeroLineNode.getBoundingClientRect() : {};
28529
28714
  var wtfLineNode = [];
28530
28715
  if (properties.isZeroValue) {
28531
28716
  var wtf = d3.selectAll('.v-wtf-linkline');
28532
- for (var i = 0; i < wtf[0].length; ++i) {
28533
- wtfLineNode.push(wtf[0][i]);
28717
+ for (var q = 0; q < wtf[0].length; ++q) {
28718
+ wtfLineNode.push(wtf[0][q]);
28534
28719
  }
28535
28720
  }
28536
28721
  var hoverPos = boundNode.node().getBoundingClientRect();
28537
- var wtfLinePos = wtfLineNode.length > 0 ?
28722
+ var wtfLinePos = wtfLineNode.length > 0 ?
28538
28723
  getWTFLineNode(wtfLineNode, hoverPos, !properties.isVerticalRender).getBoundingClientRect() : {};
28539
28724
  if (properties.isZeroValue && properties.isZeroOnFirstTab) {
28540
28725
  if (properties.isVerticalRender) {
28541
- properties.bCloseCategory = (axisPos.top <= hoverPos.top) ||
28726
+ properties.bCloseCategory = (axisPos.top <= hoverPos.top) ||
28542
28727
  (plotPos.top <= hoverPos.top);
28543
28728
  } else {
28544
- properties.bCloseCategory = (axisPos.right <= hoverPos.left) ||
28729
+ properties.bCloseCategory = (axisPos.right <= hoverPos.left) ||
28545
28730
  (plotPos.right <= hoverPos.left);
28546
28731
  }
28547
28732
  }
@@ -28551,14 +28736,14 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28551
28736
  }
28552
28737
  transform = reShapeTransform(transform, properties);
28553
28738
  boundNode.attr("transform", "translate(" + transform.e + "," + transform.f + ") " +
28554
- "scale(" + transform.a + "," + transform.d + ") ");
28739
+ "scale(" + transform.a + "," + transform.d + ") ");
28555
28740
  } else {
28556
28741
  var posTransformLine, negTransformLine;
28557
28742
  negTransformLine = {
28558
- a: properties.isVerticalRender ? 0 :
28559
- isPercentageStackedChart(properties.renderType) ?
28560
- (-1) * 0.5 * ZERO_FOCUS.LINE : 0.5 * ZERO_FOCUS.LINE,
28561
- b: properties.isVerticalRender ? isPercentageStackedChart(properties.renderType) ?
28743
+ a: properties.isVerticalRender ? 0 :
28744
+ isPercentageStackedChart(properties.renderType) ?
28745
+ (-1) * 0.5 * ZERO_FOCUS.LINE : 0.5 * ZERO_FOCUS.LINE,
28746
+ b: properties.isVerticalRender ? isPercentageStackedChart(properties.renderType) ?
28562
28747
  0.5 * ZERO_FOCUS.LINE : (-1) * 0.5 * ZERO_FOCUS.LINE : 0
28563
28748
  };
28564
28749
  posTransformLine = negTransformLine;
@@ -28594,11 +28779,11 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28594
28779
  }
28595
28780
  if (TypeUtils.isExist(bound.line) || TypeUtils.isExist(bound.rect)) {
28596
28781
  var pos = {
28597
- plotPos: plotPos,
28782
+ plotPos: plotPos,
28598
28783
  axisPos: axisPos,
28599
28784
  zeroLine: {
28600
28785
  zeroLinePos: zeroLinePos,
28601
- strokeWidth: TypeUtils.isExist(zeroLineNode) ?
28786
+ strokeWidth: TypeUtils.isExist(zeroLineNode) ?
28602
28787
  parseFloat(zeroLineNode.getAttribute('stroke-width')) : 0
28603
28788
  },
28604
28789
  hoverPos: hoverPos,
@@ -28667,19 +28852,21 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28667
28852
  var parentRect = mainBoundNode.getBoundingClientRect();
28668
28853
  var intersectionBoundRect = BoundingBox.intersection(parentRect, svgRect);
28669
28854
  if (intersectionBoundRect) {
28670
- bound.rect.attr("width", intersectionBoundRect.width)
28671
- .attr("height", intersectionBoundRect.height);
28672
- /*
28673
- * When there's scrollbar on the legend, set x = 0 or y = 0 instead of
28674
- * keeping x/y as null, will make the Chrome render differently
28675
- */
28676
- if (intersectionBoundRect.left !== svgRect.left) {
28677
- bound.rect.attr("x", (parseFloat(d3Node.attr("x")) || 0) +
28678
- intersectionBoundRect.left - svgRect.left);
28679
- }
28680
- if (intersectionBoundRect.top !== svgRect.top) {
28681
- bound.rect.attr("y", (parseFloat(d3Node.attr("y")) || 0) +
28682
- intersectionBoundRect.top - svgRect.top);
28855
+ if(!isAccEnable || (selectBound !== AXIS_ITEM_NODE_BOUND_ACC)){
28856
+ bound.rect.attr("width", intersectionBoundRect.width)
28857
+ .attr("height", intersectionBoundRect.height);
28858
+ /*
28859
+ * When there's scrollbar on the legend, set x = 0 or y = 0 instead of
28860
+ * keeping x/y as null, will make the Chrome render differently
28861
+ */
28862
+ if (intersectionBoundRect.left !== svgRect.left) {
28863
+ bound.rect.attr("x", (parseFloat(d3Node.attr("x")) || 0) +
28864
+ intersectionBoundRect.left - svgRect.left);
28865
+ }
28866
+ if (intersectionBoundRect.top !== svgRect.top) {
28867
+ bound.rect.attr("y", (parseFloat(d3Node.attr("y")) || 0) +
28868
+ intersectionBoundRect.top - svgRect.top);
28869
+ }
28683
28870
  }
28684
28871
  }
28685
28872
  }
@@ -28733,6 +28920,52 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28733
28920
  }
28734
28921
  };
28735
28922
 
28923
+ var clearTabIndexForTabbingOut = function(service){
28924
+ var tabindex0 = service._rootNode.selectAll('[tabindex="0"]')[0];
28925
+ if(tabindex0.length>1){
28926
+ //need to have exactly one element have tabindex 0,
28927
+ //otherwise can'tab out of the DOM
28928
+ //the element can be axis or legend item, preferably not datapoint
28929
+
28930
+ service._rootNode.selectAll('.v-datapoint[tabindex="0"]').attr("tabindex",null);
28931
+ tabindex0 = service._rootNode.selectAll('[tabindex="0"]')[0];
28932
+
28933
+ var isTreeMap = function (service) {
28934
+ var chartType = service._getRenderType();
28935
+ return (chartType.indexOf("treemap") > -1);
28936
+ };
28937
+
28938
+ var isHeatMap = function (service) {
28939
+ var chartType = service._getRenderType();
28940
+ return (chartType.indexOf("heatmap") > -1);
28941
+ };
28942
+
28943
+ var legend_indicator = isTreeMap(service) || isHeatMap(service) ? '.v-mbc-legend-item' : '.v-legend-item';
28944
+ var legend_node = service._rootNode.select(legend_indicator.concat('[tabindex="0"]')).node();
28945
+
28946
+ var not_legend_selector = ":not(" + legend_indicator + ")";
28947
+
28948
+ if(isHeatMap(service)){
28949
+ //heat map behaving differently for some reason
28950
+ return;
28951
+ }
28952
+
28953
+ if(legend_node){
28954
+ service._rootNode
28955
+ .selectAll('[tabindex="0"]')
28956
+ .filter(not_legend_selector)
28957
+ .attr("tabindex", null);
28958
+ }else{
28959
+ service._rootNode
28960
+ .selectAll('[tabindex="0"]')
28961
+ .filter(function(d,i){return i<tabindex0.length-1;})
28962
+ .attr("tabindex", null);
28963
+ }
28964
+
28965
+ }
28966
+ };
28967
+
28968
+
28736
28969
  var clearAllHoveredEffectAndStatus = function(service) {
28737
28970
  var hoveredTarget = service.getStatus("keyArrowHoveredDataPoint");
28738
28971
  if (isTreeMap(service) && hoveredTarget) {
@@ -28768,8 +29001,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28768
29001
  service.setStatus("hoveredLegendLabelId", null);
28769
29002
  service.setStatus("hoveredRadarLabelId", null);
28770
29003
 
28771
- service._rootNode.selectAll('g[tabindex="0"]').attr('tabindex', -1);
28772
- service._rootNode.selectAll('g[focusable="true"]').attr('focusable', false);
29004
+ service._rootNode.selectAll('[focusable="true"]').attr('focusable', null);
28773
29005
  };
28774
29006
 
28775
29007
  // make sure the direct handle functions only 2 parameters
@@ -28809,6 +29041,13 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28809
29041
  var renderType = service._getRenderType();
28810
29042
  var isTreeMapHeader = false;
28811
29043
  var isRadarChart = service._getRenderType().indexOf('radar') > -1;
29044
+ var isAccEnable = service && service.getProperties().get("interaction.enableAccUpdates");
29045
+
29046
+ //backwards tabbing (shift+tab into chart) -- remove chart border when backwards tabbing
29047
+ var backwardsTabbingIdx = service.getStatus("backwardsTabbingIdx");
29048
+ if(tabOrder === backwardsTabbingIdx && event.data.originalEvent.shiftKey){
29049
+ d3.select(event.data.rootHandler).classed(FOCUS_INSIDE_CLASS, true);
29050
+ }
28812
29051
 
28813
29052
  switch (tabOrder) {
28814
29053
  case 1:
@@ -28995,8 +29234,10 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
28995
29234
  if(axisBody.isOnlyShowingFirstAndLastLabel && axisBody.isOnlyShowingFirstAndLastLabel()){
28996
29235
  return;
28997
29236
  }
28998
-
28999
29237
  boundNode = AXIS_ITEM_NODE_BOUND;
29238
+ if(isAccEnable && !this._isTimeseries) {
29239
+ boundNode = AXIS_ITEM_NODE_BOUND_ACC;
29240
+ }
29000
29241
  componentNavigator = this._isTimeseries ? this[TIMEAXIS_NAVIGATOR] :
29001
29242
  ((tabOrder == 2) ? this[CATEGORYAXIS_NAVIGATOR] : this[CATEGORYAXIS2_NAVIGATOR]);
29002
29243
  hoveredTargetNode = this._isTimeseries ? service.getStatus("keyArrowHoveredTimeLabel") :
@@ -29009,6 +29250,14 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29009
29250
  if(this._isTimeseries) {
29010
29251
  componentNavigator.updateCells(
29011
29252
  service.getModule("main.timeAxis.axisBody").getActiveLabels());
29253
+ }else{
29254
+ if (tabOrder == 2) {
29255
+ componentNavigator.updateCells(
29256
+ service.getModule('main.categoryAxis.axisBody').getActiveLevels());
29257
+ }else{
29258
+ componentNavigator.updateCells(
29259
+ service.getModule('main.categoryAxis2.axisBody').getActiveLevels());
29260
+ }
29012
29261
  }
29013
29262
  hoveredTargetId = componentNavigator.getFirstStartPoint().id;
29014
29263
  } else if(isFocusAgain){
@@ -29269,6 +29518,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29269
29518
  };
29270
29519
 
29271
29520
  var zoomKeyHandler = function(event, service) {
29521
+ var isAccEnable = service && service.getProperties().get("interaction.enableAccUpdates");
29272
29522
  if (!service.getStatusManager().get("plot.zoom")) {
29273
29523
  return;
29274
29524
  }
@@ -29326,6 +29576,9 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29326
29576
  hoveredCategoryId + "']");
29327
29577
  service.setStatus("keyArrowHoveredTimeLabel", hoveredTarget);
29328
29578
  } else {
29579
+ if(isAccEnable) {
29580
+ boundNode = AXIS_ITEM_NODE_BOUND_ACC;
29581
+ }
29329
29582
  //Here use categoryLabel-id to query label because lazy rendering will mis-delete previous dom
29330
29583
  hoveredCategoryId = service.getStatus("hoveredCategoryLabelId");
29331
29584
  categoryGroupNode = service.getNodes(service.NodeType.CATEGORY_LABEL_GROUP);
@@ -29465,6 +29718,8 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29465
29718
  KeyboardBehaviorHandler.prototype = {
29466
29719
  initialized: function(event, service) {
29467
29720
  service.setStatus("tabOrder", -1);
29721
+ service.setStatus("backwardsTabbing", false);
29722
+ service.setStatus("backwardsTabbingIdx", 1);
29468
29723
  this[MAIN_NODE] = service.getNodes(service.NodeType.MAIN_NODE);
29469
29724
  this[LEGEND_GROUP] = service.getNodes(service.NodeType.LEGEND_GROUP);
29470
29725
  this[PLOT_NODE] = service.getNodes(service.NodeType.PLOT_NODE);
@@ -29705,6 +29960,8 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29705
29960
  service.removeStatus("tabOrder");
29706
29961
  service.removeStatus("hoveredTimeLabelId");
29707
29962
  service.removeStatus("orgHoveredTimeLabelId");
29963
+ service.removeStatus("backwardsTabbing");
29964
+ service.removeStatus("backwardsTabbingIdx");
29708
29965
  },
29709
29966
 
29710
29967
  uparrowHandler: function(event, service) {
@@ -29752,9 +30009,11 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29752
30009
  });
29753
30010
  var mainBoundNode = mainNode.select(boundNode).node();
29754
30011
  highlightNode(mainBoundNode, d3.select(mainBoundNode.parentNode),
29755
- ".v-bound", highlightProps);
30012
+ ".v-bound", highlightProps, service);
29756
30013
  }
29757
30014
  };
30015
+ var backwardstabbing = service.getStatus("backwardsTabbing");
30016
+ var backwardsTabbingIdx = service.getStatus("backwardsTabbingIdx");
29758
30017
 
29759
30018
  if (currentIdx === -1) {
29760
30019
  if (!shiftKey){
@@ -29765,7 +30024,13 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29765
30024
  currentIdx = -1;
29766
30025
  releaseTab = true;
29767
30026
  }
30027
+ //entry point from backwards tabbing
30028
+ if(backwardstabbing && shiftKey){
30029
+ currentIdx = backwardsTabbingIdx;
30030
+ releaseTab = false;
30031
+ }
29768
30032
  service.setStatus("tabOrder", currentIdx);
30033
+ service.setStatus("backwardsTabbing", false);
29769
30034
  } else {
29770
30035
  switch (currentIdx) {
29771
30036
  case 1:
@@ -29791,10 +30056,12 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29791
30056
  }else {
29792
30057
  currentIdx = -1;
29793
30058
  releaseTab = true;
30059
+ backwardstabbing = true;
29794
30060
  }
29795
30061
  } else {
29796
30062
  currentIdx = -1;
29797
30063
  releaseTab = true;
30064
+ service._rootNode.selectAll('[tabindex="0"]').attr('tabindex', null);
29798
30065
  }
29799
30066
  break;
29800
30067
  case 2:
@@ -29812,6 +30079,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29812
30079
  else {
29813
30080
  currentIdx = -1;
29814
30081
  releaseTab = true;
30082
+ backwardstabbing = true;
29815
30083
  }
29816
30084
  } else {
29817
30085
  boundNode = PLOT_NODE_BOUND;
@@ -29827,6 +30095,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29827
30095
  } else {
29828
30096
  currentIdx = -1;
29829
30097
  releaseTab = true;
30098
+ backwardstabbing = true;
29830
30099
  }
29831
30100
  } else {
29832
30101
  if (service._getRenderType().indexOf('radar') > -1) {
@@ -29850,6 +30119,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29850
30119
  if (!shiftKey) {
29851
30120
  currentIdx = -1;
29852
30121
  releaseTab = true;
30122
+ backwardstabbing = true;
29853
30123
  } else if (legendModule && legendModule.isVisible()) {
29854
30124
  mainNode = this[LEGEND_GROUP];
29855
30125
  boundNode = LEGEND_NODE_BOUND;
@@ -29867,10 +30137,17 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
29867
30137
  mode: "infoMode",
29868
30138
  action: "interrupt"
29869
30139
  });
30140
+
30141
+ if(currentIdx>0){
30142
+ service.setStatus("backwardsTabbingIdx", currentIdx);
30143
+ }
30144
+
29870
30145
  service.setStatus("tabOrder", currentIdx);
30146
+ service.setStatus("backwardsTabbing", backwardstabbing);
29871
30147
 
29872
30148
  if (releaseTab) {
29873
30149
  clearAllHoveredEffectAndStatus(service);
30150
+ clearTabIndexForTabbingOut(service);
29874
30151
  if (event && event.data && event.data.rootHandler) {
29875
30152
  d3.select(event.data.rootHandler).classed(FOCUS_INSIDE_CLASS, false);
29876
30153
  }
@@ -32862,7 +33139,6 @@ define('sap/viz/chart/views/ChartView',[
32862
33139
 
32863
33140
  this._rootContainer = rootElement.node().parentNode;
32864
33141
  if (this._rootContainer) {
32865
- this._rootContainer.setAttribute("tabIndex", this._properties.get('general.tabIndex'));
32866
33142
  if (this._outline.visible || this._properties.get("interaction.enableKeyboard")) {
32867
33143
  this._rootContainer.style.outline = null;
32868
33144
  } else {
@@ -35128,9 +35404,10 @@ define('sap/viz/chart/components/axis/sub/AxisTitle',[
35128
35404
  "sap/viz/framework/common/util/UADetector",
35129
35405
  "sap/viz/framework/common/util/NameColorUtils",
35130
35406
  "sap/viz/framework/common/util/DataGraphics",
35131
- "sap/viz/migrate/PropertyUtil"
35407
+ "sap/viz/migrate/PropertyUtil",
35408
+ "sap/viz/framework/common/util/ACCStyleUtils"
35132
35409
  ], function(Constants, oo, AxisComponent, TypeUtils, NumberUtils, StyleUtils,
35133
- TextUtils, UADetector, NameColorUtils, DataGraphics, PropertyUtil) {
35410
+ TextUtils, UADetector, NameColorUtils, DataGraphics, PropertyUtil, ACCStyleUtils) {
35134
35411
 
35135
35412
  var AXIS_CLASS_NAMES = Constants.CSS.CLASS.AXIS;
35136
35413
 
@@ -35170,7 +35447,12 @@ define('sap/viz/chart/components/axis/sub/AxisTitle',[
35170
35447
  if(this._isApplyAxisLineColor()){
35171
35448
  value = this._properties.get('color');
35172
35449
  }
35173
- return this._isAllHidden() ? Constants.AXIS.HIDDEN_TITLE.COLOR : value;
35450
+ var color = Constants.AXIS.HIDDEN_TITLE.COLOR;
35451
+ var enableAccUpdates = this._properties.origin.get('interaction.enableAccUpdates') || false;
35452
+ if(enableAccUpdates){
35453
+ color = ACCStyleUtils.convertColor(Constants.AXIS.HIDDEN_TITLE.ACC_COLOR);
35454
+ }
35455
+ return this._isAllHidden() ? color : value;
35174
35456
  };
35175
35457
 
35176
35458
  AxisTitle.prototype.render = function(selection) {
@@ -35210,9 +35492,17 @@ define('sap/viz/chart/components/axis/sub/AxisTitle',[
35210
35492
  NameColorUtils.convertColor(colorProps) :
35211
35493
  styles.color
35212
35494
  });
35213
- var hiddenStyleColor = effectManager.register({
35214
- fillColor: Constants.AXIS.HIDDEN_TITLE.COLOR
35215
- });
35495
+ var enableAccUpdates = this._properties.origin.get('interaction.enableAccUpdates') || false;
35496
+ var hiddenStyleColor = null;
35497
+ if (enableAccUpdates) {
35498
+ hiddenStyleColor = effectManager.register({
35499
+ fillColor: ACCStyleUtils.convertColor(Constants.AXIS.HIDDEN_TITLE.ACC_COLOR)
35500
+ });
35501
+ } else {
35502
+ hiddenStyleColor = effectManager.register({
35503
+ fillColor: Constants.AXIS.HIDDEN_TITLE.COLOR
35504
+ });
35505
+ }
35216
35506
 
35217
35507
  var titleText = selection.append("g")
35218
35508
  .attr("class", className)
@@ -37216,6 +37506,8 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
37216
37506
  _misc.getStep = function(axisBody, cells, startIdx, getPreferredSizeFn) {
37217
37507
  var isAccEnable = axisBody._properties.origin.get('interaction.enableAccUpdates');
37218
37508
  var isInteractive = !axisBody._properties.origin.get('interaction.noninteractiveMode');
37509
+ var rotateAngle = parseFloat(axisBody._properties.origin.get('categoryAxis.label.angle'));
37510
+ var rad = rotateAngle * Math.PI / 180;
37219
37511
  if (cells.length <= 1) {
37220
37512
  return 1;
37221
37513
  }
@@ -37229,7 +37521,11 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
37229
37521
  cell = cells[j];
37230
37522
  var isSkip;
37231
37523
  if (isAccEnable && isInteractive){
37232
- isSkip = cell.cellStart - start0 >= MIN_ELEMENT_SIZE;
37524
+ if(rotateAngle && rotateAngle !== 0 && rotateAngle !== 90){
37525
+ isSkip = cell.cellStart - start0 >= MIN_ELEMENT_SIZE / Math.sin(rad);
37526
+ }else{
37527
+ isSkip = cell.cellStart - start0 >= MIN_ELEMENT_SIZE;
37528
+ }
37233
37529
  }else{
37234
37530
  isSkip = cell.cellStart >= end0;
37235
37531
  }
@@ -39423,6 +39719,97 @@ define('sap/viz/chart/components/axis/ValueAxis',[
39423
39719
  return ValueAxis;
39424
39720
  });
39425
39721
 
39722
+ define('sap/viz/chart/components/util/PolygonUtil',[], function() {
39723
+
39724
+ var polygonUtilObj = {};
39725
+
39726
+ polygonUtilObj.calRotatedRect = function(x, y, width, height, angle) {
39727
+ var rad = angle * Math.PI / 180;
39728
+ var rotateCenterX = x, rotateCenterY = y;
39729
+ var corners = [
39730
+ [x, y], [x + width, y],
39731
+ [x + width, y + height], [x, y + height]
39732
+ ];
39733
+ var result = corners.map(function(point) {
39734
+ var dx = point[0] - rotateCenterX, dy = point[1] - rotateCenterY;
39735
+ return {
39736
+ x: dx * Math.cos(rad) - dy * Math.sin(rad) + rotateCenterX,
39737
+ y: dx * Math.sin(rad) + dy * Math.cos(rad) + rotateCenterY
39738
+ };
39739
+ });
39740
+ return result;
39741
+ };
39742
+
39743
+ polygonUtilObj.calSkewRect = function(x, y, width, height, angle) {
39744
+ var rad = angle * Math.PI / 180;
39745
+ return [
39746
+ {x: x, y: y},
39747
+ {x: x + width, y: y},
39748
+ {x: x + width + height * Math.tan(rad), y: y + height},
39749
+ {x: x + height * Math.tan(rad), y: y + height}
39750
+ ];
39751
+ };
39752
+
39753
+ polygonUtilObj.calIntersection = function(line1A, line1B, line2A, line2B) {
39754
+ var d = (line2B.y - line2A.y) * (line1B.x - line1A.x) - (line2B.x - line2A.x) * (line1B.y - line1A.y);
39755
+
39756
+ if (Math.abs(d) < 1e-10) {
39757
+ return null;
39758
+ }
39759
+
39760
+ var ua = ((line2B.x - line2A.x) * (line1A.y - line2A.y) - (line2B.y - line2A.y) * (line1A.x - line2A.x)) / d;
39761
+ var ub = ((line1B.x - line1A.x) * (line1A.y - line2A.y) - (line1B.y - line1A.y) * (line1A.x - line2A.x)) / d;
39762
+
39763
+ if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {
39764
+ return null;
39765
+ }
39766
+
39767
+ return {
39768
+ x: line1A.x + ua * (line1B.x - line1A.x),
39769
+ y: line1A.y + ua * (line1B.y - line1A.y)
39770
+ };
39771
+ };
39772
+
39773
+ polygonUtilObj.isPointInConvexPolygon = function(point, polygon) {
39774
+ for (var i = 0; i < polygon.length; i++) {
39775
+ var pointA = polygon[i];
39776
+ var pointB = polygon[(i + 1) % polygon.length];
39777
+
39778
+ var edge = { x: pointB.x - pointA.x, y: pointB.y - pointA.y };
39779
+ var toPoint = { x: point.x - pointA.x, y: point.y - pointA.y };
39780
+
39781
+ var cross = edge.x * toPoint.y - edge.y * toPoint.x;
39782
+
39783
+ if (cross < 0) {
39784
+ return false;
39785
+ }
39786
+ }
39787
+ return true;
39788
+ };
39789
+ polygonUtilObj.sortPoints = function(points) {
39790
+ if (points.length < 3) {
39791
+ return points;
39792
+ }
39793
+
39794
+ var center = points.reduce(function(acc, p) {
39795
+ return {
39796
+ x: acc.x + p.x,
39797
+ y: acc.y + p.y
39798
+ };
39799
+ }, { x: 0, y: 0 });
39800
+ center.x /= points.length;
39801
+ center.y /= points.length;
39802
+
39803
+ var result = points.sort(function(a, b) {
39804
+ var angleA = Math.atan2(a.y - center.y, a.x - center.x);
39805
+ var angleB = Math.atan2(b.y - center.y, b.x - center.x);
39806
+ return angleA - angleB;
39807
+ });
39808
+ return result;
39809
+ };
39810
+
39811
+ return polygonUtilObj;
39812
+ });
39426
39813
  define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
39427
39814
  "sap/viz/framework/common/util/Constants",
39428
39815
  "sap/viz/framework/common/util/ArrayUtils",
@@ -39435,6 +39822,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
39435
39822
  "sap/viz/framework/common/util/PositionUtil",
39436
39823
  "sap/viz/framework/common/util/RuleUtil",
39437
39824
  "sap/viz/chart/components/util/StyleUtils",
39825
+ "sap/viz/chart/components/util/PolygonUtil",
39438
39826
  "sap/viz/framework/common/util/GeometryUtils",
39439
39827
  "sap/viz/framework/common/util/DataGraphics",
39440
39828
  "sap/viz/framework/common/util/ObjectUtils"
@@ -39450,6 +39838,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
39450
39838
  PositionUtils,
39451
39839
  RuleUtil,
39452
39840
  StyleUtils,
39841
+ PolygonUtil,
39453
39842
  GeometryUtils,
39454
39843
  DataGraphics,
39455
39844
  ObjectUtils
@@ -39704,7 +40093,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
39704
40093
  };
39705
40094
 
39706
40095
  rendererFunc.prototype.drawLabels = function(selection, layers, bound, position, props, effectManager,
39707
- needRowAxisOffset, labelOffset, additionalWidth, rebuildUI, isAccEnable, lineSize) {
40096
+ needRowAxisOffset, labelOffset, additionalWidth, rebuildUI, isAccEnable, lineSize, clippathRect) {
39708
40097
  var layersReversed = layers.slice().reverse();
39709
40098
  var layersLength = layersReversed.length;
39710
40099
  var baseline = 0;
@@ -39715,7 +40104,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
39715
40104
  this.drawSingleLayerLabels(selection, layersReversed[i], bound,
39716
40105
  position, props, baseline, i, layersReversed, effectManager,
39717
40106
  needRowAxisOffset, labelOffset, additionalWidth, rebuildUI,
39718
- isAccEnable, lineSize);
40107
+ isAccEnable, lineSize, clippathRect);
39719
40108
  }
39720
40109
  //remove labels out of layer limitation
39721
40110
  while(selection.select(".index_"+i).node()){
@@ -39754,21 +40143,43 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
39754
40143
  realXOffset = xOffset - baseYOffset * Math.cos(refAngle * Math.PI/180);
39755
40144
  }
39756
40145
 
39757
- return "translate(" + realXOffset + "," + realYOffset + ")";
40146
+ return {
40147
+ offsetX: parseFloat(realXOffset),
40148
+ offsetY: parseFloat(realYOffset)
40149
+ };
39758
40150
  };
39759
40151
 
39760
- rendererFunc.prototype._setLabelRectSize = function(rectNode, labelSize, textSize, isAccEnable, isVertical) {
39761
- if(rectNode && labelSize){
39762
- if(isAccEnable && isVertical){
39763
- rectNode.setAttribute("width", Math.max(labelSize.width, MIN_ELEMENT_SIZE));
39764
- rectNode.setAttribute("height", labelSize.height);
39765
- }else if(isAccEnable && !isVertical){
39766
- rectNode.setAttribute("width", labelSize.width);
39767
- rectNode.setAttribute("height", Math.max(labelSize.height, MIN_ELEMENT_SIZE));
39768
- }else{
39769
- rectNode.setAttribute("width", labelSize.width);
39770
- rectNode.setAttribute("height", labelSize.height);
39771
- }
40152
+ rendererFunc.prototype._setLabelRectSize = function(rectNode, labelSize, textSize, isAccEnable,
40153
+ isVertical, sizeLimit) {
40154
+ if(isAccEnable){
40155
+ var x = parseFloat(rectNode.getAttribute('x'));
40156
+ var y = parseFloat(rectNode.getAttribute('y'));
40157
+ var rectPoints;
40158
+ if(rectNode && labelSize){
40159
+ if(isVertical){
40160
+ rectPoints = PolygonUtil.calRotatedRect(
40161
+ 1,
40162
+ y,
40163
+ sizeLimit + TICK_SIZE,
40164
+ labelSize.height,
40165
+ 0);
40166
+ }else{
40167
+ rectPoints = PolygonUtil.calRotatedRect(
40168
+ x,
40169
+ y,
40170
+ labelSize.width,
40171
+ Math.min(labelSize.height, sizeLimit),
40172
+ 0);
40173
+ }
40174
+ }
40175
+ rectNode.setAttribute("points", rectPoints.map(function(d) {
40176
+ var pointX = NumberUtils.preciseSimple(d.x);
40177
+ var pointY = NumberUtils.preciseSimple(d.y);
40178
+ return pointX + "," + pointY;
40179
+ }).join(" "));
40180
+ }else{
40181
+ rectNode.setAttribute("width", labelSize.width);
40182
+ rectNode.setAttribute("height", labelSize.height);
39772
40183
  }
39773
40184
  };
39774
40185
 
@@ -39850,10 +40261,12 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
39850
40261
  var MIN_LABEL_CHAR_NUM = 3;
39851
40262
  var ELLIPSIS_NUM = 3;
39852
40263
  var MIN_SPACING = 24;
39853
-
40264
+
39854
40265
  rendererFunc.prototype.drawSingleLayerLabels = function(selection, layer, bound, position, props,
39855
40266
  baseline, index, layers, effectManager, needRowAxisOffset, labelOffset, additionalWidth, rebuildUI,
39856
- isAccEnable, lineSize) {
40267
+ isAccEnable, lineSize, clippathRect) {
40268
+
40269
+ var MARGIN_SIZE = 2;
39857
40270
  var clid = CATEGORY_LABEL_ID;
39858
40271
  var width = bound.width;
39859
40272
  var realWidth = bound.realSize && bound.realSize.width;
@@ -39896,8 +40309,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
39896
40309
  }
39897
40310
  }
39898
40311
  offset = layers.length === 1 ? LABEL_OFFSET : TICK_SIZE;
39899
- this._setLabelParameters(labels, position, baseline, width, height, offset, layer,
39900
- isAccEnable);
40312
+ this._setLabelParameters(labels, position, baseline, width, height, offset, layer);
39901
40313
 
39902
40314
  var sizeLimitForFirstLabel = false;
39903
40315
  if(keepFirstAndLastLabel){
@@ -40009,12 +40421,14 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
40009
40421
  config.styles = propStyle;
40010
40422
 
40011
40423
  this.setAttribute(clid, d.id);
40424
+ var labelX = d.x;
40425
+ var labelY = d.y;
40012
40426
  if(isAccEnable){
40013
40427
  if(isVertical){
40014
- var labelX = d.x - lineSizeOffset;
40428
+ labelX = d.x - lineSizeOffset;
40015
40429
  this.setAttribute("transform", "translate(" + labelX + "," + d.y + ")");
40016
40430
  }else{
40017
- var labelY = d.y + lineSizeOffset;
40431
+ labelY = d.y + lineSizeOffset;
40018
40432
  this.setAttribute("transform", "translate(" + d.x + "," + labelY + ")");
40019
40433
  }
40020
40434
  }else{
@@ -40076,7 +40490,11 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
40076
40490
  //the axis can display the label text. we draw the rect.
40077
40491
  rect = this.querySelector("." + AXIS_CLASS_NAMES.BACKGROUND_RECT);
40078
40492
  if (!rect) {
40079
- rect = SVG.create("rect");
40493
+ if(isAccEnable){
40494
+ rect = SVG.create("polygon");
40495
+ }else{
40496
+ rect = SVG.create("rect");
40497
+ }
40080
40498
  rect.setAttribute("class", AXIS_CLASS_NAMES.BACKGROUND_RECT);
40081
40499
  rect.setAttribute("fill", "transparent");
40082
40500
  this.appendChild(rect);
@@ -40152,35 +40570,110 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
40152
40570
  width: forceLabelRotation && rotated ? d.rectHeight :d.rectWidth,
40153
40571
  height: forceLabelRotation && rotated ? d.rectWidth: d.rectHeight
40154
40572
  };
40155
- me._setLabelRectSize(rect, labelSize, textNodeSize, isAccEnable, isVertical);
40156
- var textSize, textHeight, textWidth;
40573
+ me._setLabelRectSize(rect, labelSize, textNodeSize, isAccEnable, isVertical,
40574
+ sizeLimit + 2 * MARGIN_SIZE);
40575
+ var textSize, textHeight, textWidth, rectHeight, rectOffset, refRectWidth;
40157
40576
 
40158
40577
  if(layer.rotated && layer.rotationAngle !== VERTICAL_ANGLE && layer.rotationAngle !== 0) {
40159
- if(d.isEventRectLimited) {
40578
+ if(isAccEnable){
40579
+ var clippathPoints = PolygonUtil.calRotatedRect(
40580
+ clippathRect.x - bound.offset.x,
40581
+ clippathRect.y,
40582
+ clippathRect.width,
40583
+ clippathRect.height,
40584
+ clippathRect.angle
40585
+ );
40160
40586
  textSize = TextUtils.canvasMeasure(d.text, fontSize, fontWeight, fontFamily);
40161
40587
  textHeight = NumberUtils.preciseSimple(textSize.height);
40162
40588
  textWidth = NumberUtils.preciseSimple(textSize.width);
40163
40589
 
40164
- var rectHeight = Math.min(sizeLimit, textWidth);
40590
+ rectHeight = Math.min(sizeLimit, textWidth);
40591
+ var rectWidth = Math.max(NumberUtils.preciseSimple(textHeight) + 2 * MARGIN_SIZE,
40592
+ MIN_ELEMENT_SIZE);
40593
+ var rectPoints;
40594
+ var intersections = [];
40595
+ var innerPoints = [];
40596
+ if(d.isEventRectLimited) {
40597
+ rectOffset = rectWidth/4 * Math.sin(config.rotationAngle * Math.PI/180);
40598
+
40599
+ //enlarge rect size to add margin
40600
+ var rectTranslate = addRectMargin(rect, config.rotationAngle, -rectOffset, TICK_SIZE);
40601
+ rectPoints = PolygonUtil.calRotatedRect(
40602
+ parseFloat(d.rectX + rectTranslate.offsetX + labelX),
40603
+ parseFloat(d.rectY + rectTranslate.offsetY),
40604
+ parseFloat(rectWidth),
40605
+ parseFloat(rectHeight) + 2 * MARGIN_SIZE,
40606
+ parseFloat(90 - config.rotationAngle)
40607
+ );
40608
+ } else {
40609
+ refRectWidth = d.contentWidth * 3;
40610
+ if(refRectWidth < d.cellWidth) {
40611
+ rect.setAttribute("width", refRectWidth);
40612
+ rect.setAttribute("x", d.rectX + d.cellWidth/2 - refRectWidth/2);
40613
+ }
40614
+ rectPoints = PolygonUtil.calSkewRect(
40615
+ parseFloat(d.rectX + labelX + d.cellWidth/2 - refRectWidth/2),
40616
+ parseFloat(d.rectY),
40617
+ parseFloat(refRectWidth),
40618
+ parseFloat(labelSize.height),
40619
+ parseFloat(config.rotationAngle - 90)
40620
+ );
40621
+ }
40622
+ for (var j = 0; j < 4; j++) {
40623
+ var line1A = rectPoints[j], line1B = rectPoints[(j + 1) % 4];
40624
+ for (var k = 0; k < 4; k++) {
40625
+ var line2A = clippathPoints[k], line2B = clippathPoints[(k + 1) % 4];
40626
+ var pt = PolygonUtil.calIntersection(line1A, line1B, line2A, line2B);
40627
+ if (pt) {
40628
+ intersections.push(pt);
40629
+ }
40630
+ }
40631
+ }
40632
+ rectPoints.forEach(function(pt) {
40633
+ if (PolygonUtil.isPointInConvexPolygon(pt, clippathPoints)) {
40634
+ innerPoints.push(pt);
40635
+ }
40636
+ });
40637
+ clippathPoints.forEach(function(pt) {
40638
+ if (PolygonUtil.isPointInConvexPolygon(pt, rectPoints)) {
40639
+ innerPoints.push(pt);
40640
+ }
40641
+ });
40642
+ var allPoints = intersections.concat(innerPoints);
40643
+ var sortedPoints = PolygonUtil.sortPoints(allPoints);
40644
+ rect.setAttribute("points", sortedPoints.map(function(d) {
40645
+ var pointX = NumberUtils.preciseSimple(d.x);
40646
+ var pointY = NumberUtils.preciseSimple(d.y);
40647
+ return pointX - labelX + "," + pointY;
40648
+ }).join(" "));
40649
+ }else{
40650
+ if(d.isEventRectLimited) {
40651
+ textSize = TextUtils.canvasMeasure(d.text, fontSize, fontWeight, fontFamily);
40652
+ textHeight = NumberUtils.preciseSimple(textSize.height);
40653
+ textWidth = NumberUtils.preciseSimple(textSize.width);
40654
+
40655
+ rectHeight = Math.min(sizeLimit, textWidth);
40165
40656
 
40166
- rect.setAttribute("width", textHeight);
40167
- rect.setAttribute("height", rectHeight);
40657
+ rect.setAttribute("width", textHeight);
40658
+ rect.setAttribute("height", rectHeight);
40168
40659
 
40169
- var rectOffset = textHeight/4 * Math.sin(config.rotationAngle * Math.PI/180);
40660
+ rectOffset = textHeight/4 * Math.sin(config.rotationAngle * Math.PI/180);
40170
40661
 
40171
- //enlarge rect size to add margin
40172
- var translateStr = addRectMargin(rect, config.rotationAngle, -rectOffset, TICK_SIZE);
40173
- var rotateStr = "rotate(" + (90 - config.rotationAngle) + "," +
40174
- d.rectX + "," + d.rectY + ") ";
40662
+ //enlarge rect size to add margin
40663
+ var realOffset = addRectMargin(rect, config.rotationAngle, -rectOffset, TICK_SIZE);
40664
+ var translateStr = "translate(" + realOffset.offsetX + "," + realOffset.offsetY + ")";
40665
+ var rotateStr = "rotate(" + (90 - config.rotationAngle) + "," +
40666
+ d.rectX + "," + d.rectY + ") ";
40175
40667
 
40176
- rect.setAttribute("transform", translateStr + ' ' + rotateStr);
40177
- } else {
40178
- rect.setAttribute("transform", "skewX(-" + (90-layer.rotationAngle) + ")");
40668
+ rect.setAttribute("transform", translateStr + ' ' + rotateStr);
40669
+ } else {
40670
+ rect.setAttribute("transform", "skewX(-" + (90-layer.rotationAngle) + ")");
40179
40671
 
40180
- var refRectWidth = d.contentWidth * 3;
40181
- if(refRectWidth < d.cellWidth) {
40182
- rect.setAttribute("width", refRectWidth);
40183
- rect.setAttribute("x", d.rectX + d.cellWidth/2 - refRectWidth/2);
40672
+ refRectWidth = d.contentWidth * 3;
40673
+ if(refRectWidth < d.cellWidth) {
40674
+ rect.setAttribute("width", refRectWidth);
40675
+ rect.setAttribute("x", d.rectX + d.cellWidth/2 - refRectWidth/2);
40676
+ }
40184
40677
  }
40185
40678
  }
40186
40679
  }else {
@@ -40232,7 +40725,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
40232
40725
  }
40233
40726
 
40234
40727
  rendererFunc.prototype._setLabelParameters = function(labels, position, baseline, width, height, textOffset,
40235
- layer, isAccEnable) {
40728
+ layer) {
40236
40729
  var i = 0,
40237
40730
  length = labels.length,
40238
40731
  label;
@@ -40388,6 +40881,7 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
40388
40881
  this._hasNegativeValue = false;
40389
40882
  this._styleChanged = true;
40390
40883
  this._localeChanged = true;
40884
+ this._additionalWidth = 0;
40391
40885
  //Default offset for trellis axis label is 5.
40392
40886
  this._labelOffset = 5;
40393
40887
  var styleChangeCallBack = function() {
@@ -40509,19 +41003,32 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
40509
41003
  additionalWidth = this.getAdditionalWidth();
40510
41004
  }
40511
41005
  var rect = this._selection.select('.v-clippath rect');
40512
- rect.attr('width', this._size.width + 2 + additionalWidth).attr('x', -1 - additionalWidth);
41006
+ rect.attr('width', this._size.width + 2 + additionalWidth).attr('x', -1 - additionalWidth);
40513
41007
  };
40514
41008
 
40515
41009
  OrdinalCommonAxisBody.prototype._update = function(rebuildUI) {
41010
+ var isAccEnable = this._properties.origin.get('interaction.enableAccUpdates');
40516
41011
  if(!this._tickGroupNode && !this._labelGroupNode){
40517
41012
  return;
40518
41013
  }
40519
41014
  var properties = this._properties.get();
41015
+ var rect, clippathRect;
40520
41016
  if (this._data && properties.visible) {
40521
41017
  var width = this._size.width;
40522
41018
  var height = this._size.height;
40523
41019
  var position = this._position;
40524
-
41020
+ if(isAccEnable){
41021
+ rect = this._selection.select('.v-clippath rect');
41022
+ rect.attr('width', this._size.width + 2 + this._additionalWidth)
41023
+ .attr('x', -1 - this._additionalWidth);
41024
+ clippathRect = {
41025
+ width: this._size.width + 2 + this._additionalWidth,
41026
+ height: this._size.height + 2,
41027
+ x: -1 - this._additionalWidth,
41028
+ y: -1,
41029
+ angle: 0
41030
+ };
41031
+ }
40525
41032
  if(rebuildUI){
40526
41033
  this._layers = this._buildLayers(this._data);
40527
41034
  this.layout();
@@ -40546,7 +41053,7 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
40546
41053
  position, properties, this.runtime().effectManager(), this._froce);
40547
41054
  }
40548
41055
  if (properties.label && properties.label.visible) {
40549
- this._renderLabels(properties, layers, bound, position, rebuildUI);
41056
+ this._renderLabels(properties, layers, bound, position, rebuildUI, clippathRect);
40550
41057
  }
40551
41058
  }
40552
41059
  }
@@ -40567,16 +41074,37 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
40567
41074
 
40568
41075
  OrdinalCommonAxisBody.prototype.render = function(selection) {
40569
41076
  this._selection = selection;
41077
+ var isAccEnable = this._properties.origin.get('interaction.enableAccUpdates');
40570
41078
  selection.select("g." + AXIS_CLASS_NAMES.LINE_GROUP).remove();
40571
41079
  selection.select("g." + AXIS_CLASS_NAMES.TICK_GROUP).remove();
40572
41080
  selection.select("g." + AXIS_CLASS_NAMES.LABEL_GROUP).remove();
40573
-
40574
- var additionalWidth = 0;
40575
- if(this._needExtened() && this._otherSize) {
40576
- additionalWidth = this.getAdditionalWidth();
41081
+ var clippathid;
41082
+ var clippathRect;
41083
+ if(isAccEnable) {
41084
+ var lineSize = this._properties.get('axisLine.size');
41085
+ if(this._needExtened() && this._otherSize) {
41086
+ this._additionalWidth = this.getAdditionalWidth();
41087
+ }
41088
+ clippathRect = {
41089
+ width: this._size.width + 2 + this._additionalWidth,
41090
+ height: this._size.height + 2 + lineSize / 2,
41091
+ x: -1 - this._additionalWidth,
41092
+ y: -1,
41093
+ angle: 0
41094
+ };
41095
+ clippathid = ClippathUtil.drawClippath(d3.select(selection.node()),
41096
+ clippathRect.width, clippathRect.height,
41097
+ clippathRect.x, clippathRect.y);
41098
+ } else {
41099
+ var additionalWidth = 0;
41100
+ if(this._needExtened() && this._otherSize) {
41101
+ additionalWidth = this.getAdditionalWidth();
41102
+ }
41103
+ clippathid = ClippathUtil.drawClippath(d3.select(selection.node()),
41104
+ this._size.width + 2 + additionalWidth, this._size.height + 2,
41105
+ -1 - additionalWidth, -1);
40577
41106
  }
40578
- var clippathid = ClippathUtil.drawClippath(d3.select(selection.node()),
40579
- this._size.width + 2 + additionalWidth, this._size.height + 2, -1 - additionalWidth, -1);
41107
+
40580
41108
  selection.attr('clip-path', 'url(#' + clippathid + ')');
40581
41109
  var properties = this._properties.get();
40582
41110
 
@@ -40608,7 +41136,7 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
40608
41136
 
40609
41137
  if (properties.label && properties.label.visible) {
40610
41138
  this._labelGroupNode = selection.append("g").attr("class", AXIS_CLASS_NAMES.LABEL_GROUP);
40611
- this._renderLabels(properties, layers, bound, position);
41139
+ this._renderLabels(properties, layers, bound, position, undefined, clippathRect);
40612
41140
  }
40613
41141
  }
40614
41142
  }
@@ -40618,7 +41146,8 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
40618
41146
  }
40619
41147
  };
40620
41148
 
40621
- OrdinalCommonAxisBody.prototype._renderLabels = function(properties, layers, bound, position, rebuildUI) {
41149
+ OrdinalCommonAxisBody.prototype._renderLabels = function(properties, layers, bound, position,
41150
+ rebuildUI, clippathRect) {
40622
41151
  var envManager = this.runtime().envManager();
40623
41152
  if (envManager) {
40624
41153
  properties.textAnchor = envManager.textAnchor();
@@ -40630,7 +41159,7 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
40630
41159
  this._bodyRenderer.drawLabels(this._labelGroupNode, layers, bound, position,
40631
41160
  properties, this.runtime().effectManager(), this._needRowAxisOffset(), this._labelOffset,
40632
41161
  this._needExtened() ? this.getAdditionalWidth(): 0, rebuildUI, isAccEnable && isInteractive,
40633
- lineSize);
41162
+ lineSize, clippathRect);
40634
41163
 
40635
41164
  if(this._bodyRenderer && this._bodyRenderer.applyLabelStyle){
40636
41165
  this._bodyRenderer.applyLabelStyle(this._labelGroupNode);
@@ -40803,9 +41332,6 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
40803
41332
  };
40804
41333
 
40805
41334
  OrdinalCommonAxisBody.prototype._getMaxLayersSize = function(spacings, sizeLimit) {
40806
- var lineSize = this._properties.get('axisLine.size');
40807
- var isAccEnable = this._properties.origin.get('interaction.enableAccUpdates');
40808
- var isInteractive = !this._properties.origin.get('interaction.noninteractiveMode');
40809
41335
  var sum = 0;
40810
41336
  for (var i = 0, length = spacings.length; i < length; ++i) {
40811
41337
  if (typeof sizeLimit !== 'number' || sum + spacings[i].interval <= sizeLimit) {
@@ -40818,9 +41344,6 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
40818
41344
  break;
40819
41345
  }
40820
41346
  }
40821
- if(isAccEnable && isInteractive){
40822
- sum += lineSize / 2;
40823
- }
40824
41347
  return sum;
40825
41348
  };
40826
41349
 
@@ -41968,7 +42491,8 @@ define('sap/viz/chart/components/datalabels/DataLabels',[
41968
42491
  'sap/viz/framework/common/util/ObjectUtils',
41969
42492
  'sap/viz/framework/common/util/FiscalUtil',
41970
42493
  "sap/viz/framework/common/util/GeometryUtils",
41971
- "sap/viz/framework/common/lang/LangManager"
42494
+ "sap/viz/framework/common/lang/LangManager",
42495
+ "sap/viz/framework/common/util/ACCStyleUtils"
41972
42496
  ], function (oo,
41973
42497
  TimeUtil,
41974
42498
  TypeUtils,
@@ -41986,7 +42510,8 @@ define('sap/viz/chart/components/datalabels/DataLabels',[
41986
42510
  ObjectUtils,
41987
42511
  FiscalUtil,
41988
42512
  GeometryUtils,
41989
- langManager) {
42513
+ langManager,
42514
+ ACCStyleUtils) {
41990
42515
 
41991
42516
  function defaultRenderer(config) {
41992
42517
  var text = SVG.create("text");
@@ -42386,6 +42911,8 @@ define('sap/viz/chart/components/datalabels/DataLabels',[
42386
42911
  };
42387
42912
 
42388
42913
  DataLabels.prototype._setDataLabelColor = function(item, range, backgroundColor, color, referColor) {
42914
+ var enableAccUpdates = this._properties.origin.get('interaction.enableAccUpdates') || false;
42915
+ var outOfDataPoint, backColor, fill, textColor;
42389
42916
  if(!color || range === 'outside'){
42390
42917
  //dataLabelColor may need to be calculated.
42391
42918
  //check if dataLabel "covers" dataPoint.
@@ -42399,20 +42926,59 @@ define('sap/viz/chart/components/datalabels/DataLabels',[
42399
42926
  backColor = (outOfDataPoint ? backgroundColor : referColor) || "#000000";
42400
42927
  }
42401
42928
  if(backColor){
42402
- color = ColorUtil.getDataLabelColor(backColor);
42403
- var fill = this.runtime().effectManager().register({
42404
- fillColor: color
42405
- });
42929
+ fill = null;
42930
+ if (!item.fillName) {
42931
+ item.fillName = ACCStyleUtils.getNameByColor(backColor);
42932
+ }
42933
+ if (enableAccUpdates && !outOfDataPoint) {
42934
+ textColor = ACCStyleUtils.getTextColor(item.fillName);
42935
+ fill = textColor;
42936
+ DataLabels.prototype._setTextShadow(item, item.fillName);
42937
+ } else {
42938
+ color = ColorUtil.getDataLabelColor(backColor);
42939
+ fill = this.runtime().effectManager().register({
42940
+ fillColor: color
42941
+ });
42942
+ }
42406
42943
  item.node.setAttribute("fill", fill);
42407
42944
  }
42945
+ } else if (color && enableAccUpdates) {
42946
+ // only areaDataLabels need to check if the data label is out of the data point
42947
+ if (this.constructor.name === 'AreaDataLabels') {
42948
+ // use this maybe is AreaDataLabels, not DataLabels.
42949
+ // AreaDataLabels.isDataLabelOutOfDataPoint return false
42950
+ // so we need to check if the data label is out of the data point.
42951
+ var selfProto = DataLabels.prototype;
42952
+ outOfDataPoint = selfProto.isDataLabelOutOfDataPoint(item.node, item);
42953
+ if (outOfDataPoint) {
42954
+ fill = item.fillName ? item.fillName : referColor;
42955
+ textColor = ACCStyleUtils.getTextColor(fill);
42956
+ if (textColor) {
42957
+ item.node.setAttribute("fill", textColor);
42958
+ }
42959
+ }
42960
+ selfProto._setTextShadow(item, fill);
42961
+ }
42962
+ }
42963
+ };
42964
+
42965
+ DataLabels.prototype._setTextShadow = function(item, fill) {
42966
+ var textShadow = ACCStyleUtils.getTextShadowStyle(fill);
42967
+ if (textShadow) {
42968
+ item.node.firstChild.setAttribute("style", 'text-shadow: ' + textShadow + ';');
42408
42969
  }
42409
42970
  };
42410
42971
 
42411
42972
  DataLabels.prototype.updateColor = function(dataLabelInfos, backgroundColor) {
42412
42973
  var dataLabelColor = this._properties.get('style.color');
42413
42974
  var range = this._properties.get("style.colorRange");
42975
+ var rules = this._properties.origin.get('plotArea.dataPointStyle') &&
42976
+ this._properties.origin.get('plotArea.dataPointStyle').rules || [];
42414
42977
  for (var iG = 0; iG < dataLabelInfos.length; iG++) {
42415
42978
  var item = dataLabelInfos[iG];
42979
+ if (rules.length === item.length) {
42980
+ item.fillName = rules[iG].properties && rules[iG].properties.color;
42981
+ }
42416
42982
  if (item.node) {
42417
42983
  this._setDataLabelColor(item, range, backgroundColor, dataLabelColor, item.referColor);
42418
42984
  }
@@ -48197,7 +48763,8 @@ define('sap/viz/chart/components/plots/BasePlot',[
48197
48763
  "sap/viz/framework/interaction/utils/PlotZoomUtils",
48198
48764
  "sap/viz/chart/components/util/ZoomUtil",
48199
48765
  "sap/viz/chart/components/util/ColorUtil",
48200
- 'sap/viz/framework/common/util/TimeUtil'
48766
+ 'sap/viz/framework/common/util/TimeUtil',
48767
+ 'sap/viz/framework/common/util/ACCStyleUtils'
48201
48768
  ], function Setup(
48202
48769
  oo,
48203
48770
  ObjectUtils,
@@ -48222,7 +48789,8 @@ define('sap/viz/chart/components/plots/BasePlot',[
48222
48789
  PlotZoomUtils,
48223
48790
  ZoomUtil,
48224
48791
  ColorUtil,
48225
- TimeUtil
48792
+ TimeUtil,
48793
+ ACCStyleUtils
48226
48794
  ) {
48227
48795
  var CSSCLASS = Constants.CSS.CLASS;
48228
48796
 
@@ -49233,11 +49801,33 @@ define('sap/viz/chart/components/plots/BasePlot',[
49233
49801
  config.matchSemantic = true;
49234
49802
  }
49235
49803
 
49236
- if (result.properties.stroke) {
49237
- config.graphic.stroke = result.properties.stroke;
49804
+ var excludeChart = ['info/treemap', 'info/pie', 'info/heatmap', 'info/donut'];
49805
+ var isExcludedChartType = false;
49806
+ if(excludeChart.indexOf(this._semanticMgr._chartType) >= 0){
49807
+ isExcludedChartType = true;
49238
49808
  }
49239
- if (result.properties.strokeWidth) {
49240
- config.graphic.strokeWidth = result.properties.strokeWidth;
49809
+ var enableAccUpdates = this._properties.origin.get('interaction.enableAccUpdates') || false;
49810
+
49811
+ if (enableAccUpdates && !isExcludedChartType) {
49812
+ var theme = ACCStyleUtils.getTheme(config.effectManager._template.name);
49813
+ if (this._checkColorContrast(config, theme)) {
49814
+ if (result.properties.stroke) {
49815
+ config.graphic.stroke = result.properties.stroke;
49816
+ }
49817
+ if (result.properties.strokeWidth) {
49818
+ config.graphic.strokeWidth = result.properties.strokeWidth;
49819
+ }
49820
+ } else {
49821
+ config.graphic.stroke = ACCStyleUtils.getBorderColor(result.properties.color);
49822
+ config.graphic.strokeWidth = ACCStyleUtils.getBorderWidth();
49823
+ }
49824
+ } else {
49825
+ if (result.properties.stroke) {
49826
+ config.graphic.stroke = result.properties.stroke;
49827
+ }
49828
+ if (result.properties.strokeWidth) {
49829
+ config.graphic.strokeWidth = result.properties.strokeWidth;
49830
+ }
49241
49831
  }
49242
49832
  }
49243
49833
 
@@ -49245,6 +49835,23 @@ define('sap/viz/chart/components/plots/BasePlot',[
49245
49835
  return config;
49246
49836
  };
49247
49837
 
49838
+ BasePlot.prototype._checkColorContrast = function (config, theme) {
49839
+ if (!config.graphic.fill) {
49840
+ return;
49841
+ }
49842
+ var textVisible = this._properties.get("dataLabel.visible");
49843
+ var chartType = this._runtime._semanticMgr._chartType;
49844
+ var threshold = ACCStyleUtils.getThreshold(theme, chartType, textVisible);
49845
+ var backgroundColor = this._getBackgroundColor();
49846
+ var fillColor = config.graphic.fill;
49847
+
49848
+ if (backgroundColor && fillColor) {
49849
+ var ratioObj = ColorUtil.checkColorContrast(backgroundColor, fillColor, threshold);
49850
+ return ratioObj.meetsThreshold;
49851
+ }
49852
+ return false;
49853
+ };
49854
+
49248
49855
  BasePlot.prototype._getColor = function(data) {
49249
49856
  var color = null;
49250
49857
  if (this._data.color2 && data.color2) {
@@ -52818,6 +53425,7 @@ define('sap/viz/chart/behavior/config/DataPointBehaviorConfigForBar',[
52818
53425
  "supportedChartTypes": barType2
52819
53426
  },
52820
53427
  "handler": function(event, service) {
53428
+ var isAccEnable = service.getProperties().get("interaction.enableAccUpdates");
52821
53429
  service.fireEvent(event, true);
52822
53430
  service._getDecorationLayer().clear();
52823
53431
  var gray = event.data.isGray;
@@ -55323,7 +55931,7 @@ define('sap/viz/chart/components/plots/StackedColumnPlot',[
55323
55931
  config = configs[i];
55324
55932
  position = positions[i];
55325
55933
  if (i === 0) {
55326
- x0 = position.x;
55934
+ x0 = position.x;
55327
55935
  y0 = position.y;
55328
55936
  x1 = x0 + config.graphic.width;
55329
55937
  y1 = y0 + config.graphic.height;
@@ -55420,11 +56028,7 @@ define('sap/viz/chart/components/plots/StackedColumnPlot',[
55420
56028
  if (cpRenderer.update) {
55421
56029
  if (config.graphic.pattern === "noFill") {
55422
56030
  config.path = this._generatePath(config.graphic, cfg);
55423
- if (config.isZero) {
55424
- config.graphic.pathStrokeWidth = 0;
55425
- } else {
55426
- config.graphic.pathStrokeWidth = 3;
55427
- }
56031
+ config.graphic.pathStrokeWidth = config.isZero ? 0 : 3;
55428
56032
  }
55429
56033
  cpRenderer.update(dataPointG, config);
55430
56034
  }
@@ -55435,11 +56039,7 @@ define('sap/viz/chart/components/plots/StackedColumnPlot',[
55435
56039
  } else {
55436
56040
  if (config.graphic.pattern === "noFill") {
55437
56041
  config.path = this._generatePath(config.graphic, cfg);
55438
- if (config.isZero) {
55439
- config.graphic.pathStrokeWidth = 0;
55440
- } else {
55441
- config.graphic.pathStrokeWidth = 3;
55442
- }
56042
+ config.graphic.pathStrokeWidth = config.isZero ? 0 : 3;
55443
56043
  clonedGraphic = ObjectUtils.clone(config.graphic);
55444
56044
  delete clonedGraphic.bgColor;
55445
56045
  delete clonedGraphic.drawingEffect;
@@ -55448,7 +56048,7 @@ define('sap/viz/chart/components/plots/StackedColumnPlot',[
55448
56048
  }
55449
56049
  node = cpRenderer(config);
55450
56050
  if (clonedGraphic) {
55451
- shadowNode = cpRenderer({graphic: clonedGraphic});
56051
+ shadowNode = cpRenderer({ graphic: clonedGraphic });
55452
56052
  }
55453
56053
 
55454
56054
  dataPointG = SVG.create("g");
@@ -75623,6 +76223,11 @@ define('sap/viz/chart/components/plots/PiePlot',[
75623
76223
 
75624
76224
  oo.extend(PiePlot, BasePlot);
75625
76225
 
76226
+ PiePlot.prototype._buildWrapperConfig = function (data, position, context, option) {
76227
+ option = option || {};
76228
+ return PiePlot.superclass._buildWrapperConfig.call(this, data, position, context, option);
76229
+ };
76230
+
75626
76231
  PiePlot.prototype.destroy = function() {
75627
76232
  PiePlot.superclass.destroy.call(this);
75628
76233
  this._dataPointRenderer = null;
@@ -76523,13 +77128,15 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
76523
77128
  'sap/viz/chart/components/util/TextUtils',
76524
77129
  'sap/viz/chart/components/util/ColorUtil',
76525
77130
  "sap/viz/framework/common/util/NameColorUtils",
76526
- 'sap/viz/framework/common/util/Constants'
77131
+ 'sap/viz/framework/common/util/Constants',
77132
+ 'sap/viz/framework/common/util/ACCStyleUtils'
76527
77133
  ], function(SVG,
76528
77134
  DataGraphics,
76529
77135
  TextUtils,
76530
77136
  ColorUtil,
76531
77137
  NameColorUtils,
76532
- Constants) {
77138
+ Constants,
77139
+ ACCStyleUtils) {
76533
77140
  var textLength = function(config) {
76534
77141
  var data = config.data;
76535
77142
  var labelStyle = config.styles;
@@ -76703,6 +77310,7 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
76703
77310
  var color, fill;
76704
77311
  var d = config.data;
76705
77312
  var bgColor = NameColorUtils.convertColor(d.color) || '0x000000';
77313
+ var enableAcc = config.enableAcc;
76706
77314
  var props = config.props;
76707
77315
  if (props.dimensionLabel.style.color) {
76708
77316
  color = props.dimensionLabel.style.color;
@@ -76710,12 +77318,16 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
76710
77318
  if (config.isLeafItem) {
76711
77319
  if (props.dataLabel.visible && props.dataLabel.style.color) {
76712
77320
  if(props.dataLabel.style.colorRange === 'outside'){
76713
- color = ColorUtil.getDataLabelColor(bgColor);
77321
+ color = enableAcc ? ACCStyleUtils.getTextColor(bgColor)
77322
+ :
77323
+ ColorUtil.getDataLabelColor(bgColor);
76714
77324
  }else{
76715
77325
  color = props.dataLabel.style.color;
76716
77326
  }
76717
77327
  } else {
76718
- color = ColorUtil.getDataLabelColor(bgColor);
77328
+ color = enableAcc ? ACCStyleUtils.getTextColor(bgColor)
77329
+ :
77330
+ ColorUtil.getDataLabelColor(bgColor);
76719
77331
  }
76720
77332
  } else {
76721
77333
  color = textColor(config);
@@ -76724,10 +77336,17 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
76724
77336
  return color;
76725
77337
  };
76726
77338
 
77339
+ var getTextShadow = function(config) {
77340
+ var d = config.data;
77341
+ var bgColor = NameColorUtils.convertColor(d.color) || '0x000000';
77342
+ return ACCStyleUtils.getTextShadowStyle(bgColor);
77343
+ };
77344
+
76727
77345
  var treeMapDimensionLabelRenderer = function(config) {
76728
77346
  var label = SVG.create("text");
76729
77347
  var labelStyle = config.styles;
76730
77348
  var fill = labelStyle.color ? labelStyle.color : getLabelColor(config);
77349
+ var textShadow = labelStyle.textShadow ? labelStyle.textShadow : getTextShadow(config);
76731
77350
  label.setAttribute("fill", fill);
76732
77351
  label.setAttribute("font-size", labelStyle.fontSize);
76733
77352
  label.setAttribute("stroke", "none");
@@ -76736,6 +77355,9 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
76736
77355
  label.setAttribute("font-family", labelStyle.fontFamily);
76737
77356
  label.setAttribute('fill-opacity', 1);
76738
77357
  label.setAttribute('aria-hidden','true');
77358
+ if (config.enableAcc) {
77359
+ label.setAttribute('style', "text-shadow:" + textShadow + ";");
77360
+ }
76739
77361
  label.value = config.data.label;
76740
77362
  label.textContent = getText(config);
76741
77363
  locateLabels(label, config);
@@ -78109,12 +78731,15 @@ define('sap/viz/chart/components/plots/treemap/TreeMapPlot',[
78109
78731
  var fontFamily = LABEL_STYLE["fontFamily"];
78110
78732
  var fontStyle = LABEL_STYLE["fontStyle"];
78111
78733
  var fontColor = LABEL_STYLE["color"];
78734
+ var textShadow = LABEL_STYLE["textShadow"];
78735
+ var enableAcc = _self._properties.origin.get('interaction.enableAccUpdates');
78112
78736
  var styles = {
78113
78737
  fontSize : fontSize,
78114
78738
  fontWeight : fontWeight,
78115
78739
  fontFamily : fontFamily,
78116
78740
  fontStyle : fontStyle,
78117
- color: fontColor
78741
+ color: fontColor,
78742
+ textShadow: textShadow
78118
78743
  };
78119
78744
  var context = {
78120
78745
  ctx: ctx.ctx,
@@ -78125,7 +78750,8 @@ define('sap/viz/chart/components/plots/treemap/TreeMapPlot',[
78125
78750
  isLeafItem: isLeafItem,
78126
78751
  textAnchor: textAnchor,
78127
78752
  borderWidth: _self._borderWidth,
78128
- padding: padding
78753
+ padding: padding,
78754
+ enableAcc: enableAcc
78129
78755
  };
78130
78756
  var label = dimensionLabelRenderer(context, TreeMapDimensionLabelRenderer.expose);
78131
78757
  if(label) {
@@ -78792,6 +79418,9 @@ define(
78792
79418
  };
78793
79419
 
78794
79420
  MBCLegend.prototype.render = function (selection, needRender) {
79421
+
79422
+ var isAccEnable = this._properties.origin.get('interaction.enableAccUpdates');
79423
+ var isInteractive = !this._properties.origin.get('interaction.noninteractiveMode');
78795
79424
  if(this.isInSemanticMode()){
78796
79425
  selection.selectAll('g.v-mbc-content').remove();
78797
79426
  ColorLegend.prototype.render.apply(this, arguments);
@@ -79059,6 +79688,19 @@ define(
79059
79688
  }
79060
79689
 
79061
79690
  var infos = calMarkerAndTextInfo(labelsData);
79691
+ var isMinimumSizeInHorizontal = (that._orientation === 'top' ||
79692
+ that._orientation === 'bottom') &&
79693
+ that._mbcLA_markerSize.width < 25;
79694
+ var isMinimumSizeInVertical = (that._orientation === 'left' ||
79695
+ that._orientation === 'right') &&
79696
+ that._mbcLA_markerSize.height < 25;
79697
+ if (isAccEnable && isInteractive){
79698
+ if (isMinimumSizeInHorizontal || isMinimumSizeInVertical
79699
+ ) {
79700
+ selection.selectAll('g.v-content').remove();
79701
+ return this;
79702
+ }
79703
+ }
79062
79704
  var makerWrapper = wrap.selectAll('rect.v-marker').data(infos.marker);
79063
79705
  makerWrapper.exit().remove();
79064
79706
  makerWrapper.enter().append('rect');
@@ -79505,7 +80147,6 @@ define(
79505
80147
  }
79506
80148
  }
79507
80149
  }
79508
-
79509
80150
  if (this._orientation === 'top' || this._orientation === 'bottom') {
79510
80151
  this._mbcLA_markerSize.width = h;
79511
80152
  this._mbcLA_markerSize.height = H_MARKERSIZE.height;
@@ -80880,6 +81521,7 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
80880
81521
  "sap/viz/framework/common/util/UADetector",
80881
81522
  'sap/viz/framework/common/util/DataUtils',
80882
81523
  "sap/viz/chart/components/util/ColorUtil",
81524
+ "sap/viz/framework/common/util/ACCStyleUtils",
80883
81525
  "sap/viz/chart/components/accessibility/ChartComponentNavigatorFactory",
80884
81526
  "sap/viz/chart/components/accessibility/HeatMapDataPointNavigator",
80885
81527
  "sap/viz/chart/components/util/ChartConstants",
@@ -80901,6 +81543,7 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
80901
81543
  UADetector,
80902
81544
  DataUtils,
80903
81545
  ColorUtil,
81546
+ ACCStyleUtils,
80904
81547
  ChartNavigator,
80905
81548
  DataPointNavigator,
80906
81549
  ChartConstants) {
@@ -81157,7 +81800,8 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
81157
81800
  dataLabelColor: this._properties.get("dataLabel.style.color"),
81158
81801
  ellipsisText: this._ellipsisText,
81159
81802
  ellipsisOptions: ellipsisOptions,
81160
- colorRange : this._properties.get("dataLabel.style.colorRange")
81803
+ colorRange : this._properties.get("dataLabel.style.colorRange"),
81804
+ enableAccUpdates: this._properties.origin.get('interaction.enableAccUpdates') || false
81161
81805
  };
81162
81806
 
81163
81807
 
@@ -81224,6 +81868,14 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
81224
81868
  if (!fontColor) {
81225
81869
  fontColor = ColorUtil.getDataLabelColor(context.background);
81226
81870
  }
81871
+
81872
+ var enableAccUpdates = context.enableAccUpdates;
81873
+ var textShadow = null;
81874
+ if (enableAccUpdates) {
81875
+ var referColor = context.referColor || context.background;
81876
+ fontColor = ACCStyleUtils.getTextColor(referColor);
81877
+ textShadow = ACCStyleUtils.getTextShadowStyle(referColor);
81878
+ }
81227
81879
 
81228
81880
  fontSize = TextUtils.validateFontStyle(fontSize);
81229
81881
  fontWeight = TextUtils.validateFontStyle(fontWeight);
@@ -81240,6 +81892,9 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
81240
81892
  styleStr += "font-family:" + fontFamily + ";";
81241
81893
  styleStr += "font-style:" + fontStyle + ";";
81242
81894
  styleStr += "fill:" + fontColor + ";";
81895
+ if (textShadow) {
81896
+ styleStr += "text-shadow: " + textShadow + ";";
81897
+ }
81243
81898
 
81244
81899
  //set dimension label text in ellipsis mode if it is too long
81245
81900
  var textContent = null;
@@ -81274,13 +81929,15 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
81274
81929
  }
81275
81930
  }
81276
81931
 
81277
-
81278
- d3.select(textNode)
81932
+ var selection = d3.select(textNode)
81279
81933
  .attr("font-size", fontSize)
81280
81934
  .attr("font-weight", fontWeight)
81281
81935
  .attr("font-family", fontFamily)
81282
81936
  .attr("font-style", fontStyle)
81283
81937
  .attr("fill", fontColor);
81938
+ if (textShadow) {
81939
+ selection.style("text-shadow", textShadow);
81940
+ }
81284
81941
  }
81285
81942
  return textNode;
81286
81943
  }