@fluentui/react-charting 5.10.0 → 5.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +22 -1
- package/CHANGELOG.md +12 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/Sparkline.d.ts +1 -0
- package/lib/Sparkline.js +2 -0
- package/lib/Sparkline.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.base.d.ts +18 -0
- package/lib/components/Sparkline/Sparkline.base.js +65 -0
- package/lib/components/Sparkline/Sparkline.base.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.d.ts +3 -0
- package/lib/components/Sparkline/Sparkline.js +6 -0
- package/lib/components/Sparkline/Sparkline.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.styles.d.ts +2 -0
- package/lib/components/Sparkline/Sparkline.styles.js +10 -0
- package/lib/components/Sparkline/Sparkline.styles.js.map +1 -0
- package/lib/components/Sparkline/Sparkline.types.d.ts +46 -0
- package/lib/components/Sparkline/Sparkline.types.js +2 -0
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib/components/Sparkline/index.d.ts +2 -0
- package/lib/components/Sparkline/index.js +3 -0
- package/lib/components/Sparkline/index.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/lib-amd/Sparkline.d.ts +1 -0
- package/lib-amd/Sparkline.js +6 -0
- package/lib-amd/Sparkline.js.map +1 -0
- package/lib-amd/components/Sparkline/Sparkline.base.d.ts +18 -0
- package/lib-amd/components/Sparkline/Sparkline.base.js +63 -0
- package/lib-amd/components/Sparkline/Sparkline.base.js.map +1 -0
- package/lib-amd/components/Sparkline/Sparkline.d.ts +3 -0
- package/lib-amd/components/Sparkline/Sparkline.js +8 -0
- package/lib-amd/components/Sparkline/Sparkline.js.map +1 -0
- package/lib-amd/components/Sparkline/Sparkline.styles.d.ts +2 -0
- package/lib-amd/components/Sparkline/Sparkline.styles.js +15 -0
- package/lib-amd/components/Sparkline/Sparkline.styles.js.map +1 -0
- package/lib-amd/components/Sparkline/Sparkline.types.d.ts +46 -0
- package/lib-amd/components/Sparkline/Sparkline.types.js +5 -0
- package/lib-amd/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib-amd/components/Sparkline/index.d.ts +2 -0
- package/lib-amd/components/Sparkline/index.js +7 -0
- package/lib-amd/components/Sparkline/index.js.map +1 -0
- package/lib-amd/index.d.ts +1 -0
- package/lib-amd/index.js +2 -1
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/version.js +1 -1
- package/lib-amd/version.js.map +1 -1
- package/lib-commonjs/Sparkline.d.ts +1 -0
- package/lib-commonjs/Sparkline.js +5 -0
- package/lib-commonjs/Sparkline.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.base.d.ts +18 -0
- package/lib-commonjs/components/Sparkline/Sparkline.base.js +68 -0
- package/lib-commonjs/components/Sparkline/Sparkline.base.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.d.ts +3 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js +9 -0
- package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.styles.d.ts +2 -0
- package/lib-commonjs/components/Sparkline/Sparkline.styles.js +14 -0
- package/lib-commonjs/components/Sparkline/Sparkline.styles.js.map +1 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.d.ts +46 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js +3 -0
- package/lib-commonjs/components/Sparkline/Sparkline.types.js.map +1 -0
- package/lib-commonjs/components/Sparkline/index.d.ts +2 -0
- package/lib-commonjs/components/Sparkline/index.js +6 -0
- package/lib-commonjs/components/Sparkline/index.js.map +1 -0
- package/lib-commonjs/index.d.ts +1 -0
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/version.js +1 -1
- package/lib-commonjs/version.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Sparkline/Sparkline.types.ts +55 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SparklineBase = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var React = require("react");
|
|
6
|
+
var d3_scale_1 = require("d3-scale");
|
|
7
|
+
var d3_shape_1 = require("d3-shape");
|
|
8
|
+
var d3_array_1 = require("d3-array");
|
|
9
|
+
var react_focus_1 = require("@fluentui/react-focus");
|
|
10
|
+
var Utilities_1 = require("@fluentui/react/lib-commonjs/Utilities");
|
|
11
|
+
var getClassNames = Utilities_1.classNamesFunction();
|
|
12
|
+
var SparklineBase = /** @class */ (function (_super) {
|
|
13
|
+
tslib_1.__extends(SparklineBase, _super);
|
|
14
|
+
function SparklineBase(props) {
|
|
15
|
+
var _this = _super.call(this, props) || this;
|
|
16
|
+
_this.margin = {
|
|
17
|
+
top: 2,
|
|
18
|
+
right: 0,
|
|
19
|
+
bottom: 0,
|
|
20
|
+
left: 0,
|
|
21
|
+
};
|
|
22
|
+
_this.state = {
|
|
23
|
+
_points: null,
|
|
24
|
+
_width: _this.props.width || 80,
|
|
25
|
+
_height: _this.props.height || 20 + _this.margin.bottom + _this.margin.top,
|
|
26
|
+
};
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
SparklineBase.prototype.componentDidMount = function () {
|
|
30
|
+
var _this = this;
|
|
31
|
+
var area = d3_shape_1.area()
|
|
32
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
33
|
+
.x(function (d) { return _this.x(d.x); })
|
|
34
|
+
.y0(this.state._height)
|
|
35
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
36
|
+
.y1(function (d) { return _this.y(d.y); })
|
|
37
|
+
.curve(d3_shape_1.curveMonotoneX);
|
|
38
|
+
this.area = area;
|
|
39
|
+
var points = this.props.data.lineChartData[0].data;
|
|
40
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
41
|
+
var _a = d3_array_1.extent(points, function (d) { return d.x; }), xMin = _a[0], xMax = _a[1];
|
|
42
|
+
this.x = d3_scale_1.scaleLinear()
|
|
43
|
+
.domain([xMin, xMax])
|
|
44
|
+
.range([this.margin.left, this.state._width - this.margin.right]);
|
|
45
|
+
this.y = d3_scale_1.scaleLinear()
|
|
46
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
47
|
+
.domain([0, d3_array_1.max(points, function (d) { return d.y; })])
|
|
48
|
+
.range([this.state._height - this.margin.bottom, this.margin.top]);
|
|
49
|
+
this.setState({
|
|
50
|
+
_points: points,
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
SparklineBase.prototype.drawSparkline = function () {
|
|
54
|
+
return (React.createElement("path", { className: "area", d: this.area(this.state._points), opacity: 1, fillOpacity: 0.2, fill: this.props.data.lineChartData[0].color, strokeWidth: 2, stroke: this.props.data.lineChartData[0].color, "aria-label": "Sparkline with label " + this.props.data.lineChartData[0].legend }));
|
|
55
|
+
};
|
|
56
|
+
SparklineBase.prototype.render = function () {
|
|
57
|
+
var classNames = getClassNames(this.props.styles, {
|
|
58
|
+
theme: this.props.theme,
|
|
59
|
+
});
|
|
60
|
+
return (React.createElement(react_focus_1.FocusZone, { direction: react_focus_1.FocusZoneDirection.horizontal, isCircularNavigation: true, className: classNames.inlineBlock },
|
|
61
|
+
React.createElement("div", { className: classNames.inlineBlock },
|
|
62
|
+
this.state._width >= 50 && this.state._height >= 16 ? (React.createElement("svg", { width: this.state._width, height: this.state._height, tabIndex: 0 }, this.state._points ? this.drawSparkline() : null)) : (React.createElement(React.Fragment, null)),
|
|
63
|
+
this.props.showLegend && this.props.data.lineChartData[0].legend ? (React.createElement("span", { role: "text", className: classNames.titleText, tabIndex: 0 }, this.props.data.lineChartData[0].legend)) : (React.createElement(React.Fragment, null)))));
|
|
64
|
+
};
|
|
65
|
+
return SparklineBase;
|
|
66
|
+
}(React.Component));
|
|
67
|
+
exports.SparklineBase = SparklineBase;
|
|
68
|
+
//# sourceMappingURL=Sparkline.base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.base.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.base.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,qCAAwD;AACxD,qCAA8E;AAC9E,qCAA4D;AAC5D,qDAAsE;AAEtE,2DAAmE;AAEnE,IAAM,aAAa,GAAG,8BAAkB,EAA0C,CAAC;AAQnF;IAAmC,yCAAiD;IAelF,uBAAY,KAAsB;QAAlC,YACE,kBAAM,KAAK,CAAC,SAMb;QArBO,YAAM,GAAG;YACf,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;SACR,CAAC;QAWA,KAAI,CAAC,KAAK,GAAG;YACX,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,KAAI,CAAC,KAAK,CAAC,KAAM,IAAI,EAAE;YAC/B,OAAO,EAAE,KAAI,CAAC,KAAK,CAAC,MAAO,IAAI,EAAE,GAAG,KAAI,CAAC,MAAM,CAAC,MAAM,GAAG,KAAI,CAAC,MAAM,CAAC,GAAG;SACzE,CAAC;;IACJ,CAAC;IAEM,yCAAiB,GAAxB;QAAA,iBA0BC;QAzBC,IAAM,IAAI,GAAG,eAAM,EAAE;YACnB,uDAAuD;aACtD,CAAC,CAAC,UAAC,CAAM,IAAK,OAAA,KAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAX,CAAW,CAAC;aAC1B,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YACvB,uDAAuD;aACtD,EAAE,CAAC,UAAC,CAAM,IAAK,OAAA,KAAI,CAAC,CAAC,CAAC,CAAC,CAA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U,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC,IAC3D,IAAI,CAAC,KAAK,CAAC,IAAK,CAAC,aAAc,CAAC,CAAC,CAAC,CAAC,MAAO,CACtC,CACR,CAAC,CAAC,CAAC,CACF,yCAAK,CACN,CACG,CACI,CACb,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAhGD,CAAmC,KAAK,CAAC,SAAS,GAgGjD;AAhGY,sCAAa","sourcesContent":["import * as React from 'react';\nimport { scaleLinear as d3ScaleLinear } from 'd3-scale';\nimport { area as d3Area, curveMonotoneX as d3CurveMonotoneX } from 'd3-shape';\nimport { max as d3Max, extent as d3Extent } from 'd3-array';\nimport { FocusZone, FocusZoneDirection } from '@fluentui/react-focus';\nimport { ILineChartDataPoint } from '../../types/IDataPoint';\nimport { classNamesFunction } from '@fluentui/react/lib/Utilities';\nimport { ISparklineProps, ISparklineStyleProps, ISparklineStyles } from '../../index';\nconst getClassNames = classNamesFunction<ISparklineStyleProps, ISparklineStyles>();\n\nexport interface ISparklineState {\n _points: ILineChartDataPoint[] | null;\n _width: number;\n _height: number;\n}\n\nexport class SparklineBase extends React.Component<ISparklineProps, ISparklineState> {\n private margin = {\n top: 2,\n right: 0,\n bottom: 0,\n left: 0,\n };\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private x: any;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n private y: any;\n private area: any;\n\n constructor(props: ISparklineProps) {\n super(props);\n this.state = {\n _points: null,\n _width: this.props.width! || 80,\n _height: this.props.height! || 20 + this.margin.bottom + this.margin.top,\n };\n }\n\n public componentDidMount() {\n const area = d3Area()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .x((d: any) => this.x(d.x))\n .y0(this.state._height)\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .y1((d: any) => this.y(d.y))\n .curve(d3CurveMonotoneX);\n this.area = area;\n\n const points = this.props.data!.lineChartData![0].data;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n const [xMin, xMax] = d3Extent(points, (d: any) => d.x);\n\n this.x = d3ScaleLinear()\n .domain([xMin, xMax])\n .range([this.margin.left!, this.state._width - this.margin.right!]);\n this.y = d3ScaleLinear()\n /* eslint-disable @typescript-eslint/no-explicit-any */\n .domain([0, d3Max(points, (d: any) => d.y)])\n .range([this.state._height - this.margin.bottom!, this.margin.top!]);\n\n this.setState({\n _points: points,\n });\n }\n\n public drawSparkline() {\n return (\n <path\n className=\"area\"\n d={this.area(this.state._points)}\n opacity={1}\n fillOpacity={0.2}\n fill={this.props.data!.lineChartData![0].color!}\n strokeWidth={2}\n stroke={this.props.data!.lineChartData![0].color!}\n aria-label={`Sparkline with label ${this.props.data!.lineChartData![0].legend!}`}\n />\n );\n }\n\n public render() {\n const classNames = getClassNames(this.props.styles!, {\n theme: this.props.theme!,\n });\n return (\n <FocusZone\n direction={FocusZoneDirection.horizontal}\n isCircularNavigation={true}\n className={classNames.inlineBlock}\n >\n <div className={classNames.inlineBlock}>\n {this.state._width >= 50 && this.state._height >= 16 ? (\n <svg width={this.state._width} height={this.state._height} tabIndex={0}>\n {this.state._points ? this.drawSparkline() : null}\n </svg>\n ) : (\n <></>\n )}\n {this.props.showLegend && this.props.data!.lineChartData![0].legend ? (\n <span role=\"text\" className={classNames.titleText} tabIndex={0}>\n {this.props.data!.lineChartData![0].legend!}\n </span>\n ) : (\n <></>\n )}\n </div>\n </FocusZone>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Sparkline = void 0;
|
|
4
|
+
var Utilities_1 = require("@fluentui/react/lib-commonjs/Utilities");
|
|
5
|
+
var Sparkline_base_1 = require("./Sparkline.base");
|
|
6
|
+
var Sparkline_styles_1 = require("./Sparkline.styles");
|
|
7
|
+
// Create a Sparkline variant which uses these default styles and this styled subcomponent.
|
|
8
|
+
exports.Sparkline = Utilities_1.styled(Sparkline_base_1.SparklineBase, Sparkline_styles_1.getStyles);
|
|
9
|
+
//# sourceMappingURL=Sparkline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.tsx"],"names":[],"mappings":";;;AACA,2DAAuD;AAEvD,mDAAiD;AACjD,uDAA+C;AAE/C,2FAA2F;AAC9E,QAAA,SAAS,GAA6C,kBAAM,CAIvE,8BAAa,EAAE,4BAAS,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '@fluentui/react/lib/Utilities';\nimport { ISparklineStyles, ISparklineProps, ISparklineStyleProps } from '../../index';\nimport { SparklineBase } from './Sparkline.base';\nimport { getStyles } from './Sparkline.styles';\n\n// Create a Sparkline variant which uses these default styles and this styled subcomponent.\nexport const Sparkline: React.FunctionComponent<ISparklineProps> = styled<\n ISparklineProps,\n ISparklineStyleProps,\n ISparklineStyles\n>(SparklineBase, getStyles);\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStyles = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var getStyles = function (props) {
|
|
6
|
+
return {
|
|
7
|
+
inlineBlock: {
|
|
8
|
+
display: 'inline',
|
|
9
|
+
},
|
|
10
|
+
titleText: tslib_1.__assign({ marginLeft: '8px', textAlign: 'center' }, props.theme.fonts.smallPlus),
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
exports.getStyles = getStyles;
|
|
14
|
+
//# sourceMappingURL=Sparkline.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.styles.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.styles.ts"],"names":[],"mappings":";;;;AAEO,IAAM,SAAS,GAAG,UAAC,KAA2B;IACnD,OAAO;QACL,WAAW,EAAE;YACX,OAAO,EAAE,QAAQ;SAClB;QACD,SAAS,qBACP,UAAU,EAAE,KAAK,EACjB,SAAS,EAAE,QAAQ,IAChB,KAAK,CAAC,KAAM,CAAC,KAAK,CAAC,SAAS,CAChC;KACF,CAAC;AACJ,CAAC,CAAC;AAXW,QAAA,SAAS,aAWpB","sourcesContent":["import { ISparklineStyleProps, ISparklineStyles } from './Sparkline.types';\n\nexport const getStyles = (props: ISparklineStyleProps): ISparklineStyles => {\n return {\n inlineBlock: {\n display: 'inline',\n },\n titleText: {\n marginLeft: '8px',\n textAlign: 'center',\n ...props.theme!.fonts.smallPlus,\n },\n };\n};\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ITheme, IStyle } from '@fluentui/react/lib/Styling';
|
|
2
|
+
import { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';
|
|
3
|
+
import { IChartProps } from '../../types/IDataPoint';
|
|
4
|
+
import { ICartesianChartStyleProps } from '../CommonComponents/index';
|
|
5
|
+
export interface ISparklineStyleProps extends ICartesianChartStyleProps {
|
|
6
|
+
}
|
|
7
|
+
export interface ISparklineProps {
|
|
8
|
+
/**
|
|
9
|
+
* An array of chart data points for the Sparkline chart
|
|
10
|
+
*/
|
|
11
|
+
data?: IChartProps;
|
|
12
|
+
/**
|
|
13
|
+
* Width of chart
|
|
14
|
+
* * @default 80
|
|
15
|
+
*/
|
|
16
|
+
width?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Height of chart
|
|
19
|
+
* @default 20
|
|
20
|
+
*/
|
|
21
|
+
height?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Additional CSS class(es) to apply to the SparklineChart.
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Theme (provided through customization.)
|
|
28
|
+
*/
|
|
29
|
+
theme?: ITheme;
|
|
30
|
+
/**
|
|
31
|
+
* The prop used to define the culture to localized the numbers
|
|
32
|
+
*/
|
|
33
|
+
culture?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Prop used to determine whether to show the legend or not
|
|
36
|
+
*/
|
|
37
|
+
showLegend?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Call to provide customized styling that will layer on top of the variant rules.
|
|
40
|
+
*/
|
|
41
|
+
styles?: IStyleFunctionOrObject<ISparklineStyleProps, ISparklineStyles>;
|
|
42
|
+
}
|
|
43
|
+
export interface ISparklineStyles {
|
|
44
|
+
inlineBlock?: IStyle;
|
|
45
|
+
titleText?: IStyle;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparkline.types.js","sourceRoot":"../src/","sources":["components/Sparkline/Sparkline.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IChartProps } from '../../types/IDataPoint';\nimport { ICartesianChartStyleProps } from '../CommonComponents/index';\n\nexport interface ISparklineStyleProps extends ICartesianChartStyleProps {}\n\nexport interface ISparklineProps {\n /**\n * An array of chart data points for the Sparkline chart\n */\n data?: IChartProps;\n\n /**\n * Width of chart\n * * @default 80\n */\n width?: number;\n\n /**\n * Height of chart\n * @default 20\n */\n height?: number;\n\n /**\n * Additional CSS class(es) to apply to the SparklineChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * Prop used to determine whether to show the legend or not\n */\n showLegend?: boolean;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<ISparklineStyleProps, ISparklineStyles>;\n}\n\nexport interface ISparklineStyles {\n inlineBlock?: IStyle;\n titleText?: IStyle;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Sparkline/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,4DAAkC","sourcesContent":["export * from './Sparkline';\nexport * from './Sparkline.types';\n"]}
|
package/lib-commonjs/index.d.ts
CHANGED
package/lib-commonjs/index.js
CHANGED
|
@@ -16,5 +16,6 @@ tslib_1.__exportStar(require("./types/index"), exports);
|
|
|
16
16
|
tslib_1.__exportStar(require("./utilities/ChartHoverCard/index"), exports);
|
|
17
17
|
tslib_1.__exportStar(require("./HeatMapChart"), exports);
|
|
18
18
|
tslib_1.__exportStar(require("./SankeyChart"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./Sparkline"), exports);
|
|
19
20
|
require("./version");
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,uDAA6B;AAC7B,oDAA0B;AAC1B,sDAA4B;AAC5B,sDAA4B;AAC5B,qDAA2B;AAC3B,4DAAkC;AAClC,6DAAmC;AACnC,oEAA0C;AAC1C,oEAA0C;AAC1C,2DAAiC;AACjC,wDAA8B;AAC9B,2EAAiD;AACjD,yDAA+B;AAC/B,wDAA8B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,uDAA6B;AAC7B,oDAA0B;AAC1B,sDAA4B;AAC5B,sDAA4B;AAC5B,qDAA2B;AAC3B,4DAAkC;AAClC,6DAAmC;AACnC,oEAA0C;AAC1C,oEAA0C;AAC1C,2DAAiC;AACjC,wDAA8B;AAC9B,2EAAiD;AACjD,yDAA+B;AAC/B,wDAA8B;AAC9B,sDAA4B;AAE5B,qBAAmB","sourcesContent":["export * from './HorizontalBarChart';\nexport * from './DonutChart';\nexport * from './Legends';\nexport * from './LineChart';\nexport * from './AreaChart';\nexport * from './PieChart';\nexport * from './StackedBarChart';\nexport * from './VerticalBarChart';\nexport * from './VerticalStackedBarChart';\nexport * from './GroupedVerticalBarChart';\nexport * from './CartesianChart';\nexport * from './types/index';\nexport * from './utilities/ChartHoverCard/index';\nexport * from './HeatMapChart';\nexport * from './SankeyChart';\nexport * from './Sparkline';\n\nimport './version';\n"]}
|
package/lib-commonjs/version.js
CHANGED
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
// Do not modify this file; it is generated as part of publish.
|
|
4
4
|
// The checked in version is a placeholder only and will not be updated.
|
|
5
5
|
var set_version_1 = require("@fluentui/set-version");
|
|
6
|
-
set_version_1.setVersion('@fluentui/react-charting', '5.10.
|
|
6
|
+
set_version_1.setVersion('@fluentui/react-charting', '5.10.1');
|
|
7
7
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":";;AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,qDAAmD;AACnD,wBAAU,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/react-charting', '5.10.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":";;AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,qDAAmD;AACnD,wBAAU,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/react-charting', '5.10.1');"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-charting",
|
|
3
|
-
"version": "5.10.
|
|
3
|
+
"version": "5.10.1",
|
|
4
4
|
"description": "Experimental React charting components for building experiences for Microsoft 365.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
|
31
|
-
"@fluentui/react": "^8.78.
|
|
31
|
+
"@fluentui/react": "^8.78.1",
|
|
32
32
|
"@types/react-addons-test-utils": "0.14.18",
|
|
33
33
|
"@fluentui/scripts": "^1.0.0",
|
|
34
34
|
"@fluentui/jest-serializer-merge-styles": "^8.0.19"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"tslib": "^2.1.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@fluentui/react": "^8.78.
|
|
59
|
+
"@fluentui/react": "^8.78.1",
|
|
60
60
|
"@types/react": ">=16.8.0 <18.0.0",
|
|
61
61
|
"@types/react-dom": ">=16.8.0 <18.0.0",
|
|
62
62
|
"react": ">=16.8.0 <18.0.0",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ITheme, IStyle } from '@fluentui/react/lib/Styling';
|
|
2
|
+
import { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';
|
|
3
|
+
import { IChartProps } from '../../types/IDataPoint';
|
|
4
|
+
import { ICartesianChartStyleProps } from '../CommonComponents/index';
|
|
5
|
+
|
|
6
|
+
export interface ISparklineStyleProps extends ICartesianChartStyleProps {}
|
|
7
|
+
|
|
8
|
+
export interface ISparklineProps {
|
|
9
|
+
/**
|
|
10
|
+
* An array of chart data points for the Sparkline chart
|
|
11
|
+
*/
|
|
12
|
+
data?: IChartProps;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Width of chart
|
|
16
|
+
* * @default 80
|
|
17
|
+
*/
|
|
18
|
+
width?: number;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Height of chart
|
|
22
|
+
* @default 20
|
|
23
|
+
*/
|
|
24
|
+
height?: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Additional CSS class(es) to apply to the SparklineChart.
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Theme (provided through customization.)
|
|
33
|
+
*/
|
|
34
|
+
theme?: ITheme;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The prop used to define the culture to localized the numbers
|
|
38
|
+
*/
|
|
39
|
+
culture?: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Prop used to determine whether to show the legend or not
|
|
43
|
+
*/
|
|
44
|
+
showLegend?: boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Call to provide customized styling that will layer on top of the variant rules.
|
|
48
|
+
*/
|
|
49
|
+
styles?: IStyleFunctionOrObject<ISparklineStyleProps, ISparklineStyles>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ISparklineStyles {
|
|
53
|
+
inlineBlock?: IStyle;
|
|
54
|
+
titleText?: IStyle;
|
|
55
|
+
}
|