@hpcc-js/react 2.54.0 → 3.1.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 (65) hide show
  1. package/dist/index.js +2 -575
  2. package/dist/index.js.map +7 -1
  3. package/package.json +34 -33
  4. package/src/ImageChar.tsx +12 -9
  5. package/src/__package__.ts +2 -2
  6. package/src/edge.tsx +3 -3
  7. package/src/icon.tsx +10 -10
  8. package/src/image.tsx +3 -3
  9. package/src/index.ts +15 -13
  10. package/src/render.ts +46 -17
  11. package/src/shape.tsx +15 -15
  12. package/src/span.tsx +9 -0
  13. package/src/subgraph.tsx +3 -3
  14. package/src/text.tsx +58 -39
  15. package/src/vertex.tsx +17 -14
  16. package/src/vertex2.tsx +5 -5
  17. package/src/vertex3.tsx +11 -11
  18. package/src/vertex4.tsx +10 -11
  19. package/types/ImageChar.d.ts +4 -5
  20. package/types/__package__.d.ts +2 -3
  21. package/types/edge.d.ts +2 -3
  22. package/types/icon.d.ts +6 -7
  23. package/types/image.d.ts +3 -4
  24. package/types/index.d.ts +15 -14
  25. package/types/render.d.ts +16 -8
  26. package/types/shape.d.ts +9 -10
  27. package/types/span.d.ts +5 -0
  28. package/types/subgraph.d.ts +1 -2
  29. package/types/text.d.ts +11 -13
  30. package/types/vertex.d.ts +5 -6
  31. package/types/vertex2.d.ts +2 -3
  32. package/types/vertex3.d.ts +8 -9
  33. package/types/vertex4.d.ts +4 -5
  34. package/dist/index.es6.js +0 -542
  35. package/dist/index.es6.js.map +0 -1
  36. package/dist/index.min.js +0 -2
  37. package/dist/index.min.js.map +0 -1
  38. package/types/ImageChar.d.ts.map +0 -1
  39. package/types/__package__.d.ts.map +0 -1
  40. package/types/edge.d.ts.map +0 -1
  41. package/types/icon.d.ts.map +0 -1
  42. package/types/image.d.ts.map +0 -1
  43. package/types/index.d.ts.map +0 -1
  44. package/types/render.d.ts.map +0 -1
  45. package/types/shape.d.ts.map +0 -1
  46. package/types/subgraph.d.ts.map +0 -1
  47. package/types/text.d.ts.map +0 -1
  48. package/types/vertex.d.ts.map +0 -1
  49. package/types/vertex2.d.ts.map +0 -1
  50. package/types/vertex3.d.ts.map +0 -1
  51. package/types/vertex4.d.ts.map +0 -1
  52. package/types-3.4/ImageChar.d.ts +0 -14
  53. package/types-3.4/__package__.d.ts +0 -4
  54. package/types-3.4/edge.d.ts +0 -30
  55. package/types-3.4/icon.d.ts +0 -27
  56. package/types-3.4/image.d.ts +0 -11
  57. package/types-3.4/index.d.ts +0 -15
  58. package/types-3.4/render.d.ts +0 -27
  59. package/types-3.4/shape.d.ts +0 -41
  60. package/types-3.4/subgraph.d.ts +0 -14
  61. package/types-3.4/text.d.ts +0 -51
  62. package/types-3.4/vertex.d.ts +0 -33
  63. package/types-3.4/vertex2.d.ts +0 -4
  64. package/types-3.4/vertex3.d.ts +0 -34
  65. package/types-3.4/vertex4.d.ts +0 -32
package/src/vertex.tsx CHANGED
@@ -1,15 +1,15 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- import { Icon } from "./icon";
3
- import { TextBox } from "./text";
1
+ import React from "react";
2
+ import { Icon, IconProps } from "./icon.tsx";
3
+ import { TextBox } from "./text.tsx";
4
4
 
