@unovis/react 1.7.0-pre.1 → 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 +25 -23
  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/style-inject/dist/style-inject.es.js +0 -29
  118. package/external/style-inject/dist/style-inject.es.js.map +0 -1
@@ -1,11 +1,13 @@
1
- import { Ref } from 'react';
2
- import { GroupedBar, GroupedBarConfigInterface } from '@unovis/ts';
3
- export declare type VisGroupedBarRef<Datum> = {
4
- component?: GroupedBar<Datum>;
5
- };
6
- export declare type VisGroupedBarProps<Datum> = GroupedBarConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisGroupedBarRef<Datum>>;
9
- };
10
- export declare const VisGroupedBarSelectors: typeof import("@unovis/ts/dist/components/grouped-bar/style");
11
- export declare const VisGroupedBar: (<Datum>(props: VisGroupedBarProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { GroupedBar } from '@unovis/ts/components/grouped-bar';
3
+ import { GroupedBarConfigInterface } from '@unovis/ts/components/grouped-bar/config';
4
+
5
+ export type VisGroupedBarRef<Datum> = {
6
+ component?: GroupedBar<Datum>;
7
+ };
8
+ export type VisGroupedBarProps<Datum> = GroupedBarConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisGroupedBarRef<Datum>>;
11
+ };
12
+ export declare const VisGroupedBarSelectors: typeof import("@unovis/ts/components/grouped-bar/style");
13
+ export declare const VisGroupedBar: (<Datum>(props: VisGroupedBarProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { GroupedBar } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisGroupedBarSelectors = GroupedBar.selectors;
6
- function VisGroupedBarFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new GroupedBar(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 { GroupedBar } from "@unovis/ts/components/grouped-bar";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisGroupedBarSelectors = GroupedBar.selectors;
6
+ function VisGroupedBarFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new GroupedBar(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 VisGroupedBar = React.memo(React.forwardRef(VisGroupedBarFC), arePropsEqual);
29
-
30
- export { VisGroupedBar, VisGroupedBarSelectors };
31
+ export {
32
+ VisGroupedBar,
33
+ VisGroupedBarSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/grouped-bar/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 { GroupedBar, GroupedBarConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisGroupedBarRef<Datum> = {\n component?: GroupedBar<Datum>;\n}\n\nexport type VisGroupedBarProps<Datum> = GroupedBarConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisGroupedBarRef<Datum>>;\n}\n\nexport const VisGroupedBarSelectors = GroupedBar.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisGroupedBarFC<Datum> (props: VisGroupedBarProps<Datum>, fRef: ForwardedRef<VisGroupedBarRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<GroupedBar<Datum>>>(null)\n const componentRef = useRef<GroupedBar<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<GroupedBar<Datum>>)\n\n const c = new GroupedBar<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 VisGroupedBar: (<Datum>(props: VisGroupedBarProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisGroupedBarFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,sBAAsB,GAAG,UAAU,CAAC,UAAS;AAG1D,SAAS,eAAe,CAAS,KAAgC,EAAE,IAA2C,EAAA;AAC5G,IAAA,MAAM,GAAG,GAAG,MAAM,CAAyC,IAAI,CAAC,CAAA;AAChE,IAAA,MAAM,YAAY,GAAG,MAAM,CAAgC,SAAS,CAAC,CAAA;IAGrE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAkD,CAAA;AAEvE,QAAA,MAAM,CAAC,GAAG,IAAI,UAAU,CAAQ,KAAK,CAAC,CAAA;AACtC,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,aAAa,GAAsE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/grouped-bar/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 { GroupedBar } from '@unovis/ts/components/grouped-bar'\nimport { GroupedBarConfigInterface } from '@unovis/ts/components/grouped-bar/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 VisGroupedBarRef<Datum> = {\n component?: GroupedBar<Datum>;\n}\n\nexport type VisGroupedBarProps<Datum> = GroupedBarConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisGroupedBarRef<Datum>>;\n}\n\nexport const VisGroupedBarSelectors = GroupedBar.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisGroupedBarFC<Datum> (props: VisGroupedBarProps<Datum>, fRef: ForwardedRef<VisGroupedBarRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<GroupedBar<Datum>>>(null)\n const componentRef = useRef<GroupedBar<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<GroupedBar<Datum>>)\n\n const c = new GroupedBar<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 VisGroupedBar: (<Datum>(props: VisGroupedBarProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisGroupedBarFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,yBAAyB,WAAW;AAGjD,SAAS,gBAAwB,OAAkC,MAA2D;AAC5H,QAAM,MAAM,OAA+C,IAAI;AAC/D,QAAM,eAAe,OAAsC,MAAS;AAGpE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,WAAkB,KAAK;AACrC,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,gBAAmF,MAAM,KAAK,MAAM,WAAW,eAAe,GAAG,aAAa;"}
@@ -0,0 +1,13 @@
1
+ import { Ref } from 'react';
2
+ import { Heatmap } from '@unovis/ts/components/heatmap';
3
+ import { HeatmapConfigInterface } from '@unovis/ts/components/heatmap/config';
4
+
5
+ export type VisHeatmapRef<Datum> = {
6
+ component?: Heatmap<Datum>;
7
+ };
8
+ export type VisHeatmapProps<Datum> = HeatmapConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisHeatmapRef<Datum>>;
11
+ };
12
+ export declare const VisHeatmapSelectors: typeof import("@unovis/ts/components/heatmap/style");
13
+ export declare const VisHeatmap: (<Datum>(props: VisHeatmapProps<Datum>) => JSX.Element | null);
@@ -0,0 +1,35 @@
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Heatmap } from "@unovis/ts/components/heatmap";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisHeatmapSelectors = Heatmap.selectors;
6
+ function VisHeatmapFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Heatmap(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 VisHeatmap = React.memo(React.forwardRef(VisHeatmapFC), arePropsEqual);
31
+ export {
32
+ VisHeatmap,
33
+ VisHeatmapSelectors
34
+ };
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/heatmap/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 { Heatmap } from '@unovis/ts/components/heatmap'\nimport { HeatmapConfigInterface } from '@unovis/ts/components/heatmap/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 VisHeatmapRef<Datum> = {\n component?: Heatmap<Datum>;\n}\n\nexport type VisHeatmapProps<Datum> = HeatmapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisHeatmapRef<Datum>>;\n}\n\nexport const VisHeatmapSelectors = Heatmap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisHeatmapFC<Datum> (props: VisHeatmapProps<Datum>, fRef: ForwardedRef<VisHeatmapRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Heatmap<Datum>>>(null)\n const componentRef = useRef<Heatmap<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Heatmap<Datum>>)\n\n const c = new Heatmap<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 VisHeatmap: (<Datum>(props: VisHeatmapProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisHeatmapFC), 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 { Line, LineConfigInterface } from '@unovis/ts';
3
- export declare type VisLineRef<Datum> = {
4
- component?: Line<Datum>;
5
- };
6
- export declare type VisLineProps<Datum> = LineConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisLineRef<Datum>>;
9
- };
10
- export declare const VisLineSelectors: typeof import("@unovis/ts/dist/components/line/style");
11
- export declare const VisLine: (<Datum>(props: VisLineProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Line } from '@unovis/ts/components/line';
3
+ import { LineConfigInterface } from '@unovis/ts/components/line/config';
4
+
5
+ export type VisLineRef<Datum> = {
6
+ component?: Line<Datum>;
7
+ };
8
+ export type VisLineProps<Datum> = LineConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisLineRef<Datum>>;
11
+ };
12
+ export declare const VisLineSelectors: typeof import("@unovis/ts/components/line/style");
13
+ export declare const VisLine: (<Datum>(props: VisLineProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Line } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisLineSelectors = Line.selectors;
6
- function VisLineFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Line(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 { Line } from "@unovis/ts/components/line";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisLineSelectors = Line.selectors;
6
+ function VisLineFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Line(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 VisLine = React.memo(React.forwardRef(VisLineFC), arePropsEqual);
29
-
30
- export { VisLine, VisLineSelectors };
31
+ export {
32
+ VisLine,
33
+ VisLineSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/line/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 { Line, LineConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisLineRef<Datum> = {\n component?: Line<Datum>;\n}\n\nexport type VisLineProps<Datum> = LineConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisLineRef<Datum>>;\n}\n\nexport const VisLineSelectors = Line.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLineFC<Datum> (props: VisLineProps<Datum>, fRef: ForwardedRef<VisLineRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Line<Datum>>>(null)\n const componentRef = useRef<Line<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Line<Datum>>)\n\n const c = new Line<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 VisLine: (<Datum>(props: VisLineProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLineFC), 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/line/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 { Line } from '@unovis/ts/components/line'\nimport { LineConfigInterface } from '@unovis/ts/components/line/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 VisLineRef<Datum> = {\n component?: Line<Datum>;\n}\n\nexport type VisLineProps<Datum> = LineConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisLineRef<Datum>>;\n}\n\nexport const VisLineSelectors = Line.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLineFC<Datum> (props: VisLineProps<Datum>, fRef: ForwardedRef<VisLineRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Line<Datum>>>(null)\n const componentRef = useRef<Line<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Line<Datum>>)\n\n const c = new Line<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 VisLine: (<Datum>(props: VisLineProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLineFC), 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 { NestedDonut, NestedDonutConfigInterface } from '@unovis/ts';
3
- export declare type VisNestedDonutRef<Datum> = {
4
- component?: NestedDonut<Datum>;
5
- };
6
- export declare type VisNestedDonutProps<Datum> = NestedDonutConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisNestedDonutRef<Datum>>;
9
- };
10
- export declare const VisNestedDonutSelectors: typeof import("@unovis/ts/dist/components/nested-donut/style");
11
- export declare const VisNestedDonut: (<Datum>(props: VisNestedDonutProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { NestedDonut } from '@unovis/ts/components/nested-donut';
3
+ import { NestedDonutConfigInterface } from '@unovis/ts/components/nested-donut/config';
4
+
5
+ export type VisNestedDonutRef<Datum> = {
6
+ component?: NestedDonut<Datum>;
7
+ };
8
+ export type VisNestedDonutProps<Datum> = NestedDonutConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisNestedDonutRef<Datum>>;
11
+ };
12
+ export declare const VisNestedDonutSelectors: typeof import("@unovis/ts/components/nested-donut/style");
13
+ export declare const VisNestedDonut: (<Datum>(props: VisNestedDonutProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { NestedDonut } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisNestedDonutSelectors = NestedDonut.selectors;
6
- function VisNestedDonutFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new NestedDonut(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 { NestedDonut } from "@unovis/ts/components/nested-donut";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisNestedDonutSelectors = NestedDonut.selectors;
6
+ function VisNestedDonutFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new NestedDonut(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 VisNestedDonut = React.memo(React.forwardRef(VisNestedDonutFC), arePropsEqual);
29
-
30
- export { VisNestedDonut, VisNestedDonutSelectors };
31
+ export {
32
+ VisNestedDonut,
33
+ VisNestedDonutSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/nested-donut/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 { NestedDonut, NestedDonutConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisNestedDonutRef<Datum> = {\n component?: NestedDonut<Datum>;\n}\n\nexport type VisNestedDonutProps<Datum> = NestedDonutConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisNestedDonutRef<Datum>>;\n}\n\nexport const VisNestedDonutSelectors = NestedDonut.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisNestedDonutFC<Datum> (props: VisNestedDonutProps<Datum>, fRef: ForwardedRef<VisNestedDonutRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<NestedDonut<Datum>>>(null)\n const componentRef = useRef<NestedDonut<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<NestedDonut<Datum>>)\n\n const c = new NestedDonut<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 VisNestedDonut: (<Datum>(props: VisNestedDonutProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisNestedDonutFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,uBAAuB,GAAG,WAAW,CAAC,UAAS;AAG5D,SAAS,gBAAgB,CAAS,KAAiC,EAAE,IAA4C,EAAA;AAC/G,IAAA,MAAM,GAAG,GAAG,MAAM,CAA0C,IAAI,CAAC,CAAA;AACjE,IAAA,MAAM,YAAY,GAAG,MAAM,CAAiC,SAAS,CAAC,CAAA;IAGtE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAmD,CAAA;AAExE,QAAA,MAAM,CAAC,GAAG,IAAI,WAAW,CAAQ,KAAK,CAAC,CAAA;AACvC,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,cAAc,GAAuE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/nested-donut/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 { NestedDonut } from '@unovis/ts/components/nested-donut'\nimport { NestedDonutConfigInterface } from '@unovis/ts/components/nested-donut/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 VisNestedDonutRef<Datum> = {\n component?: NestedDonut<Datum>;\n}\n\nexport type VisNestedDonutProps<Datum> = NestedDonutConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisNestedDonutRef<Datum>>;\n}\n\nexport const VisNestedDonutSelectors = NestedDonut.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisNestedDonutFC<Datum> (props: VisNestedDonutProps<Datum>, fRef: ForwardedRef<VisNestedDonutRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<NestedDonut<Datum>>>(null)\n const componentRef = useRef<NestedDonut<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<NestedDonut<Datum>>)\n\n const c = new NestedDonut<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 VisNestedDonut: (<Datum>(props: VisNestedDonutProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisNestedDonutFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,0BAA0B,YAAY;AAGnD,SAAS,iBAAyB,OAAmC,MAA4D;AAC/H,QAAM,MAAM,OAAgD,IAAI;AAChE,QAAM,eAAe,OAAuC,MAAS;AAGrE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,YAAmB,KAAK;AACtC,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,iBAAqF,MAAM,KAAK,MAAM,WAAW,gBAAgB,GAAG,aAAa;"}
@@ -1,10 +1,12 @@
1
- import { Ref } from 'react';
2
- import { Plotband, PlotbandConfigInterface } from '@unovis/ts';
3
- export declare type VisPlotbandRef<Datum> = {
4
- component?: Plotband<Datum>;
5
- };
6
- export declare type VisPlotbandProps<Datum> = PlotbandConfigInterface<Datum> & {
7
- ref?: Ref<VisPlotbandRef<Datum>>;
8
- };
9
- export declare const VisPlotbandSelectors: typeof import("@unovis/ts/dist/components/plotband/style");
10
- export declare const VisPlotband: (<Datum>(props: VisPlotbandProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Plotband } from '@unovis/ts/components/plotband';
3
+ import { PlotbandConfigInterface } from '@unovis/ts/components/plotband/config';
4
+
5
+ export type VisPlotbandRef<Datum> = {
6
+ component?: Plotband<Datum>;
7
+ };
8
+ export type VisPlotbandProps<Datum> = PlotbandConfigInterface<Datum> & {
9
+ ref?: Ref<VisPlotbandRef<Datum>>;
10
+ };
11
+ export declare const VisPlotbandSelectors: typeof import("@unovis/ts/components/plotband/style");
12
+ export declare const VisPlotband: (<Datum>(props: VisPlotbandProps<Datum>) => JSX.Element | null);
@@ -1,29 +1,34 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Plotband } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisPlotbandSelectors = Plotband.selectors;
6
- function VisPlotbandFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Plotband(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-component", { ref: ref });
25
- }
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Plotband } from "@unovis/ts/components/plotband";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisPlotbandSelectors = Plotband.selectors;
6
+ function VisPlotbandFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Plotband(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-component", { ref });
28
+ }
26
29
  const VisPlotband = React.memo(React.forwardRef(VisPlotbandFC), arePropsEqual);
27
-
28
- export { VisPlotband, VisPlotbandSelectors };
30
+ export {
31
+ VisPlotband,
32
+ VisPlotbandSelectors
33
+ };
29
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/plotband/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 { Plotband, PlotbandConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisPlotbandRef<Datum> = {\n component?: Plotband<Datum>;\n}\n\nexport type VisPlotbandProps<Datum> = PlotbandConfigInterface<Datum> & {\n ref?: Ref<VisPlotbandRef<Datum>>;\n}\n\nexport const VisPlotbandSelectors = Plotband.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisPlotbandFC<Datum> (props: VisPlotbandProps<Datum>, fRef: ForwardedRef<VisPlotbandRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Plotband<Datum>>>(null)\n const componentRef = useRef<Plotband<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Plotband<Datum>>)\n\n const c = new Plotband<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\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 VisPlotband: (<Datum>(props: VisPlotbandProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisPlotbandFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAkBa,MAAA,oBAAoB,GAAG,QAAQ,CAAC,UAAS;AAGtD,SAAS,aAAa,CAAS,KAA8B,EAAE,IAAyC,EAAA;AACtG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAA;AAC9D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA8B,SAAS,CAAC,CAAA;IAGnE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAgD,CAAA;AAErE,QAAA,MAAM,CAAC,GAAG,IAAI,QAAQ,CAAQ,KAAK,CAAC,CAAA;AACpC,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,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,WAAW,GAAoE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/plotband/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 { Plotband } from '@unovis/ts/components/plotband'\nimport { PlotbandConfigInterface } from '@unovis/ts/components/plotband/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 VisPlotbandRef<Datum> = {\n component?: Plotband<Datum>;\n}\n\nexport type VisPlotbandProps<Datum> = PlotbandConfigInterface<Datum> & {\n ref?: Ref<VisPlotbandRef<Datum>>;\n}\n\nexport const VisPlotbandSelectors = Plotband.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisPlotbandFC<Datum> (props: VisPlotbandProps<Datum>, fRef: ForwardedRef<VisPlotbandRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Plotband<Datum>>>(null)\n const componentRef = useRef<Plotband<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Plotband<Datum>>)\n\n const c = new Plotband<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\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 VisPlotband: (<Datum>(props: VisPlotbandProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisPlotbandFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBO,MAAM,uBAAuB,SAAS;AAG7C,SAAS,cAAsB,OAAgC,MAAyD;AACtH,QAAM,MAAM,OAA6C,IAAI;AAC7D,QAAM,eAAe,OAAoC,MAAS;AAGlE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,SAAgB,KAAK;AACnC,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,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,cAA+E,MAAM,KAAK,MAAM,WAAW,aAAa,GAAG,aAAa;"}
@@ -1,10 +1,12 @@
1
- import { Ref } from 'react';
2
- import { Plotline, PlotlineConfigInterface } from '@unovis/ts';
3
- export declare type VisPlotlineRef<Datum> = {
4
- component?: Plotline<Datum>;
5
- };
6
- export declare type VisPlotlineProps<Datum> = PlotlineConfigInterface<Datum> & {
7
- ref?: Ref<VisPlotlineRef<Datum>>;
8
- };
9
- export declare const VisPlotlineSelectors: typeof import("@unovis/ts/dist/components/plotline/style");
10
- export declare const VisPlotline: (<Datum>(props: VisPlotlineProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Plotline } from '@unovis/ts/components/plotline';
3
+ import { PlotlineConfigInterface } from '@unovis/ts/components/plotline/config';
4
+
5
+ export type VisPlotlineRef<Datum> = {
6
+ component?: Plotline<Datum>;
7
+ };
8
+ export type VisPlotlineProps<Datum> = PlotlineConfigInterface<Datum> & {
9
+ ref?: Ref<VisPlotlineRef<Datum>>;
10
+ };
11
+ export declare const VisPlotlineSelectors: typeof import("@unovis/ts/components/plotline/style");
12
+ export declare const VisPlotline: (<Datum>(props: VisPlotlineProps<Datum>) => JSX.Element | null);
@@ -1,29 +1,34 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Plotline } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisPlotlineSelectors = Plotline.selectors;
6
- function VisPlotlineFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Plotline(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-component", { ref: ref });
25
- }
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Plotline } from "@unovis/ts/components/plotline";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisPlotlineSelectors = Plotline.selectors;
6
+ function VisPlotlineFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Plotline(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-component", { ref });
28
+ }
26
29
  const VisPlotline = React.memo(React.forwardRef(VisPlotlineFC), arePropsEqual);
27
-
28
- export { VisPlotline, VisPlotlineSelectors };
30
+ export {
31
+ VisPlotline,
32
+ VisPlotlineSelectors
33
+ };
29
34
  //# sourceMappingURL=index.js.map