@unovis/react 1.7.0-pre.2 → 1.7.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 (118) hide show
  1. package/README.md +4 -0
  2. package/components/annotations/index.d.ts +12 -10
  3. package/components/annotations/index.js +32 -27
  4. package/components/annotations/index.js.map +1 -1
  5. package/components/area/index.d.ts +13 -11
  6. package/components/area/index.js +33 -29
  7. package/components/area/index.js.map +1 -1
  8. package/components/axis/index.d.ts +13 -11
  9. package/components/axis/index.js +33 -29
  10. package/components/axis/index.js.map +1 -1
  11. package/components/boxplot/index.d.ts +13 -0
  12. package/components/boxplot/index.js +35 -0
  13. package/components/boxplot/index.js.map +1 -0
  14. package/components/brush/index.d.ts +13 -11
  15. package/components/brush/index.js +33 -29
  16. package/components/brush/index.js.map +1 -1
  17. package/components/chord-diagram/index.d.ts +17 -14
  18. package/components/chord-diagram/index.js +33 -29
  19. package/components/chord-diagram/index.js.map +1 -1
  20. package/components/crosshair/index.d.ts +13 -11
  21. package/components/crosshair/index.js +33 -29
  22. package/components/crosshair/index.js.map +1 -1
  23. package/components/donut/index.d.ts +13 -11
  24. package/components/donut/index.js +33 -29
  25. package/components/donut/index.js.map +1 -1
  26. package/components/free-brush/index.d.ts +13 -11
  27. package/components/free-brush/index.js +33 -29
  28. package/components/free-brush/index.js.map +1 -1
  29. package/components/graph/index.d.ts +39 -36
  30. package/components/graph/index.js +33 -29
  31. package/components/graph/index.js.map +1 -1
  32. package/components/grouped-bar/index.d.ts +13 -11
  33. package/components/grouped-bar/index.js +33 -29
  34. package/components/grouped-bar/index.js.map +1 -1
  35. package/components/heatmap/index.d.ts +13 -0
  36. package/components/heatmap/index.js +35 -0
  37. package/components/heatmap/index.js.map +1 -0
  38. package/components/line/index.d.ts +13 -11
  39. package/components/line/index.js +33 -29
  40. package/components/line/index.js.map +1 -1
  41. package/components/nested-donut/index.d.ts +13 -11
  42. package/components/nested-donut/index.js +33 -29
  43. package/components/nested-donut/index.js.map +1 -1
  44. package/components/plotband/index.d.ts +12 -10
  45. package/components/plotband/index.js +32 -27
  46. package/components/plotband/index.js.map +1 -1
  47. package/components/plotline/index.d.ts +12 -10
  48. package/components/plotline/index.js +32 -27
  49. package/components/plotline/index.js.map +1 -1
  50. package/components/radial-bar/index.d.ts +13 -0
  51. package/components/radial-bar/index.js +35 -0
  52. package/components/radial-bar/index.js.map +1 -0
  53. package/components/sankey/index.d.ts +17 -14
  54. package/components/sankey/index.js +33 -29
  55. package/components/sankey/index.js.map +1 -1
  56. package/components/scatter/index.d.ts +13 -11
  57. package/components/scatter/index.js +33 -29
  58. package/components/scatter/index.js.map +1 -1
  59. package/components/stacked-bar/index.d.ts +13 -11
  60. package/components/stacked-bar/index.js +33 -29
  61. package/components/stacked-bar/index.js.map +1 -1
  62. package/components/timeline/index.d.ts +13 -11
  63. package/components/timeline/index.js +33 -29
  64. package/components/timeline/index.js.map +1 -1
  65. package/components/tooltip/index.d.ts +12 -10
  66. package/components/tooltip/index.js +32 -27
  67. package/components/tooltip/index.js.map +1 -1
  68. package/components/topojson-map/index.d.ts +17 -15
  69. package/components/topojson-map/index.js +33 -29
  70. package/components/topojson-map/index.js.map +1 -1
  71. package/components/treemap/index.d.ts +13 -11
  72. package/components/treemap/index.js +33 -29
  73. package/components/treemap/index.js.map +1 -1
  74. package/components/xy-labels/index.d.ts +13 -11
  75. package/components/xy-labels/index.js +33 -29
  76. package/components/xy-labels/index.js.map +1 -1
  77. package/components.d.ts +30 -27
  78. package/composites/time-series/index.d.ts +55 -54
  79. package/composites/time-series/index.js +65 -60
  80. package/composites/time-series/index.js.map +1 -1
  81. package/composites/time-series/style.module.css.js +14 -7
  82. package/composites/time-series/style.module.css.js.map +1 -1
  83. package/composites.d.ts +1 -1
  84. package/containers/single-container/index.d.ts +9 -8
  85. package/containers/single-container/index.js +67 -49
  86. package/containers/single-container/index.js.map +1 -1
  87. package/containers/xy-container/index.d.ts +10 -9
  88. package/containers/xy-container/index.js +71 -57
  89. package/containers/xy-container/index.js.map +1 -1
  90. package/containers.d.ts +2 -2
  91. package/html-components/bullet-legend/index.d.ts +13 -11
  92. package/html-components/bullet-legend/index.js +30 -27
  93. package/html-components/bullet-legend/index.js.map +1 -1
  94. package/html-components/flow-legend/index.d.ts +13 -11
  95. package/html-components/flow-legend/index.js +30 -27
  96. package/html-components/flow-legend/index.js.map +1 -1
  97. package/html-components/leaflet-flow-map/index.d.ts +18 -15
  98. package/html-components/leaflet-flow-map/index.js +31 -29
  99. package/html-components/leaflet-flow-map/index.js.map +1 -1
  100. package/html-components/leaflet-map/index.d.ts +15 -12
  101. package/html-components/leaflet-map/index.js +31 -29
  102. package/html-components/leaflet-map/index.js.map +1 -1
  103. package/html-components/rolling-pin-legend/index.d.ts +13 -11
  104. package/html-components/rolling-pin-legend/index.js +30 -27
  105. package/html-components/rolling-pin-legend/index.js.map +1 -1
  106. package/index.d.ts +3 -3
  107. package/index.js +111 -30
  108. package/index.js.map +1 -1
  109. package/package.json +19 -19
  110. package/types/dom.d.ts +3 -3
  111. package/utils/container.d.ts +5 -0
  112. package/utils/container.js +18 -0
  113. package/utils/container.js.map +1 -0
  114. package/utils/react.d.ts +5 -4
  115. package/utils/react.js +22 -29
  116. package/utils/react.js.map +1 -1
  117. package/external/.pnpm/style-inject@0.3.0/external/style-inject/dist/style-inject.es.js +0 -29
  118. package/external/.pnpm/style-inject@0.3.0/external/style-inject/dist/style-inject.es.js.map +0 -1
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ![cover](https://user-images.githubusercontent.com/755708/194946760-13db0396-c429-4abb-8324-a5efae0455e2.png)
2
2
 
3
+ <a href="https://npmx.dev/package/@unovis/react"><img src="https://npmx.dev/api/registry/badge/version/@unovis/react" alt="Version"></a>
4
+ <a href="https://npmx.dev/package/@unovis/react"><img src="https://npmx.dev/api/registry/badge/downloads/@unovis/react" alt="Downloads"></a>
5
+ <a href="https://github.com/f5/unovis/blob/main/LICENSE"><img src="https://img.shields.io/github/license/f5/unovis" alt="License"></a>
6
+
3
7
  🟨 **Unovis** is a modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript.
4
8
 
5
9
  `@unovis/react` provides React components for `@unovis/ts`, which makes Unovis integration into a React
@@ -1,10 +1,12 @@
1
- import { Ref } from 'react';
2
- import { Annotations, AnnotationsConfigInterface } from '@unovis/ts';
3
- export declare type VisAnnotationsRef = {
4
- component?: Annotations;
5
- };
6
- export declare type VisAnnotationsProps = AnnotationsConfigInterface & {
7
- ref?: Ref<VisAnnotationsRef>;
8
- };
9
- export declare const VisAnnotationsSelectors: typeof import("@unovis/ts/dist/components/annotations/style");
10
- export declare const VisAnnotations: ((props: VisAnnotationsProps) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Annotations } from '@unovis/ts/components/annotations';
3
+ import { AnnotationsConfigInterface } from '@unovis/ts/components/annotations/config';
4
+
5
+ export type VisAnnotationsRef = {
6
+ component?: Annotations;
7
+ };
8
+ export type VisAnnotationsProps = AnnotationsConfigInterface & {
9
+ ref?: Ref<VisAnnotationsRef>;
10
+ };
11
+ export declare const VisAnnotationsSelectors: typeof import("@unovis/ts/components/annotations/style");
12
+ export declare const VisAnnotations: ((props: VisAnnotationsProps) => JSX.Element | null);
@@ -1,29 +1,34 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Annotations } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisAnnotationsSelectors = Annotations.selectors;
6
- function VisAnnotationsFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Annotations(props);
12
- componentRef.current = c;
13
- element.__component__ = c;
14
- return () => {
15
- componentRef.current = undefined;
16
- c.destroy();
17
- };
18
- }, []);
19
- useEffect(() => {
20
- const component = componentRef.current;
21
- component === null || component === void 0 ? void 0 : component.setConfig(props);
22
- });
23
- useImperativeHandle(fRef, () => ({ get component() { return componentRef.current; } }), []);
24
- return React.createElement("vis-annotations", { ref: ref });
25
- }
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Annotations } from "@unovis/ts/components/annotations";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisAnnotationsSelectors = Annotations.selectors;
6
+ function VisAnnotationsFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Annotations(props);
12
+ componentRef.current = c;
13
+ element.__component__ = c;
14
+ return () => {
15
+ componentRef.current = void 0;
16
+ c.destroy();
17
+ };
18
+ }, []);
19
+ useEffect(() => {
20
+ const component = componentRef.current;
21
+ component?.setConfig(props);
22
+ });
23
+ useContainerRenderOnUpdate();
24
+ useImperativeHandle(fRef, () => ({ get component() {
25
+ return componentRef.current;
26
+ } }), []);
27
+ return /* @__PURE__ */ React.createElement("vis-annotations", { ref });
28
+ }
26
29
  const VisAnnotations = React.memo(React.forwardRef(VisAnnotationsFC), arePropsEqual);
