@sapui5/sap.viz 1.139.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.
- package/package.json +1 -1
- package/src/sap/viz/.library +1 -1
- package/src/sap/viz/library.js +194 -1
- package/src/sap/viz/libs/sap-viz-info-charts.js +985 -170
- package/src/sap/viz/libs/sap-viz-info-framework.js +337 -14
- package/src/sap/viz/libs/sap-viz.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_ar.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_bg.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_ca.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_cs.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_cy.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_da.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_de.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_el.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_en.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_en_GB.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_en_US_sappsd.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_en_US_saprigi.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_en_US_saptrc.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_es.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_es_MX.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_et.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_fi.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_fr.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_fr_CA.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_he.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_hi.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_hr.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_hu.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_id.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_it.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_iw.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_ja.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_kk.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_ko.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_lt.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_lv.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_ms.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_nb.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_nl.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_no.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_pl.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_pt.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_pt_PT.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_rigi.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_ro.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_ru.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_sh.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_sk.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_sl.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_sr.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_sv.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_th.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_tr.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_uk.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_vi.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_zh_CN.js +1 -1
- package/src/sap/viz/resources/chart/langs/language_zh_TW.js +1 -1
- package/src/sap/viz/resources/chart/templates/standard_fiori/template.js +24 -4
- package/src/sap/viz/themes/base/shared.less +15 -1
- package/src/sap/viz/ui5/controls/VizFrame.js +2 -1
- package/src/sap/viz/ui5/controls/chartpopover/ContentPanel.js +1 -1
- package/src/sap/viz/ui5/core/BaseChartMetadata.js +1 -1
- package/src/sap/viz/ui5/theming/Util.js +37 -36
|
@@ -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,
|
|
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
|
|
|
@@ -7163,6 +7246,7 @@ define('sap/viz/chart/components/legend/ColorLegend',[
|
|
|
7163
7246
|
var HORIZONTAL_OFFSET = Constants.LEGEND.HORIZONTAL_OFFSET;
|
|
7164
7247
|
var INTERACTION_CLASS = Constants.CSS.CLASS.LEGENDITEM,
|
|
7165
7248
|
ID_CLASS = "v-legend-element";
|
|
7249
|
+
var MIN_ELEMENT_SIZE = Constants.MIN_INTERACTIVE_ELEMENT_SIZE;
|
|
7166
7250
|
|
|
7167
7251
|
function ColorLegend(runtime, options) {
|
|
7168
7252
|
ColorLegend.superclass.constructor.apply(this, arguments);
|
|
@@ -8134,6 +8218,8 @@ define('sap/viz/chart/components/legend/ColorLegend',[
|
|
|
8134
8218
|
colorMarkerSize = colorMarkerSize && parseFloat(colorMarkerSize);
|
|
8135
8219
|
var isHorizontal = this.isHorizontal();
|
|
8136
8220
|
var isScrollable = this._isScrollable();
|
|
8221
|
+
var isAccEnable = this._properties.origin.get('interaction.enableAccUpdates');
|
|
8222
|
+
var isInteractive = !this._properties.origin.get('interaction.noninteractiveMode');
|
|
8137
8223
|
var paddingBottom = markerMargin.bottom * textHeight;
|
|
8138
8224
|
var markerSize = this._colorLabelSize * textHeight;
|
|
8139
8225
|
var markerWidth = this._getMarkerWidth(markerSize);
|
|
@@ -8146,6 +8232,10 @@ define('sap/viz/chart/components/legend/ColorLegend',[
|
|
|
8146
8232
|
markerWidth = this._getMarkerWidth(markerSize);
|
|
8147
8233
|
eachRowHeight = (1 + markerMargin.bottom) * colorMarkerSize;
|
|
8148
8234
|
}
|
|
8235
|
+
var isMinimumSize = eachRowHeight < MIN_ELEMENT_SIZE;
|
|
8236
|
+
if(isAccEnable && isInteractive && isMinimumSize){
|
|
8237
|
+
eachRowHeight = MIN_ELEMENT_SIZE;
|
|
8238
|
+
}
|
|
8149
8239
|
this._markerSize = markerSize;
|
|
8150
8240
|
|
|
8151
8241
|
var textWidthLimit = cDomain.maxWidth - paddingWidth - markerWidth;
|
|
@@ -8202,6 +8292,12 @@ define('sap/viz/chart/components/legend/ColorLegend',[
|
|
|
8202
8292
|
var textY = ((overallHeight - textHeight) / 2 + bottom);
|
|
8203
8293
|
var postRenderX = markerSize / 2 + HORIZONTAL_OFFSET;
|
|
8204
8294
|
var postRenderY = overallHeight / 2 + bottom;
|
|
8295
|
+
if(isAccEnable && isInteractive && isMinimumSize){
|
|
8296
|
+
bottom = (MIN_ELEMENT_SIZE - textHeight) / 2;
|
|
8297
|
+
textY = bottom;
|
|
8298
|
+
shapeY = eachRowHeight / 2;
|
|
8299
|
+
postRenderY = eachRowHeight / 2 ;
|
|
8300
|
+
}
|
|
8205
8301
|
|
|
8206
8302
|
cDomain.shapeX = shapeX;
|
|
8207
8303
|
cDomain.shapeY = shapeY;
|
|
@@ -9931,6 +10027,7 @@ return {
|
|
|
9931
10027
|
"plotArea.dataPoint.stroke.color": "#000000",
|
|
9932
10028
|
"plotArea.dataPoint.stroke.visible": false,
|
|
9933
10029
|
"title.alignment": "center",
|
|
10030
|
+
"title.ariaLevel": 2,
|
|
9934
10031
|
"title.layout.height": null,
|
|
9935
10032
|
"title.layout.maxHeight": 0.2,
|
|
9936
10033
|
"title.layout.respectPlotPosition": true,
|
|
@@ -10015,6 +10112,7 @@ return {
|
|
|
10015
10112
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
10016
10113
|
"interaction.deselected.stroke.visible": false,
|
|
10017
10114
|
"interaction.deselected.stroke.width": "1px",
|
|
10115
|
+
"interaction.enableAccUpdates": false,
|
|
10018
10116
|
"interaction.enableDeselectAll": true,
|
|
10019
10117
|
"interaction.enableInternalEvents": {
|
|
10020
10118
|
"access": "internal",
|
|
@@ -10033,6 +10131,7 @@ return {
|
|
|
10033
10131
|
"interaction.hover.stroke.width": "2px",
|
|
10034
10132
|
"interaction.keyboard.color": "#000000",
|
|
10035
10133
|
"interaction.keyboard.width": "1px",
|
|
10134
|
+
"interaction.keyboard.style": "solid",
|
|
10036
10135
|
"interaction.noninteractiveMode": false,
|
|
10037
10136
|
"interaction.selectability.axisLabelSelection": true,
|
|
10038
10137
|
"interaction.selectability.behavior": {
|
|
@@ -10243,6 +10342,7 @@ return {
|
|
|
10243
10342
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
10244
10343
|
"interaction.deselected.stroke.visible": false,
|
|
10245
10344
|
"interaction.deselected.stroke.width": "1px",
|
|
10345
|
+
"interaction.enableAccUpdates": false,
|
|
10246
10346
|
"interaction.enableDeselectAll": true,
|
|
10247
10347
|
"interaction.enableInternalEvents": {
|
|
10248
10348
|
"access": "internal",
|
|
@@ -10262,6 +10362,7 @@ return {
|
|
|
10262
10362
|
"interaction.hover.stroke.width": "2px",
|
|
10263
10363
|
"interaction.keyboard.color": "#000000",
|
|
10264
10364
|
"interaction.keyboard.width": "1px",
|
|
10365
|
+
"interaction.keyboard.style": "solid",
|
|
10265
10366
|
"interaction.noninteractiveMode": false,
|
|
10266
10367
|
"interaction.selectability.axisLabelSelection": true,
|
|
10267
10368
|
"interaction.selectability.behavior": {
|
|
@@ -10505,6 +10606,7 @@ return {
|
|
|
10505
10606
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
10506
10607
|
"interaction.deselected.stroke.visible": false,
|
|
10507
10608
|
"interaction.deselected.stroke.width": "1px",
|
|
10609
|
+
"interaction.enableAccUpdates": false,
|
|
10508
10610
|
"interaction.enableDeselectAll": true,
|
|
10509
10611
|
"interaction.enableInternalEvents": {
|
|
10510
10612
|
"access": "internal",
|
|
@@ -10524,6 +10626,7 @@ return {
|
|
|
10524
10626
|
"interaction.hover.stroke.width": "2px",
|
|
10525
10627
|
"interaction.keyboard.color": "#000000",
|
|
10526
10628
|
"interaction.keyboard.width": "1px",
|
|
10629
|
+
"interaction.keyboard.style": "solid",
|
|
10527
10630
|
"interaction.noninteractiveMode": false,
|
|
10528
10631
|
"interaction.selectability.behavior": {
|
|
10529
10632
|
"access": "internal",
|
|
@@ -10680,6 +10783,7 @@ return {
|
|
|
10680
10783
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
10681
10784
|
"interaction.deselected.stroke.visible": false,
|
|
10682
10785
|
"interaction.deselected.stroke.width": "1px",
|
|
10786
|
+
"interaction.enableAccUpdates": false,
|
|
10683
10787
|
"interaction.enableDeselectAll": true,
|
|
10684
10788
|
"interaction.enableInternalEvents": {
|
|
10685
10789
|
"access": "internal",
|
|
@@ -10699,6 +10803,7 @@ return {
|
|
|
10699
10803
|
"interaction.hover.stroke.width": "2px",
|
|
10700
10804
|
"interaction.keyboard.color": "#000000",
|
|
10701
10805
|
"interaction.keyboard.width": "1px",
|
|
10806
|
+
"interaction.keyboard.style": "solid",
|
|
10702
10807
|
"interaction.noninteractiveMode": false,
|
|
10703
10808
|
"interaction.selectability.behavior": {
|
|
10704
10809
|
"access": "internal",
|
|
@@ -10940,6 +11045,7 @@ return {
|
|
|
10940
11045
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
10941
11046
|
"interaction.deselected.stroke.visible": false,
|
|
10942
11047
|
"interaction.deselected.stroke.width": "1px",
|
|
11048
|
+
"interaction.enableAccUpdates": false,
|
|
10943
11049
|
"interaction.enableDeselectAll": true,
|
|
10944
11050
|
"interaction.enableInternalEvents": {
|
|
10945
11051
|
"access": "internal",
|
|
@@ -10959,6 +11065,7 @@ return {
|
|
|
10959
11065
|
"interaction.hover.stroke.width": "2px",
|
|
10960
11066
|
"interaction.keyboard.color": "#000000",
|
|
10961
11067
|
"interaction.keyboard.width": "1px",
|
|
11068
|
+
"interaction.keyboard.style": "solid",
|
|
10962
11069
|
"interaction.noninteractiveMode": false,
|
|
10963
11070
|
"interaction.selectability.axisLabelSelection": true,
|
|
10964
11071
|
"interaction.selectability.behavior": {
|
|
@@ -11222,6 +11329,7 @@ return {
|
|
|
11222
11329
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
11223
11330
|
"interaction.deselected.stroke.visible": false,
|
|
11224
11331
|
"interaction.deselected.stroke.width": "1px",
|
|
11332
|
+
"interaction.enableAccUpdates": false,
|
|
11225
11333
|
"interaction.enableDeselectAll": true,
|
|
11226
11334
|
"interaction.enableInternalEvents": {
|
|
11227
11335
|
"access": "internal",
|
|
@@ -11613,6 +11721,7 @@ return {
|
|
|
11613
11721
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
11614
11722
|
"interaction.deselected.stroke.visible": false,
|
|
11615
11723
|
"interaction.deselected.stroke.width": "1px",
|
|
11724
|
+
"interaction.enableAccUpdates": false,
|
|
11616
11725
|
"interaction.enableDeselectAll": true,
|
|
11617
11726
|
"interaction.enableInternalEvents": {
|
|
11618
11727
|
"access": "internal",
|
|
@@ -12066,6 +12175,7 @@ return {
|
|
|
12066
12175
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
12067
12176
|
"interaction.deselected.stroke.visible": false,
|
|
12068
12177
|
"interaction.deselected.stroke.width": "1px",
|
|
12178
|
+
"interaction.enableAccUpdates": false,
|
|
12069
12179
|
"interaction.enableDeselectAll": true,
|
|
12070
12180
|
"interaction.enableInternalEvents": {
|
|
12071
12181
|
"access": "internal",
|
|
@@ -12084,6 +12194,7 @@ return {
|
|
|
12084
12194
|
"interaction.hover.stroke.width": "2px",
|
|
12085
12195
|
"interaction.keyboard.color": "#000000",
|
|
12086
12196
|
"interaction.keyboard.width": "1px",
|
|
12197
|
+
"interaction.keyboard.style": "solid",
|
|
12087
12198
|
"interaction.noninteractiveMode": false,
|
|
12088
12199
|
"interaction.selectability.axisLabelSelection": true,
|
|
12089
12200
|
"interaction.selectability.behavior": {
|
|
@@ -14074,6 +14185,7 @@ return {
|
|
|
14074
14185
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
14075
14186
|
"interaction.deselected.stroke.visible": false,
|
|
14076
14187
|
"interaction.deselected.stroke.width": "1px",
|
|
14188
|
+
"interaction.enableAccUpdates": false,
|
|
14077
14189
|
"interaction.enableDeselectAll": true,
|
|
14078
14190
|
"interaction.enableInternalEvents": {
|
|
14079
14191
|
"access": "internal",
|
|
@@ -14093,6 +14205,7 @@ return {
|
|
|
14093
14205
|
"interaction.hover.stroke.width": "2px",
|
|
14094
14206
|
"interaction.keyboard.color": "#000000",
|
|
14095
14207
|
"interaction.keyboard.width": "1px",
|
|
14208
|
+
"interaction.keyboard.style": "solid",
|
|
14096
14209
|
"interaction.noninteractiveMode": false,
|
|
14097
14210
|
"interaction.selectability.axisLabelSelection": true,
|
|
14098
14211
|
"interaction.selectability.behavior": {
|
|
@@ -14274,6 +14387,7 @@ return {
|
|
|
14274
14387
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
14275
14388
|
"interaction.deselected.stroke.visible": false,
|
|
14276
14389
|
"interaction.deselected.stroke.width": "1px",
|
|
14390
|
+
"interaction.enableAccUpdates": false,
|
|
14277
14391
|
"interaction.enableDeselectAll": true,
|
|
14278
14392
|
"interaction.enableInternalEvents": {
|
|
14279
14393
|
"access": "internal",
|
|
@@ -14671,6 +14785,7 @@ return {
|
|
|
14671
14785
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
14672
14786
|
"interaction.deselected.stroke.visible": false,
|
|
14673
14787
|
"interaction.deselected.stroke.width": "1px",
|
|
14788
|
+
"interaction.enableAccUpdates": false,
|
|
14674
14789
|
"interaction.enableDeselectAll": true,
|
|
14675
14790
|
"interaction.enableInternalEvents": {
|
|
14676
14791
|
"access": "internal",
|
|
@@ -14690,6 +14805,7 @@ return {
|
|
|
14690
14805
|
"interaction.hover.stroke.width": "2px",
|
|
14691
14806
|
"interaction.keyboard.color": "#000000",
|
|
14692
14807
|
"interaction.keyboard.width": "1px",
|
|
14808
|
+
"interaction.keyboard.style": "solid",
|
|
14693
14809
|
"interaction.noninteractiveMode": false,
|
|
14694
14810
|
"interaction.selectability.axisLabelSelection": true,
|
|
14695
14811
|
"interaction.selectability.behavior": {
|
|
@@ -15063,6 +15179,7 @@ return {
|
|
|
15063
15179
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
15064
15180
|
"interaction.deselected.stroke.visible": false,
|
|
15065
15181
|
"interaction.deselected.stroke.width": "1px",
|
|
15182
|
+
"interaction.enableAccUpdates": false,
|
|
15066
15183
|
"interaction.enableDeselectAll": true,
|
|
15067
15184
|
"interaction.enableInternalEvents": {
|
|
15068
15185
|
"access": "internal",
|
|
@@ -15082,6 +15199,7 @@ return {
|
|
|
15082
15199
|
"interaction.hover.stroke.width": "2px",
|
|
15083
15200
|
"interaction.keyboard.color": "#000000",
|
|
15084
15201
|
"interaction.keyboard.width": "1px",
|
|
15202
|
+
"interaction.keyboard.style": "solid",
|
|
15085
15203
|
"interaction.noninteractiveMode": false,
|
|
15086
15204
|
"interaction.selectability.axisLabelSelection": true,
|
|
15087
15205
|
"interaction.selectability.behavior": {
|
|
@@ -16496,6 +16614,7 @@ return {
|
|
|
16496
16614
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
16497
16615
|
"interaction.deselected.stroke.visible": false,
|
|
16498
16616
|
"interaction.deselected.stroke.width": "1px",
|
|
16617
|
+
"interaction.enableAccUpdates": false,
|
|
16499
16618
|
"interaction.enableDeselectAll": true,
|
|
16500
16619
|
"interaction.enableInternalEvents": {
|
|
16501
16620
|
"access": "internal",
|
|
@@ -16515,6 +16634,7 @@ return {
|
|
|
16515
16634
|
"interaction.hover.stroke.width": "2px",
|
|
16516
16635
|
"interaction.keyboard.color": "#000000",
|
|
16517
16636
|
"interaction.keyboard.width": "1px",
|
|
16637
|
+
"interaction.keyboard.style": "solid",
|
|
16518
16638
|
"interaction.noninteractiveMode": false,
|
|
16519
16639
|
"interaction.selectByTimeAxisGroup": {
|
|
16520
16640
|
"access": "internal",
|
|
@@ -16807,6 +16927,7 @@ return {
|
|
|
16807
16927
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
16808
16928
|
"interaction.deselected.stroke.visible": false,
|
|
16809
16929
|
"interaction.deselected.stroke.width": "1px",
|
|
16930
|
+
"interaction.enableAccUpdates": false,
|
|
16810
16931
|
"interaction.enableDeselectAll": true,
|
|
16811
16932
|
"interaction.enableInternalEvents": {
|
|
16812
16933
|
"access": "internal",
|
|
@@ -16826,6 +16947,7 @@ return {
|
|
|
16826
16947
|
"interaction.hover.stroke.width": "2px",
|
|
16827
16948
|
"interaction.keyboard.color": "#000000",
|
|
16828
16949
|
"interaction.keyboard.width": "1px",
|
|
16950
|
+
"interaction.keyboard.style": "solid",
|
|
16829
16951
|
"interaction.noninteractiveMode": false,
|
|
16830
16952
|
"interaction.selectability.axisLabelSelection": true,
|
|
16831
16953
|
"interaction.selectability.behavior": {
|
|
@@ -17095,6 +17217,7 @@ return {
|
|
|
17095
17217
|
"interaction.deselected.stroke.color": "darken(20%)",
|
|
17096
17218
|
"interaction.deselected.stroke.visible": false,
|
|
17097
17219
|
"interaction.deselected.stroke.width": "1px",
|
|
17220
|
+
"interaction.enableAccUpdates": false,
|
|
17098
17221
|
"interaction.enableDeselectAll": true,
|
|
17099
17222
|
"interaction.enableInternalEvents": {
|
|
17100
17223
|
"access": "internal",
|
|
@@ -17114,6 +17237,7 @@ return {
|
|
|
17114
17237
|
"interaction.hover.stroke.width": "2px",
|
|
17115
17238
|
"interaction.keyboard.color": "#000000",
|
|
17116
17239
|
"interaction.keyboard.width": "1px",
|
|
17240
|
+
"interaction.keyboard.style": "solid",
|
|
17117
17241
|
"interaction.noninteractiveMode": false,
|
|
17118
17242
|
"interaction.selectability.axisLabelSelection": true,
|
|
17119
17243
|
"interaction.selectability.behavior": {
|
|
@@ -17914,16 +18038,22 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
|
|
|
17914
18038
|
if (!isTriggerable(service) || isOnFirstLastOnlyAxis(event, service)) {
|
|
17915
18039
|
return;
|
|
17916
18040
|
}
|
|
17917
|
-
|
|
18041
|
+
var isAccEnable = service && service.getProperties().get("interaction.enableAccUpdates");
|
|
17918
18042
|
var isRadarChart = service._getRenderType().indexOf("radar") > -1;
|
|
17919
18043
|
var polarAxis = "plotArea.polarAxis";
|
|
17920
18044
|
var axisName = isRadarChart ? polarAxis : getAxisName(event);
|
|
17921
18045
|
service.fireEvent("processUnhighlight");
|
|
17922
18046
|
var color = service.getProperties().get(axisName + ".hoverShadow.color");
|
|
17923
18047
|
if (color) {
|
|
17924
|
-
|
|
17925
|
-
|
|
17926
|
-
|
|
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
|
+
}
|
|
17927
18057
|
}
|
|
17928
18058
|
|
|
17929
18059
|
//get targets. Hovering on data points does not support trellis.
|
|
@@ -18072,9 +18202,19 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
|
|
|
18072
18202
|
}
|
|
18073
18203
|
|
|
18074
18204
|
var color;
|
|
18205
|
+
var lineColor = service.getProperties().get("interaction.selected.stroke.color");
|
|
18206
|
+
var outlineWidth = service.getProperties().get("interaction.keyboard.width");
|
|
18207
|
+
|
|
18075
18208
|
if(isTriggerable(service)) {
|
|
18209
|
+
var radar = service._getChartType().toLowerCase() === 'radar';
|
|
18076
18210
|
var axisName = getAxisName(event);
|
|
18211
|
+
|
|
18212
|
+
if(radar){
|
|
18213
|
+
axisName = 'plotArea.polarAxis';
|
|
18214
|
+
}
|
|
18215
|
+
|
|
18077
18216
|
color = service.getProperties().get(axisName+".mouseDownShadow.color");
|
|
18217
|
+
|
|
18078
18218
|
}
|
|
18079
18219
|
else if(isTimeAxisTriggerable(service)) {
|
|
18080
18220
|
color = service.getProperties().get("timeAxis"+".mouseDownShadow.color");
|
|
@@ -18082,13 +18222,19 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
|
|
|
18082
18222
|
else {
|
|
18083
18223
|
return;
|
|
18084
18224
|
}
|
|
18225
|
+
|
|
18085
18226
|
service.getNodes(service.NodeType.AXIS_ITEM_BACKGROUND)
|
|
18086
18227
|
.attr("fill", "transparent")
|
|
18087
18228
|
.classed(CSS_CLASS.HOVER_SHADOW, false);
|
|
18229
|
+
|
|
18230
|
+
var label_selector = service.NodeType.AXIS_ITEM_BACKGROUND.get('value');
|
|
18231
|
+
|
|
18088
18232
|
if (color) {
|
|
18089
|
-
d3.select(event.data.currentTarget).select(
|
|
18233
|
+
d3.select(event.data.currentTarget).select(label_selector)
|
|
18090
18234
|
.attr("fill", color)
|
|
18091
|
-
.classed(CSS_CLASS.FOCUS_SHADOW, true)
|
|
18235
|
+
.classed(CSS_CLASS.FOCUS_SHADOW, true)
|
|
18236
|
+
.attr("stroke", lineColor)
|
|
18237
|
+
.attr("stroke-width", outlineWidth);
|
|
18092
18238
|
}
|
|
18093
18239
|
};
|
|
18094
18240
|
|
|
@@ -18098,7 +18244,13 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
|
|
|
18098
18244
|
}
|
|
18099
18245
|
var color;
|
|
18100
18246
|
if(isTriggerable(service)) {
|
|
18247
|
+
var radar = service._getChartType().toLowerCase() === 'radar';
|
|
18101
18248
|
var axisName = getAxisName(event);
|
|
18249
|
+
|
|
18250
|
+
if(radar){
|
|
18251
|
+
axisName = 'plotArea.polarAxis';
|
|
18252
|
+
}
|
|
18253
|
+
|
|
18102
18254
|
color = service.getProperties().get(axisName+".hoverShadow.color");
|
|
18103
18255
|
}
|
|
18104
18256
|
else if(isTimeAxisTriggerable(service)) {
|
|
@@ -18113,10 +18265,13 @@ define('sap/viz/chart/behavior/config/handler/AxisBehaviorHandler',[
|
|
|
18113
18265
|
if (UADetector.isMobile()) {
|
|
18114
18266
|
axisBackground.classed(CSS_CLASS.HOVER_SHADOW, false);
|
|
18115
18267
|
} else {
|
|
18268
|
+
var label_selector = service.NodeType.AXIS_ITEM_BACKGROUND.get('value');
|
|
18116
18269
|
if (color) {
|
|
18117
|
-
d3.select(event.data.currentTarget).select(
|
|
18270
|
+
d3.select(event.data.currentTarget).select(label_selector)
|
|
18118
18271
|
.attr("fill", color)
|
|
18119
|
-
.classed(CSS_CLASS.HOVER_SHADOW, true)
|
|
18272
|
+
.classed(CSS_CLASS.HOVER_SHADOW, true)
|
|
18273
|
+
.attr("stroke", null)
|
|
18274
|
+
.attr("stroke-width", null);
|
|
18120
18275
|
}
|
|
18121
18276
|
}
|
|
18122
18277
|
};
|
|
@@ -20405,7 +20560,9 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
|
|
|
20405
20560
|
'sap/viz/framework/common/util/DOM',
|
|
20406
20561
|
"sap/viz/framework/common/util/DataGraphics",
|
|
20407
20562
|
"sap/viz/framework/common/util/TypeUtils",
|
|
20408
|
-
"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"
|
|
20409
20566
|
], function(
|
|
20410
20567
|
Constants,
|
|
20411
20568
|
SDKConstants,
|
|
@@ -20418,7 +20575,9 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
|
|
|
20418
20575
|
DOM,
|
|
20419
20576
|
DataGraphics,
|
|
20420
20577
|
TypeUtils,
|
|
20421
|
-
ContextualDataUtil
|
|
20578
|
+
ContextualDataUtil,
|
|
20579
|
+
ACCStyleUtils,
|
|
20580
|
+
ColorUtil
|
|
20422
20581
|
) {
|
|
20423
20582
|
var BehaviorConstants = SDKConstants.BEHAVIOR;
|
|
20424
20583
|
var CSS_CLASS = Constants.CSS.CLASS;
|
|
@@ -21430,7 +21589,7 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
|
|
|
21430
21589
|
|
|
21431
21590
|
var plot = service.getModule("main.plot");
|
|
21432
21591
|
var dataModel = service.getDataModel();
|
|
21433
|
-
|
|
21592
|
+
|
|
21434
21593
|
elements.forEach(function (e) {
|
|
21435
21594
|
if(service.isTrellis()){
|
|
21436
21595
|
//bar
|
|
@@ -21445,7 +21604,6 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
|
|
|
21445
21604
|
HighlightHelper.drawStroke(service, e, 'path, rect', prop.stroke, 2);
|
|
21446
21605
|
HighlightHelper.drawFill(service, e, 'path, rect', prop, isMarkerRendererExist, true);
|
|
21447
21606
|
} else {
|
|
21448
|
-
//bar
|
|
21449
21607
|
if (!event.data.byKeyboard) {
|
|
21450
21608
|
var extraData = DataGraphics.getData(e);
|
|
21451
21609
|
HighlightHelper.drawStroke(service, e, 'rect', prop.stroke, 2, undefined, extraData);
|
|
@@ -21480,7 +21638,7 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
|
|
|
21480
21638
|
|
|
21481
21639
|
var plot = service.getModule("main.plot");
|
|
21482
21640
|
var dataModel = service.getDataModel();
|
|
21483
|
-
|
|
21641
|
+
var isAccEnable = service.getProperties().get("interaction.enableAccUpdates");
|
|
21484
21642
|
elements.forEach(function (e) {
|
|
21485
21643
|
var dataId = DataPointUtils.getDataPointId(e);
|
|
21486
21644
|
var dataPoint = dataModel.getDataPoint(dataId);
|
|
@@ -21514,6 +21672,29 @@ define('sap/viz/chart/behavior/config/handler/DataPointBehaviorHandler',[
|
|
|
21514
21672
|
}
|
|
21515
21673
|
}else{
|
|
21516
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
|
+
}
|
|
21517
21698
|
HighlightHelper.drawStroke(service, e, 'rect', prop.stroke, width, undefined, extraData);
|
|
21518
21699
|
HighlightHelper.drawFill(service, e, 'rect, path', prop, isMarkerRendererExist);
|
|
21519
21700
|
}
|
|
@@ -27394,6 +27575,10 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
|
|
|
27394
27575
|
var HOURS = "hours";
|
|
27395
27576
|
var MINUTES = "minutes";
|
|
27396
27577
|
var SENCONDS = "senconds";
|
|
27578
|
+
var CATEGORY_LABEL_ID = "categorylabel-id";
|
|
27579
|
+
var LEGEND_ITEM = Constants.CSS.CLASS.LEGENDITEM;
|
|
27580
|
+
var MBC_LEGEND_ITEM = Constants.CSS.CLASS.MBCLEGENDITEM;
|
|
27581
|
+
var SELECTED = Constants.CSS.CLASS.SELECTED;
|
|
27397
27582
|
|
|
27398
27583
|
var setNonInteractiveScreenReaderDesc = function(chartArguments, service) {
|
|
27399
27584
|
|
|
@@ -27492,6 +27677,7 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
|
|
|
27492
27677
|
var valuesArray;
|
|
27493
27678
|
var ctx;
|
|
27494
27679
|
var units = service.getStatusManager().get("data.unit");
|
|
27680
|
+
var isSelectionFeedback = service.getProperties().get('legend.selectionFeedback');
|
|
27495
27681
|
switch (tabOrder) {
|
|
27496
27682
|
case 1:
|
|
27497
27683
|
if (isTreeMap(service) && !targetId){
|
|
@@ -27586,7 +27772,12 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
|
|
|
27586
27772
|
//.attr('aria-posinset', DataPointUtils.getDataId(target) + 1)
|
|
27587
27773
|
// .attr('aria-setsize', service.getDataModel().getDataPointCount())
|
|
27588
27774
|
if (!isNonInteractive) {
|
|
27589
|
-
d3.select(target).
|
|
27775
|
+
var parent = d3.select(target).node().parentNode;
|
|
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);
|
|
27780
|
+
d3.select(parent).attr("role", "listbox");
|
|
27590
27781
|
}
|
|
27591
27782
|
break;
|
|
27592
27783
|
case 2:
|
|
@@ -27595,7 +27786,10 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
|
|
|
27595
27786
|
text = (isTimeseries ? ' Time Axis Item ' : ' Category Axis Item ') + text;
|
|
27596
27787
|
text += DataGraphics.getContext(target).text;
|
|
27597
27788
|
if (!isNonInteractive) {
|
|
27598
|
-
d3.select(target).
|
|
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);
|
|
27599
27793
|
}
|
|
27600
27794
|
break;
|
|
27601
27795
|
case 3:
|
|
@@ -27648,7 +27842,7 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
|
|
|
27648
27842
|
});
|
|
27649
27843
|
}
|
|
27650
27844
|
if (!isNonInteractive) {
|
|
27651
|
-
d3.select(target).attr("role", "option")
|
|
27845
|
+
d3.select(target).attr("role", "option");
|
|
27652
27846
|
}
|
|
27653
27847
|
break;
|
|
27654
27848
|
}
|
|
@@ -27749,9 +27943,18 @@ define('sap/viz/chart/behavior/config/ScreenReaderUtil',[
|
|
|
27749
27943
|
}
|
|
27750
27944
|
text += ". ";
|
|
27751
27945
|
if(!isNonInteractive) {
|
|
27752
|
-
d3.select(target).attr('aria-label', text).attr("focusable", true)
|
|
27946
|
+
d3.select(target).attr('aria-label', text).attr("tabindex", 0).attr("focusable", true)
|
|
27753
27947
|
.style('outline', 'none');
|
|
27754
|
-
|
|
27948
|
+
if(isSelectionFeedback){
|
|
27949
|
+
var isLegendItemSelected = d3.select(target).attr('class').indexOf(LEGEND_ITEM + SELECTED);
|
|
27950
|
+
if(isLegendItemSelected > -1){
|
|
27951
|
+
d3.select(target).attr('aria-label', text + ' Selected');
|
|
27952
|
+
}
|
|
27953
|
+
var isMBCLegendItemSelected = d3.select(target).attr('class').indexOf(MBC_LEGEND_ITEM + SELECTED);
|
|
27954
|
+
if(isMBCLegendItemSelected > -1){
|
|
27955
|
+
d3.select(target).attr('aria-label', text + ' Selected');
|
|
27956
|
+
}
|
|
27957
|
+
}
|
|
27755
27958
|
if (typeof target.focus === "function") {
|
|
27756
27959
|
target.focus();
|
|
27757
27960
|
} else {
|
|
@@ -27913,11 +28116,13 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
27913
28116
|
var LEGEND_NODE_BOUND = Constants.CSS.CLASS.LEGEND_BOUND_SELECTION;
|
|
27914
28117
|
var PLOT_NODE_BOUND = Constants.CSS.CLASS.PLOT_BOUND_SELECTION;
|
|
27915
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;
|
|
27916
28120
|
var AXIS_ITEM_NODE_BOUND = Constants.CSS.CLASS.AXIS_ITEM_BOUND_SELECTION;
|
|
27917
28121
|
var DATAPOINTHOVER = Constants.CSS.CLASS.DATAPOINTHOVER;
|
|
27918
28122
|
var ZEROVALUEHOVER = Constants.CSS.CLASS.ZEROVALUEHOVER;
|
|
27919
28123
|
var ZERO_LINE_GROUP = Constants.CSS.CLASS.ZERO_LINE_GROUP;
|
|
27920
28124
|
var STACK = Constants.CSS.CLASS.STACK;
|
|
28125
|
+
var CLIPPATH = Constants.CSS.CLASS.CLIPPATH;
|
|
27921
28126
|
var FOCUS_INSIDE_CLASS = "v-focusInside";
|
|
27922
28127
|
var ZERO_FOCUS = {
|
|
27923
28128
|
RECT: 2,
|
|
@@ -28313,13 +28518,13 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28313
28518
|
if (dps) {
|
|
28314
28519
|
dps.forEach(function(target) {
|
|
28315
28520
|
highlightNode(mainBoundNode,
|
|
28316
|
-
d3.select(target), boundNode, highlightProps);
|
|
28521
|
+
d3.select(target), boundNode, highlightProps, service);
|
|
28317
28522
|
});
|
|
28318
28523
|
}
|
|
28319
28524
|
} else {
|
|
28320
28525
|
highlightNode(mainBoundNode, isTreeMapHeader ?
|
|
28321
28526
|
d3.select(hoveredTargetNode.parentNode) :
|
|
28322
|
-
d3.select(hoveredTargetNode), boundNode, highlightProps);
|
|
28527
|
+
d3.select(hoveredTargetNode), boundNode, highlightProps, service);
|
|
28323
28528
|
}
|
|
28324
28529
|
}
|
|
28325
28530
|
};
|
|
@@ -28424,7 +28629,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28424
28629
|
return closestNode;
|
|
28425
28630
|
};
|
|
28426
28631
|
|
|
28427
|
-
var highlightNode = function(mainBoundNode, hoverNode, selectBound, properties) {
|
|
28632
|
+
var highlightNode = function (mainBoundNode, hoverNode, selectBound, properties, service) {
|
|
28428
28633
|
blurNode(hoverNode);
|
|
28429
28634
|
var d3Node = hoverNode.select(selectBound),
|
|
28430
28635
|
currentNode = d3Node.node();
|
|
@@ -28432,7 +28637,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28432
28637
|
return;
|
|
28433
28638
|
}
|
|
28434
28639
|
var stackNode = d3.select(hoverNode.node().parentNode).node();
|
|
28435
|
-
var stackPos = TypeUtils.isExist(stackNode) ?
|
|
28640
|
+
var stackPos = TypeUtils.isExist(stackNode) ?
|
|
28436
28641
|
stackNode.getBoundingClientRect() : {};
|
|
28437
28642
|
var data = DataGraphics.getData(currentNode);
|
|
28438
28643
|
if (TypeUtils.isExist(data)) {
|
|
@@ -28441,63 +28646,87 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28441
28646
|
var svgRect = currentNode.getBoundingClientRect(),
|
|
28442
28647
|
digitalWidth = parseFloat(properties.width) || 1,
|
|
28443
28648
|
dasharray = digitalWidth + ', ' + digitalWidth;
|
|
28649
|
+
|
|
28650
|
+
if(properties.style && properties.style.toLowerCase() === 'solid'){
|
|
28651
|
+
dasharray = 'none';
|
|
28652
|
+
}
|
|
28653
|
+
|
|
28444
28654
|
var boundNode = hoverNode.append("g").attr("class", "v-m-highlight");
|
|
28445
28655
|
var bound = {
|
|
28446
28656
|
rect: null,
|
|
28447
|
-
line: null
|
|
28657
|
+
line: null,
|
|
28658
|
+
polygon: null
|
|
28448
28659
|
};
|
|
28449
|
-
|
|
28450
28660
|
var isStackedChart;
|
|
28451
28661
|
if (properties.renderType) {
|
|
28452
28662
|
isStackedChart = properties.renderType.indexOf('stacked') > -1;
|
|
28453
28663
|
}
|
|
28454
|
-
|
|
28455
28664
|
var angle = properties.angle;
|
|
28456
|
-
|
|
28665
|
+
var isAccEnable = service && service.getProperties().get("interaction.enableAccUpdates");
|
|
28666
|
+
properties.width = properties.width ? parseFloat(properties.width.split('px')[0]) : 1;
|
|
28457
28667
|
if (isStackedChart && properties.isZeroValueInStack && properties.isZeroOnFirstTab) {
|
|
28458
28668
|
bound.line = boundNode.append('line').attr('class', 'v-highlight-bound')
|
|
28459
28669
|
.attr("stroke", properties.color)
|
|
28460
28670
|
.attr("stroke-width", properties.width).attr("stroke-dasharray", dasharray)
|
|
28461
28671
|
.style("pointer-events", "none" );
|
|
28462
28672
|
} else {
|
|
28463
|
-
|
|
28464
|
-
|
|
28465
|
-
.
|
|
28466
|
-
|
|
28467
|
-
|
|
28468
|
-
|
|
28469
|
-
|
|
28470
|
-
.
|
|
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
|
+
}
|
|
28471
28700
|
}
|
|
28472
28701
|
|
|
28473
28702
|
if (selectBound === "rect" || selectBound === "path") {
|
|
28474
28703
|
var transform = SVG.getTransformToElement(currentNode, hoverNode.node());
|
|
28475
|
-
var axisNode = d3.select(CATEGORYAXIS_NODE_BOUND).node() ||
|
|
28704
|
+
var axisNode = d3.select(CATEGORYAXIS_NODE_BOUND).node() ||
|
|
28476
28705
|
d3.select(CATEGORYAXIS2_NODE_BOUND).node() || d3.select(TIMEAXIS_NODE_BOUND).node();
|
|
28477
|
-
var axisPos = TypeUtils.isExist(axisNode) ?
|
|
28706
|
+
var axisPos = TypeUtils.isExist(axisNode) ?
|
|
28478
28707
|
axisNode.getBoundingClientRect() : {};
|
|
28479
28708
|
var plotNode = d3.select(PLOT_NODE_BOUND).node();
|
|
28480
|
-
var plotPos = TypeUtils.isExist(plotNode) ?
|
|
28709
|
+
var plotPos = TypeUtils.isExist(plotNode) ?
|
|
28481
28710
|
plotNode.getBoundingClientRect() : {};
|
|
28482
28711
|
var zeroLineNode = d3.select('.' + ZERO_LINE_GROUP).node();
|
|
28483
|
-
var zeroLinePos = TypeUtils.isExist(zeroLineNode) ?
|
|
28712
|
+
var zeroLinePos = TypeUtils.isExist(zeroLineNode) ?
|
|
28484
28713
|
zeroLineNode.getBoundingClientRect() : {};
|
|
28485
28714
|
var wtfLineNode = [];
|
|
28486
28715
|
if (properties.isZeroValue) {
|
|
28487
28716
|
var wtf = d3.selectAll('.v-wtf-linkline');
|
|
28488
|
-
for (var
|
|
28489
|
-
wtfLineNode.push(wtf[0][
|
|
28717
|
+
for (var q = 0; q < wtf[0].length; ++q) {
|
|
28718
|
+
wtfLineNode.push(wtf[0][q]);
|
|
28490
28719
|
}
|
|
28491
28720
|
}
|
|
28492
28721
|
var hoverPos = boundNode.node().getBoundingClientRect();
|
|
28493
|
-
var wtfLinePos = wtfLineNode.length > 0 ?
|
|
28722
|
+
var wtfLinePos = wtfLineNode.length > 0 ?
|
|
28494
28723
|
getWTFLineNode(wtfLineNode, hoverPos, !properties.isVerticalRender).getBoundingClientRect() : {};
|
|
28495
28724
|
if (properties.isZeroValue && properties.isZeroOnFirstTab) {
|
|
28496
28725
|
if (properties.isVerticalRender) {
|
|
28497
|
-
properties.bCloseCategory = (axisPos.top <= hoverPos.top) ||
|
|
28726
|
+
properties.bCloseCategory = (axisPos.top <= hoverPos.top) ||
|
|
28498
28727
|
(plotPos.top <= hoverPos.top);
|
|
28499
28728
|
} else {
|
|
28500
|
-
properties.bCloseCategory = (axisPos.right <= hoverPos.left) ||
|
|
28729
|
+
properties.bCloseCategory = (axisPos.right <= hoverPos.left) ||
|
|
28501
28730
|
(plotPos.right <= hoverPos.left);
|
|
28502
28731
|
}
|
|
28503
28732
|
}
|
|
@@ -28507,14 +28736,14 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28507
28736
|
}
|
|
28508
28737
|
transform = reShapeTransform(transform, properties);
|
|
28509
28738
|
boundNode.attr("transform", "translate(" + transform.e + "," + transform.f + ") " +
|
|
28510
|
-
|
|
28739
|
+
"scale(" + transform.a + "," + transform.d + ") ");
|
|
28511
28740
|
} else {
|
|
28512
28741
|
var posTransformLine, negTransformLine;
|
|
28513
28742
|
negTransformLine = {
|
|
28514
|
-
a: properties.isVerticalRender ? 0 :
|
|
28515
|
-
isPercentageStackedChart(properties.renderType) ?
|
|
28516
|
-
|
|
28517
|
-
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) ?
|
|
28518
28747
|
0.5 * ZERO_FOCUS.LINE : (-1) * 0.5 * ZERO_FOCUS.LINE : 0
|
|
28519
28748
|
};
|
|
28520
28749
|
posTransformLine = negTransformLine;
|
|
@@ -28550,11 +28779,11 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28550
28779
|
}
|
|
28551
28780
|
if (TypeUtils.isExist(bound.line) || TypeUtils.isExist(bound.rect)) {
|
|
28552
28781
|
var pos = {
|
|
28553
|
-
plotPos: plotPos,
|
|
28782
|
+
plotPos: plotPos,
|
|
28554
28783
|
axisPos: axisPos,
|
|
28555
28784
|
zeroLine: {
|
|
28556
28785
|
zeroLinePos: zeroLinePos,
|
|
28557
|
-
strokeWidth: TypeUtils.isExist(zeroLineNode) ?
|
|
28786
|
+
strokeWidth: TypeUtils.isExist(zeroLineNode) ?
|
|
28558
28787
|
parseFloat(zeroLineNode.getAttribute('stroke-width')) : 0
|
|
28559
28788
|
},
|
|
28560
28789
|
hoverPos: hoverPos,
|
|
@@ -28623,19 +28852,21 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28623
28852
|
var parentRect = mainBoundNode.getBoundingClientRect();
|
|
28624
28853
|
var intersectionBoundRect = BoundingBox.intersection(parentRect, svgRect);
|
|
28625
28854
|
if (intersectionBoundRect) {
|
|
28626
|
-
|
|
28627
|
-
.attr("
|
|
28628
|
-
|
|
28629
|
-
|
|
28630
|
-
|
|
28631
|
-
|
|
28632
|
-
|
|
28633
|
-
|
|
28634
|
-
|
|
28635
|
-
|
|
28636
|
-
|
|
28637
|
-
|
|
28638
|
-
|
|
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
|
+
}
|
|
28639
28870
|
}
|
|
28640
28871
|
}
|
|
28641
28872
|
}
|
|
@@ -28689,6 +28920,52 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28689
28920
|
}
|
|
28690
28921
|
};
|
|
28691
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
|
+
|
|
28692
28969
|
var clearAllHoveredEffectAndStatus = function(service) {
|
|
28693
28970
|
var hoveredTarget = service.getStatus("keyArrowHoveredDataPoint");
|
|
28694
28971
|
if (isTreeMap(service) && hoveredTarget) {
|
|
@@ -28724,7 +29001,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28724
29001
|
service.setStatus("hoveredLegendLabelId", null);
|
|
28725
29002
|
service.setStatus("hoveredRadarLabelId", null);
|
|
28726
29003
|
|
|
28727
|
-
service._rootNode.selectAll('
|
|
29004
|
+
service._rootNode.selectAll('[focusable="true"]').attr('focusable', null);
|
|
28728
29005
|
};
|
|
28729
29006
|
|
|
28730
29007
|
// make sure the direct handle functions only 2 parameters
|
|
@@ -28764,6 +29041,13 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28764
29041
|
var renderType = service._getRenderType();
|
|
28765
29042
|
var isTreeMapHeader = false;
|
|
28766
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
|
+
}
|
|
28767
29051
|
|
|
28768
29052
|
switch (tabOrder) {
|
|
28769
29053
|
case 1:
|
|
@@ -28950,8 +29234,10 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28950
29234
|
if(axisBody.isOnlyShowingFirstAndLastLabel && axisBody.isOnlyShowingFirstAndLastLabel()){
|
|
28951
29235
|
return;
|
|
28952
29236
|
}
|
|
28953
|
-
|
|
28954
29237
|
boundNode = AXIS_ITEM_NODE_BOUND;
|
|
29238
|
+
if(isAccEnable && !this._isTimeseries) {
|
|
29239
|
+
boundNode = AXIS_ITEM_NODE_BOUND_ACC;
|
|
29240
|
+
}
|
|
28955
29241
|
componentNavigator = this._isTimeseries ? this[TIMEAXIS_NAVIGATOR] :
|
|
28956
29242
|
((tabOrder == 2) ? this[CATEGORYAXIS_NAVIGATOR] : this[CATEGORYAXIS2_NAVIGATOR]);
|
|
28957
29243
|
hoveredTargetNode = this._isTimeseries ? service.getStatus("keyArrowHoveredTimeLabel") :
|
|
@@ -28964,6 +29250,14 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
28964
29250
|
if(this._isTimeseries) {
|
|
28965
29251
|
componentNavigator.updateCells(
|
|
28966
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
|
+
}
|
|
28967
29261
|
}
|
|
28968
29262
|
hoveredTargetId = componentNavigator.getFirstStartPoint().id;
|
|
28969
29263
|
} else if(isFocusAgain){
|
|
@@ -29224,6 +29518,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29224
29518
|
};
|
|
29225
29519
|
|
|
29226
29520
|
var zoomKeyHandler = function(event, service) {
|
|
29521
|
+
var isAccEnable = service && service.getProperties().get("interaction.enableAccUpdates");
|
|
29227
29522
|
if (!service.getStatusManager().get("plot.zoom")) {
|
|
29228
29523
|
return;
|
|
29229
29524
|
}
|
|
@@ -29281,6 +29576,9 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29281
29576
|
hoveredCategoryId + "']");
|
|
29282
29577
|
service.setStatus("keyArrowHoveredTimeLabel", hoveredTarget);
|
|
29283
29578
|
} else {
|
|
29579
|
+
if(isAccEnable) {
|
|
29580
|
+
boundNode = AXIS_ITEM_NODE_BOUND_ACC;
|
|
29581
|
+
}
|
|
29284
29582
|
//Here use categoryLabel-id to query label because lazy rendering will mis-delete previous dom
|
|
29285
29583
|
hoveredCategoryId = service.getStatus("hoveredCategoryLabelId");
|
|
29286
29584
|
categoryGroupNode = service.getNodes(service.NodeType.CATEGORY_LABEL_GROUP);
|
|
@@ -29420,6 +29718,8 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29420
29718
|
KeyboardBehaviorHandler.prototype = {
|
|
29421
29719
|
initialized: function(event, service) {
|
|
29422
29720
|
service.setStatus("tabOrder", -1);
|
|
29721
|
+
service.setStatus("backwardsTabbing", false);
|
|
29722
|
+
service.setStatus("backwardsTabbingIdx", 1);
|
|
29423
29723
|
this[MAIN_NODE] = service.getNodes(service.NodeType.MAIN_NODE);
|
|
29424
29724
|
this[LEGEND_GROUP] = service.getNodes(service.NodeType.LEGEND_GROUP);
|
|
29425
29725
|
this[PLOT_NODE] = service.getNodes(service.NodeType.PLOT_NODE);
|
|
@@ -29660,6 +29960,8 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29660
29960
|
service.removeStatus("tabOrder");
|
|
29661
29961
|
service.removeStatus("hoveredTimeLabelId");
|
|
29662
29962
|
service.removeStatus("orgHoveredTimeLabelId");
|
|
29963
|
+
service.removeStatus("backwardsTabbing");
|
|
29964
|
+
service.removeStatus("backwardsTabbingIdx");
|
|
29663
29965
|
},
|
|
29664
29966
|
|
|
29665
29967
|
uparrowHandler: function(event, service) {
|
|
@@ -29707,9 +30009,11 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29707
30009
|
});
|
|
29708
30010
|
var mainBoundNode = mainNode.select(boundNode).node();
|
|
29709
30011
|
highlightNode(mainBoundNode, d3.select(mainBoundNode.parentNode),
|
|
29710
|
-
".v-bound", highlightProps);
|
|
30012
|
+
".v-bound", highlightProps, service);
|
|
29711
30013
|
}
|
|
29712
30014
|
};
|
|
30015
|
+
var backwardstabbing = service.getStatus("backwardsTabbing");
|
|
30016
|
+
var backwardsTabbingIdx = service.getStatus("backwardsTabbingIdx");
|
|
29713
30017
|
|
|
29714
30018
|
if (currentIdx === -1) {
|
|
29715
30019
|
if (!shiftKey){
|
|
@@ -29720,7 +30024,13 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29720
30024
|
currentIdx = -1;
|
|
29721
30025
|
releaseTab = true;
|
|
29722
30026
|
}
|
|
30027
|
+
//entry point from backwards tabbing
|
|
30028
|
+
if(backwardstabbing && shiftKey){
|
|
30029
|
+
currentIdx = backwardsTabbingIdx;
|
|
30030
|
+
releaseTab = false;
|
|
30031
|
+
}
|
|
29723
30032
|
service.setStatus("tabOrder", currentIdx);
|
|
30033
|
+
service.setStatus("backwardsTabbing", false);
|
|
29724
30034
|
} else {
|
|
29725
30035
|
switch (currentIdx) {
|
|
29726
30036
|
case 1:
|
|
@@ -29746,10 +30056,12 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29746
30056
|
}else {
|
|
29747
30057
|
currentIdx = -1;
|
|
29748
30058
|
releaseTab = true;
|
|
30059
|
+
backwardstabbing = true;
|
|
29749
30060
|
}
|
|
29750
30061
|
} else {
|
|
29751
30062
|
currentIdx = -1;
|
|
29752
30063
|
releaseTab = true;
|
|
30064
|
+
service._rootNode.selectAll('[tabindex="0"]').attr('tabindex', null);
|
|
29753
30065
|
}
|
|
29754
30066
|
break;
|
|
29755
30067
|
case 2:
|
|
@@ -29767,6 +30079,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29767
30079
|
else {
|
|
29768
30080
|
currentIdx = -1;
|
|
29769
30081
|
releaseTab = true;
|
|
30082
|
+
backwardstabbing = true;
|
|
29770
30083
|
}
|
|
29771
30084
|
} else {
|
|
29772
30085
|
boundNode = PLOT_NODE_BOUND;
|
|
@@ -29782,6 +30095,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29782
30095
|
} else {
|
|
29783
30096
|
currentIdx = -1;
|
|
29784
30097
|
releaseTab = true;
|
|
30098
|
+
backwardstabbing = true;
|
|
29785
30099
|
}
|
|
29786
30100
|
} else {
|
|
29787
30101
|
if (service._getRenderType().indexOf('radar') > -1) {
|
|
@@ -29805,6 +30119,7 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29805
30119
|
if (!shiftKey) {
|
|
29806
30120
|
currentIdx = -1;
|
|
29807
30121
|
releaseTab = true;
|
|
30122
|
+
backwardstabbing = true;
|
|
29808
30123
|
} else if (legendModule && legendModule.isVisible()) {
|
|
29809
30124
|
mainNode = this[LEGEND_GROUP];
|
|
29810
30125
|
boundNode = LEGEND_NODE_BOUND;
|
|
@@ -29822,10 +30137,17 @@ define('sap/viz/chart/behavior/config/handler/KeyboardBehaviorHandler',[
|
|
|
29822
30137
|
mode: "infoMode",
|
|
29823
30138
|
action: "interrupt"
|
|
29824
30139
|
});
|
|
30140
|
+
|
|
30141
|
+
if(currentIdx>0){
|
|
30142
|
+
service.setStatus("backwardsTabbingIdx", currentIdx);
|
|
30143
|
+
}
|
|
30144
|
+
|
|
29825
30145
|
service.setStatus("tabOrder", currentIdx);
|
|
30146
|
+
service.setStatus("backwardsTabbing", backwardstabbing);
|
|
29826
30147
|
|
|
29827
30148
|
if (releaseTab) {
|
|
29828
30149
|
clearAllHoveredEffectAndStatus(service);
|
|
30150
|
+
clearTabIndexForTabbingOut(service);
|
|
29829
30151
|
if (event && event.data && event.data.rootHandler) {
|
|
29830
30152
|
d3.select(event.data.rootHandler).classed(FOCUS_INSIDE_CLASS, false);
|
|
29831
30153
|
}
|
|
@@ -32817,7 +33139,6 @@ define('sap/viz/chart/views/ChartView',[
|
|
|
32817
33139
|
|
|
32818
33140
|
this._rootContainer = rootElement.node().parentNode;
|
|
32819
33141
|
if (this._rootContainer) {
|
|
32820
|
-
this._rootContainer.setAttribute("tabIndex", this._properties.get('general.tabIndex'));
|
|
32821
33142
|
if (this._outline.visible || this._properties.get("interaction.enableKeyboard")) {
|
|
32822
33143
|
this._rootContainer.style.outline = null;
|
|
32823
33144
|
} else {
|
|
@@ -35083,9 +35404,10 @@ define('sap/viz/chart/components/axis/sub/AxisTitle',[
|
|
|
35083
35404
|
"sap/viz/framework/common/util/UADetector",
|
|
35084
35405
|
"sap/viz/framework/common/util/NameColorUtils",
|
|
35085
35406
|
"sap/viz/framework/common/util/DataGraphics",
|
|
35086
|
-
"sap/viz/migrate/PropertyUtil"
|
|
35407
|
+
"sap/viz/migrate/PropertyUtil",
|
|
35408
|
+
"sap/viz/framework/common/util/ACCStyleUtils"
|
|
35087
35409
|
], function(Constants, oo, AxisComponent, TypeUtils, NumberUtils, StyleUtils,
|
|
35088
|
-
TextUtils, UADetector, NameColorUtils, DataGraphics, PropertyUtil) {
|
|
35410
|
+
TextUtils, UADetector, NameColorUtils, DataGraphics, PropertyUtil, ACCStyleUtils) {
|
|
35089
35411
|
|
|
35090
35412
|
var AXIS_CLASS_NAMES = Constants.CSS.CLASS.AXIS;
|
|
35091
35413
|
|
|
@@ -35125,7 +35447,12 @@ define('sap/viz/chart/components/axis/sub/AxisTitle',[
|
|
|
35125
35447
|
if(this._isApplyAxisLineColor()){
|
|
35126
35448
|
value = this._properties.get('color');
|
|
35127
35449
|
}
|
|
35128
|
-
|
|
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;
|
|
35129
35456
|
};
|
|
35130
35457
|
|
|
35131
35458
|
AxisTitle.prototype.render = function(selection) {
|
|
@@ -35165,9 +35492,17 @@ define('sap/viz/chart/components/axis/sub/AxisTitle',[
|
|
|
35165
35492
|
NameColorUtils.convertColor(colorProps) :
|
|
35166
35493
|
styles.color
|
|
35167
35494
|
});
|
|
35168
|
-
var
|
|
35169
|
-
|
|
35170
|
-
|
|
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
|
+
}
|
|
35171
35506
|
|
|
35172
35507
|
var titleText = selection.append("g")
|
|
35173
35508
|
.attr("class", className)
|
|
@@ -35235,6 +35570,7 @@ define('sap/viz/chart/components/axis/sub/AxisTitle',[
|
|
|
35235
35570
|
!useCustomColor && !titleObj.noNeedApplyHiddenTitleColor) {
|
|
35236
35571
|
//note: you have to set v-hidden-title css after v-title (because of css rules)
|
|
35237
35572
|
tItem.attr("class", className + " " + hiddenClassName);
|
|
35573
|
+
tItem.attr("aria-hidden", true);
|
|
35238
35574
|
tItem.attr("fill", hiddenStyleColor);
|
|
35239
35575
|
}
|
|
35240
35576
|
|
|
@@ -35726,17 +36062,20 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
35726
36062
|
"sap/viz/framework/common/util/NumberUtils",
|
|
35727
36063
|
"sap/viz/framework/common/util/DataUtils",
|
|
35728
36064
|
"sap/viz/framework/common/util/ArrayUtils",
|
|
36065
|
+
'sap/viz/framework/common/util/Constants',
|
|
35729
36066
|
"sap/viz/chart/components/axis/renderer/DefaultCategoryLabelRenderer"
|
|
35730
36067
|
], function(
|
|
35731
36068
|
NumberUtils,
|
|
35732
36069
|
DataUtils,
|
|
35733
36070
|
ArrayUtils,
|
|
36071
|
+
Constants,
|
|
35734
36072
|
DefaultCategoryLabelRenderer
|
|
35735
36073
|
) {
|
|
35736
36074
|
|
|
35737
36075
|
var LABEL_OFFSET = 6;
|
|
35738
36076
|
var TICK_SIZE = 5;
|
|
35739
36077
|
var VERTICAL_ANGLE = 90;
|
|
36078
|
+
var MIN_ELEMENT_SIZE = Constants.MIN_INTERACTIVE_ELEMENT_SIZE;
|
|
35740
36079
|
|
|
35741
36080
|
var _buildUtils = {};
|
|
35742
36081
|
|
|
@@ -35951,7 +36290,8 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
35951
36290
|
}
|
|
35952
36291
|
var propStyle = config.propStyle;
|
|
35953
36292
|
var labelVisible = config.labelVisible;
|
|
35954
|
-
|
|
36293
|
+
var isAccEnable = axisBody._properties.origin.get('interaction.enableAccUpdates');
|
|
36294
|
+
var isInteractive = !axisBody._properties.origin.get('interaction.noninteractiveMode');
|
|
35955
36295
|
var checkLabelVisible = config.checkLabelVisible;
|
|
35956
36296
|
|
|
35957
36297
|
var truncatedLabelRatioSetting = +config.truncatedLabelRatioSetting;
|
|
@@ -36102,7 +36442,7 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
36102
36442
|
|
|
36103
36443
|
//determine initial step value
|
|
36104
36444
|
var len = filteredCells.length;
|
|
36105
|
-
step = noAutoHide ? 1 : _misc.getStep(filteredCells, 0, getPreferredSizeFn);
|
|
36445
|
+
step = noAutoHide ? 1 : _misc.getStep(axisBody, filteredCells, 0, getPreferredSizeFn);
|
|
36106
36446
|
if(truncatedLabelRatio === 1) {
|
|
36107
36447
|
//no rotation. So we have to check each label "noLabelSpace"
|
|
36108
36448
|
step = 1;
|
|
@@ -36135,7 +36475,7 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
36135
36475
|
labelNumber = 0;
|
|
36136
36476
|
j = -step;
|
|
36137
36477
|
//step changed
|
|
36138
|
-
step = _misc.getStep(filteredCells, prevIdx, getPreferredSizeFn);
|
|
36478
|
+
step = _misc.getStep(axisBody, filteredCells, prevIdx, getPreferredSizeFn);
|
|
36139
36479
|
continue;
|
|
36140
36480
|
}
|
|
36141
36481
|
prevIdx = j;
|
|
@@ -36250,6 +36590,9 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
36250
36590
|
minMinLayerBand = -offset;
|
|
36251
36591
|
}
|
|
36252
36592
|
refSize = NumberUtils.preciseSimple(maxRefSize + offset);
|
|
36593
|
+
if(isAccEnable && isInteractive && refSize < MIN_ELEMENT_SIZE){
|
|
36594
|
+
refSize = MIN_ELEMENT_SIZE;
|
|
36595
|
+
}
|
|
36253
36596
|
for (j = 0, jLength = cells.length; j < jLength; ++j) {
|
|
36254
36597
|
cell = cells[j];
|
|
36255
36598
|
cell.isVisible = false;
|
|
@@ -36269,6 +36612,10 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
36269
36612
|
if(config.isFlexibleLayers && (isVertical || layer.rotated)) {
|
|
36270
36613
|
layer.reCalculateLayerContext = true;
|
|
36271
36614
|
}
|
|
36615
|
+
|
|
36616
|
+
if(isAccEnable && isInteractive){
|
|
36617
|
+
layer.reCalculateLayerContext = false;
|
|
36618
|
+
}
|
|
36272
36619
|
} else {
|
|
36273
36620
|
maxMinLayerBand = 0;
|
|
36274
36621
|
var pSizeCache = [];
|
|
@@ -36302,7 +36649,13 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
36302
36649
|
if (maxRefSize < psize[cellRefSizeField]) {
|
|
36303
36650
|
maxRefSize = psize[cellRefSizeField];
|
|
36304
36651
|
}
|
|
36305
|
-
|
|
36652
|
+
var reCalcSize;
|
|
36653
|
+
if(isAccEnable && isInteractive){
|
|
36654
|
+
reCalcSize = MIN_ELEMENT_SIZE;
|
|
36655
|
+
}else{
|
|
36656
|
+
reCalcSize = psize[cellSizeField];
|
|
36657
|
+
}
|
|
36658
|
+
if (!noAutoHide && reCalcSize > cell[cellSizeField]) {
|
|
36306
36659
|
if(config.isFlexibleLayers) {
|
|
36307
36660
|
layer.reCalculateLayerContext = true;
|
|
36308
36661
|
}
|
|
@@ -36314,6 +36667,9 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
36314
36667
|
}
|
|
36315
36668
|
}
|
|
36316
36669
|
refSize = NumberUtils.preciseSimple(maxRefSize + offset);
|
|
36670
|
+
if(isAccEnable && isInteractive && refSize < MIN_ELEMENT_SIZE){
|
|
36671
|
+
refSize = MIN_ELEMENT_SIZE;
|
|
36672
|
+
}
|
|
36317
36673
|
|
|
36318
36674
|
var visibleLabelNum = 0;
|
|
36319
36675
|
for (j = 0, jLength = cells.length; j < jLength; ++j) {
|
|
@@ -36329,6 +36685,17 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
36329
36685
|
if(visibleLabelNum <= 0) {
|
|
36330
36686
|
layer.isVisible = false;
|
|
36331
36687
|
}
|
|
36688
|
+
var realSize;
|
|
36689
|
+
if(axisBody._isVertical()){
|
|
36690
|
+
realSize = axisBody._realSize.height;
|
|
36691
|
+
}else{
|
|
36692
|
+
realSize = axisBody._realSize.width;
|
|
36693
|
+
}
|
|
36694
|
+
var eachLabelSpace = realSize / layer.cells.length;
|
|
36695
|
+
if(isAccEnable && isInteractive && eachLabelSpace < MIN_ELEMENT_SIZE){
|
|
36696
|
+
layer.isVisible = false;
|
|
36697
|
+
continue;
|
|
36698
|
+
}
|
|
36332
36699
|
}
|
|
36333
36700
|
|
|
36334
36701
|
if(layer.reCalculateLayerContext) {
|
|
@@ -36441,7 +36808,7 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
36441
36808
|
var hideOverlappedLabels = function(allCells, layers, layerIndex, isVertical, cellsToShow,
|
|
36442
36809
|
cellsToMeasure, isAllowEmptySegement) {
|
|
36443
36810
|
//detect text height
|
|
36444
|
-
var labelBand;
|
|
36811
|
+
var labelBand;
|
|
36445
36812
|
for(var i = 0; i < allCells.length; i++) {
|
|
36446
36813
|
if(isVertical) {
|
|
36447
36814
|
if(allCells[i].contentHeight) {
|
|
@@ -37136,18 +37503,34 @@ define('sap/viz/chart/components/util/BuildLayerUtil',[
|
|
|
37136
37503
|
}
|
|
37137
37504
|
};
|
|
37138
37505
|
|
|
37139
|
-
_misc.getStep = function(cells, startIdx, getPreferredSizeFn) {
|
|
37506
|
+
_misc.getStep = function(axisBody, cells, startIdx, getPreferredSizeFn) {
|
|
37507
|
+
var isAccEnable = axisBody._properties.origin.get('interaction.enableAccUpdates');
|
|
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;
|
|
37140
37511
|
if (cells.length <= 1) {
|
|
37141
37512
|
return 1;
|
|
37142
37513
|
}
|
|
37143
37514
|
var step;
|
|
37144
37515
|
var cell0 = cells[startIdx];
|
|
37516
|
+
var start0 = cell0.cellStart;
|
|
37145
37517
|
var end0 = cell0.end - 0.001; //fix javascript precision issue
|
|
37146
37518
|
var len = cells.length;
|
|
37147
37519
|
var cell;
|
|
37148
37520
|
for (var j = startIdx + 1; j < len; j++) {
|
|
37149
37521
|
cell = cells[j];
|
|
37150
|
-
|
|
37522
|
+
var isSkip;
|
|
37523
|
+
if (isAccEnable && isInteractive){
|
|
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
|
+
}
|
|
37529
|
+
}else{
|
|
37530
|
+
isSkip = cell.cellStart >= end0;
|
|
37531
|
+
}
|
|
37532
|
+
//TODO: use cell.start to compare for better space usage
|
|
37533
|
+
if (isSkip){
|
|
37151
37534
|
for (var k = j; k < len; k++) {
|
|
37152
37535
|
getPreferredSizeFn(cells[k]);
|
|
37153
37536
|
if (cells[k].start >= end0) {
|
|
@@ -39336,6 +39719,97 @@ define('sap/viz/chart/components/axis/ValueAxis',[
|
|
|
39336
39719
|
return ValueAxis;
|
|
39337
39720
|
});
|
|
39338
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
|
+
});
|
|
39339
39813
|
define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
39340
39814
|
"sap/viz/framework/common/util/Constants",
|
|
39341
39815
|
"sap/viz/framework/common/util/ArrayUtils",
|
|
@@ -39348,6 +39822,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
39348
39822
|
"sap/viz/framework/common/util/PositionUtil",
|
|
39349
39823
|
"sap/viz/framework/common/util/RuleUtil",
|
|
39350
39824
|
"sap/viz/chart/components/util/StyleUtils",
|
|
39825
|
+
"sap/viz/chart/components/util/PolygonUtil",
|
|
39351
39826
|
"sap/viz/framework/common/util/GeometryUtils",
|
|
39352
39827
|
"sap/viz/framework/common/util/DataGraphics",
|
|
39353
39828
|
"sap/viz/framework/common/util/ObjectUtils"
|
|
@@ -39363,6 +39838,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
39363
39838
|
PositionUtils,
|
|
39364
39839
|
RuleUtil,
|
|
39365
39840
|
StyleUtils,
|
|
39841
|
+
PolygonUtil,
|
|
39366
39842
|
GeometryUtils,
|
|
39367
39843
|
DataGraphics,
|
|
39368
39844
|
ObjectUtils
|
|
@@ -39373,6 +39849,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
39373
39849
|
var TICK_SIZE = 5;
|
|
39374
39850
|
var LABEL_OFFSET = 6;
|
|
39375
39851
|
var VERTICAL_ANGLE = 90;
|
|
39852
|
+
var MIN_ELEMENT_SIZE = Constants.MIN_INTERACTIVE_ELEMENT_SIZE;
|
|
39376
39853
|
|
|
39377
39854
|
var LONG_TICK_STROKE = "#B3B3B3";
|
|
39378
39855
|
var TICK_LABEL_SPACING = TICK_SIZE + LABEL_OFFSET - 1;
|
|
@@ -39616,7 +40093,7 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
39616
40093
|
};
|
|
39617
40094
|
|
|
39618
40095
|
rendererFunc.prototype.drawLabels = function(selection, layers, bound, position, props, effectManager,
|
|
39619
|
-
needRowAxisOffset, labelOffset, additionalWidth, rebuildUI) {
|
|
40096
|
+
needRowAxisOffset, labelOffset, additionalWidth, rebuildUI, isAccEnable, lineSize, clippathRect) {
|
|
39620
40097
|
var layersReversed = layers.slice().reverse();
|
|
39621
40098
|
var layersLength = layersReversed.length;
|
|
39622
40099
|
var baseline = 0;
|
|
@@ -39626,7 +40103,8 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
39626
40103
|
baseline = getLayersBand(layersReversed, i);
|
|
39627
40104
|
this.drawSingleLayerLabels(selection, layersReversed[i], bound,
|
|
39628
40105
|
position, props, baseline, i, layersReversed, effectManager,
|
|
39629
|
-
needRowAxisOffset, labelOffset, additionalWidth, rebuildUI
|
|
40106
|
+
needRowAxisOffset, labelOffset, additionalWidth, rebuildUI,
|
|
40107
|
+
isAccEnable, lineSize, clippathRect);
|
|
39630
40108
|
}
|
|
39631
40109
|
//remove labels out of layer limitation
|
|
39632
40110
|
while(selection.select(".index_"+i).node()){
|
|
@@ -39665,11 +40143,41 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
39665
40143
|
realXOffset = xOffset - baseYOffset * Math.cos(refAngle * Math.PI/180);
|
|
39666
40144
|
}
|
|
39667
40145
|
|
|
39668
|
-
return
|
|
40146
|
+
return {
|
|
40147
|
+
offsetX: parseFloat(realXOffset),
|
|
40148
|
+
offsetY: parseFloat(realYOffset)
|
|
40149
|
+
};
|
|
39669
40150
|
};
|
|
39670
40151
|
|
|
39671
|
-
rendererFunc.prototype._setLabelRectSize = function(rectNode, labelSize, textSize
|
|
39672
|
-
|
|
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{
|
|
39673
40181
|
rectNode.setAttribute("width", labelSize.width);
|
|
39674
40182
|
rectNode.setAttribute("height", labelSize.height);
|
|
39675
40183
|
}
|
|
@@ -39753,9 +40261,12 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
39753
40261
|
var MIN_LABEL_CHAR_NUM = 3;
|
|
39754
40262
|
var ELLIPSIS_NUM = 3;
|
|
39755
40263
|
var MIN_SPACING = 24;
|
|
39756
|
-
|
|
40264
|
+
|
|
39757
40265
|
rendererFunc.prototype.drawSingleLayerLabels = function(selection, layer, bound, position, props,
|
|
39758
|
-
baseline, index, layers, effectManager, needRowAxisOffset, labelOffset, additionalWidth, rebuildUI
|
|
40266
|
+
baseline, index, layers, effectManager, needRowAxisOffset, labelOffset, additionalWidth, rebuildUI,
|
|
40267
|
+
isAccEnable, lineSize, clippathRect) {
|
|
40268
|
+
|
|
40269
|
+
var MARGIN_SIZE = 2;
|
|
39759
40270
|
var clid = CATEGORY_LABEL_ID;
|
|
39760
40271
|
var width = bound.width;
|
|
39761
40272
|
var realWidth = bound.realSize && bound.realSize.width;
|
|
@@ -39905,11 +40416,24 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
39905
40416
|
var fontWeight = propStyle.fontWeight;
|
|
39906
40417
|
var fontFamily = propStyle.fontFamily;
|
|
39907
40418
|
var fontStyle = propStyle.fontStyle;
|
|
39908
|
-
|
|
40419
|
+
var lineSizeOffset = lineSize / 2;
|
|
40420
|
+
|
|
39909
40421
|
config.styles = propStyle;
|
|
39910
40422
|
|
|
39911
40423
|
this.setAttribute(clid, d.id);
|
|
39912
|
-
|
|
40424
|
+
var labelX = d.x;
|
|
40425
|
+
var labelY = d.y;
|
|
40426
|
+
if(isAccEnable){
|
|
40427
|
+
if(isVertical){
|
|
40428
|
+
labelX = d.x - lineSizeOffset;
|
|
40429
|
+
this.setAttribute("transform", "translate(" + labelX + "," + d.y + ")");
|
|
40430
|
+
}else{
|
|
40431
|
+
labelY = d.y + lineSizeOffset;
|
|
40432
|
+
this.setAttribute("transform", "translate(" + d.x + "," + labelY + ")");
|
|
40433
|
+
}
|
|
40434
|
+
}else{
|
|
40435
|
+
this.setAttribute("transform", "translate(" + d.x + "," + d.y + ")");
|
|
40436
|
+
}
|
|
39913
40437
|
var psize = d._preferredSize;
|
|
39914
40438
|
var refSize = Math.max(d[cellSizeField], psize[cellSizeField]);
|
|
39915
40439
|
|
|
@@ -39966,14 +40490,17 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
39966
40490
|
//the axis can display the label text. we draw the rect.
|
|
39967
40491
|
rect = this.querySelector("." + AXIS_CLASS_NAMES.BACKGROUND_RECT);
|
|
39968
40492
|
if (!rect) {
|
|
39969
|
-
|
|
40493
|
+
if(isAccEnable){
|
|
40494
|
+
rect = SVG.create("polygon");
|
|
40495
|
+
}else{
|
|
40496
|
+
rect = SVG.create("rect");
|
|
40497
|
+
}
|
|
39970
40498
|
rect.setAttribute("class", AXIS_CLASS_NAMES.BACKGROUND_RECT);
|
|
39971
40499
|
rect.setAttribute("fill", "transparent");
|
|
39972
40500
|
this.appendChild(rect);
|
|
39973
40501
|
}else if(keepFirstAndLastLabel){
|
|
39974
40502
|
rect.setAttribute("fill", "transparent");
|
|
39975
40503
|
}
|
|
39976
|
-
|
|
39977
40504
|
rect.setAttribute("x", d.rectX);
|
|
39978
40505
|
rect.setAttribute("y", d.rectY);
|
|
39979
40506
|
}
|
|
@@ -40043,35 +40570,110 @@ define('sap/viz/chart/components/axis/renderer/OrdinalCommonBodyRenderer',[
|
|
|
40043
40570
|
width: forceLabelRotation && rotated ? d.rectHeight :d.rectWidth,
|
|
40044
40571
|
height: forceLabelRotation && rotated ? d.rectWidth: d.rectHeight
|
|
40045
40572
|
};
|
|
40046
|
-
me._setLabelRectSize(rect, labelSize, textNodeSize
|
|
40047
|
-
|
|
40573
|
+
me._setLabelRectSize(rect, labelSize, textNodeSize, isAccEnable, isVertical,
|
|
40574
|
+
sizeLimit + 2 * MARGIN_SIZE);
|
|
40575
|
+
var textSize, textHeight, textWidth, rectHeight, rectOffset, refRectWidth;
|
|
40048
40576
|
|
|
40049
40577
|
if(layer.rotated && layer.rotationAngle !== VERTICAL_ANGLE && layer.rotationAngle !== 0) {
|
|
40050
|
-
if(
|
|
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
|
+
);
|
|
40051
40586
|
textSize = TextUtils.canvasMeasure(d.text, fontSize, fontWeight, fontFamily);
|
|
40052
40587
|
textHeight = NumberUtils.preciseSimple(textSize.height);
|
|
40053
40588
|
textWidth = NumberUtils.preciseSimple(textSize.width);
|
|
40054
40589
|
|
|
40055
|
-
|
|
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);
|
|
40056
40656
|
|
|
40057
|
-
|
|
40058
|
-
|
|
40657
|
+
rect.setAttribute("width", textHeight);
|
|
40658
|
+
rect.setAttribute("height", rectHeight);
|
|
40059
40659
|
|
|
40060
|
-
|
|
40660
|
+
rectOffset = textHeight/4 * Math.sin(config.rotationAngle * Math.PI/180);
|
|
40061
40661
|
|
|
40062
|
-
|
|
40063
|
-
|
|
40064
|
-
|
|
40065
|
-
|
|
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 + ") ";
|
|
40066
40667
|
|
|
40067
|
-
|
|
40068
|
-
|
|
40069
|
-
|
|
40668
|
+
rect.setAttribute("transform", translateStr + ' ' + rotateStr);
|
|
40669
|
+
} else {
|
|
40670
|
+
rect.setAttribute("transform", "skewX(-" + (90-layer.rotationAngle) + ")");
|
|
40070
40671
|
|
|
40071
|
-
|
|
40072
|
-
|
|
40073
|
-
|
|
40074
|
-
|
|
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
|
+
}
|
|
40075
40677
|
}
|
|
40076
40678
|
}
|
|
40077
40679
|
}else {
|
|
@@ -40279,6 +40881,7 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
|
|
|
40279
40881
|
this._hasNegativeValue = false;
|
|
40280
40882
|
this._styleChanged = true;
|
|
40281
40883
|
this._localeChanged = true;
|
|
40884
|
+
this._additionalWidth = 0;
|
|
40282
40885
|
//Default offset for trellis axis label is 5.
|
|
40283
40886
|
this._labelOffset = 5;
|
|
40284
40887
|
var styleChangeCallBack = function() {
|
|
@@ -40400,19 +41003,32 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
|
|
|
40400
41003
|
additionalWidth = this.getAdditionalWidth();
|
|
40401
41004
|
}
|
|
40402
41005
|
var rect = this._selection.select('.v-clippath rect');
|
|
40403
|
-
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);
|
|
40404
41007
|
};
|
|
40405
41008
|
|
|
40406
41009
|
OrdinalCommonAxisBody.prototype._update = function(rebuildUI) {
|
|
41010
|
+
var isAccEnable = this._properties.origin.get('interaction.enableAccUpdates');
|
|
40407
41011
|
if(!this._tickGroupNode && !this._labelGroupNode){
|
|
40408
41012
|
return;
|
|
40409
41013
|
}
|
|
40410
41014
|
var properties = this._properties.get();
|
|
41015
|
+
var rect, clippathRect;
|
|
40411
41016
|
if (this._data && properties.visible) {
|
|
40412
41017
|
var width = this._size.width;
|
|
40413
41018
|
var height = this._size.height;
|
|
40414
41019
|
var position = this._position;
|
|
40415
|
-
|
|
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
|
+
}
|
|
40416
41032
|
if(rebuildUI){
|
|
40417
41033
|
this._layers = this._buildLayers(this._data);
|
|
40418
41034
|
this.layout();
|
|
@@ -40437,7 +41053,7 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
|
|
|
40437
41053
|
position, properties, this.runtime().effectManager(), this._froce);
|
|
40438
41054
|
}
|
|
40439
41055
|
if (properties.label && properties.label.visible) {
|
|
40440
|
-
this._renderLabels(properties, layers, bound, position, rebuildUI);
|
|
41056
|
+
this._renderLabels(properties, layers, bound, position, rebuildUI, clippathRect);
|
|
40441
41057
|
}
|
|
40442
41058
|
}
|
|
40443
41059
|
}
|
|
@@ -40458,16 +41074,37 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
|
|
|
40458
41074
|
|
|
40459
41075
|
OrdinalCommonAxisBody.prototype.render = function(selection) {
|
|
40460
41076
|
this._selection = selection;
|
|
41077
|
+
var isAccEnable = this._properties.origin.get('interaction.enableAccUpdates');
|
|
40461
41078
|
selection.select("g." + AXIS_CLASS_NAMES.LINE_GROUP).remove();
|
|
40462
41079
|
selection.select("g." + AXIS_CLASS_NAMES.TICK_GROUP).remove();
|
|
40463
41080
|
selection.select("g." + AXIS_CLASS_NAMES.LABEL_GROUP).remove();
|
|
40464
|
-
|
|
40465
|
-
var
|
|
40466
|
-
if(
|
|
40467
|
-
|
|
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);
|
|
40468
41106
|
}
|
|
40469
|
-
|
|
40470
|
-
this._size.width + 2 + additionalWidth, this._size.height + 2, -1 - additionalWidth, -1);
|
|
41107
|
+
|
|
40471
41108
|
selection.attr('clip-path', 'url(#' + clippathid + ')');
|
|
40472
41109
|
var properties = this._properties.get();
|
|
40473
41110
|
|
|
@@ -40499,7 +41136,7 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
|
|
|
40499
41136
|
|
|
40500
41137
|
if (properties.label && properties.label.visible) {
|
|
40501
41138
|
this._labelGroupNode = selection.append("g").attr("class", AXIS_CLASS_NAMES.LABEL_GROUP);
|
|
40502
|
-
this._renderLabels(properties, layers, bound, position);
|
|
41139
|
+
this._renderLabels(properties, layers, bound, position, undefined, clippathRect);
|
|
40503
41140
|
}
|
|
40504
41141
|
}
|
|
40505
41142
|
}
|
|
@@ -40509,16 +41146,20 @@ define('sap/viz/chart/components/axis/sub/OrdinalCommonAxisBody',[
|
|
|
40509
41146
|
}
|
|
40510
41147
|
};
|
|
40511
41148
|
|
|
40512
|
-
OrdinalCommonAxisBody.prototype._renderLabels = function(properties, layers, bound, position,
|
|
41149
|
+
OrdinalCommonAxisBody.prototype._renderLabels = function(properties, layers, bound, position,
|
|
41150
|
+
rebuildUI, clippathRect) {
|
|
40513
41151
|
var envManager = this.runtime().envManager();
|
|
40514
41152
|
if (envManager) {
|
|
40515
41153
|
properties.textAnchor = envManager.textAnchor();
|
|
40516
41154
|
properties.reverseDots = envManager.reverseDots();
|
|
40517
41155
|
}
|
|
40518
|
-
|
|
41156
|
+
var isAccEnable = this._properties.origin.get('interaction.enableAccUpdates');
|
|
41157
|
+
var isInteractive = !this._properties.origin.get('interaction.nonInteractiveMode');
|
|
41158
|
+
var lineSize = this._properties.get('axisLine.size');
|
|
40519
41159
|
this._bodyRenderer.drawLabels(this._labelGroupNode, layers, bound, position,
|
|
40520
41160
|
properties, this.runtime().effectManager(), this._needRowAxisOffset(), this._labelOffset,
|
|
40521
|
-
this._needExtened() ? this.getAdditionalWidth(): 0, rebuildUI
|
|
41161
|
+
this._needExtened() ? this.getAdditionalWidth(): 0, rebuildUI, isAccEnable && isInteractive,
|
|
41162
|
+
lineSize, clippathRect);
|
|
40522
41163
|
|
|
40523
41164
|
if(this._bodyRenderer && this._bodyRenderer.applyLabelStyle){
|
|
40524
41165
|
this._bodyRenderer.applyLabelStyle(this._labelGroupNode);
|
|
@@ -41850,7 +42491,8 @@ define('sap/viz/chart/components/datalabels/DataLabels',[
|
|
|
41850
42491
|
'sap/viz/framework/common/util/ObjectUtils',
|
|
41851
42492
|
'sap/viz/framework/common/util/FiscalUtil',
|
|
41852
42493
|
"sap/viz/framework/common/util/GeometryUtils",
|
|
41853
|
-
"sap/viz/framework/common/lang/LangManager"
|
|
42494
|
+
"sap/viz/framework/common/lang/LangManager",
|
|
42495
|
+
"sap/viz/framework/common/util/ACCStyleUtils"
|
|
41854
42496
|
], function (oo,
|
|
41855
42497
|
TimeUtil,
|
|
41856
42498
|
TypeUtils,
|
|
@@ -41868,7 +42510,8 @@ define('sap/viz/chart/components/datalabels/DataLabels',[
|
|
|
41868
42510
|
ObjectUtils,
|
|
41869
42511
|
FiscalUtil,
|
|
41870
42512
|
GeometryUtils,
|
|
41871
|
-
langManager
|
|
42513
|
+
langManager,
|
|
42514
|
+
ACCStyleUtils) {
|
|
41872
42515
|
|
|
41873
42516
|
function defaultRenderer(config) {
|
|
41874
42517
|
var text = SVG.create("text");
|
|
@@ -42268,6 +42911,8 @@ define('sap/viz/chart/components/datalabels/DataLabels',[
|
|
|
42268
42911
|
};
|
|
42269
42912
|
|
|
42270
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;
|
|
42271
42916
|
if(!color || range === 'outside'){
|
|
42272
42917
|
//dataLabelColor may need to be calculated.
|
|
42273
42918
|
//check if dataLabel "covers" dataPoint.
|
|
@@ -42281,20 +42926,59 @@ define('sap/viz/chart/components/datalabels/DataLabels',[
|
|
|
42281
42926
|
backColor = (outOfDataPoint ? backgroundColor : referColor) || "#000000";
|
|
42282
42927
|
}
|
|
42283
42928
|
if(backColor){
|
|
42284
|
-
|
|
42285
|
-
|
|
42286
|
-
|
|
42287
|
-
}
|
|
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
|
+
}
|
|
42288
42943
|
item.node.setAttribute("fill", fill);
|
|
42289
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 + ';');
|
|
42290
42969
|
}
|
|
42291
42970
|
};
|
|
42292
42971
|
|
|
42293
42972
|
DataLabels.prototype.updateColor = function(dataLabelInfos, backgroundColor) {
|
|
42294
42973
|
var dataLabelColor = this._properties.get('style.color');
|
|
42295
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 || [];
|
|
42296
42977
|
for (var iG = 0; iG < dataLabelInfos.length; iG++) {
|
|
42297
42978
|
var item = dataLabelInfos[iG];
|
|
42979
|
+
if (rules.length === item.length) {
|
|
42980
|
+
item.fillName = rules[iG].properties && rules[iG].properties.color;
|
|
42981
|
+
}
|
|
42298
42982
|
if (item.node) {
|
|
42299
42983
|
this._setDataLabelColor(item, range, backgroundColor, dataLabelColor, item.referColor);
|
|
42300
42984
|
}
|
|
@@ -42681,7 +43365,7 @@ define('sap/viz/chart/components/datalabels/DataLabels',[
|
|
|
42681
43365
|
step = Math.ceil((isDistributeByHeight ? labelBBox.height : labelBBox.width)/dPLength);
|
|
42682
43366
|
if (step === 0) {
|
|
42683
43367
|
break;
|
|
42684
|
-
}
|
|
43368
|
+
}
|
|
42685
43369
|
}
|
|
42686
43370
|
}
|
|
42687
43371
|
}
|
|
@@ -48079,7 +48763,8 @@ define('sap/viz/chart/components/plots/BasePlot',[
|
|
|
48079
48763
|
"sap/viz/framework/interaction/utils/PlotZoomUtils",
|
|
48080
48764
|
"sap/viz/chart/components/util/ZoomUtil",
|
|
48081
48765
|
"sap/viz/chart/components/util/ColorUtil",
|
|
48082
|
-
'sap/viz/framework/common/util/TimeUtil'
|
|
48766
|
+
'sap/viz/framework/common/util/TimeUtil',
|
|
48767
|
+
'sap/viz/framework/common/util/ACCStyleUtils'
|
|
48083
48768
|
], function Setup(
|
|
48084
48769
|
oo,
|
|
48085
48770
|
ObjectUtils,
|
|
@@ -48104,7 +48789,8 @@ define('sap/viz/chart/components/plots/BasePlot',[
|
|
|
48104
48789
|
PlotZoomUtils,
|
|
48105
48790
|
ZoomUtil,
|
|
48106
48791
|
ColorUtil,
|
|
48107
|
-
TimeUtil
|
|
48792
|
+
TimeUtil,
|
|
48793
|
+
ACCStyleUtils
|
|
48108
48794
|
) {
|
|
48109
48795
|
var CSSCLASS = Constants.CSS.CLASS;
|
|
48110
48796
|
|
|
@@ -48662,7 +49348,7 @@ define('sap/viz/chart/components/plots/BasePlot',[
|
|
|
48662
49348
|
var wrapper = SVG.create("g", selection);
|
|
48663
49349
|
var mainNode = SVG.create("g", wrapper);
|
|
48664
49350
|
mainNode.setAttribute("class", "v-plot-main");
|
|
48665
|
-
mainNode.setAttribute('role', '
|
|
49351
|
+
mainNode.setAttribute('role', 'listbox');
|
|
48666
49352
|
if (enableClipPath && !this._notNeedClippath) {
|
|
48667
49353
|
wrapper.setAttribute("clip-path", "url(#" + clipPathId + ")");
|
|
48668
49354
|
}
|
|
@@ -49115,11 +49801,33 @@ define('sap/viz/chart/components/plots/BasePlot',[
|
|
|
49115
49801
|
config.matchSemantic = true;
|
|
49116
49802
|
}
|
|
49117
49803
|
|
|
49118
|
-
|
|
49119
|
-
|
|
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;
|
|
49120
49808
|
}
|
|
49121
|
-
|
|
49122
|
-
|
|
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
|
+
}
|
|
49123
49831
|
}
|
|
49124
49832
|
}
|
|
49125
49833
|
|
|
@@ -49127,6 +49835,23 @@ define('sap/viz/chart/components/plots/BasePlot',[
|
|
|
49127
49835
|
return config;
|
|
49128
49836
|
};
|
|
49129
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
|
+
|
|
49130
49855
|
BasePlot.prototype._getColor = function(data) {
|
|
49131
49856
|
var color = null;
|
|
49132
49857
|
if (this._data.color2 && data.color2) {
|
|
@@ -52700,6 +53425,7 @@ define('sap/viz/chart/behavior/config/DataPointBehaviorConfigForBar',[
|
|
|
52700
53425
|
"supportedChartTypes": barType2
|
|
52701
53426
|
},
|
|
52702
53427
|
"handler": function(event, service) {
|
|
53428
|
+
var isAccEnable = service.getProperties().get("interaction.enableAccUpdates");
|
|
52703
53429
|
service.fireEvent(event, true);
|
|
52704
53430
|
service._getDecorationLayer().clear();
|
|
52705
53431
|
var gray = event.data.isGray;
|
|
@@ -55205,7 +55931,7 @@ define('sap/viz/chart/components/plots/StackedColumnPlot',[
|
|
|
55205
55931
|
config = configs[i];
|
|
55206
55932
|
position = positions[i];
|
|
55207
55933
|
if (i === 0) {
|
|
55208
|
-
x0 = position.x;
|
|
55934
|
+
x0 = position.x;
|
|
55209
55935
|
y0 = position.y;
|
|
55210
55936
|
x1 = x0 + config.graphic.width;
|
|
55211
55937
|
y1 = y0 + config.graphic.height;
|
|
@@ -55302,11 +56028,7 @@ define('sap/viz/chart/components/plots/StackedColumnPlot',[
|
|
|
55302
56028
|
if (cpRenderer.update) {
|
|
55303
56029
|
if (config.graphic.pattern === "noFill") {
|
|
55304
56030
|
config.path = this._generatePath(config.graphic, cfg);
|
|
55305
|
-
|
|
55306
|
-
config.graphic.pathStrokeWidth = 0;
|
|
55307
|
-
} else {
|
|
55308
|
-
config.graphic.pathStrokeWidth = 3;
|
|
55309
|
-
}
|
|
56031
|
+
config.graphic.pathStrokeWidth = config.isZero ? 0 : 3;
|
|
55310
56032
|
}
|
|
55311
56033
|
cpRenderer.update(dataPointG, config);
|
|
55312
56034
|
}
|
|
@@ -55317,11 +56039,7 @@ define('sap/viz/chart/components/plots/StackedColumnPlot',[
|
|
|
55317
56039
|
} else {
|
|
55318
56040
|
if (config.graphic.pattern === "noFill") {
|
|
55319
56041
|
config.path = this._generatePath(config.graphic, cfg);
|
|
55320
|
-
|
|
55321
|
-
config.graphic.pathStrokeWidth = 0;
|
|
55322
|
-
} else {
|
|
55323
|
-
config.graphic.pathStrokeWidth = 3;
|
|
55324
|
-
}
|
|
56042
|
+
config.graphic.pathStrokeWidth = config.isZero ? 0 : 3;
|
|
55325
56043
|
clonedGraphic = ObjectUtils.clone(config.graphic);
|
|
55326
56044
|
delete clonedGraphic.bgColor;
|
|
55327
56045
|
delete clonedGraphic.drawingEffect;
|
|
@@ -55330,7 +56048,7 @@ define('sap/viz/chart/components/plots/StackedColumnPlot',[
|
|
|
55330
56048
|
}
|
|
55331
56049
|
node = cpRenderer(config);
|
|
55332
56050
|
if (clonedGraphic) {
|
|
55333
|
-
shadowNode = cpRenderer({graphic: clonedGraphic});
|
|
56051
|
+
shadowNode = cpRenderer({ graphic: clonedGraphic });
|
|
55334
56052
|
}
|
|
55335
56053
|
|
|
55336
56054
|
dataPointG = SVG.create("g");
|
|
@@ -61333,6 +62051,7 @@ define('sap/viz/chart/components/axis/renderer/TimeBodyRenderer',[
|
|
|
61333
62051
|
var LABEL_OFFSET = 11;
|
|
61334
62052
|
var AXIS_CLASS_NAMES = Constants.CSS.CLASS.AXIS;
|
|
61335
62053
|
var AXIS_INTERACTION_CLASS_NAMES = 'v-label-interaction';
|
|
62054
|
+
var MIN_ELEMENT_SIZE = Constants.MIN_INTERACTIVE_ELEMENT_SIZE;
|
|
61336
62055
|
|
|
61337
62056
|
var TICK_SIZE = 5;
|
|
61338
62057
|
var LONG_TICK_SIZE = 10;
|
|
@@ -61427,6 +62146,8 @@ define('sap/viz/chart/components/axis/renderer/TimeBodyRenderer',[
|
|
|
61427
62146
|
var labelClass = AXIS_CLASS_NAMES.LABEL + " " + AXIS_CLASS_NAMES.MORPHABLE_LABEL + " " +
|
|
61428
62147
|
AXIS_CLASS_NAMES.LABEL_BACKWORD;
|
|
61429
62148
|
var styles = props.get('label.style');
|
|
62149
|
+
var isInteractive = !props.origin.get('interaction.noninteractiveMode');
|
|
62150
|
+
var isAccEnable = props.origin.get('interaction.enableAccUpdates');
|
|
61430
62151
|
var offset = TextUtils.getTextBaselineOffset(styles);
|
|
61431
62152
|
var fill = effectManager.register({
|
|
61432
62153
|
fillColor: styles.color
|
|
@@ -61501,7 +62222,13 @@ define('sap/viz/chart/components/axis/renderer/TimeBodyRenderer',[
|
|
|
61501
62222
|
LABEL_OFFSET + layer.height - offset;
|
|
61502
62223
|
fillText(text, layer, fillUpperLevel);
|
|
61503
62224
|
text.setAttribute("x", layer.left - scrollOffset);
|
|
61504
|
-
|
|
62225
|
+
var isMinimumSize = layer.height + 2 * HOVERSHADOW_PADDING < MIN_ELEMENT_SIZE;
|
|
62226
|
+
var textPosInRect = (MIN_ELEMENT_SIZE - layer.height / 1.2) / 2;
|
|
62227
|
+
if(isAccEnable && isInteractive && isMinimumSize){
|
|
62228
|
+
text.setAttribute("y", textPosInRect + baseLayerTop);
|
|
62229
|
+
}else{
|
|
62230
|
+
text.setAttribute("y", baseLayerTop);
|
|
62231
|
+
}
|
|
61505
62232
|
text.setAttribute("timelabel-id", layer.id);
|
|
61506
62233
|
|
|
61507
62234
|
var x, rectWidth;
|
|
@@ -61513,14 +62240,26 @@ define('sap/viz/chart/components/axis/renderer/TimeBodyRenderer',[
|
|
|
61513
62240
|
rectWidth = layer.width + 2 * HOVERSHADOW_PADDING;
|
|
61514
62241
|
var textSize = TextUtils.fastMeasure(layer.text, fontSize, fontWeight, fontFamily);
|
|
61515
62242
|
rect.setAttribute("x", x);
|
|
61516
|
-
|
|
62243
|
+
if(isAccEnable && isInteractive && isMinimumSize){
|
|
62244
|
+
rect.setAttribute("y", LABEL_OFFSET);
|
|
62245
|
+
rect.setAttribute("height", MIN_ELEMENT_SIZE);
|
|
62246
|
+
}else{
|
|
62247
|
+
rect.setAttribute("y", baseLayerTop + textSize.y - HOVERSHADOW_PADDING);
|
|
62248
|
+
rect.setAttribute("height", layer.height + 2 * HOVERSHADOW_PADDING);
|
|
62249
|
+
}
|
|
61517
62250
|
rect.setAttribute("width", rectWidth);
|
|
61518
|
-
rect.setAttribute("height", layer.height + 2 * HOVERSHADOW_PADDING);
|
|
61519
62251
|
}
|
|
61520
62252
|
else if(layer.hasOwnProperty('rectX')){
|
|
61521
62253
|
x = layer.rectX - scrollOffset;
|
|
61522
62254
|
rect.setAttribute("x", x);
|
|
61523
|
-
|
|
62255
|
+
|
|
62256
|
+
if(isAccEnable && isInteractive && isMinimumSize){
|
|
62257
|
+
rect.setAttribute("y", LABEL_OFFSET);
|
|
62258
|
+
rect.setAttribute("height", MIN_ELEMENT_SIZE);
|
|
62259
|
+
}else{
|
|
62260
|
+
rect.setAttribute("y", 1);
|
|
62261
|
+
rect.setAttribute("height", baseLayerTop + HOVERSHADOW_PADDING);
|
|
62262
|
+
}
|
|
61524
62263
|
rectWidth = layer.rectWidth;
|
|
61525
62264
|
if(x > width) {
|
|
61526
62265
|
rectWidth = 0;
|
|
@@ -61529,7 +62268,6 @@ define('sap/viz/chart/components/axis/renderer/TimeBodyRenderer',[
|
|
|
61529
62268
|
rectWidth = width - x;
|
|
61530
62269
|
}
|
|
61531
62270
|
rect.setAttribute("width", rectWidth);
|
|
61532
|
-
rect.setAttribute("height", baseLayerTop + HOVERSHADOW_PADDING);
|
|
61533
62271
|
}
|
|
61534
62272
|
}
|
|
61535
62273
|
|
|
@@ -61557,6 +62295,8 @@ define('sap/viz/chart/components/axis/renderer/TimeBodyRenderer',[
|
|
|
61557
62295
|
baseLayerTop = isTop ? height - LABEL_OFFSET - offset :
|
|
61558
62296
|
LABEL_OFFSET + d.height - offset;
|
|
61559
62297
|
var heightOffset = d.height * (i + 1) * (isTop ? -1 : 1);
|
|
62298
|
+
var isMinimumSize = d.height < MIN_ELEMENT_SIZE;
|
|
62299
|
+
var textPosInRect = (MIN_ELEMENT_SIZE - layer.height / 1.2) / 2;
|
|
61560
62300
|
var upperLevelRect = this.querySelector("." + AXIS_CLASS_NAMES.BACKGROUND_RECT);
|
|
61561
62301
|
if(layer.hasOwnProperty('rectX')) {
|
|
61562
62302
|
upperLevelRect = SVG.create("rect");
|
|
@@ -61576,9 +62316,14 @@ define('sap/viz/chart/components/axis/renderer/TimeBodyRenderer',[
|
|
|
61576
62316
|
rectWidth = width - x;
|
|
61577
62317
|
}
|
|
61578
62318
|
upperLevelRect.setAttribute("x", x);
|
|
61579
|
-
|
|
62319
|
+
if(isAccEnable && isInteractive && isMinimumSize){
|
|
62320
|
+
upperLevelRect.setAttribute("y", (i + 1) * MIN_ELEMENT_SIZE + LABEL_OFFSET);
|
|
62321
|
+
upperLevelRect.setAttribute("height", MIN_ELEMENT_SIZE);
|
|
62322
|
+
}else{
|
|
62323
|
+
upperLevelRect.setAttribute("y", (baseLayerTop + d.height * i * (isTop ? -1 : 1)) + 3);
|
|
62324
|
+
upperLevelRect.setAttribute("height", d.height);
|
|
62325
|
+
}
|
|
61580
62326
|
upperLevelRect.setAttribute("width", rectWidth);
|
|
61581
|
-
upperLevelRect.setAttribute("height", d.height);
|
|
61582
62327
|
}
|
|
61583
62328
|
|
|
61584
62329
|
var upperLevelText = that.querySelector(".v-label-upperLevel:nth-child(" + (i + 2) + ")");
|
|
@@ -61591,7 +62336,11 @@ define('sap/viz/chart/components/axis/renderer/TimeBodyRenderer',[
|
|
|
61591
62336
|
upperLevelText.setAttribute("timelabel-id", layer.id);
|
|
61592
62337
|
upperLevelText.setAttribute("fill", fillUpperLevel);
|
|
61593
62338
|
upperLevelText.setAttribute("x", d.left - scrollOffset);
|
|
61594
|
-
|
|
62339
|
+
if(isAccEnable && isInteractive && isMinimumSize){
|
|
62340
|
+
upperLevelText.setAttribute("y", textPosInRect + baseLayerTop + (i + 1) * MIN_ELEMENT_SIZE);
|
|
62341
|
+
}else{
|
|
62342
|
+
upperLevelText.setAttribute("y", baseLayerTop + heightOffset);
|
|
62343
|
+
}
|
|
61595
62344
|
});
|
|
61596
62345
|
|
|
61597
62346
|
} else {
|
|
@@ -64717,6 +65466,7 @@ define('sap/viz/chart/components/axis/sub/TimeAxisBody',[
|
|
|
64717
65466
|
|
|
64718
65467
|
var AXIS_CLASS_NAMES = Constants.CSS.CLASS.AXIS;
|
|
64719
65468
|
var TIME_LEVEL = Constants.TIME_LEVEL;
|
|
65469
|
+
var MIN_ELEMENT_SIZE = Constants.MIN_INTERACTIVE_ELEMENT_SIZE;
|
|
64720
65470
|
|
|
64721
65471
|
var EASTERN_LANGUAGE = ["ja", "zh_CN", "zh_TW", "ko"];
|
|
64722
65472
|
|
|
@@ -65609,6 +66359,8 @@ define('sap/viz/chart/components/axis/sub/TimeAxisBody',[
|
|
|
65609
66359
|
var scale = this._data;
|
|
65610
66360
|
var range = scale.getRange();
|
|
65611
66361
|
var rangeLong = Math.abs(range[0] - range[1]);
|
|
66362
|
+
var isAccEnable = props.origin.get('interaction.enableAccUpdates');
|
|
66363
|
+
var isInteractive = !props.origin.get('interaction.noninteractiveMode');
|
|
65612
66364
|
var spacing = LABEL_OFFSET;
|
|
65613
66365
|
var viewportWidth = refSize ? refSize.width : (this._size.width || rangeLong);
|
|
65614
66366
|
var result = this._getTicksAndLabels(rangeLong, viewportWidth);
|
|
@@ -65617,7 +66369,13 @@ define('sap/viz/chart/components/axis/sub/TimeAxisBody',[
|
|
|
65617
66369
|
|
|
65618
66370
|
if (props.get('label.visible')) {
|
|
65619
66371
|
var labelStyle = this._properties.get('label.style');
|
|
65620
|
-
var labelHeight
|
|
66372
|
+
var labelHeight;
|
|
66373
|
+
var isMinimumSize = this._measureTextSize('1', labelStyle).height < MIN_ELEMENT_SIZE;
|
|
66374
|
+
if(isAccEnable && isInteractive && isMinimumSize){
|
|
66375
|
+
labelHeight = MIN_ELEMENT_SIZE;
|
|
66376
|
+
}else{
|
|
66377
|
+
labelHeight = this._measureTextSize('1', labelStyle).height;
|
|
66378
|
+
}
|
|
65621
66379
|
spacing += labelHeight * Math.max(result.labels.layerCount, 2);
|
|
65622
66380
|
}
|
|
65623
66381
|
}
|
|
@@ -75465,6 +76223,11 @@ define('sap/viz/chart/components/plots/PiePlot',[
|
|
|
75465
76223
|
|
|
75466
76224
|
oo.extend(PiePlot, BasePlot);
|
|
75467
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
|
+
|
|
75468
76231
|
PiePlot.prototype.destroy = function() {
|
|
75469
76232
|
PiePlot.superclass.destroy.call(this);
|
|
75470
76233
|
this._dataPointRenderer = null;
|
|
@@ -76365,13 +77128,15 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
|
|
|
76365
77128
|
'sap/viz/chart/components/util/TextUtils',
|
|
76366
77129
|
'sap/viz/chart/components/util/ColorUtil',
|
|
76367
77130
|
"sap/viz/framework/common/util/NameColorUtils",
|
|
76368
|
-
'sap/viz/framework/common/util/Constants'
|
|
77131
|
+
'sap/viz/framework/common/util/Constants',
|
|
77132
|
+
'sap/viz/framework/common/util/ACCStyleUtils'
|
|
76369
77133
|
], function(SVG,
|
|
76370
77134
|
DataGraphics,
|
|
76371
77135
|
TextUtils,
|
|
76372
77136
|
ColorUtil,
|
|
76373
77137
|
NameColorUtils,
|
|
76374
|
-
Constants
|
|
77138
|
+
Constants,
|
|
77139
|
+
ACCStyleUtils) {
|
|
76375
77140
|
var textLength = function(config) {
|
|
76376
77141
|
var data = config.data;
|
|
76377
77142
|
var labelStyle = config.styles;
|
|
@@ -76545,6 +77310,7 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
|
|
|
76545
77310
|
var color, fill;
|
|
76546
77311
|
var d = config.data;
|
|
76547
77312
|
var bgColor = NameColorUtils.convertColor(d.color) || '0x000000';
|
|
77313
|
+
var enableAcc = config.enableAcc;
|
|
76548
77314
|
var props = config.props;
|
|
76549
77315
|
if (props.dimensionLabel.style.color) {
|
|
76550
77316
|
color = props.dimensionLabel.style.color;
|
|
@@ -76552,12 +77318,16 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
|
|
|
76552
77318
|
if (config.isLeafItem) {
|
|
76553
77319
|
if (props.dataLabel.visible && props.dataLabel.style.color) {
|
|
76554
77320
|
if(props.dataLabel.style.colorRange === 'outside'){
|
|
76555
|
-
color =
|
|
77321
|
+
color = enableAcc ? ACCStyleUtils.getTextColor(bgColor)
|
|
77322
|
+
:
|
|
77323
|
+
ColorUtil.getDataLabelColor(bgColor);
|
|
76556
77324
|
}else{
|
|
76557
77325
|
color = props.dataLabel.style.color;
|
|
76558
77326
|
}
|
|
76559
77327
|
} else {
|
|
76560
|
-
color =
|
|
77328
|
+
color = enableAcc ? ACCStyleUtils.getTextColor(bgColor)
|
|
77329
|
+
:
|
|
77330
|
+
ColorUtil.getDataLabelColor(bgColor);
|
|
76561
77331
|
}
|
|
76562
77332
|
} else {
|
|
76563
77333
|
color = textColor(config);
|
|
@@ -76566,10 +77336,17 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
|
|
|
76566
77336
|
return color;
|
|
76567
77337
|
};
|
|
76568
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
|
+
|
|
76569
77345
|
var treeMapDimensionLabelRenderer = function(config) {
|
|
76570
77346
|
var label = SVG.create("text");
|
|
76571
77347
|
var labelStyle = config.styles;
|
|
76572
77348
|
var fill = labelStyle.color ? labelStyle.color : getLabelColor(config);
|
|
77349
|
+
var textShadow = labelStyle.textShadow ? labelStyle.textShadow : getTextShadow(config);
|
|
76573
77350
|
label.setAttribute("fill", fill);
|
|
76574
77351
|
label.setAttribute("font-size", labelStyle.fontSize);
|
|
76575
77352
|
label.setAttribute("stroke", "none");
|
|
@@ -76578,6 +77355,9 @@ define('sap/viz/chart/components/renderers/TreeMapDimensionLabelRenderer',["sap/
|
|
|
76578
77355
|
label.setAttribute("font-family", labelStyle.fontFamily);
|
|
76579
77356
|
label.setAttribute('fill-opacity', 1);
|
|
76580
77357
|
label.setAttribute('aria-hidden','true');
|
|
77358
|
+
if (config.enableAcc) {
|
|
77359
|
+
label.setAttribute('style', "text-shadow:" + textShadow + ";");
|
|
77360
|
+
}
|
|
76581
77361
|
label.value = config.data.label;
|
|
76582
77362
|
label.textContent = getText(config);
|
|
76583
77363
|
locateLabels(label, config);
|
|
@@ -77951,12 +78731,15 @@ define('sap/viz/chart/components/plots/treemap/TreeMapPlot',[
|
|
|
77951
78731
|
var fontFamily = LABEL_STYLE["fontFamily"];
|
|
77952
78732
|
var fontStyle = LABEL_STYLE["fontStyle"];
|
|
77953
78733
|
var fontColor = LABEL_STYLE["color"];
|
|
78734
|
+
var textShadow = LABEL_STYLE["textShadow"];
|
|
78735
|
+
var enableAcc = _self._properties.origin.get('interaction.enableAccUpdates');
|
|
77954
78736
|
var styles = {
|
|
77955
78737
|
fontSize : fontSize,
|
|
77956
78738
|
fontWeight : fontWeight,
|
|
77957
78739
|
fontFamily : fontFamily,
|
|
77958
78740
|
fontStyle : fontStyle,
|
|
77959
|
-
color: fontColor
|
|
78741
|
+
color: fontColor,
|
|
78742
|
+
textShadow: textShadow
|
|
77960
78743
|
};
|
|
77961
78744
|
var context = {
|
|
77962
78745
|
ctx: ctx.ctx,
|
|
@@ -77967,7 +78750,8 @@ define('sap/viz/chart/components/plots/treemap/TreeMapPlot',[
|
|
|
77967
78750
|
isLeafItem: isLeafItem,
|
|
77968
78751
|
textAnchor: textAnchor,
|
|
77969
78752
|
borderWidth: _self._borderWidth,
|
|
77970
|
-
padding: padding
|
|
78753
|
+
padding: padding,
|
|
78754
|
+
enableAcc: enableAcc
|
|
77971
78755
|
};
|
|
77972
78756
|
var label = dimensionLabelRenderer(context, TreeMapDimensionLabelRenderer.expose);
|
|
77973
78757
|
if(label) {
|
|
@@ -78634,6 +79418,9 @@ define(
|
|
|
78634
79418
|
};
|
|
78635
79419
|
|
|
78636
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');
|
|
78637
79424
|
if(this.isInSemanticMode()){
|
|
78638
79425
|
selection.selectAll('g.v-mbc-content').remove();
|
|
78639
79426
|
ColorLegend.prototype.render.apply(this, arguments);
|
|
@@ -78901,6 +79688,19 @@ define(
|
|
|
78901
79688
|
}
|
|
78902
79689
|
|
|
78903
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
|
+
}
|
|
78904
79704
|
var makerWrapper = wrap.selectAll('rect.v-marker').data(infos.marker);
|
|
78905
79705
|
makerWrapper.exit().remove();
|
|
78906
79706
|
makerWrapper.enter().append('rect');
|
|
@@ -79347,7 +80147,6 @@ define(
|
|
|
79347
80147
|
}
|
|
79348
80148
|
}
|
|
79349
80149
|
}
|
|
79350
|
-
|
|
79351
80150
|
if (this._orientation === 'top' || this._orientation === 'bottom') {
|
|
79352
80151
|
this._mbcLA_markerSize.width = h;
|
|
79353
80152
|
this._mbcLA_markerSize.height = H_MARKERSIZE.height;
|
|
@@ -80722,6 +81521,7 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
|
|
|
80722
81521
|
"sap/viz/framework/common/util/UADetector",
|
|
80723
81522
|
'sap/viz/framework/common/util/DataUtils',
|
|
80724
81523
|
"sap/viz/chart/components/util/ColorUtil",
|
|
81524
|
+
"sap/viz/framework/common/util/ACCStyleUtils",
|
|
80725
81525
|
"sap/viz/chart/components/accessibility/ChartComponentNavigatorFactory",
|
|
80726
81526
|
"sap/viz/chart/components/accessibility/HeatMapDataPointNavigator",
|
|
80727
81527
|
"sap/viz/chart/components/util/ChartConstants",
|
|
@@ -80743,6 +81543,7 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
|
|
|
80743
81543
|
UADetector,
|
|
80744
81544
|
DataUtils,
|
|
80745
81545
|
ColorUtil,
|
|
81546
|
+
ACCStyleUtils,
|
|
80746
81547
|
ChartNavigator,
|
|
80747
81548
|
DataPointNavigator,
|
|
80748
81549
|
ChartConstants) {
|
|
@@ -80999,7 +81800,8 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
|
|
|
80999
81800
|
dataLabelColor: this._properties.get("dataLabel.style.color"),
|
|
81000
81801
|
ellipsisText: this._ellipsisText,
|
|
81001
81802
|
ellipsisOptions: ellipsisOptions,
|
|
81002
|
-
colorRange : this._properties.get("dataLabel.style.colorRange")
|
|
81803
|
+
colorRange : this._properties.get("dataLabel.style.colorRange"),
|
|
81804
|
+
enableAccUpdates: this._properties.origin.get('interaction.enableAccUpdates') || false
|
|
81003
81805
|
};
|
|
81004
81806
|
|
|
81005
81807
|
|
|
@@ -81066,6 +81868,14 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
|
|
|
81066
81868
|
if (!fontColor) {
|
|
81067
81869
|
fontColor = ColorUtil.getDataLabelColor(context.background);
|
|
81068
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
|
+
}
|
|
81069
81879
|
|
|
81070
81880
|
fontSize = TextUtils.validateFontStyle(fontSize);
|
|
81071
81881
|
fontWeight = TextUtils.validateFontStyle(fontWeight);
|
|
@@ -81082,6 +81892,9 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
|
|
|
81082
81892
|
styleStr += "font-family:" + fontFamily + ";";
|
|
81083
81893
|
styleStr += "font-style:" + fontStyle + ";";
|
|
81084
81894
|
styleStr += "fill:" + fontColor + ";";
|
|
81895
|
+
if (textShadow) {
|
|
81896
|
+
styleStr += "text-shadow: " + textShadow + ";";
|
|
81897
|
+
}
|
|
81085
81898
|
|
|
81086
81899
|
//set dimension label text in ellipsis mode if it is too long
|
|
81087
81900
|
var textContent = null;
|
|
@@ -81116,13 +81929,15 @@ define('sap/viz/chart/components/plots/HeatMapPlot',[
|
|
|
81116
81929
|
}
|
|
81117
81930
|
}
|
|
81118
81931
|
|
|
81119
|
-
|
|
81120
|
-
d3.select(textNode)
|
|
81932
|
+
var selection = d3.select(textNode)
|
|
81121
81933
|
.attr("font-size", fontSize)
|
|
81122
81934
|
.attr("font-weight", fontWeight)
|
|
81123
81935
|
.attr("font-family", fontFamily)
|
|
81124
81936
|
.attr("font-style", fontStyle)
|
|
81125
81937
|
.attr("fill", fontColor);
|
|
81938
|
+
if (textShadow) {
|
|
81939
|
+
selection.style("text-shadow", textShadow);
|
|
81940
|
+
}
|
|
81126
81941
|
}
|
|
81127
81942
|
return textNode;
|
|
81128
81943
|
}
|