|
|
@ -36,9 +36,7 @@ |
|
|
|
import React, { PureComponent } from 'react' |
|
|
|
import * as d3 from 'd3' |
|
|
|
import noop from 'lodash/noop' |
|
|
|
import { formatShort } from '@ledgerhq/live-common/lib/helpers/currencies' |
|
|
|
|
|
|
|
import type { Account } from '@ledgerhq/live-common/lib/types' |
|
|
|
import type { Unit } from '@ledgerhq/live-common/lib/types' |
|
|
|
|
|
|
|
import refreshNodes from './refreshNodes' |
|
|
|
import refreshDraw from './refreshDraw' |
|
|
@ -49,8 +47,7 @@ import type { Data } from './types' |
|
|
|
|
|
|
|
export type Props = { |
|
|
|
data: Data, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
account?: Account, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
|
|
|
|
unit?: ?Unit, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
id?: string, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
height?: number, |
|
|
|
tickXScale: string, // eslint-disable-line react/no-unused-prop-types
|
|
|
@ -59,7 +56,7 @@ export type Props = { |
|
|
|
dateFormat?: string, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
isInteractive?: boolean, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
renderTooltip?: Function, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
renderTickY?: (t: number, account: ?Account) => mixed, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
renderTickY: (t: number) => string | number, // eslint-disable-line react/no-unused-prop-types
|
|
|
|
} |
|
|
|
|
|
|
|
class Chart extends PureComponent<Props> { |
|
|
@ -71,8 +68,7 @@ class Chart extends PureComponent<Props> { |
|
|
|
id: 'chart', |
|
|
|
isInteractive: true, |
|
|
|
tickXScale: 'month', |
|
|
|
renderTickY: (t: number, account: Account): mixed => |
|
|
|
account ? formatShort(account.unit, t) : '', |
|
|
|
renderTickY: (t: *) => t, |
|
|
|
} |
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|