27
-
28
- export { VisAnnotations, VisAnnotationsSelectors };
30
+ export {
31
+ VisAnnotations,
32
+ VisAnnotationsSelectors
33
+ };
29
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/annotations/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Annotations, AnnotationsConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisAnnotationsRef = {\n component?: Annotations;\n}\n\nexport type VisAnnotationsProps = AnnotationsConfigInterface & {\n ref?: Ref<VisAnnotationsRef>;\n}\n\nexport const VisAnnotationsSelectors = Annotations.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAnnotationsFC (props: VisAnnotationsProps, fRef: ForwardedRef<VisAnnotationsRef>): ReactElement {\n const ref = useRef<VisComponentElement<Annotations>>(null)\n const componentRef = useRef<Annotations | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Annotations>)\n\n const c = new Annotations(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-annotations ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisAnnotations: ((props: VisAnnotationsProps) => JSX.Element | null) = React.memo(React.forwardRef(VisAnnotationsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAkBa,MAAA,uBAAuB,GAAG,WAAW,CAAC,UAAS;AAG5D,SAAS,gBAAgB,CAAE,KAA0B,EAAE,IAAqC,EAAA;AAC1F,IAAA,MAAM,GAAG,GAAG,MAAM,CAAmC,IAAI,CAAC,CAAA;AAC1D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAA;IAG/D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA4C,CAAA;AAEjE,QAAA,MAAM,CAAC,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAA;AAChC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QAEtC,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAiB,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACtC,CAAC;AAIY,MAAA,cAAc,GAAyD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/annotations/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Annotations } from '@unovis/ts/components/annotations'\nimport { AnnotationsConfigInterface } from '@unovis/ts/components/annotations/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisAnnotationsRef = {\n component?: Annotations;\n}\n\nexport type VisAnnotationsProps = AnnotationsConfigInterface & {\n ref?: Ref<VisAnnotationsRef>;\n}\n\nexport const VisAnnotationsSelectors = Annotations.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAnnotationsFC (props: VisAnnotationsProps, fRef: ForwardedRef<VisAnnotationsRef>): ReactElement {\n const ref = useRef<VisComponentElement<Annotations>>(null)\n const componentRef = useRef<Annotations | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Annotations>)\n\n const c = new Annotations(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-annotations ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisAnnotations: ((props: VisAnnotationsProps) => JSX.Element | null) = React.memo(React.forwardRef(VisAnnotationsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBO,MAAM,0BAA0B,YAAY;AAGnD,SAAS,iBAAkB,OAA4B,MAAqD;AAC1G,QAAM,MAAM,OAAyC,IAAI;AACzD,QAAM,eAAe,OAAgC,MAAS;AAG9D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,YAAY,KAAK;AAC/B,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAE/B,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,qBAAgB,IAAA,CAAU;AACpC;AAIO,MAAM,iBAAuE,MAAM,KAAK,MAAM,WAAW,gBAAgB,GAAG,aAAa;"}
@@ -1,11 +1,13 @@
1
- import { Ref } from 'react';
2
- import { Area, AreaConfigInterface } from '@unovis/ts';
3
- export declare type VisAreaRef<Datum> = {
4
- component?: Area<Datum>;
5
- };
6
- export declare type VisAreaProps<Datum> = AreaConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisAreaRef<Datum>>;
9
- };
10
- export declare const VisAreaSelectors: typeof import("@unovis/ts/dist/components/area/style");
11
- export declare const VisArea: (<Datum>(props: VisAreaProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Area } from '@unovis/ts/components/area';
3
+ import { AreaConfigInterface } from '@unovis/ts/components/area/config';
4
+
5
+ export type VisAreaRef<Datum> = {
6
+ component?: Area<Datum>;
7
+ };
8
+ export type VisAreaProps<Datum> = AreaConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisAreaRef<Datum>>;
11
+ };
12
+ export declare const VisAreaSelectors: typeof import("@unovis/ts/components/area/style");
13
+ export declare const VisArea: (<Datum>(props: VisAreaProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Area } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisAreaSelectors = Area.selectors;
6
- function VisAreaFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Area(props);
12
- componentRef.current = c;
13
- element.__component__ = c;
14
- return () => {
15
- componentRef.current = undefined;
16
- c.destroy();
17
- };
18
- }, []);
19
- useEffect(() => {
20
- const component = componentRef.current;
21
- if (props.data)
22
- component === null || component === void 0 ? void 0 : component.setData(props.data);
23
- component === null || component === void 0 ? void 0 : component.setConfig(props);
24
- });
25
- useImperativeHandle(fRef, () => ({ get component() { return componentRef.current; } }), []);
26
- return React.createElement("vis-component", { ref: ref });
27
- }
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Area } from "@unovis/ts/components/area";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisAreaSelectors = Area.selectors;
6
+ function VisAreaFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Area(props);
12
+ componentRef.current = c;
13
+ element.__component__ = c;
14
+ return () => {
15
+ componentRef.current = void 0;
16
+ c.destroy();
17
+ };
18
+ }, []);
19
+ useEffect(() => {
20
+ const component = componentRef.current;
21
+ if (props.data) component?.setData(props.data);
22
+ component?.setConfig(props);
23
+ });
24
+ useContainerRenderOnUpdate();
25
+ useImperativeHandle(fRef, () => ({ get component() {
26
+ return componentRef.current;
27
+ } }), []);
28
+ return /* @__PURE__ */ React.createElement("vis-component", { ref });
29
+ }
28
30
  const VisArea = React.memo(React.forwardRef(VisAreaFC), arePropsEqual);