5
- export interface Annotations {
5
+ export interface AnnotationsProps {
6
6
  x: number;
7
7
  y: number;
8
8
  annotationIDs: string[];
9
9
  stepSize?: number;
10
10
  }
11
11
 
12
- export const Annotations: React.FunctionComponent<Annotations> = ({
12
+ export const Annotations: React.FunctionComponent<AnnotationsProps> = ({
13
13
  x,
14
14
  y,
15
15
  annotationIDs = [],
@@ -35,7 +35,7 @@ export interface VertexProps {
35
35
  text: string;
36
36
  textHeight?: number;
37
37
  textPadding?: number;
38
- icon?: Icon;
38
+ icon?: IconProps;
39
39
  annotationsHeight?: number;
40
40
  annotationIDs?: string[];
41
41
  textFill?: string;
@@ -52,7 +52,7 @@ export const Vertex: React.FunctionComponent<VertexProps> = ({
52
52
  text = "",
53
53
  textHeight = 12,
54
54
  textPadding = 4,
55
- icon = {},
55
+ icon = {} as IconProps,
56
56
  annotationsHeight = 12,
57
57
  annotationIDs = [],
58
58
  textFill,
@@ -63,19 +63,22 @@ export const Vertex: React.FunctionComponent<VertexProps> = ({
63
63
  showLabel = true,
64
64
  scale = 1
65
65
  }) => {
66
- const [textBoxWidth, setTextBoxWidthUpdate] = React.useState(0);
67
- const [textBoxHeight, setTextBoxHeightUpdate] = React.useState(0);
68
-
69
- React.useEffect(() => {
70
- onSizeUpdate && onSizeUpdate({ width: 0, height: 0 });
71
- }, [textBoxWidth, textBoxHeight, onSizeUpdate]);
72
-
73
66
  icon = {
74
67
  imageChar: "fa-question",
75
68
  height: 32,
76
69
  fill: "transparent",
77
70
  ...icon
78
71
  };
72
+
73
+ const [textBoxWidth, setTextBoxWidthUpdate] = React.useState(0);
74
+ const [textBoxHeight, setTextBoxHeightUpdate] = React.useState(0);
75
+
76
+ React.useEffect(() => {
77
+ if (onSizeUpdate) {
78
+ onSizeUpdate({ width: 0, height: 0 });
79
+ }
80
+ }, [textBoxWidth, textBoxHeight, onSizeUpdate]);
81
+
79
82
  let width = textBoxWidth;
80
83
  width += 4;
81
84
  let offsetY = -(icon.height * 2 / 6 + textHeight + 8) / 2;
package/src/vertex2.tsx CHANGED
@@ -1,15 +1,15 @@
1
+ import React from "react";
1
2
  import { Utility } from "@hpcc-js/common";
2
- import * as React from "@hpcc-js/preact-shim";
3
- import { Icon } from "./icon";
4
- import { TextBox } from "./text";
5
- import { Annotations, VertexProps } from "./vertex";
3
+ import { Icon, IconProps } from "./icon.tsx";
4
+ import { TextBox } from "./text.tsx";
5
+ import { Annotations, VertexProps } from "./vertex.tsx";
6
6
 
7
7
  export const Vertex2: React.FunctionComponent<VertexProps> = ({
8
8
  categoryID = "",
9
9
  text = "",
10
10
  textHeight = 12,
11
11
  textPadding = 4,
12
- icon = {},
12
+ icon = {} as IconProps,
13
13
  textFill = "black",
14
14
  textboxFill = "white",
15
15
  textboxStroke = "black",
package/src/vertex3.tsx CHANGED
@@ -1,8 +1,8 @@
1
+ import React from "react";
1
2
  import { Utility } from "@hpcc-js/common";
2
- import * as React from "@hpcc-js/preact-shim";
3
- import { Icon } from "./icon";
4
- import { TextBox } from "./text";
5
- import { VertexProps } from "./vertex";
3
+ import { Icon, IconProps } from "./icon.tsx";
4
+ import { TextBox, TextBoxProps } from "./text.tsx";
5
+ import { VertexProps } from "./vertex.tsx";
6
6
 
7
7
  export interface Vertex3Props extends VertexProps {
8
8
  id: string;
@@ -12,8 +12,8 @@ export interface Vertex3Props extends VertexProps {
12
12
  textHeight?: number;
13
13
  textPadding?: number;
14
14
  textboxStrokeWidth?: number;
15
- icon?: Icon;
16
- annotations?: Icon[];
15
+ icon?: IconProps;
16
+ annotations?: IconProps[];
17
17
  annotationsHeight?: number;
18
18
  annotationGutter?: number;
19
19
  textFill?: string;
@@ -21,11 +21,11 @@ export interface Vertex3Props extends VertexProps {
21
21
  textboxStroke?: string;
22
22
  textFontFamily?: string;
23
23
  cornerRadius?: number;
24
- subText?: TextBox;
24
+ subText?: TextBoxProps;
25
25
  onSizeUpdate?: (size: { width: number, height: number }) => void;
26
26
  showLabel?: boolean;
27
27
  noLabelRadius?: number;
28
- expansionIcon?: Icon;
28
+ expansionIcon?: IconProps;
29
29
  scale?: number;
30
30
  }
31
31
 
@@ -41,8 +41,8 @@ export const Vertex3: React.FunctionComponent<Vertex3Props> = ({
41
41
  annotationGutter = 2,
42
42
  annotations = [],
43
43
  cornerRadius = 3,
44
- icon = {},
45
- subText = { text: "" },
44
+ icon = {} as IconProps,
45
+ subText = { text: "" } as TextBoxProps,
46
46
  showLabel = true,
47
47
  noLabelRadius = 5,
48
48
  expansionIcon,
@@ -98,7 +98,7 @@ export const Vertex3: React.FunctionComponent<Vertex3Props> = ({
98
98
  fullAnnotationWidth += annoShapeWidth + annotationGutter;
99
99
  const annoOffsetX = fullAnnotationWidth - (annoShapeWidth / 2);
100
100
  annotationArr.push(
101
- <g key={idx} class="vertex3-anno" data-click={"annotation"} data-click-data={JSON.stringify(anno)} transform={`translate(${annoOffsetX} ${annoOffsetY})`}>
101
+ <g key={idx} className="vertex3-anno" data-click={"annotation"} data-click-data={JSON.stringify(anno)} transform={`translate(${annoOffsetX} ${annoOffsetY})`}>
102
102
  <Icon
103
103
  {...anno}
104
104
  shape="square"
package/src/vertex4.tsx CHANGED
@@ -1,11 +1,10 @@
1
- /* eslint-disable no-debugger, no-console */
1
+ import React from "react";
2
2
  import { Utility } from "@hpcc-js/common";
3
- import * as React from "@hpcc-js/preact-shim";
4
- import { Icon } from "./icon";
5
- import { TextBox } from "./text";
6
- import { VertexProps } from "./vertex";
3
+ import { Icon, IconProps } from "./icon.tsx";
4
+ import { TextBox, TextBoxProps } from "./text.tsx";
5
+ import { VertexProps } from "./vertex.tsx";
7
6
 
8
- export interface IVertex4Annotation extends Icon {
7
+ export interface IVertex4Annotation extends IconProps {
9
8
  shapeOffsetX?: number;
10
9
  shapeOffsetY?: number;
11
10
  }
@@ -47,8 +46,8 @@ export const Vertex4: React.FunctionComponent<IVertex4> = ({
47
46
  annotations = [],
48
47
  iconAnnotations = [],
49
48
  cornerRadius = 3,
50
- icon = {},
51
- subText = {},
49
+ icon = {} as IconProps,
50
+ subText = {} as TextBoxProps,
52
51
  showLabel = true,
53
52
  noLabelRadius = 5,
54
53
 
@@ -99,7 +98,7 @@ export const Vertex4: React.FunctionComponent<IVertex4> = ({
99
98
  const textOffsetX = fullAnnotationWidth - (labelShapeWidth / 2);
100
99
 
101
100
  const textShapeHeight = textHeight + (annotationGutter * 2) + (textboxStrokeWidth * 2);
102
- const annoWidthArr = annotations.map((anno, i) => {
101
+ const annoWidthArr = annotations.map((anno) => {
103
102
  return Utility.textSize(anno.imageChar, anno.imageFontFamily, anno.height, false).width;
104
103
  });
105
104
  const annotationArr = [];
@@ -110,7 +109,7 @@ export const Vertex4: React.FunctionComponent<IVertex4> = ({
110
109
  _labelAnnoOffsetX += annoWidthArr[i] + annotationGutter;
111
110
  const annoOffsetX = _labelAnnoOffsetX - (annoWidthArr[i] / 2);
112
111
  annotationArr.push(
113
- <g key={i} class="vertex3-anno" data-click={"annotation"} data-click-data={JSON.stringify(anno)} transform={`translate(${annoOffsetX} ${annoOffsetY})`}>
112
+ <g key={i} className="vertex3-anno" data-click={"annotation"} data-click-data={JSON.stringify(anno)} transform={`translate(${annoOffsetX} ${annoOffsetY})`}>
114
113
  <Icon
115
114
  {...anno}
116
115
  shape="rectangle"
@@ -133,7 +132,7 @@ export const Vertex4: React.FunctionComponent<IVertex4> = ({
133
132
  const x = anno.shapeOffsetX;
134
133
  const y = anno.shapeOffsetY;
135
134
  iconAnnotationArr.push(
136
- <g key={i} class="vertex3-iconAnno" data-click={"icon-annotation"} data-click-data={JSON.stringify(anno)} transform={`translate(${x} ${y})`}>
135
+ <g key={i} className="vertex3-iconAnno" data-click={"icon-annotation"} data-click-data={JSON.stringify(anno)} transform={`translate(${x} ${y})`}>
137
136
  <Icon
138
137
  {...anno}
139
138
  shape={anno.shape ?? "square"}
@@ -1,5 +1,5 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- interface ImageChar {
1
+ import React from "react";
2
+ export interface ImageCharProps {
3
3
  x?: number;
4
4
  y?: number;
5
5
  height?: number;
@@ -8,7 +8,6 @@ interface ImageChar {
8
8
  fontFamily?: string;
9
9
  char?: string;
10
10
  yOffset?: number;
11
+ fontWeight?: number;
11
12
  }
12
- export declare const ImageChar: React.FunctionComponent<ImageChar>;
13
- export {};
14
- //# sourceMappingURL=ImageChar.d.ts.map
13
+ export declare const ImageChar: React.FunctionComponent<ImageCharProps>;
@@ -1,4 +1,3 @@
1
1
  export declare const PKG_NAME = "@hpcc-js/react";
2
- export declare const PKG_VERSION = "2.54.0";
3
- export declare const BUILD_VERSION = "2.106.0";
4
- //# sourceMappingURL=__package__.d.ts.map
2
+ export declare const PKG_VERSION = "3.1.0";
3
+ export declare const BUILD_VERSION = "3.2.0";
package/types/edge.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- import { VertexProps } from "./vertex";
1
+ import React from "react";
2
+ import { VertexProps } from "./vertex.tsx";
3
3
  type Point = [number, number];
4
4
  export interface EdgeProps<V extends VertexProps = VertexProps> {
5
5
  id: string | number;
@@ -21,4 +21,3 @@ export interface EdgeProps<V extends VertexProps = VertexProps> {
21
21
  }
22
22
  export declare const Edge: React.FunctionComponent<EdgeProps>;
23
23
  export {};
24
- //# sourceMappingURL=edge.d.ts.map
package/types/icon.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- export interface Icon {
1
+ import React from "react";
2
+ export interface IconProps {
3
3
  shape?: "circle" | "square" | "rectangle";
4
4
  width?: number;
5
5
  height?: number;
@@ -16,12 +16,11 @@ export interface Icon {
16
16
  cornerRadius?: number;
17
17
  shapeRendering?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision";
18
18
  }
19
- export declare const Icon: React.FunctionComponent<Icon>;
20
- export interface IconEx extends Icon {
19
+ export declare const Icon: React.FunctionComponent<IconProps>;
20
+ export interface IconEx extends IconProps {
21
21
  id: string;
22
22
  }
23
- export interface Icons {
23
+ export interface IconsProps {
24
24
  icons: IconEx[];
25
25
  }
26
- export declare const Icons: React.FunctionComponent<Icons>;
27
- //# sourceMappingURL=icon.d.ts.map
26
+ export declare const Icons: React.FunctionComponent<IconsProps>;
package/types/image.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- interface Image {
1
+ import React from "react";
2
+ interface ImageProps {
3
3
  href: string;
4
4
  x?: number;
5
5
  y?: number;
6
6
  height?: number;
7
7
  yOffset?: number;
8
8
  }
9
- export declare const Image: React.FunctionComponent<Image>;
9
+ export declare const Image: React.FunctionComponent<ImageProps>;
10
10
  export {};
11
- //# sourceMappingURL=image.d.ts.map
package/types/index.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- export * from "./__package__";
2
- export * from "./edge";
3
- export * from "./ImageChar";
4
- export * from "./icon";
5
- export * from "./render";
6
- export * from "./shape";
7
- export * from "./text";
8
- export * from "./vertex";
9
- export * from "./vertex2";
10
- export * from "./vertex3";
11
- export * from "./vertex4";
12
- export * from "./subgraph";
13
- import * as React from "@hpcc-js/preact-shim";
1
+ export * from "./__package__.ts";
2
+ export * from "./edge.tsx";
3
+ export * from "./ImageChar.tsx";
4
+ export * from "./icon.tsx";
5
+ export * from "./image.tsx";
6
+ export * from "./render.ts";
7
+ export * from "./shape.tsx";
8
+ export * from "./span.tsx";
9
+ export * from "./text.tsx";
10
+ export * from "./vertex.tsx";
11
+ export * from "./vertex2.tsx";
12
+ export * from "./vertex3.tsx";
13
+ export * from "./vertex4.tsx";
14
+ export * from "./subgraph.tsx";
15
+ import React from "react";
14
16
  export { React };
15
- //# sourceMappingURL=index.d.ts.map
package/types/render.d.ts CHANGED
@@ -1,27 +1,35 @@
1
+ import React from "react";
2
+ import { Root } from "react-dom/client";
1
3
  import { HTMLWidget, SVGWidget } from "@hpcc-js/common";
2
- import * as React from "@hpcc-js/preact-shim";
3
- export declare function render<P>(C: React.FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text): void;
4
- export interface FunctionComponent<T> extends React.FunctionComponent<T> {
5
- }
6
- export declare function svgRender<P>(C: React.FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment, replaceNode?: Element | Text): void;
4
+ export declare function render<P>(C: React.FunctionComponent<P>, props: Readonly<P>, parent: Element | Document | ShadowRoot | DocumentFragment): void;
7
5
  export declare class HTMLAdapter<P> extends HTMLWidget {
8
6
  protected readonly _component: React.FunctionComponent<P>;
9
- protected _props: P;
7
+ protected _root: Root;
10
8
  props(): P;
11
9
  props(_: Partial<P>): this;
12
10
  prop<K extends keyof P>(_: K): P[K];
13
11
  prop<K extends keyof P>(_: K, value: P[K]): this;
14
12
  constructor(_component: React.FunctionComponent<P>);
13
+ enter(domNode: any, element: any): void;
15
14
  update(domNode: any, element: any): void;
15
+ exit(domNode: any, element: any): void;
16
+ }
17
+ export interface HTMLAdapter<P> {
18
+ _props: P;
16
19
  }
17
20
  export declare class SVGAdapter<P> extends SVGWidget {
18
21
  protected readonly _component: React.FunctionComponent<P>;
19
- protected _props: P;
22
+ protected _root: Root;
20
23
  props(): P;
21
24
  props(_: Partial<P>): this;
22
25
  prop<K extends keyof P>(_: K): P[K];
23
26
  prop<K extends keyof P>(_: K, value: P[K]): this;
24
27
  constructor(_component: React.FunctionComponent<P>);
28
+ _c2: React.ReactElement;
29
+ enter(domNode: any, element: any): void;
25
30
  update(domNode: any, element: any): void;
31
+ exit(domNode: any, element: any): void;
32
+ }
33
+ export interface SVGAdapter<P> {
34
+ _props: P;
26
35
  }
27
- //# sourceMappingURL=render.d.ts.map
package/types/shape.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- interface Circle {
1
+ import React from "react";
2
+ interface CircleProps {
3
3
  radius?: number;
4
4
  fill?: string;
5
5
  stroke?: string;
6
6
  strokeWidth?: number;
7
7
  shapeRendering?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision";
8
8
  }
9
- export declare const Circle: React.FunctionComponent<Circle>;
10
- interface Square {
9
+ export declare const Circle: React.FunctionComponent<CircleProps>;
10
+ interface SquareProps {
11
11
  radius?: number;
12
12
  cornerRadius?: number;
13
13
  fill?: string;
@@ -15,8 +15,8 @@ interface Square {
15
15
  strokeWidth?: number;
16
16
  shapeRendering?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision";
17
17
  }
18
- export declare const Square: React.FunctionComponent<Square>;
19
- interface Rectangle {
18
+ export declare const Square: React.FunctionComponent<SquareProps>;
19
+ interface RectangleProps {
20
20
  width?: number;
21
21
  height?: number;
22
22
  cornerRadius?: number;
@@ -25,8 +25,8 @@ interface Rectangle {
25
25
  strokeWidth?: number;
26
26
  shapeRendering?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision";
27
27
  }
28
- export declare const Rectangle: React.FunctionComponent<Rectangle>;
29
- interface Shape {
28
+ export declare const Rectangle: React.FunctionComponent<RectangleProps>;
29
+ interface ShapeProps {
30
30
  shape?: "circle" | "square" | "rectangle";
31
31
  height?: number;
32
32
  width?: number;
@@ -36,6 +36,5 @@ interface Shape {
36
36
  shapeRendering?: "auto" | "optimizeSpeed" | "crispEdges" | "geometricPrecision";
37
37
  cornerRadius?: number;
38
38
  }
39
- export declare const Shape: React.FunctionComponent<Shape>;
39
+ export declare const Shape: React.FunctionComponent<ShapeProps>;
40
40
  export {};
41
- //# sourceMappingURL=shape.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export interface SpanProps {
3
+ text: string;
4
+ }
5
+ export declare const Span: React.FunctionComponent<SpanProps>;
@@ -1,4 +1,4 @@
1
- import * as React from "@hpcc-js/preact-shim";
1
+ import React from "react";
2
2
  export interface SubgraphProps {
3
3
  id: string;
4
4
  origData?: any;
@@ -11,4 +11,3 @@ export interface SubgraphProps {
11
11
  fontFamily?: string;
12
12
  }
13
13
  export declare const Subgraph: React.FunctionComponent<SubgraphProps>;
14
- //# sourceMappingURL=subgraph.d.ts.map
package/types/text.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- interface TextLine {
1
+ import React from "react";
2
+ export interface TextLineProps {
3
3
  text: string;
4
4
  height?: number;
5
5
  anchor?: string;
@@ -7,8 +7,8 @@ interface TextLine {
7
7
  fontFamily?: string;
8
8
  fill?: string;
9
9
  }
10
- export declare const TextLine: React.FunctionComponent<TextLine>;
11
- interface Text {
10
+ export declare const TextLine: React.FunctionComponent<TextLineProps>;
11
+ export interface TextProps {
12
12
  text: string;
13
13
  height?: number;
14
14
  fontFamily?: string;
@@ -18,8 +18,8 @@ interface Text {
18
18
  height: number;
19
19
  }) => void;
20
20
  }
21
- export declare const Text: React.FunctionComponent<Text>;
22
- export interface TextBox {
21
+ export declare const Text: React.FunctionComponent<TextProps>;
22
+ export interface TextBoxProps {
23
23
  text: string;
24
24
  height?: number;
25
25
  fontFamily?: string;
@@ -35,17 +35,15 @@ export interface TextBox {
35
35
  height: number;
36
36
  }) => void;
37
37
  }
38
- export declare const TextBox: React.FunctionComponent<TextBox>;
39
- export interface LabelledRect extends TextBox {
38
+ export declare const TextBox: React.FunctionComponent<TextBoxProps>;
39
+ export interface LabelledRect extends TextBoxProps {
40
40
  width?: number;
41
41
  fontSize?: number;
42
42
  }
43
+ export declare const LabelledRect: React.FunctionComponent<LabelledRect>;
43
44
  export interface IconLabelledRect extends LabelledRect {
44
45
  icon: string;
45
- iconFontFamily: string;
46
- iconFontSize: number;
46
+ iconFontFamily?: string;
47
+ iconFontSize?: number;
47
48
  }
48
- export declare const LabelledRect: React.FunctionComponent<LabelledRect>;
49
49
  export declare const IconLabelledRect: React.FunctionComponent<IconLabelledRect>;
50
- export {};
51
- //# sourceMappingURL=text.d.ts.map
package/types/vertex.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- import { Icon } from "./icon";
3
- export interface Annotations {
1
+ import React from "react";
2
+ import { IconProps } from "./icon.tsx";
3
+ export interface AnnotationsProps {
4
4
  x: number;
5
5
  y: number;
6
6
  annotationIDs: string[];
7
7
  stepSize?: number;
8
8
  }
9
- export declare const Annotations: React.FunctionComponent<Annotations>;
9
+ export declare const Annotations: React.FunctionComponent<AnnotationsProps>;
10
10
  export interface VertexProps {
11
11
  id: string | number;
12
12
  origData?: any;
@@ -15,7 +15,7 @@ export interface VertexProps {
15
15
  text: string;
16
16
  textHeight?: number;
17
17
  textPadding?: number;
18
- icon?: Icon;
18
+ icon?: IconProps;
19
19
  annotationsHeight?: number;
20
20
  annotationIDs?: string[];
21
21
  textFill?: string;
@@ -30,4 +30,3 @@ export interface VertexProps {
30
30
  scale?: number;
31
31
  }
32
32
  export declare const Vertex: React.FunctionComponent<VertexProps>;
33
- //# sourceMappingURL=vertex.d.ts.map
@@ -1,4 +1,3 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- import { VertexProps } from "./vertex";
1
+ import React from "react";
2
+ import { VertexProps } from "./vertex.tsx";
3
3
  export declare const Vertex2: React.FunctionComponent<VertexProps>;
4
- //# sourceMappingURL=vertex2.d.ts.map
@@ -1,7 +1,7 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- import { Icon } from "./icon";
3
- import { TextBox } from "./text";
4
- import { VertexProps } from "./vertex";
1
+ import React from "react";
2
+ import { IconProps } from "./icon.tsx";
3
+ import { TextBoxProps } from "./text.tsx";
4
+ import { VertexProps } from "./vertex.tsx";
5
5
  export interface Vertex3Props extends VertexProps {
6
6
  id: string;
7
7
  origData?: any;
@@ -10,8 +10,8 @@ export interface Vertex3Props extends VertexProps {
10
10
  textHeight?: number;
11
11
  textPadding?: number;
12
12
  textboxStrokeWidth?: number;
13
- icon?: Icon;
14
- annotations?: Icon[];
13
+ icon?: IconProps;
14
+ annotations?: IconProps[];
15
15
  annotationsHeight?: number;
16
16
  annotationGutter?: number;
17
17
  textFill?: string;
@@ -19,16 +19,15 @@ export interface Vertex3Props extends VertexProps {
19
19
  textboxStroke?: string;
20
20
  textFontFamily?: string;
21
21
  cornerRadius?: number;
22
- subText?: TextBox;
22
+ subText?: TextBoxProps;
23
23
  onSizeUpdate?: (size: {
24
24
  width: number;
25
25
  height: number;
26
26
  }) => void;
27
27
  showLabel?: boolean;
28
28
  noLabelRadius?: number;
29
- expansionIcon?: Icon;
29
+ expansionIcon?: IconProps;
30
30
  scale?: number;
31
31
  }
32
32
  export declare const Vertex3: React.FunctionComponent<Vertex3Props>;
33
33
  export declare const CentroidVertex3: React.FunctionComponent<Vertex3Props>;
34
- //# sourceMappingURL=vertex3.d.ts.map
@@ -1,7 +1,7 @@
1
- import * as React from "@hpcc-js/preact-shim";
2
- import { Icon } from "./icon";
3
- import { VertexProps } from "./vertex";
4
- export interface IVertex4Annotation extends Icon {
1
+ import React from "react";
2
+ import { IconProps } from "./icon.tsx";
3
+ import { VertexProps } from "./vertex.tsx";
4
+ export interface IVertex4Annotation extends IconProps {
5
5
  shapeOffsetX?: number;
6
6
  shapeOffsetY?: number;
7
7
  }
@@ -29,4 +29,3 @@ export interface IVertex4 extends VertexProps {
29
29
  }
30
30
  export declare const Vertex4: React.FunctionComponent<IVertex4>;
31
31
  export declare const CentroidVertex4: React.FunctionComponent<IVertex4>;
32
- //# sourceMappingURL=vertex4.d.ts.map