Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
feat: make wordcloud font size range larger
Browse files Browse the repository at this point in the history
  • Loading branch information
zxch3n committed Mar 28, 2020
1 parent b8a3ae7 commit 707df6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/renderer/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,20 @@ export function to2digits(num: number) {
}

export function formatTime(timeInHour: number) {
if (timeInHour >= 1e6) {
return `${(timeInHour / 1e6).toFixed(2)}mh`;
}

if (timeInHour >= 1e5) {
return `${(timeInHour / 1000).toFixed(0)}kh`;
}

if (timeInHour >= 10000) {
return `${(timeInHour / 1000).toFixed(1)}kh`;
}

if (timeInHour >= 1000) {
return `${timeInHour}h`;
return `${(timeInHour / 1000).toFixed(2)}kh`;
}

if (timeInHour >= 100) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/tokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const CardContentWeight = 0.5;
export const getWeightsFromPomodoros = (
records: PomodoroRecord[],
cards: Card[] = [],
targetMax: number = 42,
targetMin: number = 12
targetMax: number = 56,
targetMin: number = 8
): [string, number][] => {
const tokenWeights = new Counter();
const tokenizer = new Tokenizer();
Expand Down

0 comments on commit 707df6e

Please sign in to comment.