29
-
30
- export { VisArea, VisAreaSelectors };
31
+ export {
32
+ VisArea,
33
+ VisAreaSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/area/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Area, AreaConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisAreaRef<Datum> = {\n component?: Area<Datum>;\n}\n\nexport type VisAreaProps<Datum> = AreaConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisAreaRef<Datum>>;\n}\n\nexport const VisAreaSelectors = Area.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAreaFC<Datum> (props: VisAreaProps<Datum>, fRef: ForwardedRef<VisAreaRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Area<Datum>>>(null)\n const componentRef = useRef<Area<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Area<Datum>>)\n\n const c = new Area<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisArea: (<Datum>(props: VisAreaProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisAreaFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,gBAAgB,GAAG,IAAI,CAAC,UAAS;AAG9C,SAAS,SAAS,CAAS,KAA0B,EAAE,IAAqC,EAAA;AAC1F,IAAA,MAAM,GAAG,GAAG,MAAM,CAAmC,IAAI,CAAC,CAAA;AAC1D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAA;IAG/D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA4C,CAAA;AAEjE,QAAA,MAAM,CAAC,GAAG,IAAI,IAAI,CAAQ,KAAK,CAAC,CAAA;AAChC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,OAAO,GAAgE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/area/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Area } from '@unovis/ts/components/area'\nimport { AreaConfigInterface } from '@unovis/ts/components/area/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisAreaRef<Datum> = {\n component?: Area<Datum>;\n}\n\nexport type VisAreaProps<Datum> = AreaConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisAreaRef<Datum>>;\n}\n\nexport const VisAreaSelectors = Area.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAreaFC<Datum> (props: VisAreaProps<Datum>, fRef: ForwardedRef<VisAreaRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Area<Datum>>>(null)\n const componentRef = useRef<Area<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Area<Datum>>)\n\n const c = new Area<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisArea: (<Datum>(props: VisAreaProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisAreaFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,mBAAmB,KAAK;AAGrC,SAAS,UAAkB,OAA4B,MAAqD;AAC1G,QAAM,MAAM,OAAyC,IAAI;AACzD,QAAM,eAAe,OAAgC,MAAS;AAG9D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,KAAY,KAAK;AAC/B,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,UAAuE,MAAM,KAAK,MAAM,WAAW,SAAS,GAAG,aAAa;"}
@@ -1,11 +1,13 @@
1
- import { Ref } from 'react';
2
- import { Axis, AxisConfigInterface } from '@unovis/ts';
3
- export declare type VisAxisRef<Datum> = {
4
- component?: Axis<Datum>;
5
- };
6
- export declare type VisAxisProps<Datum> = AxisConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisAxisRef<Datum>>;
9
- };
10
- export declare const VisAxisSelectors: typeof import("@unovis/ts/dist/components/axis/style");
11
- export declare const VisAxis: (<Datum>(props: VisAxisProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Axis } from '@unovis/ts/components/axis';
3
+ import { AxisConfigInterface } from '@unovis/ts/components/axis/config';
4
+
5
+ export type VisAxisRef<Datum> = {
6
+ component?: Axis<Datum>;
7
+ };
8
+ export type VisAxisProps<Datum> = AxisConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisAxisRef<Datum>>;
11
+ };
12
+ export declare const VisAxisSelectors: typeof import("@unovis/ts/components/axis/style");
13
+ export declare const VisAxis: (<Datum>(props: VisAxisProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Axis } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisAxisSelectors = Axis.selectors;
6
- function VisAxisFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Axis(props);
12
- componentRef.current = c;
13
- element.__component__ = c;
14
- return () => {
15
- componentRef.current = undefined;
16
- c.destroy();
17
- };
18
- }, []);
19
- useEffect(() => {
20
- const component = componentRef.current;
21
- if (props.data)
22
- component === null || component === void 0 ? void 0 : component.setData(props.data);
23
- component === null || component === void 0 ? void 0 : component.setConfig(props);
24
- });
25
- useImperativeHandle(fRef, () => ({ get component() { return componentRef.current; } }), []);
26
- return React.createElement("vis-axis", { ref: ref });
27
- }
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Axis } from "@unovis/ts/components/axis";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisAxisSelectors = Axis.selectors;
6
+ function VisAxisFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Axis(props);
12
+ componentRef.current = c;
13
+ element.__component__ = c;
14
+ return () => {
15
+ componentRef.current = void 0;
16
+ c.destroy();
17
+ };
18
+ }, []);
19
+ useEffect(() => {
20
+ const component = componentRef.current;
21
+ if (props.data) component?.setData(props.data);
22
+ component?.setConfig(props);
23
+ });
24
+ useContainerRenderOnUpdate();
25
+ useImperativeHandle(fRef, () => ({ get component() {
26
+ return componentRef.current;
27
+ } }), []);
28
+ return /* @__PURE__ */ React.createElement("vis-axis", { ref });
29
+ }
28
30
  const VisAxis = React.memo(React.forwardRef(VisAxisFC), arePropsEqual);
