@weng-lab/visualization 1.2.11 → 1.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/src/components/PhyloTree/ControlPanel.d.ts +8 -0
  2. package/dist/src/components/PhyloTree/ControlPanel.d.ts.map +1 -0
  3. package/dist/src/components/PhyloTree/LeafLinkExtension.d.ts +10 -0
  4. package/dist/src/components/PhyloTree/LeafLinkExtension.d.ts.map +1 -0
  5. package/dist/src/components/PhyloTree/LeafNodeLabel.d.ts +13 -0
  6. package/dist/src/components/PhyloTree/LeafNodeLabel.d.ts.map +1 -0
  7. package/dist/src/components/PhyloTree/PhyloTree.d.ts +25 -0
  8. package/dist/src/components/PhyloTree/PhyloTree.d.ts.map +1 -0
  9. package/dist/src/components/PhyloTree/RenderTree.d.ts +19 -0
  10. package/dist/src/components/PhyloTree/RenderTree.d.ts.map +1 -0
  11. package/dist/src/components/PhyloTree/TreeLink.d.ts +13 -0
  12. package/dist/src/components/PhyloTree/TreeLink.d.ts.map +1 -0
  13. package/dist/src/components/PhyloTree/ZoomFrame.d.ts +12 -0
  14. package/dist/src/components/PhyloTree/ZoomFrame.d.ts.map +1 -0
  15. package/dist/src/components/PhyloTree/ZoomSurface.d.ts +20 -0
  16. package/dist/src/components/PhyloTree/ZoomSurface.d.ts.map +1 -0
  17. package/dist/src/components/PhyloTree/example-data/241_mammals_treedata.d.ts +1056 -0
  18. package/dist/src/components/PhyloTree/example-data/241_mammals_treedata.d.ts.map +1 -0
  19. package/dist/src/components/PhyloTree/example-data/utils.d.ts +6 -0
  20. package/dist/src/components/PhyloTree/example-data/utils.d.ts.map +1 -0
  21. package/dist/src/components/PhyloTree/index.d.ts +4 -0
  22. package/dist/src/components/PhyloTree/index.d.ts.map +1 -0
  23. package/dist/src/components/PhyloTree/types.d.ts +106 -0
  24. package/dist/src/components/PhyloTree/types.d.ts.map +1 -0
  25. package/dist/src/components/ScatterPlot/scatterplot.d.ts.map +1 -1
  26. package/dist/src/components/ScatterPlot/types.d.ts +1 -4
  27. package/dist/src/components/ScatterPlot/types.d.ts.map +1 -1
  28. package/dist/src/components/SequenceAlignmentPlot/SequenceAlignmentPlot.d.ts +47 -0
  29. package/dist/src/components/SequenceAlignmentPlot/SequenceAlignmentPlot.d.ts.map +1 -0
  30. package/dist/src/components/SequenceAlignmentPlot/example-data/mockData.d.ts +25 -0
  31. package/dist/src/components/SequenceAlignmentPlot/example-data/mockData.d.ts.map +1 -0
  32. package/dist/src/components/SequenceAlignmentPlot/index.d.ts +2 -0
  33. package/dist/src/components/SequenceAlignmentPlot/index.d.ts.map +1 -0
  34. package/dist/src/index.d.ts +2 -0
  35. package/dist/src/index.d.ts.map +1 -1
  36. package/dist/visualization.es.js +16440 -16301
  37. package/dist/visualization.es.js.map +1 -1
  38. package/package.json +5 -1
