@credithub/harlan-components 1.53.3 → 1.53.5

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.
@@ -0,0 +1,9 @@
1
+ export interface ChartColors {
2
+ protestos: string;
3
+ chequesDevolvidos: string;
4
+ pefinSerasa: string;
5
+ pefinBoaVista: string;
6
+ dividasPublicas: string;
7
+ processosJuridicos: string;
8
+ }
9
+ export declare const defaultChartColors: ChartColors;
@@ -0,0 +1,8 @@
1
+ export var defaultChartColors = {
2
+ protestos: '#E63946',
3
+ chequesDevolvidos: '#1E88E5',
4
+ pefinSerasa: '#264653',
5
+ pefinBoaVista: '#F4A261',
6
+ dividasPublicas: '#2A9D8F',
7
+ processosJuridicos: '#8E44AD'
8
+ };
@@ -1,5 +1,6 @@
1
1
  import { useWindowSize } from '../../../hooks/useWindowSize';
2
2
  import { useMemo } from 'react';
3
+ import { defaultChartColors } from '../config/chartColors';
3
4
  export var usePieChartData = function (dataInput) {
4
5
  var width = useWindowSize().width;
5
6
  return useMemo(function () {
@@ -31,12 +32,12 @@ export var usePieChartData = function (dataInput) {
31
32
  processosJuridicos !== null && processosJuridicos !== void 0 ? processosJuridicos : 0
32
33
  ],
33
34
  backgroundColor: [
34
- '#ff4081',
35
- '#3f51b5',
36
- '#008cf8',
37
- '#ffc107',
38
- '#4caf50',
39
- '#58508d'
35
+ defaultChartColors.protestos,
36
+ defaultChartColors.chequesDevolvidos,
37
+ defaultChartColors.pefinSerasa,
38
+ defaultChartColors.pefinBoaVista,
39
+ defaultChartColors.dividasPublicas,
40
+ defaultChartColors.processosJuridicos
40
41
  ],
41
42
  hoverOffset: 4
42
43
  }
@@ -10,6 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { format, parseISO } from 'date-fns';
13
+ import { defaultChartColors } from '../config/chartColors';
13
14
  import { getBarSettings } from './dataManipulation';
14
15
  export function createDatasets(data, uniqueDates, timeFilter) {
15
16
  var _a = getBarSettings(timeFilter), categoryPercentage = _a.categoryPercentage, barPercentage = _a.barPercentage;
@@ -33,16 +34,16 @@ export function createDatasets(data, uniqueDates, timeFilter) {
33
34
  return datasetConfiguration;
34
35
  };
35
36
  return [
36
- createDataSet(data.protestos, 'Protestos - Quantidade', '#ff4081', 'line', 'quantidade', 'y'),
37
- createDataSet(data.protestos, 'Protestos - Valor Total', '#ff4081', 'bar', 'valorTotal', 'y2'),
38
- createDataSet(data.ccfs, 'CCFs - Quantidade', '#3f51b5', 'line', 'quantidade', 'y'),
39
- createDataSet(data.ccfs, 'CCFs - Valor Total', '#3f51b5', 'bar', 'valorTotal', 'y2'),
40
- createDataSet(data.serasa, 'Serasa - Quantidade', '#008cf8', 'line', 'quantidade', 'y'),
41
- createDataSet(data.serasa, 'Serasa - Valor Total', '#008cf8', 'bar', 'valorTotal', 'y2'),
42
- createDataSet(data.boaVista, 'Boa Vista - Quantidade', '#ffc107', 'line', 'quantidade', 'y'),
43
- createDataSet(data.boaVista, 'Boa Vista - Valor Total', '#ffc107', 'bar', 'valorTotal', 'y2'),
44
- createDataSet(data.dividasPublicasGrafico, 'Dívidas Públicas - Quantidade', '#4caf50', 'line', 'quantidade', 'y'),
45
- createDataSet(data.dividasPublicasGrafico, 'Dívidas Públicas - Valor Total', '#4caf50', 'bar', 'valorTotal', 'y2')
37
+ createDataSet(data.protestos, 'Protestos - Quantidade', defaultChartColors.protestos, 'line', 'quantidade', 'y'),
38
+ createDataSet(data.protestos, 'Protestos - Valor Total', defaultChartColors.protestos, 'bar', 'valorTotal', 'y2'),
39
+ createDataSet(data.ccfs, 'CCFs - Quantidade', defaultChartColors.chequesDevolvidos, 'line', 'quantidade', 'y'),
40
+ createDataSet(data.ccfs, 'CCFs - Valor Total', defaultChartColors.chequesDevolvidos, 'bar', 'valorTotal', 'y2'),
41
+ createDataSet(data.serasa, 'Serasa - Quantidade', defaultChartColors.pefinSerasa, 'line', 'quantidade', 'y'),
42
+ createDataSet(data.serasa, 'Serasa - Valor Total', defaultChartColors.pefinSerasa, 'bar', 'valorTotal', 'y2'),
43
+ createDataSet(data.boaVista, 'Boa Vista - Quantidade', defaultChartColors.pefinBoaVista, 'line', 'quantidade', 'y'),
44
+ createDataSet(data.boaVista, 'Boa Vista - Valor Total', defaultChartColors.pefinBoaVista, 'bar', 'valorTotal', 'y2'),
45
+ createDataSet(data.dividasPublicasGrafico, 'Dívidas Públicas - Quantidade', defaultChartColors.dividasPublicas, 'line', 'quantidade', 'y'),
46
+ createDataSet(data.dividasPublicasGrafico, 'Dívidas Públicas - Valor Total', defaultChartColors.dividasPublicas, 'bar', 'valorTotal', 'y2')
46
47
  ];
47
48
  }
48
49
  export function getChartOptions(timeFilter) {