29
-
30
- export { VisAxis, VisAxisSelectors };
31
+ export {
32
+ VisAxis,
33
+ VisAxisSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/axis/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Axis, AxisConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisAxisRef<Datum> = {\n component?: Axis<Datum>;\n}\n\nexport type VisAxisProps<Datum> = AxisConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisAxisRef<Datum>>;\n}\n\nexport const VisAxisSelectors = Axis.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAxisFC<Datum> (props: VisAxisProps<Datum>, fRef: ForwardedRef<VisAxisRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Axis<Datum>>>(null)\n const componentRef = useRef<Axis<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Axis<Datum>>)\n\n const c = new Axis<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-axis ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisAxis: (<Datum>(props: VisAxisProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisAxisFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,gBAAgB,GAAG,IAAI,CAAC,UAAS;AAG9C,SAAS,SAAS,CAAS,KAA0B,EAAE,IAAqC,EAAA;AAC1F,IAAA,MAAM,GAAG,GAAG,MAAM,CAAmC,IAAI,CAAC,CAAA;AAC1D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAA;IAG/D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA4C,CAAA;AAEjE,QAAA,MAAM,CAAC,GAAG,IAAI,IAAI,CAAQ,KAAK,CAAC,CAAA;AAChC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAU,CAAA,aAAA,CAAA,UAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AAC/B,CAAC;AAIY,MAAA,OAAO,GAAgE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/axis/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Axis } from '@unovis/ts/components/axis'\nimport { AxisConfigInterface } from '@unovis/ts/components/axis/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisAxisRef<Datum> = {\n component?: Axis<Datum>;\n}\n\nexport type VisAxisProps<Datum> = AxisConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisAxisRef<Datum>>;\n}\n\nexport const VisAxisSelectors = Axis.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAxisFC<Datum> (props: VisAxisProps<Datum>, fRef: ForwardedRef<VisAxisRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Axis<Datum>>>(null)\n const componentRef = useRef<Axis<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Axis<Datum>>)\n\n const c = new Axis<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-axis ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisAxis: (<Datum>(props: VisAxisProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisAxisFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,mBAAmB,KAAK;AAGrC,SAAS,UAAkB,OAA4B,MAAqD;AAC1G,QAAM,MAAM,OAAyC,IAAI;AACzD,QAAM,eAAe,OAAgC,MAAS;AAG9D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,KAAY,KAAK;AAC/B,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,cAAS,IAAA,CAAU;AAC7B;AAIO,MAAM,UAAuE,MAAM,KAAK,MAAM,WAAW,SAAS,GAAG,aAAa;"}
@@ -0,0 +1,13 @@
1
+ import { Ref } from 'react';
2
+ import { Boxplot } from '@unovis/ts/components/boxplot';
3
+ import { BoxplotConfigInterface } from '@unovis/ts/components/boxplot/config';
4
+
5
+ export type VisBoxplotRef<Datum> = {
6
+ component?: Boxplot<Datum>;
7
+ };
8
+ export type VisBoxplotProps<Datum> = BoxplotConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisBoxplotRef<Datum>>;
11
+ };
12
+ export declare const VisBoxplotSelectors: typeof import("@unovis/ts/components/boxplot/style");
13
+ export declare const VisBoxplot: (<Datum>(props: VisBoxplotProps<Datum>) => JSX.Element | null);
@@ -0,0 +1,35 @@
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Boxplot } from "@unovis/ts/components/boxplot";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisBoxplotSelectors = Boxplot.selectors;
6
+ function VisBoxplotFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Boxplot(props);
12
+ componentRef.current = c;
13
+ element.__component__ = c;
14
+ return () => {
15
+ componentRef.current = void 0;
16
+ c.destroy();
17
+ };
18
+ }, []);
19
+ useEffect(() => {
20
+ const component = componentRef.current;
21
+ if (props.data) component?.setData(props.data);
22
+ component?.setConfig(props);
23
+ });
24
+ useContainerRenderOnUpdate();
25
+ useImperativeHandle(fRef, () => ({ get component() {
26
+ return componentRef.current;
27
+ } }), []);
28
+ return /* @__PURE__ */ React.createElement("vis-component", { ref });
29
+ }
30
+ const VisBoxplot = React.memo(React.forwardRef(VisBoxplotFC), arePropsEqual);
31
+ export {
32
+ VisBoxplot,
33
+ VisBoxplotSelectors
34
+ };
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/boxplot/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Boxplot } from '@unovis/ts/components/boxplot'\nimport { BoxplotConfigInterface } from '@unovis/ts/components/boxplot/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisBoxplotRef<Datum> = {\n component?: Boxplot<Datum>;\n}\n\nexport type VisBoxplotProps<Datum> = BoxplotConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisBoxplotRef<Datum>>;\n}\n\nexport const VisBoxplotSelectors = Boxplot.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisBoxplotFC<Datum> (props: VisBoxplotProps<Datum>, fRef: ForwardedRef<VisBoxplotRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Boxplot<Datum>>>(null)\n const componentRef = useRef<Boxplot<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Boxplot<Datum>>)\n\n const c = new Boxplot<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisBoxplot: (<Datum>(props: VisBoxplotProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisBoxplotFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,sBAAsB,QAAQ;AAG3C,SAAS,aAAqB,OAA+B,MAAwD;AACnH,QAAM,MAAM,OAA4C,IAAI;AAC5D,QAAM,eAAe,OAAmC,MAAS;AAGjE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,QAAe,KAAK;AAClC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,aAA6E,MAAM,KAAK,MAAM,WAAW,YAAY,GAAG,aAAa;"}
@@ -1,11 +1,13 @@
1
- import { Ref } from 'react';
2
- import { Brush, BrushConfigInterface } from '@unovis/ts';
3
- export declare type VisBrushRef<Datum> = {
4
- component?: Brush<Datum>;
5
- };
6
- export declare type VisBrushProps<Datum> = BrushConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisBrushRef<Datum>>;
9
- };
10
- export declare const VisBrushSelectors: typeof import("@unovis/ts/dist/components/brush/style");
11
- export declare const VisBrush: (<Datum>(props: VisBrushProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Brush } from '@unovis/ts/components/brush';
3
+ import { BrushConfigInterface } from '@unovis/ts/components/brush/config';
4
+
5
+ export type VisBrushRef<Datum> = {
6
+ component?: Brush<Datum>;
7
+ };
8
+ export type VisBrushProps<Datum> = BrushConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisBrushRef<Datum>>;
11
+ };
12
+ export declare const VisBrushSelectors: typeof import("@unovis/ts/components/brush/style");
13
+ export declare const VisBrush: (<Datum>(props: VisBrushProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Brush } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisBrushSelectors = Brush.selectors;
6
- function VisBrushFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Brush(props);
12
- componentRef.current = c;
13
- element.__component__ = c;
14
- return () => {
15
- componentRef.current = undefined;
16
- c.destroy();
17
- };
18
- }, []);
19
- useEffect(() => {
20
- const component = componentRef.current;
21
- if (props.data)
22
- component === null || component === void 0 ? void 0 : component.setData(props.data);
23
- component === null || component === void 0 ? void 0 : component.setConfig(props);
24
- });
25
- useImperativeHandle(fRef, () => ({ get component() { return componentRef.current; } }), []);
26
- return React.createElement("vis-component", { ref: ref });
27
- }
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Brush } from "@unovis/ts/components/brush";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisBrushSelectors = Brush.selectors;
6
+ function VisBrushFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Brush(props);
12
+ componentRef.current = c;
13
+ element.__component__ = c;
14
+ return () => {
15
+ componentRef.current = void 0;
16
+ c.destroy();
17
+ };
18
+ }, []);
19
+ useEffect(() => {
20
+ const component = componentRef.current;
21
+ if (props.data) component?.setData(props.data);
22
+ component?.setConfig(props);
23
+ });
24
+ useContainerRenderOnUpdate();
25
+ useImperativeHandle(fRef, () => ({ get component() {
26
+ return componentRef.current;
27
+ } }), []);
28
+ return /* @__PURE__ */ React.createElement("vis-component", { ref });
29
+ }
28
30
  const VisBrush = React.memo(React.forwardRef(VisBrushFC), arePropsEqual);
