@credithub/harlan-components 1.3.4 → 1.4.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/lib/cjs/components/ccf/ccf.js +2 -5
- package/lib/cjs/components/chart/categoryProtestos.d.ts +4 -0
- package/lib/cjs/components/chart/categoryProtestos.js +97 -0
- package/lib/cjs/components/chart/chartContent.d.ts +7 -0
- package/lib/cjs/components/chart/chartContent.js +77 -0
- package/lib/cjs/components/chart/chartHelper.d.ts +7 -0
- package/lib/cjs/components/chart/chartHelper.js +66 -0
- package/lib/cjs/components/chart/customChart.d.ts +10 -0
- package/lib/cjs/components/chart/customChart.js +125 -0
- package/lib/cjs/components/chart/getUniqueDates.d.ts +2 -0
- package/lib/cjs/components/chart/getUniqueDates.js +8 -0
- package/lib/cjs/components/chart/plotly/barChartDataStrategy.d.ts +14 -0
- package/lib/cjs/components/chart/plotly/barChartDataStrategy.js +152 -0
- package/lib/cjs/components/chart/plotly/baseChartDataStrategy.d.ts +8 -0
- package/lib/cjs/components/chart/plotly/baseChartDataStrategy.js +31 -0
- package/lib/cjs/components/chart/plotly/getSeries.d.ts +3 -0
- package/lib/cjs/components/chart/plotly/getSeries.js +35 -0
- package/lib/cjs/components/chart/plotly/iChartDataStrategy.d.ts +35 -0
- package/lib/cjs/components/chart/plotly/iChartDataStrategy.js +2 -0
- package/lib/cjs/components/chart/plotly/index.d.ts +5 -0
- package/lib/cjs/components/chart/plotly/index.js +20 -0
- package/lib/cjs/components/chart/plotly/layoutLineBarChart.d.ts +39 -0
- package/lib/cjs/components/chart/plotly/layoutLineBarChart.js +65 -0
- package/lib/cjs/components/chart/plotly/lineChartDataStrategy.d.ts +17 -0
- package/lib/cjs/components/chart/plotly/lineChartDataStrategy.js +198 -0
- package/lib/cjs/components/chart/plotly/pieChartDataStrategy.d.ts +5 -0
- package/lib/cjs/components/chart/plotly/pieChartDataStrategy.js +45 -0
- package/lib/cjs/components/chart/plotly/types.d.ts +40 -0
- package/lib/cjs/components/chart/plotly/types.js +2 -0
- package/lib/cjs/components/chart/processChartData.d.ts +5 -0
- package/lib/cjs/components/chart/processChartData.js +41 -0
- package/lib/cjs/components/chart/quantityResult.d.ts +17 -0
- package/lib/cjs/components/chart/quantityResult.js +38 -0
- package/lib/cjs/components/chart/useCalculation.d.ts +6 -0
- package/lib/cjs/components/chart/useCalculation.js +12 -0
- package/lib/cjs/components/chart/useUltimaOcorrenciaCCF.d.ts +2 -0
- package/lib/cjs/components/chart/useUltimaOcorrenciaCCF.js +20 -0
- package/lib/cjs/components/dossie/transactionTable/transactionTable.js +2 -4
- package/lib/cjs/components/processos-juridicos/processosJuridicosList.js +6 -3
- package/lib/cjs/components/protestos/getTotalProtestos.d.ts +1 -0
- package/lib/cjs/components/protestos/getTotalProtestos.js +10 -0
- package/lib/cjs/components/protestos/protestosCategory.js +1 -1
- package/lib/cjs/components/protestos/protestosList.js +2 -1
- package/lib/cjs/components/webservice.d.ts +14 -0
- package/lib/cjs/components/webservice.js +6 -5
- package/lib/cjs/consultaSimples.js +13 -11
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +4 -1
- package/lib/cjs/mock/mockDataInput.d.ts +34 -0
- package/lib/cjs/mock/mockDataInput.js +139 -0
- package/lib/cjs/utils/calculation.d.ts +9 -0
- package/lib/cjs/utils/calculation.js +23 -0
- package/lib/cjs/utils/date.d.ts +1 -0
- package/lib/cjs/utils/date.js +10 -0
- package/lib/cjs/utils/formatter.d.ts +2 -0
- package/lib/cjs/utils/formatter.js +7 -0
- package/lib/cjs/utils/number.d.ts +3 -2
- package/lib/cjs/utils/number.js +9 -5
- package/lib/cjs/utils/string.d.ts +1 -0
- package/lib/cjs/utils/string.js +8 -3
- package/lib/esm/components/ccf/ccf.js +2 -5
- package/lib/esm/components/chart/categoryProtestos.d.ts +4 -0
- package/lib/esm/components/chart/categoryProtestos.js +69 -0
- package/lib/esm/components/chart/chartContent.d.ts +7 -0
- package/lib/esm/components/chart/chartContent.js +49 -0
- package/lib/esm/components/chart/chartHelper.d.ts +7 -0
- package/lib/esm/components/chart/chartHelper.js +60 -0
- package/lib/esm/components/chart/customChart.d.ts +10 -0
- package/lib/esm/components/chart/customChart.js +95 -0
- package/lib/esm/components/chart/getUniqueDates.d.ts +2 -0
- package/lib/esm/components/chart/getUniqueDates.js +4 -0
- package/lib/esm/components/chart/plotly/barChartDataStrategy.d.ts +14 -0
- package/lib/esm/components/chart/plotly/barChartDataStrategy.js +149 -0
- package/lib/esm/components/chart/plotly/baseChartDataStrategy.d.ts +8 -0
- package/lib/esm/components/chart/plotly/baseChartDataStrategy.js +28 -0
- package/lib/esm/components/chart/plotly/getSeries.d.ts +3 -0
- package/lib/esm/components/chart/plotly/getSeries.js +31 -0
- package/lib/esm/components/chart/plotly/iChartDataStrategy.d.ts +35 -0
- package/lib/esm/components/chart/plotly/iChartDataStrategy.js +1 -0
- package/lib/esm/components/chart/plotly/index.d.ts +5 -0
- package/lib/esm/components/chart/plotly/index.js +5 -0
- package/lib/esm/components/chart/plotly/layoutLineBarChart.d.ts +39 -0
- package/lib/esm/components/chart/plotly/layoutLineBarChart.js +62 -0
- package/lib/esm/components/chart/plotly/lineChartDataStrategy.d.ts +17 -0
- package/lib/esm/components/chart/plotly/lineChartDataStrategy.js +195 -0
- package/lib/esm/components/chart/plotly/pieChartDataStrategy.d.ts +5 -0
- package/lib/esm/components/chart/plotly/pieChartDataStrategy.js +42 -0
- package/lib/esm/components/chart/plotly/types.d.ts +40 -0
- package/lib/esm/components/chart/plotly/types.js +1 -0
- package/lib/esm/components/chart/processChartData.d.ts +5 -0
- package/lib/esm/components/chart/processChartData.js +37 -0
- package/lib/esm/components/chart/quantityResult.d.ts +17 -0
- package/lib/esm/components/chart/quantityResult.js +33 -0
- package/lib/esm/components/chart/useCalculation.d.ts +6 -0
- package/lib/esm/components/chart/useCalculation.js +8 -0
- package/lib/esm/components/chart/useUltimaOcorrenciaCCF.d.ts +2 -0
- package/lib/esm/components/chart/useUltimaOcorrenciaCCF.js +15 -0
- package/lib/esm/components/dossie/transactionTable/transactionTable.js +2 -4
- package/lib/esm/components/processos-juridicos/processosJuridicosList.js +6 -3
- package/lib/esm/components/protestos/getTotalProtestos.d.ts +1 -0
- package/lib/esm/components/protestos/getTotalProtestos.js +4 -0
- package/lib/esm/components/protestos/protestosCategory.js +1 -1
- package/lib/esm/components/protestos/protestosList.js +2 -1
- package/lib/esm/components/webservice.d.ts +14 -0
- package/lib/esm/components/webservice.js +3 -2
- package/lib/esm/consultaSimples.js +14 -12
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/mock/mockDataInput.d.ts +34 -0
- package/lib/esm/mock/mockDataInput.js +137 -0
- package/lib/esm/utils/calculation.d.ts +9 -0
- package/lib/esm/utils/calculation.js +17 -0
- package/lib/esm/utils/date.d.ts +1 -0
- package/lib/esm/utils/date.js +6 -0
- package/lib/esm/utils/formatter.d.ts +2 -0
- package/lib/esm/utils/formatter.js +5 -0
- package/lib/esm/utils/number.d.ts +3 -2
- package/lib/esm/utils/number.js +7 -4
- package/lib/esm/utils/string.d.ts +1 -0
- package/lib/esm/utils/string.js +6 -2
- package/package.json +8 -2
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import Plot from "react-plotly.js";
|
|
3
|
+
import { Queries } from "../webservice";
|
|
4
|
+
import XPathUtils from "../../utils/xpath";
|
|
5
|
+
import { REGEX_PROTESTOS_DE_CREDITO, REGEX_PROTESTOS_DE_IMPOSTO } from "../../constants/regex";
|
|
6
|
+
var CategoriaProtesto = function (_a) {
|
|
7
|
+
var _b = _a.width, width = _b === void 0 ? 600 : _b, _c = _a.height, height = _c === void 0 ? 400 : _c;
|
|
8
|
+
var ctx = useContext(Queries.Protestos);
|
|
9
|
+
var Section = ctx.Section;
|
|
10
|
+
return (React.createElement(Section, { hideHeader: true, onSuccess: function (document) {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
var filterProtestos = function (regex, data) {
|
|
13
|
+
return XPathUtils.select("//body//protesto", data).filter(function (protesto) {
|
|
14
|
+
return regex.test(XPathUtils.select("string(./nomeCedente)", protesto));
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var data = [
|
|
18
|
+
{
|
|
19
|
+
categoria: 'Protestos de Crédito',
|
|
20
|
+
quantidade: (_a = filterProtestos(REGEX_PROTESTOS_DE_CREDITO, document)) === null || _a === void 0 ? void 0 : _a.length
|
|
21
|
+
}, {
|
|
22
|
+
categoria: 'Protestos de Impostos',
|
|
23
|
+
quantidade: (_b = filterProtestos(REGEX_PROTESTOS_DE_IMPOSTO, document)) === null || _b === void 0 ? void 0 : _b.length
|
|
24
|
+
}, {
|
|
25
|
+
categoria: 'Protestos em Geral',
|
|
26
|
+
quantidade: (_c = XPathUtils.select("//body//protesto", document).filter(function (protesto) {
|
|
27
|
+
var nomeCedente = XPathUtils.select("string(./nomeCedente)", protesto);
|
|
28
|
+
return (!REGEX_PROTESTOS_DE_IMPOSTO.test(nomeCedente) &&
|
|
29
|
+
!REGEX_PROTESTOS_DE_CREDITO.test(nomeCedente));
|
|
30
|
+
})) === null || _c === void 0 ? void 0 : _c.length
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
// Filtrar dados com quantidade nula ou zero
|
|
34
|
+
var dadosFiltrados = data === null || data === void 0 ? void 0 : data.filter(function (dado) { return dado.quantidade > 0; });
|
|
35
|
+
if (dadosFiltrados.length === 0) {
|
|
36
|
+
return React.createElement(React.Fragment, null);
|
|
37
|
+
}
|
|
38
|
+
var categoriaParaCor = {
|
|
39
|
+
"Protestos de Crédito": 'red',
|
|
40
|
+
"Protestos de Impostos": "orange",
|
|
41
|
+
};
|
|
42
|
+
var categorias = dadosFiltrados.map(function (dado) { return dado.categoria; });
|
|
43
|
+
var quantidades = dadosFiltrados.map(function (dado) { return dado.quantidade; });
|
|
44
|
+
var cores = categorias.map(function (categoria) { return categoriaParaCor[categoria] || "rgb(30, 144, 255)"; });
|
|
45
|
+
var plotData = [
|
|
46
|
+
{
|
|
47
|
+
x: categorias,
|
|
48
|
+
y: quantidades,
|
|
49
|
+
type: "bar",
|
|
50
|
+
marker: {
|
|
51
|
+
color: cores,
|
|
52
|
+
},
|
|
53
|
+
text: quantidades.map(String),
|
|
54
|
+
textposition: "auto",
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
var layout = {
|
|
58
|
+
title: "Protestos por Categoria",
|
|
59
|
+
width: width,
|
|
60
|
+
height: height,
|
|
61
|
+
yaxis: { fixedrange: true, autorange: true },
|
|
62
|
+
xaxis: { fixedrange: true },
|
|
63
|
+
margin: { l: 50, r: 50, b: 100, t: 50, pad: 4 },
|
|
64
|
+
};
|
|
65
|
+
var config = { displayModeBar: false, responsive: true };
|
|
66
|
+
return React.createElement(Plot, { data: plotData, layout: layout, config: config });
|
|
67
|
+
} }));
|
|
68
|
+
};
|
|
69
|
+
export default CategoriaProtesto;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
2
|
+
import Plot from "react-plotly.js";
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
import { createPieChart } from "./chartHelper";
|
|
5
|
+
import { layoutLineBarChart } from "./plotly";
|
|
6
|
+
import { processChartData } from "./processChartData";
|
|
7
|
+
import { PieChartDataStrategy } from "./plotly/pieChartDataStrategy";
|
|
8
|
+
import { getUniqueDates } from "./getUniqueDates";
|
|
9
|
+
import { max } from "underscore";
|
|
10
|
+
import CategoriaProtesto from "./categoryProtestos";
|
|
11
|
+
var ChartContent = function (_a) {
|
|
12
|
+
var dataInput = _a.dataInput;
|
|
13
|
+
var _b = useState(window.innerWidth), windowWidth = _b[0], setWindowWidth = _b[1];
|
|
14
|
+
// Atualiza a largura da janela
|
|
15
|
+
var updateWindowWidth = function () {
|
|
16
|
+
setWindowWidth(window.innerWidth);
|
|
17
|
+
};
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
window.addEventListener("resize", updateWindowWidth);
|
|
20
|
+
return function () { return window.removeEventListener("resize", updateWindowWidth); };
|
|
21
|
+
}, []);
|
|
22
|
+
var pieChartData = useMemo(function () {
|
|
23
|
+
var pieChartStrategy = new PieChartDataStrategy();
|
|
24
|
+
return createPieChart(pieChartStrategy.processData(dataInput));
|
|
25
|
+
}, [dataInput]);
|
|
26
|
+
var pieChartWidth = (windowWidth * (windowWidth > 1100 ? 4 : 11)) / 12;
|
|
27
|
+
var lineBarChartWidth = (windowWidth * (windowWidth > 1100 && pieChartData.possuiPendencias ? 7.8 : 11)) / 12;
|
|
28
|
+
var dates = useMemo(function () {
|
|
29
|
+
return getUniqueDates(dataInput);
|
|
30
|
+
}, [dataInput]);
|
|
31
|
+
var chartData = useMemo(function () {
|
|
32
|
+
return dataInput ? processChartData({ dataInput: dataInput, dates: dates }) : [];
|
|
33
|
+
}, [dataInput, dates]);
|
|
34
|
+
var lastDate = max(dates, function (x) { return x.getTime(); });
|
|
35
|
+
var plotLayout = layoutLineBarChart(lineBarChartWidth, lastDate);
|
|
36
|
+
return (React.createElement(React.Fragment, null,
|
|
37
|
+
React.createElement("div", { className: cn("container", "chart-container") },
|
|
38
|
+
React.createElement("div", { className: cn("chart-content") },
|
|
39
|
+
React.createElement("div", { className: cn("mdl-grid") },
|
|
40
|
+
React.createElement("div", { className: cn("mdl-cell", "mdl-cell--".concat(windowWidth < 1100 ? 12 : 4, "-col")), hidden: !pieChartData.possuiPendencias },
|
|
41
|
+
React.createElement("h2", { className: cn("title-chart") }, "Quantidade de Ocorr\u00EAncias"),
|
|
42
|
+
React.createElement(Plot, { config: { displayModeBar: false }, data: [pieChartData], layout: { width: pieChartWidth } })),
|
|
43
|
+
React.createElement("div", { className: cn("mdl-cell", "mdl-cell--".concat(pieChartData.possuiPendencias ? 8 : 12, "-col")) },
|
|
44
|
+
React.createElement("h2", { className: cn("title-chart") }, "Quantidade de Ocorr\u00EAncias por Consulta"),
|
|
45
|
+
React.createElement(Plot, { data: chartData, layout: plotLayout }))))),
|
|
46
|
+
React.createElement("div", { className: cn("category-protestos") },
|
|
47
|
+
React.createElement(CategoriaProtesto, { width: windowWidth * 0.9, height: 256 }))));
|
|
48
|
+
};
|
|
49
|
+
export default ChartContent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Plotly from "react-plotly.js";
|
|
2
|
+
import { ChartDataAndLayoutState } from "./plotly/types";
|
|
3
|
+
export declare const createPieChart: (data: ChartDataAndLayoutState) => Plotly.Data & {
|
|
4
|
+
possuiPendencias: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const createBarChart: (data: ChartDataAndLayoutState) => Plotly.Data;
|
|
7
|
+
export declare const createLineChart: (data: ChartDataAndLayoutState) => Plotly.Data;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { formatValue } from "../../utils/number";
|
|
2
|
+
export var createPieChart = function (data) {
|
|
3
|
+
var _a;
|
|
4
|
+
var defaultColors = [
|
|
5
|
+
"#ff4081",
|
|
6
|
+
"#3f51b5",
|
|
7
|
+
"#008cf8",
|
|
8
|
+
"#ffc107",
|
|
9
|
+
"#4caf50",
|
|
10
|
+
"#58508d",
|
|
11
|
+
];
|
|
12
|
+
return {
|
|
13
|
+
values: data.data.map(function (d) { return d.y; }).filter(function (y) { return y !== null; }).map(function (value) { return formatValue(value); }),
|
|
14
|
+
labels: data.data.map(function (d) { return d.x; }),
|
|
15
|
+
possuiPendencias: !!data.data.map(function (d) { return d.y; }).filter(function (y) { return y; }).length,
|
|
16
|
+
type: "pie",
|
|
17
|
+
marker: {
|
|
18
|
+
colors: ((_a = data.marker) === null || _a === void 0 ? void 0 : _a.color) ? [data.marker.color] : defaultColors,
|
|
19
|
+
},
|
|
20
|
+
textinfo: "value",
|
|
21
|
+
hovertemplate: "Total de %{label}: %{value}<extra></extra>",
|
|
22
|
+
textfont: data.textfont || {
|
|
23
|
+
family: "Arial, sans-serif",
|
|
24
|
+
size: 14,
|
|
25
|
+
color: "white",
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export var createBarChart = function (data) {
|
|
30
|
+
var _a;
|
|
31
|
+
return {
|
|
32
|
+
x: data.data.map(function (d) { return d.x; }),
|
|
33
|
+
y: data.data.map(function (d) { return d.y; }),
|
|
34
|
+
type: "bar",
|
|
35
|
+
name: data.name,
|
|
36
|
+
yaxis: data.yaxis,
|
|
37
|
+
marker: { color: ((_a = data.marker) === null || _a === void 0 ? void 0 : _a.color) || "#000000" },
|
|
38
|
+
text: data.text,
|
|
39
|
+
textposition: "auto",
|
|
40
|
+
textfont: data.textfont,
|
|
41
|
+
hovertemplate: data.hovertemplate || "%{y}<extra></extra>",
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export var createLineChart = function (data) {
|
|
45
|
+
var _a;
|
|
46
|
+
return {
|
|
47
|
+
x: data.data.map(function (d) { return d.x; }),
|
|
48
|
+
y: data.data.map(function (d) { return d.y; }),
|
|
49
|
+
type: "scatter",
|
|
50
|
+
mode: "lines+markers",
|
|
51
|
+
name: data.name,
|
|
52
|
+
yaxis: data.yaxis,
|
|
53
|
+
line: { color: ((_a = data.marker) === null || _a === void 0 ? void 0 : _a.color) || "#000000" },
|
|
54
|
+
connectgaps: data.connectgaps || false,
|
|
55
|
+
text: data.text,
|
|
56
|
+
textposition: "auto",
|
|
57
|
+
textfont: data.textfont,
|
|
58
|
+
hovertemplate: data.hovertemplate || "%{x|%d/%m/%Y}<br>".concat(data.name, ": %{y} <extra></extra>"),
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DataInput } from "./plotly/types";
|
|
3
|
+
interface ChartProps {
|
|
4
|
+
dataInput: DataInput;
|
|
5
|
+
}
|
|
6
|
+
export declare const ResumoDeNegativacoesChartSection: ({ documento }: {
|
|
7
|
+
documento: string;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
declare const CustomChart: React.FC<ChartProps>;
|
|
10
|
+
export default CustomChart;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
13
|
+
import React, { useContext, useEffect, useMemo } from "react";
|
|
14
|
+
import { Result } from "../interface/result";
|
|
15
|
+
import { useCalculation } from "./useCalculation";
|
|
16
|
+
import ChartContent from "./chartContent";
|
|
17
|
+
import QuantidadeResultados from "./quantityResult";
|
|
18
|
+
import { Queries, RequestStatus, useQuery } from "../webservice";
|
|
19
|
+
import { formatDatePtBrToDate } from "../../utils/string";
|
|
20
|
+
import { groupBy, sortBy, unique } from "underscore";
|
|
21
|
+
import Header from "../interface/header";
|
|
22
|
+
import classNames from "classnames";
|
|
23
|
+
import useUltimaOcorrenciaCCF from "./useUltimaOcorrenciaCCF";
|
|
24
|
+
export var ResumoDeNegativacoesChartSection = function (_a) {
|
|
25
|
+
var documento = _a.documento;
|
|
26
|
+
var _b = useQuery("SELECT FROM 'DOCUMENTHISTORY'.'BASICHISTORY'", { documento: documento }), response = _b.response, error = _b.error, isLoading = _b.isLoading, refetch = _b.refetch;
|
|
27
|
+
var ctxProtestos = useContext(Queries.Protestos);
|
|
28
|
+
var ctxCCF = useContext(Queries.CCF);
|
|
29
|
+
var ctxProcessosJuridicos = useContext(Queries.ProcessosJuridicos);
|
|
30
|
+
var quantidadeProcessosJuridicos = useMemo(function () {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
if ((ctxProcessosJuridicos === null || ctxProcessosJuridicos === void 0 ? void 0 : ctxProcessosJuridicos.type) === RequestStatus.Success)
|
|
33
|
+
return (_b = (_a = ctxProcessosJuridicos === null || ctxProcessosJuridicos === void 0 ? void 0 : ctxProcessosJuridicos.document) === null || _a === void 0 ? void 0 : _a.empresa) === null || _b === void 0 ? void 0 : _b.length;
|
|
34
|
+
return undefined;
|
|
35
|
+
}, [ctxProcessosJuridicos === null || ctxProcessosJuridicos === void 0 ? void 0 : ctxProcessosJuridicos.type]);
|
|
36
|
+
var liveQueriesIsFinish = useMemo(function () {
|
|
37
|
+
return [ctxProtestos === null || ctxProtestos === void 0 ? void 0 : ctxProtestos.type, ctxCCF === null || ctxCCF === void 0 ? void 0 : ctxCCF.type].map(function (type) { return type != RequestStatus.Loading; }).every(function (e) { return e; });
|
|
38
|
+
}, [ctxProtestos === null || ctxProtestos === void 0 ? void 0 : ctxProtestos.type, ctxCCF === null || ctxCCF === void 0 ? void 0 : ctxCCF.type]);
|
|
39
|
+
useEffect(function () {
|
|
40
|
+
if (liveQueriesIsFinish) {
|
|
41
|
+
refetch();
|
|
42
|
+
}
|
|
43
|
+
}, [liveQueriesIsFinish]);
|
|
44
|
+
var process = function (_data) {
|
|
45
|
+
if (!_data)
|
|
46
|
+
return null;
|
|
47
|
+
var data = JSON.parse(_data);
|
|
48
|
+
data.pieChartTotalConfig = {
|
|
49
|
+
processosJuridicos: quantidadeProcessosJuridicos,
|
|
50
|
+
};
|
|
51
|
+
var removeZeros = function (current, index, arr) {
|
|
52
|
+
// Combine firstOrLastObjects check for efficiency
|
|
53
|
+
return index === 0 || index === arr.length - 1 || Number(current.quantidade) > 0;
|
|
54
|
+
};
|
|
55
|
+
var removeSameAsNext = function (current, index, arr) {
|
|
56
|
+
// Return early for first/last objects
|
|
57
|
+
if (index === 0 || index === arr.length - 1)
|
|
58
|
+
return true;
|
|
59
|
+
return current.quantidade !== arr[index + 1].quantidade;
|
|
60
|
+
};
|
|
61
|
+
var grouped = groupBy(data.protestos, function (e) { return e.data; });
|
|
62
|
+
data.protestos = Object.values(grouped).map(function (e) {
|
|
63
|
+
if (e.length === 1)
|
|
64
|
+
return e;
|
|
65
|
+
return e.filter(function (el) { return Number(el.quantidade) > 0; });
|
|
66
|
+
}).flat();
|
|
67
|
+
data.protestos = sortBy(unique(data.protestos, function (x) { return x.data; }).filter(removeZeros).filter(removeSameAsNext).map(function (info) { return (__assign(__assign({}, info), { data: formatDatePtBrToDate(info.data) })); }), function (info) { return info.data; });
|
|
68
|
+
data.ccfs = sortBy(unique(data.ccfs, function (x) { return x.data; }).filter(removeZeros)
|
|
69
|
+
.filter(removeSameAsNext)
|
|
70
|
+
.map(function (info) { return (__assign(__assign({}, info), { data: formatDatePtBrToDate(info.data) })); }), function (info) { return info.data; });
|
|
71
|
+
data.boaVista = data.boaVista.map(function (pefin) { return (__assign(__assign({}, pefin), { creation: formatDatePtBrToDate(pefin.creation) })); }).filter(function (info) { return info.creation; });
|
|
72
|
+
data.serasa = data.serasa.map(function (pefin) { return (__assign(__assign({}, pefin), { creation: formatDatePtBrToDate(pefin.creation) })); }).filter(function (info) { return info.creation; });
|
|
73
|
+
data.dividasPublicasGrafico = data.dividasPublicasGrafico.map(function (info) { return (__assign(__assign({}, info), { data: formatDatePtBrToDate(info.data) })); }).filter(function (info) { return info.data; });
|
|
74
|
+
return React.createElement(CustomChart, { dataInput: data });
|
|
75
|
+
};
|
|
76
|
+
return (React.createElement(React.Fragment, null,
|
|
77
|
+
React.createElement(Header, { title: "Resumo de Negativa\u00E7\u00F5es", subtitle: "Veja a quantidade de ocorr\u00EAncias conforme o documento foi consultado ao longo do tempo", className: classNames({ 'external-source loading': isLoading, 'external-source error': error }) }),
|
|
78
|
+
!isLoading && (response === null || response === void 0 ? void 0 : response.document) && process(response === null || response === void 0 ? void 0 : response.document)));
|
|
79
|
+
};
|
|
80
|
+
var CustomChart = function (_a) {
|
|
81
|
+
var _b, _c, _d, _e;
|
|
82
|
+
var dataInput = _a.dataInput;
|
|
83
|
+
var ultimaOcorrenciaCCF = useUltimaOcorrenciaCCF();
|
|
84
|
+
var _f = useCalculation(dataInput.protestos), quantidadeProtestos = _f.quantidade, valorTotalProtestos = _f.valorTotal;
|
|
85
|
+
var _g = useCalculation(dataInput.dividasPublicasGrafico), quantidadeDividas = _g.quantidade, valorTotalDividas = _g.valorTotal;
|
|
86
|
+
var _h = useCalculation(dataInput.serasa), quantidadeDeNegativacoesSerasa = _h.quantidade, valorTotalDeNegativacoesSerasa = _h.valorTotal;
|
|
87
|
+
var _j = useCalculation(dataInput.boaVista), quantidadeDeNegativacoesBoaVista = _j.quantidade, valorTotalDeNegativacoesBoaVista = _j.valorTotal;
|
|
88
|
+
var quantidadeCCF = useCalculation(dataInput.ccfs).quantidade;
|
|
89
|
+
var ultimaOcorrenciaProtestos = (_d = (_c = dataInput === null || dataInput === void 0 ? void 0 : dataInput.protestos[((_b = dataInput === null || dataInput === void 0 ? void 0 : dataInput.protestos) === null || _b === void 0 ? void 0 : _b.length) - 1]) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.toLocaleDateString();
|
|
90
|
+
return (React.createElement(Result, null,
|
|
91
|
+
React.createElement("div", null,
|
|
92
|
+
React.createElement(ChartContent, { dataInput: dataInput }),
|
|
93
|
+
React.createElement(QuantidadeResultados, { quantidadeProtestos: quantidadeProtestos, quantidadeProcessos: (_e = dataInput === null || dataInput === void 0 ? void 0 : dataInput.pieChartTotalConfig) === null || _e === void 0 ? void 0 : _e.processosJuridicos, quantidadeDividas: quantidadeDividas, quantidadeDividasSerasa: quantidadeDeNegativacoesSerasa, quantidadeDividasBoaVista: quantidadeDeNegativacoesBoaVista, quantidadeChequesSemFundos: quantidadeCCF, ultimaOcorrenciaChequesSemFundos: ultimaOcorrenciaCCF, valorTotalDividasSerasa: valorTotalDeNegativacoesSerasa, valorTotalDividasBoaVista: valorTotalDeNegativacoesBoaVista, valorTotalProtestos: valorTotalProtestos, valorTotalDividas: valorTotalDividas, ultimaOcorrenciaProtestos: ultimaOcorrenciaProtestos }))));
|
|
94
|
+
};
|
|
95
|
+
export default CustomChart;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { union, unique } from "underscore";
|
|
2
|
+
export function getUniqueDates(data) {
|
|
3
|
+
return union(data.ccfs.map(function (ccf) { return ccf.data; }), unique(data.protestos, "data").map(function (protesto) { return protesto.data; }), unique(data.serasa, "creation").map(function (pefinRefin) { return pefinRefin.creation; }), unique(data.boaVista, "creation").map(function (pefinRefin) { return pefinRefin.creation; }), unique(data.dividasPublicasGrafico, "data").map(function (dividas) { return dividas.data; })).filter(function (date) { return date; }).sort(function (dateA, dateB) { return dateA.getTime() - dateB.getTime(); });
|
|
4
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseChartDataStrategy } from "./";
|
|
2
|
+
import { ChartDataAndLayoutState, DataInput } from "./types";
|
|
3
|
+
export declare class barDividasPublicas extends BaseChartDataStrategy<DataInput> {
|
|
4
|
+
processData(data: DataInput): ChartDataAndLayoutState;
|
|
5
|
+
}
|
|
6
|
+
export declare class barProtestos extends BaseChartDataStrategy<DataInput> {
|
|
7
|
+
processData(data: DataInput): ChartDataAndLayoutState;
|
|
8
|
+
}
|
|
9
|
+
export declare class barSerasa extends BaseChartDataStrategy<DataInput> {
|
|
10
|
+
processData(data: DataInput): ChartDataAndLayoutState;
|
|
11
|
+
}
|
|
12
|
+
export declare class barBoaVista extends BaseChartDataStrategy<DataInput> {
|
|
13
|
+
processData(data: DataInput): ChartDataAndLayoutState;
|
|
14
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { BaseChartDataStrategy } from "./";
|
|
17
|
+
var layout = {};
|
|
18
|
+
var barDividasPublicas = /** @class */ (function (_super) {
|
|
19
|
+
__extends(barDividasPublicas, _super);
|
|
20
|
+
function barDividasPublicas() {
|
|
21
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
barDividasPublicas.prototype.processData = function (data) {
|
|
24
|
+
var dividasPublicasData = data.dividasPublicasGrafico
|
|
25
|
+
.filter(function (consulta) {
|
|
26
|
+
return consulta.valorTotal !== null;
|
|
27
|
+
})
|
|
28
|
+
.map(function (consulta) { return ({
|
|
29
|
+
x: consulta.data,
|
|
30
|
+
y: consulta.valorTotal,
|
|
31
|
+
}); });
|
|
32
|
+
if ((dividasPublicasData === null || dividasPublicasData === void 0 ? void 0 : dividasPublicasData.length) > 1) {
|
|
33
|
+
dividasPublicasData[(dividasPublicasData === null || dividasPublicasData === void 0 ? void 0 : dividasPublicasData.length) - 1].y = data.dividasPublicas.valorTotal;
|
|
34
|
+
}
|
|
35
|
+
var dividasPublicasState = {
|
|
36
|
+
name: "Dívidas",
|
|
37
|
+
yaxis: "y2",
|
|
38
|
+
type: "bar",
|
|
39
|
+
textposition: "auto",
|
|
40
|
+
marker: {
|
|
41
|
+
color: "#bb3b55",
|
|
42
|
+
opacity: 0.6,
|
|
43
|
+
line: {
|
|
44
|
+
color: "#bb3b55",
|
|
45
|
+
width: 1.5,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
hovertemplate: "%{x|%d/%m/%Y}<br> Dívidas Públicas: R$ %{y} <extra></extra>",
|
|
49
|
+
data: dividasPublicasData,
|
|
50
|
+
layout: layout,
|
|
51
|
+
};
|
|
52
|
+
return dividasPublicasState;
|
|
53
|
+
};
|
|
54
|
+
return barDividasPublicas;
|
|
55
|
+
}(BaseChartDataStrategy));
|
|
56
|
+
export { barDividasPublicas };
|
|
57
|
+
var barProtestos = /** @class */ (function (_super) {
|
|
58
|
+
__extends(barProtestos, _super);
|
|
59
|
+
function barProtestos() {
|
|
60
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
61
|
+
}
|
|
62
|
+
barProtestos.prototype.processData = function (data) {
|
|
63
|
+
var protestosData = data.protestos
|
|
64
|
+
.filter(function (consulta) { return consulta.valorTotal !== null; })
|
|
65
|
+
.map(function (consulta) { return ({
|
|
66
|
+
x: consulta.data,
|
|
67
|
+
y: consulta.valorTotal,
|
|
68
|
+
}); });
|
|
69
|
+
var protestosState = {
|
|
70
|
+
name: "Protestos",
|
|
71
|
+
yaxis: "y2",
|
|
72
|
+
type: "bar",
|
|
73
|
+
textposition: "outside",
|
|
74
|
+
marker: {
|
|
75
|
+
color: "#800000",
|
|
76
|
+
opacity: 0.6,
|
|
77
|
+
line: {
|
|
78
|
+
color: "#800000",
|
|
79
|
+
width: 1.5,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
hovertemplate: "%{x|%d/%m/%Y}<br> Protestos: R$ %{y} <extra></extra>",
|
|
83
|
+
data: protestosData,
|
|
84
|
+
layout: layout,
|
|
85
|
+
};
|
|
86
|
+
return protestosState;
|
|
87
|
+
};
|
|
88
|
+
return barProtestos;
|
|
89
|
+
}(BaseChartDataStrategy));
|
|
90
|
+
export { barProtestos };
|
|
91
|
+
var barSerasa = /** @class */ (function (_super) {
|
|
92
|
+
__extends(barSerasa, _super);
|
|
93
|
+
function barSerasa() {
|
|
94
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
95
|
+
}
|
|
96
|
+
barSerasa.prototype.processData = function (data) {
|
|
97
|
+
var serasaData = data.serasa
|
|
98
|
+
.filter(function (consulta) { return consulta.valorTotal !== null; })
|
|
99
|
+
.map(function (consulta) { return ({
|
|
100
|
+
x: consulta.creation,
|
|
101
|
+
y: consulta.valorTotal,
|
|
102
|
+
}); });
|
|
103
|
+
var serasaState = {
|
|
104
|
+
name: "Pefin/Refin Serasa",
|
|
105
|
+
yaxis: "y2",
|
|
106
|
+
type: "bar",
|
|
107
|
+
color: "orange",
|
|
108
|
+
marker: {
|
|
109
|
+
color: "rgb(158,202,225)",
|
|
110
|
+
opacity: 0.6,
|
|
111
|
+
line: {
|
|
112
|
+
color: "rgb(8,48,107)",
|
|
113
|
+
width: 1.5,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
hovertemplate: "%{x|%d/%m/%Y}<br> Serasa: R$ %{y} <extra></extra>",
|
|
117
|
+
data: serasaData,
|
|
118
|
+
layout: layout,
|
|
119
|
+
};
|
|
120
|
+
return serasaState;
|
|
121
|
+
};
|
|
122
|
+
return barSerasa;
|
|
123
|
+
}(BaseChartDataStrategy));
|
|
124
|
+
export { barSerasa };
|
|
125
|
+
var barBoaVista = /** @class */ (function (_super) {
|
|
126
|
+
__extends(barBoaVista, _super);
|
|
127
|
+
function barBoaVista() {
|
|
128
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
129
|
+
}
|
|
130
|
+
barBoaVista.prototype.processData = function (data) {
|
|
131
|
+
var boaVistaData = data.boaVista
|
|
132
|
+
.filter(function (consulta) { return consulta.valorTotal !== null; })
|
|
133
|
+
.map(function (consulta) { return ({
|
|
134
|
+
x: consulta.creation,
|
|
135
|
+
y: consulta.valorTotal,
|
|
136
|
+
}); });
|
|
137
|
+
var boaVistaState = {
|
|
138
|
+
name: "Pefin/Refin Boa Vista",
|
|
139
|
+
yaxis: "y2",
|
|
140
|
+
type: "bar",
|
|
141
|
+
hovertemplate: "%{x|%d/%m/%Y}<br> Boa Vista: R$ %{y} <extra></extra>",
|
|
142
|
+
data: boaVistaData,
|
|
143
|
+
layout: layout,
|
|
144
|
+
};
|
|
145
|
+
return boaVistaState;
|
|
146
|
+
};
|
|
147
|
+
return barBoaVista;
|
|
148
|
+
}(BaseChartDataStrategy));
|
|
149
|
+
export { barBoaVista };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChartDataState, IChartDataStrategy } from "./iChartDataStrategy";
|
|
2
|
+
import { LayoutConfig } from "./layoutLineBarChart";
|
|
3
|
+
import { ChartDataAndLayoutState } from "./types";
|
|
4
|
+
export declare abstract class BaseChartDataStrategy<T> implements IChartDataStrategy<T> {
|
|
5
|
+
abstract processData(data: T): ChartDataAndLayoutState;
|
|
6
|
+
protected parseDate(dateStr: string): Date;
|
|
7
|
+
protected createProcessedData(chartData: ChartDataState, layout?: LayoutConfig): ChartDataAndLayoutState;
|
|
8
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var BaseChartDataStrategy = /** @class */ (function () {
|
|
13
|
+
function BaseChartDataStrategy() {
|
|
14
|
+
}
|
|
15
|
+
BaseChartDataStrategy.prototype.parseDate = function (dateStr) {
|
|
16
|
+
var _a = dateStr.split("/").map(Number), day = _a[0], month = _a[1], year = _a[2];
|
|
17
|
+
return new Date(year, month - 1, day);
|
|
18
|
+
};
|
|
19
|
+
BaseChartDataStrategy.prototype.createProcessedData = function (chartData, layout) {
|
|
20
|
+
var processedData = chartData.data.map(function (d) { return ({
|
|
21
|
+
x: d.x.toISOString(),
|
|
22
|
+
y: d.y,
|
|
23
|
+
}); });
|
|
24
|
+
return __assign(__assign({}, chartData), { data: processedData, text: processedData.map(function (d) { return (d.y !== null ? d.y.toString() : ""); }), layout: layout || {} });
|
|
25
|
+
};
|
|
26
|
+
return BaseChartDataStrategy;
|
|
27
|
+
}());
|
|
28
|
+
export { BaseChartDataStrategy };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { find, isEqual, sortBy } from "underscore";
|
|
2
|
+
import { barDividasPublicas, barProtestos, barSerasa, barBoaVista, lineProtestos, lineDividasPublicas, lineCCF, lineSerasa, lineBoaVista, } from "./";
|
|
3
|
+
import { getUniqueDates } from "../getUniqueDates";
|
|
4
|
+
export function getSeries(data) {
|
|
5
|
+
var strategies = [
|
|
6
|
+
new lineCCF(),
|
|
7
|
+
new lineProtestos(),
|
|
8
|
+
new lineSerasa(),
|
|
9
|
+
new lineBoaVista(),
|
|
10
|
+
new lineDividasPublicas(),
|
|
11
|
+
new barSerasa(),
|
|
12
|
+
new barBoaVista(),
|
|
13
|
+
new barProtestos(),
|
|
14
|
+
new barDividasPublicas(),
|
|
15
|
+
];
|
|
16
|
+
var processedDataSets = strategies.map(function (strategy) {
|
|
17
|
+
return strategy.processData(data);
|
|
18
|
+
});
|
|
19
|
+
var dates = getUniqueDates(data);
|
|
20
|
+
processedDataSets.forEach(function (dataset) {
|
|
21
|
+
dataset.data = dates.map(function (date) {
|
|
22
|
+
var foundItem = find(dataset.data, function (d) { return isEqual(d.x, date); });
|
|
23
|
+
return foundItem !== null && foundItem !== void 0 ? foundItem : { x: date, y: null };
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
processedDataSets.forEach(function (dataset) {
|
|
27
|
+
dataset.data = sortBy(dataset.data, function (d) { return d.x.getTime(); });
|
|
28
|
+
//dataset.data = sortBy(dataset.data, (d) => new Date(d.x).getTime());
|
|
29
|
+
});
|
|
30
|
+
return processedDataSets;
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ChartDataAndLayoutState } from "./types";
|
|
2
|
+
export interface ChartDataState {
|
|
3
|
+
name: string;
|
|
4
|
+
yaxis: string;
|
|
5
|
+
type: string;
|
|
6
|
+
data: {
|
|
7
|
+
x: string | Date;
|
|
8
|
+
y: number | null;
|
|
9
|
+
}[];
|
|
10
|
+
text?: string[];
|
|
11
|
+
textposition?: string;
|
|
12
|
+
values?: number[];
|
|
13
|
+
labels?: string[];
|
|
14
|
+
color?: string;
|
|
15
|
+
marker?: {
|
|
16
|
+
color: string;
|
|
17
|
+
opacity?: number;
|
|
18
|
+
line?: {
|
|
19
|
+
color: string;
|
|
20
|
+
width: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
textfont?: {
|
|
24
|
+
bgcolor?: string;
|
|
25
|
+
family: string;
|
|
26
|
+
size: number;
|
|
27
|
+
color: string;
|
|
28
|
+
};
|
|
29
|
+
mode?: string;
|
|
30
|
+
connectgaps?: boolean;
|
|
31
|
+
hovertemplate?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IChartDataStrategy<T> {
|
|
34
|
+
processData: (data: T) => ChartDataAndLayoutState;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BaseChartDataStrategy } from "./baseChartDataStrategy";
|
|
2
|
+
export { barDividasPublicas, barProtestos, barSerasa, barBoaVista, } from "./barChartDataStrategy";
|
|
3
|
+
export { lineDividasPublicas, lineCCF, lineSerasa, lineBoaVista, lineProtestos, } from "./lineChartDataStrategy";
|
|
4
|
+
export { getSeries } from "./getSeries";
|
|
5
|
+
export { layoutLineBarChart } from "./layoutLineBarChart";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BaseChartDataStrategy } from "./baseChartDataStrategy";
|
|
2
|
+
export { barDividasPublicas, barProtestos, barSerasa, barBoaVista, } from "./barChartDataStrategy";
|
|
3
|
+
export { lineDividasPublicas, lineCCF, lineSerasa, lineBoaVista, lineProtestos, } from "./lineChartDataStrategy";
|
|
4
|
+
export { getSeries } from "./getSeries";
|
|
5
|
+
export { layoutLineBarChart } from "./layoutLineBarChart";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface LayoutConfig extends Partial<Plotly.Layout> {
|
|
2
|
+
xaxis?: {
|
|
3
|
+
range: [string, string];
|
|
4
|
+
domain: [number, number];
|
|
5
|
+
rangeslider: {};
|
|
6
|
+
rangeselector: {
|
|
7
|
+
buttons: Array<{
|
|
8
|
+
step: "month" | "year" | "all";
|
|
9
|
+
stepmode?: "backward" | "todate";
|
|
10
|
+
count?: number;
|
|
11
|
+
label?: string;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
yaxis2?: {
|
|
16
|
+
title: string;
|
|
17
|
+
titlefont: {
|
|
18
|
+
color: string;
|
|
19
|
+
};
|
|
20
|
+
tickfont: {
|
|
21
|
+
color: string;
|
|
22
|
+
};
|
|
23
|
+
tickformat: string;
|
|
24
|
+
};
|
|
25
|
+
yaxis?: {
|
|
26
|
+
title: string;
|
|
27
|
+
titlefont: {
|
|
28
|
+
color: string;
|
|
29
|
+
};
|
|
30
|
+
tickfont: {
|
|
31
|
+
color: string;
|
|
32
|
+
};
|
|
33
|
+
anchor: "x";
|
|
34
|
+
side: "right";
|
|
35
|
+
overlaying: "y2";
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
declare const layoutLineBarChart: (layoutWidth: number, lastDate: Date) => LayoutConfig;
|
|
39
|
+
export { layoutLineBarChart };
|