@tecsinapse/react-charts 0.0.2 → 1.0.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/LICENSE.md +21 -0
- package/README.md +78 -0
- package/dist/cjs/components/Dot/Dot.js +10 -0
- package/dist/cjs/components/Dot/styled.js +24 -0
- package/dist/cjs/components/Label/Label.js +14 -0
- package/dist/cjs/components/Label/styled.js +35 -0
- package/dist/cjs/components/PieChart/PieChart.js +95 -0
- package/dist/cjs/components/PieChart/functions.js +42 -0
- package/dist/cjs/components/PieChart/styled.js +22 -0
- package/dist/cjs/index.js +17 -0
- package/dist/cjs/styles/constants.js +65 -0
- package/dist/cjs/styles/functions.js +14 -0
- package/dist/esm/components/Dot/Dot.js +8 -0
- package/{src/components/Dot/styled.ts → dist/esm/components/Dot/styled.js} +5 -4
- package/dist/esm/components/Label/Label.js +12 -0
- package/dist/esm/components/Label/styled.js +32 -0
- package/dist/esm/components/PieChart/PieChart.js +93 -0
- package/dist/esm/components/PieChart/functions.js +38 -0
- package/{src/components/PieChart/styled.ts → dist/esm/components/PieChart/styled.js} +4 -3
- package/dist/esm/index.js +3 -0
- package/dist/esm/styles/constants.js +57 -0
- package/dist/esm/styles/functions.js +12 -0
- package/dist/types/components/Dot/styled.d.ts +16 -0
- package/dist/types/components/Label/styled.d.ts +23 -0
- package/dist/{components → types/components}/PieChart/functions.d.ts +4 -4
- package/dist/types/components/PieChart/styled.d.ts +14 -0
- package/dist/types/index.d.ts +3 -3
- package/{src/types/font.ts → dist/types/types/font.d.ts} +3 -4
- package/dist/types/{pie.d.ts → types/pie.d.ts} +1 -1
- package/dist/types/types/svg.d.ts +11 -0
- package/package.json +24 -79
- package/dist/components/Dot/Dot.js +0 -24
- package/dist/components/Dot/Dot.js.map +0 -1
- package/dist/components/Dot/index.js +0 -16
- package/dist/components/Dot/index.js.map +0 -1
- package/dist/components/Dot/styled.d.ts +0 -16
- package/dist/components/Dot/styled.js +0 -35
- package/dist/components/Dot/styled.js.map +0 -1
- package/dist/components/Label/Label.js +0 -40
- package/dist/components/Label/Label.js.map +0 -1
- package/dist/components/Label/index.js +0 -16
- package/dist/components/Label/index.js.map +0 -1
- package/dist/components/Label/styled.d.ts +0 -23
- package/dist/components/Label/styled.js +0 -59
- package/dist/components/Label/styled.js.map +0 -1
- package/dist/components/PieChart/PieChart.js +0 -97
- package/dist/components/PieChart/PieChart.js.map +0 -1
- package/dist/components/PieChart/functions.js +0 -50
- package/dist/components/PieChart/functions.js.map +0 -1
- package/dist/components/PieChart/index.js +0 -16
- package/dist/components/PieChart/index.js.map +0 -1
- package/dist/components/PieChart/styled.d.ts +0 -14
- package/dist/components/PieChart/styled.js +0 -30
- package/dist/components/PieChart/styled.js.map +0 -1
- package/dist/components/index.js +0 -14
- package/dist/components/index.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -45
- package/dist/index.js.map +0 -1
- package/dist/styles/constants.js +0 -63
- package/dist/styles/constants.js.map +0 -1
- package/dist/styles/functions.js +0 -21
- package/dist/styles/functions.js.map +0 -1
- package/dist/styles/index.js +0 -32
- package/dist/styles/index.js.map +0 -1
- package/dist/types/font.d.ts +0 -6
- package/dist/types/font.js +0 -6
- package/dist/types/font.js.map +0 -1
- package/dist/types/index.js +0 -45
- package/dist/types/index.js.map +0 -1
- package/dist/types/pie.js +0 -6
- package/dist/types/pie.js.map +0 -1
- package/dist/types/svg.d.ts +0 -11
- package/dist/types/svg.js +0 -6
- package/dist/types/svg.js.map +0 -1
- package/src/components/Dot/Dot.tsx +0 -12
- package/src/components/Dot/index.ts +0 -1
- package/src/components/Label/Label.tsx +0 -31
- package/src/components/Label/index.ts +0 -1
- package/src/components/Label/styled.ts +0 -47
- package/src/components/PieChart/PieChart.tsx +0 -122
- package/src/components/PieChart/functions.ts +0 -70
- package/src/components/PieChart/index.ts +0 -1
- package/src/components/index.ts +0 -1
- package/src/index.ts +0 -3
- package/src/styles/constants.ts +0 -55
- package/src/styles/functions.ts +0 -17
- package/src/styles/index.ts +0 -2
- package/src/types/pie.ts +0 -7
- package/src/types/svg.ts +0 -31
- /package/dist/{components → types/components}/Dot/Dot.d.ts +0 -0
- /package/dist/{components → types/components}/Dot/index.d.ts +0 -0
- /package/dist/{components → types/components}/Label/Label.d.ts +0 -0
- /package/dist/{components → types/components}/Label/index.d.ts +0 -0
- /package/dist/{components → types/components}/PieChart/PieChart.d.ts +0 -0
- /package/dist/{components → types/components}/PieChart/index.d.ts +0 -0
- /package/dist/{components → types/components}/index.d.ts +0 -0
- /package/dist/{styles → types/styles}/constants.d.ts +0 -0
- /package/dist/{styles → types/styles}/functions.d.ts +0 -0
- /package/dist/{styles → types/styles}/index.d.ts +0 -0
- /package/{src/types/index.ts → dist/types/types/index.d.ts} +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _reactNativeSvg = require("react-native-svg");
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _reactNativeSvgCharts = require("react-native-svg-charts");
|
|
13
|
-
|
|
14
|
-
var _Label = require("../Label");
|
|
15
|
-
|
|
16
|
-
var _functions = require("./functions");
|
|
17
|
-
|
|
18
|
-
var _styled = require("./styled");
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
|
-
const PieChart = ({
|
|
23
|
-
data,
|
|
24
|
-
dimension = 200,
|
|
25
|
-
radius = 32,
|
|
26
|
-
label,
|
|
27
|
-
sub,
|
|
28
|
-
labelProps,
|
|
29
|
-
subProps,
|
|
30
|
-
columns = 1,
|
|
31
|
-
chartConfig
|
|
32
|
-
}) => {
|
|
33
|
-
const inner = 90 - radius * 100 / (dimension / 2);
|
|
34
|
-
const chart = data.map((item, index) => ({
|
|
35
|
-
value: item.value,
|
|
36
|
-
svg: {
|
|
37
|
-
fill: item.color,
|
|
38
|
-
...(0, _functions.getCallback)(item.value, item.label, item.onPress)
|
|
39
|
-
},
|
|
40
|
-
...(0, _functions.getFeatured)(item.featured ?? false),
|
|
41
|
-
key: `pie-${index}`
|
|
42
|
-
}));
|
|
43
|
-
const sum = data.reduce((prev, curr) => prev + curr.value, 0);
|
|
44
|
-
const {
|
|
45
|
-
textAnchor,
|
|
46
|
-
alignmentBaseline,
|
|
47
|
-
fontSize = 32,
|
|
48
|
-
fontWeight,
|
|
49
|
-
fontFamily,
|
|
50
|
-
fill,
|
|
51
|
-
y = sub ? -5 : undefined
|
|
52
|
-
} = (0, _functions.getTextStyles)(labelProps, 'bold', chartConfig);
|
|
53
|
-
const {
|
|
54
|
-
textAnchor: textAnchorSub,
|
|
55
|
-
alignmentBaseline: alignmentBaselineSub,
|
|
56
|
-
fontSize: fontSizeSub = 14,
|
|
57
|
-
fontWeight: fontWeightSub,
|
|
58
|
-
fontFamily: fontFamilySub,
|
|
59
|
-
fill: fillSub,
|
|
60
|
-
y: ySub = 16
|
|
61
|
-
} = (0, _functions.getTextStyles)(subProps, 'bold', chartConfig);
|
|
62
|
-
return _react.default.createElement(_styled.Container, null, _react.default.createElement(_reactNativeSvgCharts.PieChart, {
|
|
63
|
-
style: {
|
|
64
|
-
width: dimension,
|
|
65
|
-
height: dimension,
|
|
66
|
-
flex: 1
|
|
67
|
-
},
|
|
68
|
-
data: chart,
|
|
69
|
-
padAngle: 0,
|
|
70
|
-
innerRadius: `${inner}%`
|
|
71
|
-
}, _react.default.createElement(_reactNativeSvg.Text, {
|
|
72
|
-
textAnchor: textAnchor,
|
|
73
|
-
alignmentBaseline: alignmentBaseline,
|
|
74
|
-
fontSize: fontSize,
|
|
75
|
-
fontWeight: fontWeight,
|
|
76
|
-
fontFamily: fontFamily,
|
|
77
|
-
fill: fill,
|
|
78
|
-
y: y
|
|
79
|
-
}, label ?? sum), sub && _react.default.createElement(_reactNativeSvg.Text, {
|
|
80
|
-
textAnchor: textAnchorSub,
|
|
81
|
-
alignmentBaseline: alignmentBaselineSub,
|
|
82
|
-
fontSize: fontSizeSub,
|
|
83
|
-
fontWeight: fontWeightSub,
|
|
84
|
-
fontFamily: fontFamilySub,
|
|
85
|
-
fill: fillSub,
|
|
86
|
-
y: ySub
|
|
87
|
-
}, sub)), _react.default.createElement(_styled.LabelsContainer, null, data.map(item => _react.default.createElement(_Label.Label, {
|
|
88
|
-
data: item,
|
|
89
|
-
columns: columns,
|
|
90
|
-
key: item.label,
|
|
91
|
-
chartConfig: chartConfig
|
|
92
|
-
}))));
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
var _default = PieChart;
|
|
96
|
-
exports.default = _default;
|
|
97
|
-
//# sourceMappingURL=PieChart.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PieChart/PieChart.tsx"],"names":["PieChart","data","dimension","radius","label","sub","labelProps","subProps","columns","chartConfig","inner","chart","map","item","index","value","svg","fill","color","onPress","featured","key","sum","reduce","prev","curr","textAnchor","alignmentBaseline","fontSize","fontWeight","fontFamily","y","undefined","textAnchorSub","alignmentBaselineSub","fontSizeSub","fontWeightSub","fontFamilySub","fillSub","ySub","width","height","flex"],"mappings":"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","sourcesContent":["import { Text } from 'react-native-svg';\nimport React from 'react';\nimport { PieChart as PChart } from 'react-native-svg-charts';\nimport { Label } from '../Label';\nimport { FontFamily, PieChartData, SvgTextType } from '../../types';\nimport { getCallback, getFeatured, getTextStyles } from './functions';\nimport { Container, LabelsContainer } from './styled';\n\nexport interface PieChartProps {\n data: PieChartData[];\n /** Chart width/height (square view, in px) */\n dimension?: number;\n /** Chart pie area radius (in px) */\n radius?: number;\n label?: string;\n /** You should specify at least fontFamily */\n labelProps?: SvgTextType;\n sub?: string;\n /** You should specify at least fontFamily */\n subProps?: SvgTextType;\n /** Number of label columns */\n columns?: number;\n /** This should be used if you have a custom font configuration */\n chartConfig?: {\n fontFamily: FontFamily;\n };\n}\n\nconst PieChart: React.FC<PieChartProps> = ({\n data,\n dimension = 200,\n radius = 32,\n label,\n sub,\n labelProps,\n subProps,\n columns = 1,\n chartConfig,\n}) => {\n /** 90 is to compensate the outerRadius featured option */\n const inner = 90 - (radius * 100) / (dimension / 2);\n\n const chart = data.map((item, index) => ({\n value: item.value,\n svg: {\n fill: item.color,\n ...getCallback(item.value, item.label, item.onPress),\n },\n ...getFeatured(item.featured ?? false),\n key: `pie-${index}`,\n }));\n\n const sum = data.reduce((prev, curr) => prev + curr.value, 0);\n\n const {\n textAnchor,\n alignmentBaseline,\n fontSize = 32,\n fontWeight,\n fontFamily,\n fill,\n y = sub ? -5 : undefined,\n } = getTextStyles(labelProps, 'bold', chartConfig);\n\n const {\n textAnchor: textAnchorSub,\n alignmentBaseline: alignmentBaselineSub,\n fontSize: fontSizeSub = 14,\n fontWeight: fontWeightSub,\n fontFamily: fontFamilySub,\n fill: fillSub,\n y: ySub = 16,\n } = getTextStyles(subProps, 'bold', chartConfig);\n\n return (\n <Container>\n <PChart\n style={{ width: dimension, height: dimension, flex: 1 }}\n data={chart}\n padAngle={0}\n innerRadius={`${inner}%`}\n >\n <Text\n textAnchor={textAnchor}\n alignmentBaseline={alignmentBaseline}\n fontSize={fontSize}\n fontWeight={fontWeight}\n fontFamily={fontFamily}\n fill={fill}\n y={y}\n >\n {label ?? sum}\n </Text>\n {sub && (\n <Text\n textAnchor={textAnchorSub}\n alignmentBaseline={alignmentBaselineSub}\n fontSize={fontSizeSub}\n fontWeight={fontWeightSub}\n fontFamily={fontFamilySub}\n fill={fillSub}\n y={ySub}\n >\n {sub}\n </Text>\n )}\n </PChart>\n <LabelsContainer>\n {data.map(item => (\n <Label\n data={item}\n columns={columns}\n key={item.label}\n chartConfig={chartConfig}\n />\n ))}\n </LabelsContainer>\n </Container>\n );\n};\n\nexport default PieChart;\n"],"file":"PieChart.js"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getTextStyles = exports.getFeatured = exports.getCallback = void 0;
|
|
7
|
-
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
|
-
var _styles = require("../../styles");
|
|
11
|
-
|
|
12
|
-
const getCallback = (value, label, fn) => {
|
|
13
|
-
if (!fn) return {};
|
|
14
|
-
return _reactNative.Platform.OS === 'web' ? {
|
|
15
|
-
onClick: () => fn === null || fn === void 0 ? void 0 : fn(value, label)
|
|
16
|
-
} : {
|
|
17
|
-
onPress: () => fn === null || fn === void 0 ? void 0 : fn(value, label)
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
exports.getCallback = getCallback;
|
|
22
|
-
|
|
23
|
-
const getFeatured = featured => ({
|
|
24
|
-
arc: {
|
|
25
|
-
outerRadius: featured ? '100%' : '90%'
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
exports.getFeatured = getFeatured;
|
|
30
|
-
|
|
31
|
-
const getTextStyles = (styles, defaultFontWeight, chartConfig) => {
|
|
32
|
-
const {
|
|
33
|
-
textAnchor = 'middle',
|
|
34
|
-
alignmentBaseline = 'middle',
|
|
35
|
-
fontSize,
|
|
36
|
-
fill = _styles.fontColor.dark,
|
|
37
|
-
y
|
|
38
|
-
} = styles || {};
|
|
39
|
-
return {
|
|
40
|
-
textAnchor,
|
|
41
|
-
alignmentBaseline,
|
|
42
|
-
fontSize,
|
|
43
|
-
fill,
|
|
44
|
-
y,
|
|
45
|
-
...(0, _styles.getFontFamilyAndWeight)(chartConfig === null || chartConfig === void 0 ? void 0 : chartConfig.fontFamily, (styles === null || styles === void 0 ? void 0 : styles.fontWeight) ?? defaultFontWeight)
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
exports.getTextStyles = getTextStyles;
|
|
50
|
-
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PieChart/functions.ts"],"names":["getCallback","value","label","fn","Platform","OS","onClick","onPress","getFeatured","featured","arc","outerRadius","getTextStyles","styles","defaultFontWeight","chartConfig","textAnchor","alignmentBaseline","fontSize","fill","fontColor","dark","y","fontFamily","fontWeight"],"mappings":";;;;;;;AAAA;;AAQA;;AAOO,MAAMA,WAAW,GAAG,CACzBC,KADyB,EAEzBC,KAFyB,EAGzBC,EAHyB,KAIN;AACnB,MAAI,CAACA,EAAL,EAAS,OAAO,EAAP;AACT,SAAOC,sBAASC,EAAT,KAAgB,KAAhB,GACH;AACEC,IAAAA,OAAO,EAAE,MAAMH,EAAN,aAAMA,EAAN,uBAAMA,EAAE,CAAGF,KAAH,EAAUC,KAAV;AADnB,GADG,GAIH;AACEK,IAAAA,OAAO,EAAE,MAAMJ,EAAN,aAAMA,EAAN,uBAAMA,EAAE,CAAGF,KAAH,EAAUC,KAAV;AADnB,GAJJ;AAOD,CAbM;;;;AAiBA,MAAMM,WAAW,GAAIC,QAAD,KAAsC;AAC/DC,EAAAA,GAAG,EAAE;AAAEC,IAAAA,WAAW,EAAEF,QAAQ,GAAG,MAAH,GAAY;AAAnC;AAD0D,CAAtC,CAApB;;;;AAcA,MAAMG,aAAa,GAAG,CAC3BC,MAD2B,EAE3BC,iBAF2B,EAG3BC,WAH2B,KAIN;AACrB,QAAM;AACJC,IAAAA,UAAU,GAAG,QADT;AAEJC,IAAAA,iBAAiB,GAAG,QAFhB;AAGJC,IAAAA,QAHI;AAIJC,IAAAA,IAAI,GAAGC,kBAAUC,IAJb;AAKJC,IAAAA;AALI,MAMFT,MAAM,IAAI,EANd;AAOA,SAAO;AACLG,IAAAA,UADK;AAELC,IAAAA,iBAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,IAJK;AAKLG,IAAAA,CALK;AAML,OAAG,oCACDP,WADC,aACDA,WADC,uBACDA,WAAW,CAAEQ,UADZ,EAED,CAAAV,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEW,UAAR,KAAsBV,iBAFrB;AANE,GAAP;AAWD,CAvBM","sourcesContent":["import { Platform } from 'react-native';\nimport {\n AlignmentBaseline,\n FontFamily,\n FontWeight,\n SvgTextType,\n TextAnchor,\n} from '../../types';\nimport { fontColor, getFontFamilyAndWeight } from '../../styles';\n\ntype CallbackReturn =\n | Record<string, unknown>\n | { onClick: () => undefined }\n | { onPress: () => undefined };\n\nexport const getCallback = (\n value: number,\n label?: string,\n fn?: (value: number, label?: string) => void\n): CallbackReturn => {\n if (!fn) return {};\n return Platform.OS === 'web'\n ? {\n onClick: () => fn?.(value, label),\n }\n : {\n onPress: () => fn?.(value, label),\n };\n};\n\ntype FeaturedType = { arc: { outerRadius: string } };\n\nexport const getFeatured = (featured: boolean): FeaturedType => ({\n arc: { outerRadius: featured ? '100%' : '90%' },\n});\n\ntype TextStylesReturn = {\n fontFamily: string;\n y: number | undefined;\n fontSize: number | undefined;\n textAnchor: TextAnchor;\n fill: string;\n alignmentBaseline: AlignmentBaseline;\n fontWeight: string;\n};\n\nexport const getTextStyles = (\n styles: SvgTextType | undefined,\n defaultFontWeight: FontWeight,\n chartConfig: { fontFamily: FontFamily } | undefined\n): TextStylesReturn => {\n const {\n textAnchor = 'middle',\n alignmentBaseline = 'middle',\n fontSize,\n fill = fontColor.dark,\n y,\n } = styles || {};\n return {\n textAnchor,\n alignmentBaseline,\n fontSize,\n fill,\n y,\n ...getFontFamilyAndWeight(\n chartConfig?.fontFamily,\n styles?.fontWeight ?? defaultFontWeight\n ),\n };\n};\n"],"file":"functions.js"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "PieChart", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _PieChart.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
var _PieChart = _interopRequireDefault(require("./PieChart"));
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PieChart/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { default as PieChart } from './PieChart';\n"],"file":"index.js"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
export declare const Container: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
4
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
-
as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
|
6
|
-
}, {}, {
|
|
7
|
-
ref?: ((instance: View | null) => void) | import("react").RefObject<View> | null | undefined;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const LabelsContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
10
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
-
as?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
|
12
|
-
}, {}, {
|
|
13
|
-
ref?: ((instance: View | null) => void) | import("react").RefObject<View> | null | undefined;
|
|
14
|
-
}>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.LabelsContainer = exports.Container = void 0;
|
|
7
|
-
|
|
8
|
-
var _native = _interopRequireDefault(require("@emotion/native"));
|
|
9
|
-
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
const Container = (0, _native.default)(_reactNative.View)`
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: space-between;
|
|
19
|
-
flex: 1;
|
|
20
|
-
`;
|
|
21
|
-
exports.Container = Container;
|
|
22
|
-
const LabelsContainer = (0, _native.default)(_reactNative.View)`
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: row;
|
|
25
|
-
flex-wrap: wrap;
|
|
26
|
-
justify-content: space-between;
|
|
27
|
-
width: 100%;
|
|
28
|
-
`;
|
|
29
|
-
exports.LabelsContainer = LabelsContainer;
|
|
30
|
-
//# sourceMappingURL=styled.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PieChart/styled.ts"],"names":["Container","View","LabelsContainer"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEO,MAAMA,SAAS,GAAG,qBAAOC,iBAAP,CAAa;AACtC;AACA;AACA;AACA;AACA;AACA,CANO;;AAQA,MAAMC,eAAe,GAAG,qBAAOD,iBAAP,CAAa;AAC5C;AACA;AACA;AACA;AACA;AACA,CANO","sourcesContent":["import styled from '@emotion/native';\nimport { View } from 'react-native';\n\nexport const Container = styled(View)`\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n flex: 1;\n`;\n\nexport const LabelsContainer = styled(View)`\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: space-between;\n width: 100%;\n`;\n"],"file":"styled.js"}
|
package/dist/components/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "PieChart", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _PieChart.PieChart;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
var _PieChart = require("./PieChart");
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA","sourcesContent":["export { PieChart } from './PieChart';\n"],"file":"index.js"}
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _components = require("./components");
|
|
8
|
-
|
|
9
|
-
Object.keys(_components).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _components[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _components[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
var _types = require("./types");
|
|
21
|
-
|
|
22
|
-
Object.keys(_types).forEach(function (key) {
|
|
23
|
-
if (key === "default" || key === "__esModule") return;
|
|
24
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
25
|
-
Object.defineProperty(exports, key, {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _types[key];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var _styles = require("./styles");
|
|
34
|
-
|
|
35
|
-
Object.keys(_styles).forEach(function (key) {
|
|
36
|
-
if (key === "default" || key === "__esModule") return;
|
|
37
|
-
if (key in exports && exports[key] === _styles[key]) return;
|
|
38
|
-
Object.defineProperty(exports, key, {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function () {
|
|
41
|
-
return _styles[key];
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './components';\nexport * from './types';\nexport * from './styles';\n"],"file":"index.js"}
|
package/dist/styles/constants.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.nativeFontStack = exports.fontWeight = exports.fontStack = exports.borderRadius = exports.iconSize = exports.spacing = exports.fontColor = void 0;
|
|
7
|
-
const fontColor = {
|
|
8
|
-
light: '#fff',
|
|
9
|
-
medium: '#85807a',
|
|
10
|
-
dark: '#353231',
|
|
11
|
-
orange: '#f89907'
|
|
12
|
-
};
|
|
13
|
-
exports.fontColor = fontColor;
|
|
14
|
-
const spacing = {
|
|
15
|
-
nano: '2px',
|
|
16
|
-
micro: '4px',
|
|
17
|
-
mili: '8px',
|
|
18
|
-
centi: '12px',
|
|
19
|
-
deca: '16px',
|
|
20
|
-
kilo: '24px',
|
|
21
|
-
mega: '32px',
|
|
22
|
-
giga: '40px',
|
|
23
|
-
tera: '48px',
|
|
24
|
-
peta: '56px',
|
|
25
|
-
hexa: '64px'
|
|
26
|
-
};
|
|
27
|
-
exports.spacing = spacing;
|
|
28
|
-
const iconSize = {
|
|
29
|
-
micro: '12px',
|
|
30
|
-
mili: '14px',
|
|
31
|
-
centi: '16px',
|
|
32
|
-
deca: '18px',
|
|
33
|
-
kilo: '24px',
|
|
34
|
-
mega: '32px'
|
|
35
|
-
};
|
|
36
|
-
exports.iconSize = iconSize;
|
|
37
|
-
const borderRadius = {
|
|
38
|
-
nano: '2px',
|
|
39
|
-
micro: '4px',
|
|
40
|
-
mili: '8px',
|
|
41
|
-
centi: '16px',
|
|
42
|
-
deca: '24px',
|
|
43
|
-
pill: '999999px'
|
|
44
|
-
};
|
|
45
|
-
exports.borderRadius = borderRadius;
|
|
46
|
-
const fontStack = {
|
|
47
|
-
default: 'Lato',
|
|
48
|
-
mono: 'Consolas, monaco, monospace'
|
|
49
|
-
};
|
|
50
|
-
exports.fontStack = fontStack;
|
|
51
|
-
const fontWeight = {
|
|
52
|
-
regular: '400',
|
|
53
|
-
bold: '700',
|
|
54
|
-
black: '900'
|
|
55
|
-
};
|
|
56
|
-
exports.fontWeight = fontWeight;
|
|
57
|
-
const nativeFontStack = {
|
|
58
|
-
black: 'Lato-Black',
|
|
59
|
-
bold: 'Lato-Bold',
|
|
60
|
-
regular: 'Lato-Regular'
|
|
61
|
-
};
|
|
62
|
-
exports.nativeFontStack = nativeFontStack;
|
|
63
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/styles/constants.ts"],"names":["fontColor","light","medium","dark","orange","spacing","nano","micro","mili","centi","deca","kilo","mega","giga","tera","peta","hexa","iconSize","borderRadius","pill","fontStack","default","mono","fontWeight","regular","bold","black","nativeFontStack"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,KAAK,EAAE,MADgB;AAEvBC,EAAAA,MAAM,EAAE,SAFe;AAGvBC,EAAAA,IAAI,EAAE,SAHiB;AAIvBC,EAAAA,MAAM,EAAE;AAJe,CAAlB;;AAOA,MAAMC,OAAO,GAAG;AACrBC,EAAAA,IAAI,EAAE,KADe;AAErBC,EAAAA,KAAK,EAAE,KAFc;AAGrBC,EAAAA,IAAI,EAAE,KAHe;AAIrBC,EAAAA,KAAK,EAAE,MAJc;AAKrBC,EAAAA,IAAI,EAAE,MALe;AAMrBC,EAAAA,IAAI,EAAE,MANe;AAOrBC,EAAAA,IAAI,EAAE,MAPe;AAQrBC,EAAAA,IAAI,EAAE,MARe;AASrBC,EAAAA,IAAI,EAAE,MATe;AAUrBC,EAAAA,IAAI,EAAE,MAVe;AAWrBC,EAAAA,IAAI,EAAE;AAXe,CAAhB;;AAcA,MAAMC,QAAQ,GAAG;AACtBV,EAAAA,KAAK,EAAE,MADe;AAEtBC,EAAAA,IAAI,EAAE,MAFgB;AAGtBC,EAAAA,KAAK,EAAE,MAHe;AAItBC,EAAAA,IAAI,EAAE,MAJgB;AAKtBC,EAAAA,IAAI,EAAE,MALgB;AAMtBC,EAAAA,IAAI,EAAE;AANgB,CAAjB;;AASA,MAAMM,YAAY,GAAG;AAC1BZ,EAAAA,IAAI,EAAE,KADoB;AAE1BC,EAAAA,KAAK,EAAE,KAFmB;AAG1BC,EAAAA,IAAI,EAAE,KAHoB;AAI1BC,EAAAA,KAAK,EAAE,MAJmB;AAK1BC,EAAAA,IAAI,EAAE,MALoB;AAM1BS,EAAAA,IAAI,EAAE;AANoB,CAArB;;AASA,MAAMC,SAAS,GAAG;AACvBC,EAAAA,OAAO,EAAE,MADc;AAEvBC,EAAAA,IAAI,EAAE;AAFiB,CAAlB;;AAKA,MAAMC,UAAU,GAAG;AACxBC,EAAAA,OAAO,EAAE,KADe;AAExBC,EAAAA,IAAI,EAAE,KAFkB;AAGxBC,EAAAA,KAAK,EAAE;AAHiB,CAAnB;;AAMA,MAAMC,eAAe,GAAG;AAC7BD,EAAAA,KAAK,EAAE,YADsB;AAE7BD,EAAAA,IAAI,EAAE,WAFuB;AAG7BD,EAAAA,OAAO,EAAE;AAHoB,CAAxB","sourcesContent":["export const fontColor = {\n light: '#fff',\n medium: '#85807a',\n dark: '#353231', // default\n orange: '#f89907',\n};\n\nexport const spacing = {\n nano: '2px',\n micro: '4px',\n mili: '8px',\n centi: '12px',\n deca: '16px',\n kilo: '24px',\n mega: '32px',\n giga: '40px',\n tera: '48px',\n peta: '56px',\n hexa: '64px',\n};\n\nexport const iconSize = {\n micro: '12px',\n mili: '14px',\n centi: '16px', // '1rem'\n deca: '18px', // '1.5rem'\n kilo: '24px', // '1.6rem'\n mega: '32px', // '2rem'\n};\n\nexport const borderRadius = {\n nano: '2px',\n micro: '4px',\n mili: '8px',\n centi: '16px',\n deca: '24px',\n pill: '999999px', // also circle\n};\n\nexport const fontStack = {\n default: 'Lato',\n mono: 'Consolas, monaco, monospace',\n};\n\nexport const fontWeight = {\n regular: '400',\n bold: '700',\n black: '900',\n};\n\nexport const nativeFontStack = {\n black: 'Lato-Black',\n bold: 'Lato-Bold',\n regular: 'Lato-Regular',\n};\n"],"file":"constants.js"}
|
package/dist/styles/functions.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getFontFamilyAndWeight = void 0;
|
|
7
|
-
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
|
-
var _constants = require("./constants");
|
|
11
|
-
|
|
12
|
-
const getFontFamilyAndWeight = (fontFamily, weight) => _reactNative.Platform.OS === 'web' ? {
|
|
13
|
-
fontFamily: fontFamily ? fontFamily[weight] : _constants.fontStack.default,
|
|
14
|
-
fontWeight: _constants.fontWeight[weight]
|
|
15
|
-
} : {
|
|
16
|
-
fontFamily: fontFamily ? fontFamily[weight] : _constants.nativeFontStack[weight],
|
|
17
|
-
fontWeight: _constants.fontWeight[weight]
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
exports.getFontFamilyAndWeight = getFontFamilyAndWeight;
|
|
21
|
-
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/styles/functions.ts"],"names":["getFontFamilyAndWeight","fontFamily","weight","Platform","OS","fontStack","default","fontWeight","nativeFontStack"],"mappings":";;;;;;;AAAA;;AACA;;AAGO,MAAMA,sBAAsB,GAAG,CACpCC,UADoC,EAEpCC,MAFoC,KAIpCC,sBAASC,EAAT,KAAgB,KAAhB,GACI;AACEH,EAAAA,UAAU,EAAEA,UAAU,GAAGA,UAAU,CAACC,MAAD,CAAb,GAAwBG,qBAAUC,OAD1D;AAEEC,EAAAA,UAAU,EAAEA,sBAAWL,MAAX;AAFd,CADJ,GAKI;AACED,EAAAA,UAAU,EAAEA,UAAU,GAAGA,UAAU,CAACC,MAAD,CAAb,GAAwBM,2BAAgBN,MAAhB,CADhD;AAEEK,EAAAA,UAAU,EAAEA,sBAAWL,MAAX;AAFd,CATC","sourcesContent":["import { Platform } from 'react-native';\nimport { fontStack, fontWeight, nativeFontStack } from './constants';\nimport { FontFamily, FontWeight } from '../types';\n\nexport const getFontFamilyAndWeight = (\n fontFamily: FontFamily | undefined,\n weight: FontWeight\n): { fontFamily: string; fontWeight: string } =>\n Platform.OS === 'web'\n ? {\n fontFamily: fontFamily ? fontFamily[weight] : fontStack.default,\n fontWeight: fontWeight[weight],\n }\n : {\n fontFamily: fontFamily ? fontFamily[weight] : nativeFontStack[weight],\n fontWeight: fontWeight[weight],\n };\n"],"file":"functions.js"}
|
package/dist/styles/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _constants = require("./constants");
|
|
8
|
-
|
|
9
|
-
Object.keys(_constants).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _constants[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _constants[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
var _functions = require("./functions");
|
|
21
|
-
|
|
22
|
-
Object.keys(_functions).forEach(function (key) {
|
|
23
|
-
if (key === "default" || key === "__esModule") return;
|
|
24
|
-
if (key in exports && exports[key] === _functions[key]) return;
|
|
25
|
-
Object.defineProperty(exports, key, {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _functions[key];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
package/dist/styles/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/styles/index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './constants';\nexport * from './functions';\n"],"file":"index.js"}
|
package/dist/types/font.d.ts
DELETED
package/dist/types/font.js
DELETED
package/dist/types/font.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"font.js"}
|
package/dist/types/index.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _svg = require("./svg");
|
|
8
|
-
|
|
9
|
-
Object.keys(_svg).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _svg[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _svg[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
var _pie = require("./pie");
|
|
21
|
-
|
|
22
|
-
Object.keys(_pie).forEach(function (key) {
|
|
23
|
-
if (key === "default" || key === "__esModule") return;
|
|
24
|
-
if (key in exports && exports[key] === _pie[key]) return;
|
|
25
|
-
Object.defineProperty(exports, key, {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _pie[key];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var _font = require("./font");
|
|
34
|
-
|
|
35
|
-
Object.keys(_font).forEach(function (key) {
|
|
36
|
-
if (key === "default" || key === "__esModule") return;
|
|
37
|
-
if (key in exports && exports[key] === _font[key]) return;
|
|
38
|
-
Object.defineProperty(exports, key, {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function () {
|
|
41
|
-
return _font[key];
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './svg';\nexport * from './pie';\nexport * from './font';\n"],"file":"index.js"}
|
package/dist/types/pie.js
DELETED
package/dist/types/pie.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"pie.js"}
|
package/dist/types/svg.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FontWeight } from './font';
|
|
2
|
-
export declare type AlignmentBaseline = 'baseline' | 'text-bottom' | 'alphabetic' | 'ideographic' | 'middle' | 'central' | 'mathematical' | 'text-top' | 'bottom' | 'center' | 'top' | 'text-before-edge' | 'text-after-edge' | 'before-edge' | 'after-edge' | 'hanging';
|
|
3
|
-
export declare type TextAnchor = 'start' | 'middle' | 'end';
|
|
4
|
-
export declare type SvgTextType = {
|
|
5
|
-
textAnchor?: TextAnchor;
|
|
6
|
-
alignmentBaseline?: AlignmentBaseline;
|
|
7
|
-
fontSize?: number;
|
|
8
|
-
fontWeight?: FontWeight;
|
|
9
|
-
fill?: string;
|
|
10
|
-
y?: number;
|
|
11
|
-
};
|
package/dist/types/svg.js
DELETED
package/dist/types/svg.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"svg.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Dot } from './Dot';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Dot } from '../Dot';
|
|
3
|
-
import { FontFamily, PieChartData } from '../../types';
|
|
4
|
-
import { Container, Text } from './styled';
|
|
5
|
-
import { getFontFamilyAndWeight } from '../../styles';
|
|
6
|
-
|
|
7
|
-
interface LabelProps {
|
|
8
|
-
columns: number;
|
|
9
|
-
data: PieChartData;
|
|
10
|
-
chartConfig?: {
|
|
11
|
-
fontFamily: FontFamily;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const Label: React.FC<LabelProps> = ({ columns, data, chartConfig }) => {
|
|
16
|
-
const valueFont = getFontFamilyAndWeight(chartConfig?.fontFamily, 'bold');
|
|
17
|
-
const labelFont = getFontFamilyAndWeight(chartConfig?.fontFamily, 'regular');
|
|
18
|
-
return (
|
|
19
|
-
<Container columns={columns}>
|
|
20
|
-
<Dot color={data.color} />
|
|
21
|
-
<Text font={labelFont} expand>
|
|
22
|
-
{data.label}
|
|
23
|
-
</Text>
|
|
24
|
-
<Text font={valueFont} flexEnd>
|
|
25
|
-
{data.value}
|
|
26
|
-
</Text>
|
|
27
|
-
</Container>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default Label;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Label } from './Label';
|