Skip to content

Commit

Permalink
Merge pull request #37 from nginformatica/chore/clean
Browse files Browse the repository at this point in the history
chore(clean-code): create constants file
  • Loading branch information
evandersondev authored Jul 19, 2023
2 parents e9c6547 + 9e7d1ae commit 6126db5
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
"publishConfig": {
"registry": "https://registry.npmjs.org/"
}
}
}
2 changes: 1 addition & 1 deletion src/core/AreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
ZoomProps
} from './types'

export const STYLES = { width: '99.9%', height: 300 }
const STYLES = { width: '99.9%', height: 300 }
export const TOOLBOX_DEFAULT_PROPS = {
showTitle: false,
right: '9.52%',
Expand Down
3 changes: 2 additions & 1 deletion src/core/ForecastAreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
ZoomProps
} from './types'
import { take } from 'ramda'
import { STYLES } from './AreaChart'

const STYLES = { width: '99.9%', height: 300 }

interface IProps extends Omit<IDefaultChartProps, 'tooltip'> {
tooltip: {
Expand Down
2 changes: 1 addition & 1 deletion src/core/HorizontalBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import {
formatLabelWithImage,
} from '../lib/auxiliarFunctions'
import { reverse } from 'ramda'
import { WIDTH_STYLE } from './DonutChart'
import { TOOLBOX_DEFAULT_PROPS } from './AreaChart'
import { WIDTH_STYLE } from '../lib/constants'

interface IProps extends IDefaultChartProps {
showTickInfos?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/core/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
takeLabelComplement,
timeConvert
} from '../lib/auxiliarFunctions'
import { WIDTH_STYLE } from './DonutChart'
import { WIDTH_STYLE } from '../lib/constants'

interface IProps extends Omit<IDefaultChartProps, 'data'> {
data: EntryDataLine[]
Expand Down
4 changes: 1 addition & 3 deletions src/core/MultipurposeChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
timeConvert
} from '../lib/auxiliarFunctions'
import { IDefaultChartProps, WidthProps } from './types'
import { WIDTH_STYLE } from '../lib/constants'

interface MultipurposeChartProps {
series: Array<{
Expand All @@ -25,9 +26,6 @@ interface MultipurposeChartProps {
rangeSelector?: boolean
}

export const WIDTH_STYLE = { width: '99.9%' }


const isDarkColor = (color: string) => {
const c = color.substring(1)
const rgb = parseInt(c, 16)
Expand Down
2 changes: 1 addition & 1 deletion src/core/PieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
getPercentage,
getWidthOpts
} from '../lib/auxiliarFunctions'
import { WIDTH_STYLE } from './DonutChart'
import { TOOLBOX_DEFAULT_PROPS } from './AreaChart'
import { WIDTH_STYLE } from '../lib/constants'

export interface IProps extends Omit<IDefaultChartProps, 'data'> {
data: PieChartData[]
Expand Down
2 changes: 1 addition & 1 deletion src/core/RadarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import ReactEcharts from 'echarts-for-react'
import { EChartOption } from 'echarts/lib/echarts'
import React from 'react'
import { getWidthOpts, takeLabelComplement } from '../lib/auxiliarFunctions'
import { WIDTH_STYLE } from './DonutChart'
import { WidthProps } from './types'
import { WIDTH_STYLE } from '../lib/constants'

interface RadarChartProps {
series: Array<{
Expand Down
2 changes: 1 addition & 1 deletion src/core/StackedBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import {
normalLabel,
rotatedLabel
} from './VerticalBarChart'
import { WIDTH_STYLE } from './DonutChart'
import { concat, move } from 'ramda'
import { WIDTH_STYLE } from '../lib/constants'

interface IProps extends Omit<IDefaultChartProps, 'data'> {
data: EntryDataNTuples
Expand Down
3 changes: 1 addition & 2 deletions src/core/VerticalBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import {
getWidthOpts,
getDateFormatType
} from '../lib/auxiliarFunctions'

const WIDTH_STYLE = { width: '99.9%' }
import { WIDTH_STYLE } from '../lib/constants'

interface IProps extends IDefaultChartProps {
rotateTickLabel?: number
Expand Down
1 change: 1 addition & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const WIDTH_STYLE = { width: '99.9%' }

0 comments on commit 6126db5

Please sign in to comment.