29
-
30
- export { VisBrush, VisBrushSelectors };
31
+ export {
32
+ VisBrush,
33
+ VisBrushSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/brush/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Brush, BrushConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisBrushRef<Datum> = {\n component?: Brush<Datum>;\n}\n\nexport type VisBrushProps<Datum> = BrushConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisBrushRef<Datum>>;\n}\n\nexport const VisBrushSelectors = Brush.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisBrushFC<Datum> (props: VisBrushProps<Datum>, fRef: ForwardedRef<VisBrushRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Brush<Datum>>>(null)\n const componentRef = useRef<Brush<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Brush<Datum>>)\n\n const c = new Brush<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisBrush: (<Datum>(props: VisBrushProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisBrushFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,iBAAiB,GAAG,KAAK,CAAC,UAAS;AAGhD,SAAS,UAAU,CAAS,KAA2B,EAAE,IAAsC,EAAA;AAC7F,IAAA,MAAM,GAAG,GAAG,MAAM,CAAoC,IAAI,CAAC,CAAA;AAC3D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA2B,SAAS,CAAC,CAAA;IAGhE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA6C,CAAA;AAElE,QAAA,MAAM,CAAC,GAAG,IAAI,KAAK,CAAQ,KAAK,CAAC,CAAA;AACjC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,QAAQ,GAAiE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/brush/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Brush } from '@unovis/ts/components/brush'\nimport { BrushConfigInterface } from '@unovis/ts/components/brush/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisBrushRef<Datum> = {\n component?: Brush<Datum>;\n}\n\nexport type VisBrushProps<Datum> = BrushConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisBrushRef<Datum>>;\n}\n\nexport const VisBrushSelectors = Brush.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisBrushFC<Datum> (props: VisBrushProps<Datum>, fRef: ForwardedRef<VisBrushRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Brush<Datum>>>(null)\n const componentRef = useRef<Brush<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Brush<Datum>>)\n\n const c = new Brush<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisBrush: (<Datum>(props: VisBrushProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisBrushFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,oBAAoB,MAAM;AAGvC,SAAS,WAAmB,OAA6B,MAAsD;AAC7G,QAAM,MAAM,OAA0C,IAAI;AAC1D,QAAM,eAAe,OAAiC,MAAS;AAG/D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,MAAa,KAAK;AAChC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,WAAyE,MAAM,KAAK,MAAM,WAAW,UAAU,GAAG,aAAa;"}
@@ -1,14 +1,17 @@
1
- import { Ref } from 'react';
2
- import { ChordDiagram, ChordDiagramConfigInterface, ChordInputNode, ChordInputLink } from '@unovis/ts';
3
- export declare type VisChordDiagramRef<N extends ChordInputNode, L extends ChordInputLink> = {
4
- component?: ChordDiagram<N, L>;
5
- };
6
- export declare type VisChordDiagramProps<N extends ChordInputNode, L extends ChordInputLink> = ChordDiagramConfigInterface<N, L> & {
7
- data?: {
8
- nodes: N[];
9
- links?: L[];
10
- };
11
- ref?: Ref<VisChordDiagramRef<N, L>>;
12
- };
13
- export declare const VisChordDiagramSelectors: typeof import("@unovis/ts/dist/components/chord-diagram/style");
14
- export declare const VisChordDiagram: (<N extends ChordInputNode, L extends ChordInputLink>(props: VisChordDiagramProps<N, L>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { ChordDiagram } from '@unovis/ts/components/chord-diagram';
3
+ import { ChordDiagramConfigInterface } from '@unovis/ts/components/chord-diagram/config';
4
+ import { ChordInputNode, ChordInputLink } from '@unovis/ts/components/chord-diagram/types';
5
+
6
+ export type VisChordDiagramRef<N extends ChordInputNode, L extends ChordInputLink> = {
7
+ component?: ChordDiagram<N, L>;
8
+ };
9
+ export type VisChordDiagramProps<N extends ChordInputNode, L extends ChordInputLink> = ChordDiagramConfigInterface<N, L> & {
10
+ data?: {
11
+ nodes: N[];
12
+ links?: L[];
13
+ };
14
+ ref?: Ref<VisChordDiagramRef<N, L>>;
15
+ };
16
+ export declare const VisChordDiagramSelectors: typeof import("@unovis/ts/components/chord-diagram/style");
17
+ export declare const VisChordDiagram: (<N extends ChordInputNode, L extends ChordInputLink>(props: VisChordDiagramProps<N, L>) => JSX.Element | null);