@hpcc-js/react 2.53.3 → 2.53.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/react",
3
- "version": "2.53.3",
3
+ "version": "2.53.5",
4
4
  "description": "hpcc-js - Viz React",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es6",
@@ -38,7 +38,7 @@
38
38
  "update": "npx --yes npm-check-updates -u -t minor"
39
39
  },
40
40
  "dependencies": {
41
- "@hpcc-js/common": "^2.71.7",
41
+ "@hpcc-js/common": "^2.71.8",
42
42
  "@hpcc-js/preact-shim": "^2.16.3"
43
43
  },
44
44
  "devDependencies": {
@@ -56,5 +56,5 @@
56
56
  "url": "https://github.com/hpcc-systems/Visualization/issues"
57
57
  },
58
58
  "homepage": "https://github.com/hpcc-systems/Visualization",
59
- "gitHead": "cec45fe4a28dff27d43cf0bb9238d751534c8e88"
59
+ "gitHead": "2704ebc35d1e391d2ac6a0e4962b66b3b8d488f8"
60
60
  }
@@ -1,3 +1,3 @@
1
1
  export const PKG_NAME = "@hpcc-js/react";
2
- export const PKG_VERSION = "2.53.3";
3
- export const BUILD_VERSION = "2.104.14";
2
+ export const PKG_VERSION = "2.53.5";
3
+ export const BUILD_VERSION = "2.104.19";
package/src/icon.tsx CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Palette } from "@hpcc-js/common";
2
2
  import * as React from "@hpcc-js/preact-shim";
3
+ import { Image } from "./image";
3
4
  import { ImageChar } from "./ImageChar";
4
5
  import { Shape } from "./shape";
5
6
 
@@ -11,6 +12,7 @@ export interface Icon {
11
12
  fill?: string;
12
13
  stroke?: string;
13
14
  strokeWidth?: number;
15
+ imageUrl?: string;
14
16
  imageFontFamily?: string;
15
17
  imageChar?: string;
16
18
  imageCharFill?: string;
@@ -27,6 +29,7 @@ export const Icon: React.FunctionComponent<Icon> = ({
27
29
  fill,
28
30
  stroke,
29
31
  strokeWidth = 0,
32
+ imageUrl = "",
30
33
  imageFontFamily = "FontAwesome",
31
34
  imageChar = "",
32
35
  imageCharFill = Palette.textColor(fill),
@@ -47,15 +50,23 @@ export const Icon: React.FunctionComponent<Icon> = ({
47
50
  shapeRendering={shapeRendering}
48
51
  cornerRadius={cornerRadius}
49
52
  />
50
- <ImageChar
51
- x={xOffset}
52
- y={yOffset}
53
- height={height - padding}
54
- fontFamily={imageFontFamily}
55
- char={imageChar}
56
- fill={imageCharFill}
57
- font-weight={400}
58
- ></ImageChar>
53
+ {imageUrl ?
54
+ <Image
55
+ href={imageUrl}
56
+ x={xOffset}
57
+ y={yOffset}
58
+ height={height - padding}
59
+ ></Image> :
60
+ <ImageChar
61
+ x={xOffset}
62
+ y={yOffset}
63
+ height={height - padding}
64
+ fontFamily={imageFontFamily}
65
+ char={imageChar}
66
+ fill={imageCharFill}
67
+ font-weight={400}
68
+ ></ImageChar>
69
+ }
59
70
  </>;
60
71
  };
61
72
 
@@ -72,13 +83,13 @@ export const Icons: React.FunctionComponent<Icons> = ({
72
83
  }) => {
73
84
  const IconComponents = icons.map(cat => {
74
85
  return <g
75
- key={cat.id}
76
- id={cat.id}
77
- >
78
- <Icon
79
- {...cat}
80
- />
81
- </g>;
86
+ key={cat.id}
87
+ id={cat.id}
88
+ >
89
+ <Icon
90
+ {...cat}
91
+ />
92
+ </g>;
82
93
  });
83
94
  return <>{IconComponents}</>;
84
95
  };
package/src/image.tsx ADDED
@@ -0,0 +1,25 @@
1
+ import * as React from "@hpcc-js/preact-shim";
2
+
3
+ interface Image {
4
+ href: string;
5
+ x?: number;
6
+ y?: number;
7
+ height?: number;
8
+ yOffset?: number;
9
+ }
10
+
11
+ export const Image: React.FunctionComponent<Image> = ({
12
+ href,
13
+ x,
14
+ y = 0,
15
+ height = 12
16
+ }) => {
17
+
18
+ return <image
19
+ href={href}
20
+ x={x - height / 2}
21
+ y={y - height / 2}
22
+ width={height}
23
+ height={height}
24
+ ></image>;
25
+ };
package/src/vertex3.tsx CHANGED
@@ -42,7 +42,7 @@ export const Vertex3: React.FunctionComponent<Vertex3Props> = ({
42
42
  annotations = [],
43
43
  cornerRadius = 3,
44
44
  icon = {},
45
- subText = {},
45
+ subText = { text: "" },
46
46
  showLabel = true,
47
47
  noLabelRadius = 5,
48
48
  expansionIcon,
@@ -1,4 +1,4 @@
1
1
  export declare const PKG_NAME = "@hpcc-js/react";
2
- export declare const PKG_VERSION = "2.53.3";
3
- export declare const BUILD_VERSION = "2.104.14";
2
+ export declare const PKG_VERSION = "2.53.5";
3
+ export declare const BUILD_VERSION = "2.104.19";
4
4
  //# sourceMappingURL=__package__.d.ts.map
package/types/icon.d.ts CHANGED
@@ -7,6 +7,7 @@ export interface Icon {
7
7
  fill?: string;
8
8
  stroke?: string;
9
9
  strokeWidth?: number;
10
+ imageUrl?: string;
10
11
  imageFontFamily?: string;
11
12
  imageChar?: string;
12
13
  imageCharFill?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../src/icon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAI9C,MAAM,WAAW,IAAI;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,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AAQ,IAAI;IAChC,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,KAAK;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAchD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import * as React from "@hpcc-js/preact-shim";
2
+ interface Image {
3
+ href: string;
4
+ x?: number;
5
+ y?: number;
6
+ height?: number;
7
+ yOffset?: number;
8
+ }
9
+ export declare const Image: React.FunctionComponent<Image>;
10
+ export {};
11
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAE9C,UAAU,KAAK;IACX,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAchD,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export declare const PKG_NAME = "@hpcc-js/react";
2
- export declare const PKG_VERSION = "2.53.3";
3
- export declare const BUILD_VERSION = "2.104.14";
2
+ export declare const PKG_VERSION = "2.53.5";
3
+ export declare const BUILD_VERSION = "2.104.19";
4
4
  //# sourceMappingURL=__package__.d.ts.map
@@ -7,6 +7,7 @@ export interface Icon {
7
7
  fill?: string;
8
8
  stroke?: string;
9
9
  strokeWidth?: number;
10
+ imageUrl?: string;
10
11
  imageFontFamily?: string;
11
12
  imageChar?: string;
12
13
  imageCharFill?: string;
@@ -0,0 +1,11 @@
1
+ import * as React from "@hpcc-js/preact-shim";
2
+ interface Image {
3
+ href: string;
4
+ x?: number;
5
+ y?: number;
6
+ height?: number;
7
+ yOffset?: number;
8
+ }
9
+ export declare const Image: React.FunctionComponent<Image>;
10
+ export {};
11
+ //# sourceMappingURL=image.d.ts.map