@quillsql/react 2.9.6 → 2.9.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/dist/cjs/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/cjs/components/Chart/BarChart.js +5 -4
- package/dist/cjs/components/Chart/LineChart.js +2 -3
- package/dist/esm/components/Chart/BarChart.d.ts.map +1 -1
- package/dist/esm/components/Chart/BarChart.js +5 -4
- package/dist/esm/components/Chart/LineChart.js +2 -3
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/BarChart.tsx"],"names":[],"mappings":";AAgBA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,MAAM,EACN,WAAW,EACX,IAAI,EACJ,cAAc,EACd,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,GAC1B,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/BarChart.tsx"],"names":[],"mappings":";AAgBA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,MAAM,EACN,WAAW,EACX,IAAI,EACJ,cAAc,EACd,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,GAC1B,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,2CAiJA"}
|
|
@@ -10,6 +10,7 @@ const valueFormatter_1 = require("../../utils/valueFormatter");
|
|
|
10
10
|
const axisFormatter_1 = require("../../utils/axisFormatter");
|
|
11
11
|
const color_1 = require("../../utils/color");
|
|
12
12
|
const ChartTooltip_1 = __importDefault(require("../../components/Chart/ChartTooltip"));
|
|
13
|
+
const getDomain_1 = __importDefault(require("../../utils/getDomain"));
|
|
13
14
|
function BarChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesionGrid = false, }) {
|
|
14
15
|
if (!data || data.length === 0) {
|
|
15
16
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
@@ -26,9 +27,7 @@ function BarChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxis
|
|
|
26
27
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
27
28
|
...containerStyle,
|
|
28
29
|
boxSizing: 'content-box',
|
|
29
|
-
}, children: (0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: '100%', children: (0, jsx_runtime_1.jsxs)(recharts_1.BarChart, { data: data, layout: 'horizontal', children: [!hideCartesionGrid && ((0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { width: 44, hide: hideYAxis, axisLine: false, tickLine: false, type: "number",
|
|
30
|
-
// domain={getDomain(data, yAxisFields)}
|
|
31
|
-
tick: { transform: 'translate(-3, 0)' }, style: {
|
|
30
|
+
}, children: (0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: '100%', children: (0, jsx_runtime_1.jsxs)(recharts_1.BarChart, { data: data, layout: 'horizontal', children: [!hideCartesionGrid && ((0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { width: 44, hide: hideYAxis, axisLine: false, tickLine: false, type: "number", domain: (0, getDomain_1.default)(data, yAxisFields), tick: { transform: 'translate(-3, 0)' }, style: {
|
|
32
31
|
fontSize: '12px',
|
|
33
32
|
fontFamily: theme.chartLabelFontFamily,
|
|
34
33
|
}, tickFormatter: (tick) => (0, axisFormatter_1.axisFormatter)({
|
|
@@ -59,6 +58,8 @@ function BarChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxis
|
|
|
59
58
|
field: payload[0].dataKey,
|
|
60
59
|
fields: yAxisFields,
|
|
61
60
|
}), xAxisFormat: xAxisFormat, xAxisField: xAxisField, colors: colors }));
|
|
62
|
-
}, position: { y: 0 } }), yAxisFields.map((elem) => ((0, jsx_runtime_1.jsx)(recharts_1.Bar, { name: elem.label, dataKey: elem.field, stackId: isStacked &&
|
|
61
|
+
}, position: { y: 0 } }), yAxisFields.map((elem) => ((0, jsx_runtime_1.jsx)(recharts_1.Bar, { name: elem.label, dataKey: elem.field, stackId: isStacked &&
|
|
62
|
+
(elem.field?.replace('comparison_', '') ??
|
|
63
|
+
'unknown'), type: "linear", fill: (0, color_1.selectColor)(elem, colors, yAxisFields.findIndex((field) => field.field === elem.field?.replace('comparison_', ''))), isAnimationActive: isAnimationActive }, elem.field)))] }) }) }));
|
|
63
64
|
}
|
|
64
65
|
exports.default = BarChart;
|
|
@@ -10,6 +10,7 @@ const valueFormatter_1 = require("../../utils/valueFormatter");
|
|
|
10
10
|
const axisFormatter_1 = require("../../utils/axisFormatter");
|
|
11
11
|
const color_1 = require("../../utils/color");
|
|
12
12
|
const ChartTooltip_1 = __importDefault(require("../../components/Chart/ChartTooltip"));
|
|
13
|
+
const getDomain_1 = __importDefault(require("../../utils/getDomain"));
|
|
13
14
|
function LineChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesionGrid = false, }) {
|
|
14
15
|
if (!yAxisFields || !yAxisFields.length) {
|
|
15
16
|
return null;
|
|
@@ -36,9 +37,7 @@ function LineChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxi
|
|
|
36
37
|
value: tick,
|
|
37
38
|
field: xAxisField,
|
|
38
39
|
fields: [{ field: xAxisField, format: xAxisFormat }],
|
|
39
|
-
}) }), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { hide: hideYAxis, width: 44, axisLine: false, tickLine: false, type: "number",
|
|
40
|
-
// domain={getDomain(data, yAxisFields)}
|
|
41
|
-
tick: { transform: 'translate(-3, 0)' }, style: {
|
|
40
|
+
}) }), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { hide: hideYAxis, width: 44, axisLine: false, tickLine: false, type: "number", domain: (0, getDomain_1.default)(data, yAxisFields), tick: { transform: 'translate(-3, 0)' }, style: {
|
|
42
41
|
fontSize: '12px',
|
|
43
42
|
fontFamily: theme?.chartLabelFontFamily ||
|
|
44
43
|
theme?.fontFamily ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/BarChart.tsx"],"names":[],"mappings":";AAgBA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,MAAM,EACN,WAAW,EACX,IAAI,EACJ,cAAc,EACd,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,GAC1B,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/BarChart.tsx"],"names":[],"mappings":";AAgBA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,MAAM,EACN,WAAW,EACX,IAAI,EACJ,cAAc,EACd,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,SAAS,EACT,iBAAwB,EACxB,SAAiB,EACjB,SAAiB,EACjB,iBAAyB,GAC1B,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,2CAiJA"}
|
|
@@ -5,6 +5,7 @@ import { valueFormatter } from '../../utils/valueFormatter';
|
|
|
5
5
|
import { axisFormatter } from '../../utils/axisFormatter';
|
|
6
6
|
import { selectColor } from '../../utils/color';
|
|
7
7
|
import ChartTooltip from '../../components/Chart/ChartTooltip';
|
|
8
|
+
import getDomain from '../../utils/getDomain';
|
|
8
9
|
export default function BarChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesionGrid = false, }) {
|
|
9
10
|
if (!data || data.length === 0) {
|
|
10
11
|
return (_jsx("div", { style: {
|
|
@@ -21,9 +22,7 @@ export default function BarChart({ colors, yAxisFields, data, containerStyle, xA
|
|
|
21
22
|
return (_jsx("div", { style: {
|
|
22
23
|
...containerStyle,
|
|
23
24
|
boxSizing: 'content-box',
|
|
24
|
-
}, children: _jsx(ResponsiveContainer, { width: "100%", height: '100%', children: _jsxs(ReChartsBarChart, { data: data, layout: 'horizontal', children: [!hideCartesionGrid && (_jsx(CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), _jsx(YAxis, { width: 44, hide: hideYAxis, axisLine: false, tickLine: false, type: "number",
|
|
25
|
-
// domain={getDomain(data, yAxisFields)}
|
|
26
|
-
tick: { transform: 'translate(-3, 0)' }, style: {
|
|
25
|
+
}, children: _jsx(ResponsiveContainer, { width: "100%", height: '100%', children: _jsxs(ReChartsBarChart, { data: data, layout: 'horizontal', children: [!hideCartesionGrid && (_jsx(CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), _jsx(YAxis, { width: 44, hide: hideYAxis, axisLine: false, tickLine: false, type: "number", domain: getDomain(data, yAxisFields), tick: { transform: 'translate(-3, 0)' }, style: {
|
|
27
26
|
fontSize: '12px',
|
|
28
27
|
fontFamily: theme.chartLabelFontFamily,
|
|
29
28
|
}, tickFormatter: (tick) => axisFormatter({
|
|
@@ -54,5 +53,7 @@ export default function BarChart({ colors, yAxisFields, data, containerStyle, xA
|
|
|
54
53
|
field: payload[0].dataKey,
|
|
55
54
|
fields: yAxisFields,
|
|
56
55
|
}), xAxisFormat: xAxisFormat, xAxisField: xAxisField, colors: colors }));
|
|
57
|
-
}, position: { y: 0 } }), yAxisFields.map((elem) => (_jsx(Bar, { name: elem.label, dataKey: elem.field, stackId: isStacked &&
|
|
56
|
+
}, position: { y: 0 } }), yAxisFields.map((elem) => (_jsx(Bar, { name: elem.label, dataKey: elem.field, stackId: isStacked &&
|
|
57
|
+
(elem.field?.replace('comparison_', '') ??
|
|
58
|
+
'unknown'), type: "linear", fill: selectColor(elem, colors, yAxisFields.findIndex((field) => field.field === elem.field?.replace('comparison_', ''))), isAnimationActive: isAnimationActive }, elem.field)))] }) }) }));
|
|
58
59
|
}
|
|
@@ -5,6 +5,7 @@ import { valueFormatter } from '../../utils/valueFormatter';
|
|
|
5
5
|
import { axisFormatter } from '../../utils/axisFormatter';
|
|
6
6
|
import { selectColor } from '../../utils/color';
|
|
7
7
|
import ChartTooltip from '../../components/Chart/ChartTooltip';
|
|
8
|
+
import getDomain from '../../utils/getDomain';
|
|
8
9
|
export default function LineChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesionGrid = false, }) {
|
|
9
10
|
if (!yAxisFields || !yAxisFields.length) {
|
|
10
11
|
return null;
|
|
@@ -31,9 +32,7 @@ export default function LineChart({ colors, yAxisFields, data, containerStyle, x
|
|
|
31
32
|
value: tick,
|
|
32
33
|
field: xAxisField,
|
|
33
34
|
fields: [{ field: xAxisField, format: xAxisFormat }],
|
|
34
|
-
}) }), _jsx(YAxis, { hide: hideYAxis, width: 44, axisLine: false, tickLine: false, type: "number",
|
|
35
|
-
// domain={getDomain(data, yAxisFields)}
|
|
36
|
-
tick: { transform: 'translate(-3, 0)' }, style: {
|
|
35
|
+
}) }), _jsx(YAxis, { hide: hideYAxis, width: 44, axisLine: false, tickLine: false, type: "number", domain: getDomain(data, yAxisFields), tick: { transform: 'translate(-3, 0)' }, style: {
|
|
37
36
|
fontSize: '12px',
|
|
38
37
|
fontFamily: theme?.chartLabelFontFamily ||
|
|
39
38
|
theme?.fontFamily ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillsql/react",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.7",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./dist/esm/index.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "rm -rf dist && tsc -p tsconfig.json && tsc -p tsconfig.esm.json",
|
|
16
16
|
"dev": "tsc -p tsconfig.json -w & tsc -p tsconfig.esm.json",
|
|
17
|
-
"lint": "eslint . --max-warnings 0"
|
|
17
|
+
"lint": "eslint . --max-warnings 0",
|
|
18
|
+
"pub": "rm -rf dist && tsc -p tsconfig.json && tsc -p tsconfig.esm.json && npm publish --access public"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"@monaco-editor/react": "^4.5.1",
|