-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
29 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export { Dendrogram, type DendrogramOptions } from './dendrogram'; | ||
export { Fishbone, type FishboneOptions } from './fishbone'; | ||
export { FlowDirectionGraph, type FlowDirectionGraphOptions } from './flow-direction-graph'; | ||
export { FlowGraph, type FlowGraphOptions } from './flow-graph'; | ||
export { IndentedTree, type IndentedTreeOptions } from './indented-tree'; | ||
export { MindMap, type MindMapOptions } from './mind-map'; | ||
export { NetworkGraph, type NetworkGraphOptions } from './network-graph'; | ||
export { OrganizationChart, type OrganizationChartOptions } from './organization-chart'; | ||
export { Fishbone, type FishboneOptions } from './fishbone'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
import { memoize } from 'lodash'; | ||
import { measureTextSize } from './measure-text'; | ||
|
||
export const getLinearTextNodeStyle = memoize( | ||
(text: string, minWidth: number, maxWidth: number, depth: number = 0) => { | ||
const font = { | ||
fontWeight: depth === 0 ? 600 : 400, | ||
fontSize: depth === 0 ? 24 : 16, | ||
}; | ||
const offset = depth === 0 ? [64, 30] : [12, 12]; | ||
const size = measureTextSize(text, offset, font, minWidth, maxWidth); | ||
return { font, size }; | ||
}, | ||
); | ||
export const getLinearTextNodeStyle = memoize((text: string, minWidth: number, maxWidth: number, depth: number = 0) => { | ||
const font = { | ||
fontWeight: depth === 0 ? 600 : 400, | ||
fontSize: depth === 0 ? 24 : 16, | ||
}; | ||
const offset = depth === 0 ? [64, 30] : [12, 12]; | ||
const size = measureTextSize(text, offset, font, minWidth, maxWidth); | ||
return { font, size }; | ||
}); | ||
|
||
export const getBoxedTextNodeStyle = memoize( | ||
(text: string, minWidth: number, maxWidth: number, depth: number = 0) => { | ||
const font = { | ||
fontWeight: depth === 0 || depth === 1 ? 600 : 400, | ||
fontSize: depth === 0 ? 24 : 16, | ||
}; | ||
const offset = depth === 0 ? [64, 30] : [36, 24]; | ||
const size = measureTextSize(text, offset, font, minWidth, maxWidth); | ||
return { font, size }; | ||
}, | ||
); | ||
export const getBoxedTextNodeStyle = memoize((text: string, minWidth: number, maxWidth: number, depth: number = 0) => { | ||
const font = { | ||
fontWeight: depth === 0 || depth === 1 ? 600 : 400, | ||
fontSize: depth === 0 ? 24 : 16, | ||
}; | ||
const offset = depth === 0 ? [64, 30] : [36, 24]; | ||
const size = measureTextSize(text, offset, font, minWidth, maxWidth); | ||
return { font, size }; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters