@react-financial-charts/scales
Advanced tools
Comparing version 1.3.1 to 2.0.0
@@ -5,13 +5,13 @@ import { InterpolatorFactory } from "d3-scale"; | ||
invert(value: number): number; | ||
domain(newDomain?: number[] | undefined): number[] | any; | ||
range(range?: number[] | undefined): number[] | any; | ||
domain(newDomain?: number[]): number[] | any; | ||
range(range?: number[]): number[] | any; | ||
rangeRound(range: number[]): import("d3-scale").ScaleLinear<number, number, never>; | ||
clamp(clamp?: boolean | undefined): boolean | any; | ||
interpolate(interpolate?: InterpolatorFactory<number, number> | undefined): InterpolatorFactory<any, any> | any; | ||
ticks(m?: number | undefined): number[]; | ||
clamp(clamp?: boolean): boolean | any; | ||
interpolate(interpolate?: InterpolatorFactory<number, number>): InterpolatorFactory<any, any> | any; | ||
ticks(m?: number): number[]; | ||
tickFormat(): (x: any) => any; | ||
value(x: any): any; | ||
nice(count?: number | undefined): any; | ||
index(x?: any[] | undefined): any[] | any; | ||
nice(count?: number): any; | ||
index(x?: any[]): any[] | any; | ||
copy(): any; | ||
}; |
{ | ||
"name": "@react-financial-charts/scales", | ||
"version": "1.3.1", | ||
"description": "Scales for react-financial-charts", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"type": "module", | ||
"main": "./lib/index.js", | ||
"typings": "./lib/index.d.ts", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"sideEffects": false, | ||
"author": "Reactive Markets", | ||
"keywords": [ | ||
"charts", | ||
"charting", | ||
"stockcharts", | ||
"finance", | ||
"financial", | ||
"finance-chart", | ||
"react", | ||
"d3" | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/reactivemarkets/react-financial-charts.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/reactivemarkets/react-financial-charts/issues" | ||
}, | ||
"scripts": { | ||
"build": "npm run clean && npm run compile", | ||
"clean": "rimraf lib", | ||
"compile": "tsc -p tsconfig.json", | ||
"watch": "tsc -p tsconfig.json --watch --preserveWatchOutput" | ||
}, | ||
"dependencies": { | ||
"@react-financial-charts/core": "^1.3.1", | ||
"d3-array": "^2.9.1", | ||
"d3-scale": "^3.2.3", | ||
"d3-time-format": "^3.0.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.0.0 || ^17.0.0", | ||
"react-dom": "^16.0.0 || ^17.0.0" | ||
}, | ||
"gitHead": "403d8b776af90cbd787af7683a8d1537108b1b25" | ||
"name": "@react-financial-charts/scales", | ||
"version": "2.0.0", | ||
"description": "Scales for react-financial-charts", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"main": "./lib/index.js", | ||
"typings": "./lib/index.d.ts", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"sideEffects": false, | ||
"author": "Reactive Markets", | ||
"keywords": [ | ||
"charts", | ||
"charting", | ||
"stockcharts", | ||
"finance", | ||
"financial", | ||
"finance-chart", | ||
"react", | ||
"d3" | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/reactivemarkets/react-financial-charts.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/reactivemarkets/react-financial-charts/issues" | ||
}, | ||
"scripts": { | ||
"build": "npm run clean && npm run compile", | ||
"clean": "rimraf lib", | ||
"compile": "tsc -p tsconfig.json", | ||
"watch": "tsc -p tsconfig.json --watch --preserveWatchOutput" | ||
}, | ||
"dependencies": { | ||
"@react-financial-charts/core": "^2.0.0", | ||
"d3-array": "^2.9.1", | ||
"d3-scale": "^3.2.3", | ||
"d3-time-format": "^3.0.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.0.0 || ^17.0.0 || ^18.0.0", | ||
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0" | ||
}, | ||
"gitHead": "281943c4c71e8fb9e48caff017bcf0e431854bb2" | ||
} |
# Axes | ||
```bash | ||
npm i @react-finanical-charts/axes | ||
npm i @react-financial-charts/axes | ||
``` |
@@ -14,17 +14,19 @@ import { timeSecond, timeMinute, timeHour, timeDay, timeWeek, timeMonth, timeYear } from "d3-time"; | ||
export const timeFormat = (date: Date) => { | ||
return (timeSecond(date) < date | ||
? formatMillisecond | ||
: timeMinute(date) < date | ||
? formatSecond | ||
: timeHour(date) < date | ||
? formatMinute | ||
: timeDay(date) < date | ||
? formatHour | ||
: timeMonth(date) < date | ||
? timeWeek(date) < date | ||
? formatDay | ||
: formatWeek | ||
: timeYear(date) < date | ||
? formatMonth | ||
: formatYear)(date); | ||
return ( | ||
timeSecond(date) < date | ||
? formatMillisecond | ||
: timeMinute(date) < date | ||
? formatSecond | ||
: timeHour(date) < date | ||
? formatMinute | ||
: timeDay(date) < date | ||
? formatHour | ||
: timeMonth(date) < date | ||
? timeWeek(date) < date | ||
? formatDay | ||
: formatWeek | ||
: timeYear(date) < date | ||
? formatMonth | ||
: formatYear | ||
)(date); | ||
}; |
Sorry, the diff of this file is not supported yet
916
58011
No
+ Added@react-financial-charts/core@2.0.0(transitive)
+ Addedreact@18.3.1(transitive)
+ Addedreact-dom@18.3.1(transitive)
+ Addedscheduler@0.23.2(transitive)
- Removed@react-financial-charts/core@1.3.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@17.0.2(transitive)
- Removedreact-dom@17.0.2(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedscheduler@0.20.2(transitive)