chord.d.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { NodeLinkData } from '../../types/relation-data';
  2. export type ChordLayoutOptions = {
  3. weight?: boolean;
  4. y?: number;
  5. nodeWidthRatio?: number;
  6. nodePaddingRatio?: number;
  7. id?(node: any): any;
  8. source?(edge: any): any;
  9. target?(edge: any): any;
  10. sourceWeight?(edge: any): number;
  11. targetWeight?(edge: any): number;
  12. sortBy?: 'id' | 'weight' | 'frequency' | null | ((a: any, b: any) => number);
  13. };
  14. type OutputNode = {
  15. readonly id: number;
  16. readonly name: string;
  17. readonly value: number;
  18. x: number[];
  19. y: number[];
  20. };
  21. type OutputLink = {
  22. readonly source: OutputNode;
  23. readonly target: OutputNode;
  24. readonly value: number;
  25. x?: number[];
  26. y?: number[];
  27. };
  28. type ChordLayoutOutputData = {
  29. readonly nodes: OutputNode[];
  30. readonly links: OutputLink[];
  31. };
  32. export declare function getDefaultOptions(options: ChordLayoutOptions): ChordLayoutOptions;
  33. export declare function chordLayout(chordLayoutOptions: ChordLayoutOptions, chordLayoutInputData: NodeLinkData): ChordLayoutOutputData;
  34. export {};