@fluentui/react-charting 5.24.5 → 5.24.7
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/CHANGELOG.json +43 -1
- package/CHANGELOG.md +22 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/AreaChart/AreaChart.styles.js +2 -2
- package/lib/components/AreaChart/AreaChart.styles.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.base.d.ts +3 -2
- package/lib/components/CommonComponents/CartesianChart.base.js +134 -112
- package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.styles.js +35 -62
- package/lib/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +13 -10
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.styles.js +2 -18
- package/lib/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +15 -24
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js +3 -14
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js.map +1 -1
- package/lib/components/LineChart/LineChart.styles.js +3 -11
- package/lib/components/LineChart/LineChart.styles.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.styles.js +2 -1
- package/lib/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.styles.js +3 -14
- package/lib/components/ScatterChart/ScatterChart.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js +14 -12
- package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.styles.js +3 -14
- package/lib/components/VerticalBarChart/VerticalBarChart.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +13 -17
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js +3 -14
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js.map +1 -1
- package/lib/utilities/Common.styles.d.ts +6 -0
- package/lib/utilities/Common.styles.js +51 -0
- package/lib/utilities/Common.styles.js.map +1 -0
- package/lib/utilities/SVGTooltipText.d.ts +1 -1
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/index.d.ts +1 -0
- package/lib/utilities/index.js +1 -0
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/utilities.d.ts +3 -0
- package/lib/utilities/utilities.js +25 -38
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/utilities/vbc-utils.d.ts +18 -0
- package/lib/utilities/vbc-utils.js +29 -0
- package/lib/utilities/vbc-utils.js.map +1 -1
- package/lib-amd/components/AreaChart/AreaChart.styles.js +2 -2
- package/lib-amd/components/AreaChart/AreaChart.styles.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +3 -2
- package/lib-amd/components/CommonComponents/CartesianChart.base.js +133 -111
- package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js +33 -61
- package/lib-amd/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +13 -10
- package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-amd/components/DonutChart/DonutChart.styles.js +2 -17
- package/lib-amd/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +14 -23
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js +3 -13
- package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js.map +1 -1
- package/lib-amd/components/LineChart/LineChart.styles.js +3 -10
- package/lib-amd/components/LineChart/LineChart.styles.js.map +1 -1
- package/lib-amd/components/SankeyChart/SankeyChart.styles.js +2 -2
- package/lib-amd/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib-amd/components/ScatterChart/ScatterChart.styles.js +3 -13
- package/lib-amd/components/ScatterChart/ScatterChart.styles.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +13 -11
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.styles.js +3 -13
- package/lib-amd/components/VerticalBarChart/VerticalBarChart.styles.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +12 -16
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js +3 -13
- package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js.map +1 -1
- package/lib-amd/utilities/Common.styles.d.ts +6 -0
- package/lib-amd/utilities/Common.styles.js +57 -0
- package/lib-amd/utilities/Common.styles.js.map +1 -0
- package/lib-amd/utilities/SVGTooltipText.d.ts +1 -1
- package/lib-amd/utilities/SVGTooltipText.js.map +1 -1
- package/lib-amd/utilities/index.d.ts +1 -0
- package/lib-amd/utilities/index.js +2 -1
- package/lib-amd/utilities/index.js.map +1 -1
- package/lib-amd/utilities/utilities.d.ts +3 -0
- package/lib-amd/utilities/utilities.js +26 -39
- package/lib-amd/utilities/utilities.js.map +1 -1
- package/lib-amd/utilities/vbc-utils.d.ts +18 -0
- package/lib-amd/utilities/vbc-utils.js +34 -1
- package/lib-amd/utilities/vbc-utils.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.styles.js +2 -2
- package/lib-commonjs/components/AreaChart/AreaChart.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +3 -2
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +133 -111
- package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js +33 -60
- package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +13 -10
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.styles.js +2 -18
- package/lib-commonjs/components/DonutChart/DonutChart.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +14 -23
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js +3 -14
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.styles.js +3 -11
- package/lib-commonjs/components/LineChart/LineChart.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js +2 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.styles.js +3 -14
- package/lib-commonjs/components/ScatterChart/ScatterChart.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +13 -11
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.styles.js +3 -14
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +12 -16
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js +3 -14
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.styles.js.map +1 -1
- package/lib-commonjs/utilities/Common.styles.d.ts +6 -0
- package/lib-commonjs/utilities/Common.styles.js +58 -0
- package/lib-commonjs/utilities/Common.styles.js.map +1 -0
- package/lib-commonjs/utilities/SVGTooltipText.d.ts +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/index.d.ts +1 -0
- package/lib-commonjs/utilities/index.js +1 -0
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/utilities.d.ts +3 -0
- package/lib-commonjs/utilities/utilities.js +27 -40
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/lib-commonjs/utilities/vbc-utils.d.ts +18 -0
- package/lib-commonjs/utilities/vbc-utils.js +34 -1
- package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
define(["require", "exports", "
|
|
1
|
+
define(["require", "exports", "../../utilities/index"], function (require, exports, index_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.getStyles = void 0;
|
|
5
5
|
var getStyles = function (props) {
|
|
6
|
-
var _a;
|
|
7
6
|
var shouldHighlight = props.shouldHighlight, theme = props.theme;
|
|
8
7
|
return {
|
|
9
8
|
opacityChangeOnHover: {
|
|
@@ -20,17 +19,8 @@ define(["require", "exports", "tslib", "@fluentui/react/lib/Styling"], function
|
|
|
20
19
|
transform: 'scaleX(-1)',
|
|
21
20
|
},
|
|
22
21
|
],
|
|
23
|
-
tooltip:
|
|
24
|
-
barLabel:
|
|
25
|
-
fontSize: Styling_1.FontSizes.small,
|
|
26
|
-
fontWeight: Styling_1.FontWeights.semibold,
|
|
27
|
-
fill: theme.palette.neutralPrimary,
|
|
28
|
-
selectors: (_a = {},
|
|
29
|
-
_a[Styling_1.HighContrastSelector] = {
|
|
30
|
-
fill: 'CanvasText',
|
|
31
|
-
},
|
|
32
|
-
_a),
|
|
33
|
-
},
|
|
22
|
+
tooltip: (0, index_1.getTooltipStyle)(theme),
|
|
23
|
+
barLabel: (0, index_1.getBarLabelStyle)(theme),
|
|
34
24
|
};
|
|
35
25
|
};
|
|
36
26
|
exports.getStyles = getStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalBarChart.styles.js","sourceRoot":"../src/","sources":["components/VerticalBarChart/VerticalBarChart.styles.ts"],"names":[],"mappings":";;;;IAGO,IAAM,SAAS,GAAG,UAAC,KAAkC
|
|
1
|
+
{"version":3,"file":"VerticalBarChart.styles.js","sourceRoot":"../src/","sources":["components/VerticalBarChart/VerticalBarChart.styles.ts"],"names":[],"mappings":";;;;IAGO,IAAM,SAAS,GAAG,UAAC,KAAkC;QAClD,IAAA,eAAe,GAAY,KAAK,gBAAjB,EAAE,KAAK,GAAK,KAAK,MAAV,CAAW;QACzC,OAAO;YACL,oBAAoB,EAAE;gBACpB,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;aACtC;YAED,UAAU,EAAE,EAAE;YAEd,UAAU,EAAE;gBACV;oBACE,SAAS,EAAE,YAAY;iBACxB;aACF;YACD,WAAW,EAAE;gBACX;oBACE,SAAS,EAAE,YAAY;iBACxB;aACF;YACD,OAAO,EAAE,IAAA,uBAAe,EAAC,KAAK,CAAC;YAC/B,QAAQ,EAAE,IAAA,wBAAgB,EAAC,KAAK,CAAC;SAClC,CAAC;IACJ,CAAC,CAAC;IAtBW,QAAA,SAAS,aAsBpB","sourcesContent":["import { IVerticalBarChartStyleProps, IVerticalBarChartStyles } from '../../index';\nimport { getBarLabelStyle, getTooltipStyle } from '../../utilities/index';\n\nexport const getStyles = (props: IVerticalBarChartStyleProps): IVerticalBarChartStyles => {\n const { shouldHighlight, theme } = props;\n return {\n opacityChangeOnHover: {\n opacity: shouldHighlight ? '' : '0.1',\n },\n\n xAxisTicks: [],\n\n yAxisTicks: [\n {\n transform: 'scaleX(-1)',\n },\n ],\n yAxisDomain: [\n {\n transform: 'scaleX(-1)',\n },\n ],\n tooltip: getTooltipStyle(theme),\n barLabel: getBarLabelStyle(theme),\n };\n};\n"]}
|
|
@@ -256,7 +256,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
256
256
|
if (!barsToDisplay.length) {
|
|
257
257
|
return undefined;
|
|
258
258
|
}
|
|
259
|
-
var _a = _this._getBarGapAndScale(barsToDisplay, yBarScale), gapHeight = _a.gapHeight, heightValueScale = _a.heightValueScale,
|
|
259
|
+
var _a = _this._getBarGapAndScale(barsToDisplay, yBarScale), gapHeight = _a.gapHeight, heightValueScale = _a.heightValueScale, absStackTotal = _a.absStackTotal;
|
|
260
260
|
if (heightValueScale < 0) {
|
|
261
261
|
return undefined;
|
|
262
262
|
}
|
|
@@ -307,7 +307,8 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
307
307
|
}
|
|
308
308
|
else {
|
|
309
309
|
barHeight = Math.abs(heightValueScale * point.data);
|
|
310
|
-
|
|
310
|
+
// FIXME: The current scaling logic may produce different min and gap heights for each bar stack.
|
|
311
|
+
var minHeight = Math.max((heightValueScale * absStackTotal) / 100.0, barMinimumHeight);
|
|
311
312
|
if (barHeight < minHeight) {
|
|
312
313
|
barHeight = minHeight;
|
|
313
314
|
}
|
|
@@ -519,9 +520,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
519
520
|
var _a;
|
|
520
521
|
_this._domainMargin = MIN_DOMAIN_MARGIN;
|
|
521
522
|
/** Total width available to render the bars */
|
|
522
|
-
var totalWidth =
|
|
523
|
-
/** Rate at which the space between the bars changes wrt the bar width */
|
|
524
|
-
var barGapRate = _this._xAxisInnerPadding / (1 - _this._xAxisInnerPadding);
|
|
523
|
+
var totalWidth = (0, index_3.calcTotalWidth)(containerWidth, _this.margins, MIN_DOMAIN_MARGIN);
|
|
525
524
|
if (_this._xAxisType === index_3.XAxisTypes.StringAxis) {
|
|
526
525
|
if ((0, index_3.isScalePaddingDefined)(_this.props.xAxisOuterPadding, _this.props.xAxisPadding)) {
|
|
527
526
|
// Setting the domain margin for string x-axis to 0 because the xAxisOuterPadding prop is now available
|
|
@@ -533,7 +532,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
533
532
|
// the following calculations don't use the previous bar width.
|
|
534
533
|
_this._barWidth = (0, index_3.getBarWidth)(_this.props.barWidth, _this.props.maxBarWidth);
|
|
535
534
|
/** Total width required to render the bars. Directly proportional to bar width */
|
|
536
|
-
var reqWidth = (_this.
|
|
535
|
+
var reqWidth = (0, index_3.calcRequiredWidth)(_this._barWidth, _this._xAxisLabels.length, _this._xAxisInnerPadding);
|
|
537
536
|
if (totalWidth >= reqWidth) {
|
|
538
537
|
// Center align the chart by setting equal left and right margins for domain
|
|
539
538
|
_this._domainMargin = MIN_DOMAIN_MARGIN + (totalWidth - reqWidth) / 2;
|
|
@@ -541,17 +540,14 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
541
540
|
}
|
|
542
541
|
else if (_this.props.mode === 'plotly' && _this._xAxisLabels.length > 1) {
|
|
543
542
|
// Calculate the remaining width after rendering bars at their maximum allowable width
|
|
544
|
-
var bandwidth = totalWidth
|
|
543
|
+
var bandwidth = (0, index_3.calcBandwidth)(totalWidth, _this._xAxisLabels.length, _this._xAxisInnerPadding);
|
|
545
544
|
var barWidth = (0, index_3.getBarWidth)(_this.props.barWidth, _this.props.maxBarWidth, bandwidth);
|
|
546
|
-
var reqWidth = (_this._xAxisLabels.length
|
|
545
|
+
var reqWidth = (0, index_3.calcRequiredWidth)(barWidth, _this._xAxisLabels.length, _this._xAxisInnerPadding);
|
|
547
546
|
var margin1 = (totalWidth - reqWidth) / 2;
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
reqWidth = (_this._xAxisLabels.length - _this._xAxisInnerPadding) * step;
|
|
553
|
-
margin2 = (totalWidth - reqWidth) / 2;
|
|
554
|
-
}
|
|
547
|
+
// Calculate the remaining width after accounting for the space required to render x-axis labels
|
|
548
|
+
var step = (0, index_3.calculateLongestLabelWidth)(_this._xAxisLabels) + 20;
|
|
549
|
+
reqWidth = (_this._xAxisLabels.length - _this._xAxisInnerPadding) * step;
|
|
550
|
+
var margin2 = (totalWidth - reqWidth) / 2;
|
|
555
551
|
_this._domainMargin = MIN_DOMAIN_MARGIN + Math.max(0, Math.min(margin1, margin2));
|
|
556
552
|
}
|
|
557
553
|
}
|
|
@@ -985,7 +981,7 @@ define(["require", "exports", "tslib", "react", "d3-array", "d3-selection", "d3-
|
|
|
985
981
|
return {
|
|
986
982
|
gapHeight: gapHeight,
|
|
987
983
|
heightValueScale: heightValueScale,
|
|
988
|
-
|
|
984
|
+
absStackTotal: totalData,
|
|
989
985
|
};
|
|
990
986
|
};
|
|
991
987
|
VerticalStackedBarChartBase.prototype._isChartEmpty = function () {
|