@@ -0,0 +1,8 @@
1
+ import { ProvidedZoom } from '@visx/zoom/lib/types';
2
+ export type ControlPanelProps = {
3
+ scaleZoom: ProvidedZoom<SVGSVGElement>["scale"];
4
+ resetZoom: ProvidedZoom<SVGSVGElement>["reset"];
5
+ toggleBranchLength: () => void;
6
+ };
7
+ export declare const ControlPanel: ({ scaleZoom, resetZoom, toggleBranchLength }: ControlPanelProps) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=ControlPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControlPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/PhyloTree/ControlPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAI,MAAM,sBAAsB,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAA;IAC/C,SAAS,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAA;IAC/C,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,8CAA4C,iBAAiB,4CAsCzF,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { TreeNode } from './types';
2
+ export type LeafLinkExtensionProps = {
3
+ baseLeafLinkExtension: TreeNode["baseLeafLinkExtension"];
4
+ scaledLeafLinkExtension: TreeNode["scaledLeafLinkExtension"];
5
+ color: TreeNode["color"];
6
+ strokeWidth: TreeNode["linkStrokeWidth"];
7
+ useBranchLengths: boolean;
8
+ };
9
+ export declare const LeafLinkExtension: import('react').NamedExoticComponent<LeafLinkExtensionProps>;
10
+ //# sourceMappingURL=LeafLinkExtension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeafLinkExtension.d.ts","sourceRoot":"","sources":["../../../../src/components/PhyloTree/LeafLinkExtension.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,MAAM,MAAM,sBAAsB,GAAG;IACnC,qBAAqB,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAA;IACxD,uBAAuB,EAAE,QAAQ,CAAC,yBAAyB,CAAC,CAAA;IAC5D,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACzB,WAAW,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAA;IACxC,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,8DAiB5B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { PhyloTreeProps, TreeNode } from './types';
2
+ export type LeafNodeLabelProps = {
3
+ nodeX: number;
4
+ baseNodeX: TreeNode["baseNodeX"];
5
+ baseNodeY: TreeNode["baseNodeY"];
6
+ label: TreeNode["label"];
7
+ color: TreeNode["color"];
8
+ fontSize: PhyloTreeProps["leafFontSize"];
9
+ fontFamily: PhyloTreeProps["leafFontFamily"];
10
+ strokeWidth: TreeNode["labelStrokeWidth"];
11
+ };
12
+ export declare const LeafNodeLabel: import('react').NamedExoticComponent<LeafNodeLabelProps>;
13
+ //# sourceMappingURL=LeafNodeLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeafNodeLabel.d.ts","sourceRoot":"","sources":["../../../../src/components/PhyloTree/LeafNodeLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKnD,MAAM,MAAM,kBAAkB,GAAG;IAE/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACjC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACzB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACzC,UAAU,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC7C,WAAW,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAA;CAC1C,CAAC;AAEF,eAAO,MAAM,aAAa,0DAwCxB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { PhyloTreeProps } from './types';
2
+ /**
3
+ * Improvements that would make this scale better (as much as svg can):
4
+ * - Combine links into fewer path elements
5
+ * - Requires having static hit detecting paths, but can create fewer <path> elements by combining link paths
6
+ * - Creates less work for the browser to update fewer, but more complex paths
7
+ * - Would need base branches grouped by color, selection path, external highlight path, and invisible static hit target paths for branch selection
8
+ * - Remove hover interaction and opt for click only interactions
9
+ * - If keeping hover behavior, define gapless areas between nodes to prevent -> hover NodeA, hover null, hover NodeB in favor of NodeA -> NodeB
10
+ * - Define single hit area that takes in click event and determines what was hit
11
+ */
12
+ export declare const useBranchLengthTransition: {
13
+ readonly duration: 0.3;
14
+ readonly ease: "easeInOut";
15
+ };
16
+ /**
17
+ * For internal svg calculation only
18
+ */
19
+ export declare const TOTAL_INNER_RADIUS = 500;
20
+ /**
21
+ * For internal svg calculation only (used to define viewbox in ZoomFrame)
22
+ */
23
+ export declare const TOTAL_INNER_DIAMETER: number;
24
+ export default function PhyloTree({ width: totalWidth, height: totalHeight, data, highlighted, hovered: externalHovered, leafFontSize, leafFontFamily, linkStrokeWidth, getColor, getLabel, onLeafClick, onLeafHoverChange, labelPadding, defaultScaling, tooltipContents, }: PhyloTreeProps): import("react/jsx-runtime").JSX.Element | null;
25
+ //# sourceMappingURL=PhyloTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhyloTree.d.ts","sourceRoot":"","sources":["../../../../src/components/PhyloTree/PhyloTree.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAA2C,MAAM,SAAS,CAAC;AAQlF;;;;;;;;;GASG;AAEH,eAAO,MAAM,yBAAyB;;;CAG5B,CAAC;AA2EX;;GAEG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AACtC;;GAEG;AACH,eAAO,MAAM,oBAAoB,QAAyB,CAAC;AAE3D,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,EACnB,IAAI,EACJ,WAAgB,EAChB,OAAO,EAAE,eAAoB,EAC7B,YAAgB,EAChB,cAAwB,EACxB,eAAmB,EACnB,QAAwB,EACxB,QAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAkB,EAClB,cAAyB,EACzB,eAAe,GAChB,EAAE,cAAc,kDAiShB"}
@@ -0,0 +1,19 @@
1
+ import { PhyloTreeProps, TreeNode } from './types';
2
+ type Shared = {
3
+ node: TreeNode;
4
+ useBranchLengths: boolean;
5
+ leafFontSize: PhyloTreeProps["leafFontSize"];
6
+ leafFontFamily: PhyloTreeProps["leafFontFamily"];
7
+ onNodeMouseMove: (event: React.MouseEvent, node: TreeNode) => void;
8
+ onNodeMouseLeave: (event: React.MouseEvent, node: TreeNode) => void;
9
+ onLeafClick: PhyloTreeProps["onLeafClick"];
10
+ };
11
+ export type RenderTreeProps = Shared & {
12
+ hovered: string[];
13
+ };
14
+ export type RenderChildProps = Shared & {
15
+ dimmed: boolean;
16
+ };
17
+ export declare const RenderTree: import('react').NamedExoticComponent<RenderTreeProps>;
18
+ export {};
19
+ //# sourceMappingURL=RenderTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderTree.d.ts","sourceRoot":"","sources":["../../../../src/components/PhyloTree/RenderTree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMnD,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,QAAQ,CAAC;IACf,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC7C,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACjD,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACnE,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpE,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG;IACrC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IACtC,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AA8CF,eAAO,MAAM,UAAU,uDAkCnB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { TreeNode } from './types';
2
+ export type TreeLinkProps = {
3
+ scaledLinkPath: TreeNode["scaledLinkPath"];
4
+ baseLinkPath: TreeNode["baseLinkPath"];
5
+ color: TreeNode["color"];
6
+ strokeWidth: TreeNode["linkStrokeWidth"];
7
+ useBranchLengths: boolean;
8
+ };
9
+ /**
10
+ * Link from node to its parent
11
+ */
12
+ export declare const TreeLink: import('react').NamedExoticComponent<TreeLinkProps>;
13
+ //# sourceMappingURL=TreeLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeLink.d.ts","sourceRoot":"","sources":["../../../../src/components/PhyloTree/TreeLink.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKnC,MAAM,MAAM,aAAa,GAAG;IAC1B,cAAc,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;IAC1C,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAA;IACtC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACxB,WAAW,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAA;IACxC,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,qDAuBnB,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { ProvidedZoom } from '@visx/zoom/lib/types';
2
+ import { ReactNode } from 'react';
3
+ import { ZoomState } from './types';
4
+ export type ZoomFrameProps = {
5
+ zoom: ProvidedZoom<SVGSVGElement> & ZoomState;
6
+ totalHeight: number;
7
+ totalWidth: number;
8
+ toggleBranchLength: () => void;
9
+ children: ReactNode;
10
+ };
11
+ export declare const ZoomFrame: import('react').NamedExoticComponent<ZoomFrameProps>;
12
+ //# sourceMappingURL=ZoomFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomFrame.d.ts","sourceRoot":"","sources":["../../../../src/components/PhyloTree/ZoomFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAQ,SAAS,EAAY,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMpC,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAC;AAEF,eAAO,MAAM,SAAS,sDA+BpB,CAAC"}
@@ -0,0 +1,20 @@
1
+ type ZoomSurfaceProps = {
2
+ dragStart: (event: React.TouchEvent | React.MouseEvent) => void;
3
+ dragMove: (event: React.TouchEvent | React.MouseEvent) => void;
4
+ dragEnd: () => void;
5
+ scale: (args: {
6
+ scaleX: number;
7
+ scaleY: number;
8
+ point?: {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ }) => void;
13
+ isDragging: boolean;
14
+ };
15
+ /**
16
+ * rect which catches and handles zoom events
17
+ */
18
+ export declare const ZoomSurface: import('react').MemoExoticComponent<({ dragStart, dragMove, dragEnd, scale, isDragging }: ZoomSurfaceProps) => import("react/jsx-runtime").JSX.Element>;
19
+ export {};
20
+ //# sourceMappingURL=ZoomSurface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomSurface.d.ts","sourceRoot":"","sources":["../../../../src/components/PhyloTree/ZoomSurface.tsx"],"names":[],"mappings":"AAGA,KAAK,gBAAgB,GAAG;IACtB,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAChE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5F,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAGF;;GAEG;AAEH,eAAO,MAAM,WAAW,4FACgC,gBAAgB,6CAsBvE,CAAC"}