@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
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { ChordDiagram } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisChordDiagramSelectors = ChordDiagram.selectors;
6
- function VisChordDiagramFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new ChordDiagram(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 { ChordDiagram } from "@unovis/ts/components/chord-diagram";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisChordDiagramSelectors = ChordDiagram.selectors;
6
+ function VisChordDiagramFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new ChordDiagram(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 VisChordDiagram = React.memo(React.forwardRef(VisChordDiagramFC), arePropsEqual);
29
-
30
- export { VisChordDiagram, VisChordDiagramSelectors };
31
+ export {
32
+ VisChordDiagram,
33
+ VisChordDiagramSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/chord-diagram/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 { ChordDiagram, ChordDiagramConfigInterface, ChordInputNode, ChordInputLink } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisChordDiagramRef<N extends ChordInputNode, L extends ChordInputLink> = {\n component?: ChordDiagram<N, L>;\n}\n\nexport type VisChordDiagramProps<N extends ChordInputNode, L extends ChordInputLink> = ChordDiagramConfigInterface<N, L> & {\n data?: { nodes: N[]; links?: L[] };\n ref?: Ref<VisChordDiagramRef<N, L>>;\n}\n\nexport const VisChordDiagramSelectors = ChordDiagram.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisChordDiagramFC<N extends ChordInputNode, L extends ChordInputLink> (props: VisChordDiagramProps<N, L>, fRef: ForwardedRef<VisChordDiagramRef<N, L>>): ReactElement {\n const ref = useRef<VisComponentElement<ChordDiagram<N, L>>>(null)\n const componentRef = useRef<ChordDiagram<N, L> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<ChordDiagram<N, L>>)\n\n const c = new ChordDiagram<N, L>(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 VisChordDiagram: (<N extends ChordInputNode, L extends ChordInputLink>(props: VisChordDiagramProps<N, L>) => JSX.Element | null) = React.memo(React.forwardRef(VisChordDiagramFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,wBAAwB,GAAG,YAAY,CAAC,UAAS;AAG9D,SAAS,iBAAiB,CAAsD,KAAiC,EAAE,IAA4C,EAAA;AAC7J,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,YAAY,CAAO,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,eAAe,GAAoH,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/chord-diagram/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 { ChordDiagram } from '@unovis/ts/components/chord-diagram'\nimport { ChordDiagramConfigInterface } from '@unovis/ts/components/chord-diagram/config'\nimport { ChordInputNode, ChordInputLink } from '@unovis/ts/components/chord-diagram/types'\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 VisChordDiagramRef<N extends ChordInputNode, L extends ChordInputLink> = {\n component?: ChordDiagram<N, L>;\n}\n\nexport type VisChordDiagramProps<N extends ChordInputNode, L extends ChordInputLink> = ChordDiagramConfigInterface<N, L> & {\n data?: { nodes: N[]; links?: L[] };\n ref?: Ref<VisChordDiagramRef<N, L>>;\n}\n\nexport const VisChordDiagramSelectors = ChordDiagram.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisChordDiagramFC<N extends ChordInputNode, L extends ChordInputLink> (props: VisChordDiagramProps<N, L>, fRef: ForwardedRef<VisChordDiagramRef<N, L>>): ReactElement {\n const ref = useRef<VisComponentElement<ChordDiagram<N, L>>>(null)\n const componentRef = useRef<ChordDiagram<N, L> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<ChordDiagram<N, L>>)\n\n const c = new ChordDiagram<N, L>(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 VisChordDiagram: (<N extends ChordInputNode, L extends ChordInputLink>(props: VisChordDiagramProps<N, L>) => JSX.Element | null) = React.memo(React.forwardRef(VisChordDiagramFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAsBO,MAAM,2BAA2B,aAAa;AAGrD,SAAS,kBAAuE,OAAmC,MAA4D;AAC7K,QAAM,MAAM,OAAgD,IAAI;AAChE,QAAM,eAAe,OAAuC,MAAS;AAGrE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,aAAmB,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,kBAAmI,MAAM,KAAK,MAAM,WAAW,iBAAiB,GAAG,aAAa;"}
@@ -1,11 +1,13 @@
1
- import { Ref } from 'react';
2
- import { Crosshair, CrosshairConfigInterface } from '@unovis/ts';
3
- export declare type VisCrosshairRef<Datum> = {
4
- component?: Crosshair<Datum>;
5
- };
6
- export declare type VisCrosshairProps<Datum> = CrosshairConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisCrosshairRef<Datum>>;
9
- };
10
- export declare const VisCrosshairSelectors: typeof import("@unovis/ts/dist/components/crosshair/style");
11
- export declare const VisCrosshair: (<Datum>(props: VisCrosshairProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Crosshair } from '@unovis/ts/components/crosshair';
3
+ import { CrosshairConfigInterface } from '@unovis/ts/components/crosshair/config';
4
+
5
+ export type VisCrosshairRef<Datum> = {
6
+ component?: Crosshair<Datum>;
7
+ };
8
+ export type VisCrosshairProps<Datum> = CrosshairConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisCrosshairRef<Datum>>;
11
+ };
12
+ export declare const VisCrosshairSelectors: typeof import("@unovis/ts/components/crosshair/style");
13
+ export declare const VisCrosshair: (<Datum>(props: VisCrosshairProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Crosshair } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisCrosshairSelectors = Crosshair.selectors;
6
- function VisCrosshairFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Crosshair(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-crosshair", { ref: ref });
27
- }
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Crosshair } from "@unovis/ts/components/crosshair";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisCrosshairSelectors = Crosshair.selectors;
6
+ function VisCrosshairFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Crosshair(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-crosshair", { ref });
29
+ }
28
30
  const VisCrosshair = React.memo(React.forwardRef(VisCrosshairFC), arePropsEqual);
29
-
30
- export { VisCrosshair, VisCrosshairSelectors };
31
+ export {
32
+ VisCrosshair,
33
+ VisCrosshairSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/crosshair/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 { Crosshair, CrosshairConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisCrosshairRef<Datum> = {\n component?: Crosshair<Datum>;\n}\n\nexport type VisCrosshairProps<Datum> = CrosshairConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisCrosshairRef<Datum>>;\n}\n\nexport const VisCrosshairSelectors = Crosshair.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisCrosshairFC<Datum> (props: VisCrosshairProps<Datum>, fRef: ForwardedRef<VisCrosshairRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Crosshair<Datum>>>(null)\n const componentRef = useRef<Crosshair<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Crosshair<Datum>>)\n\n const c = new Crosshair<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-crosshair 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 VisCrosshair: (<Datum>(props: VisCrosshairProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisCrosshairFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,qBAAqB,GAAG,SAAS,CAAC,UAAS;AAGxD,SAAS,cAAc,CAAS,KAA+B,EAAE,IAA0C,EAAA;AACzG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAwC,IAAI,CAAC,CAAA;AAC/D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA+B,SAAS,CAAC,CAAA;IAGpE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAiD,CAAA;AAEtE,QAAA,MAAM,CAAC,GAAG,IAAI,SAAS,CAAQ,KAAK,CAAC,CAAA;AACrC,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,YAAY,GAAqE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/crosshair/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 { Crosshair } from '@unovis/ts/components/crosshair'\nimport { CrosshairConfigInterface } from '@unovis/ts/components/crosshair/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 VisCrosshairRef<Datum> = {\n component?: Crosshair<Datum>;\n}\n\nexport type VisCrosshairProps<Datum> = CrosshairConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisCrosshairRef<Datum>>;\n}\n\nexport const VisCrosshairSelectors = Crosshair.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisCrosshairFC<Datum> (props: VisCrosshairProps<Datum>, fRef: ForwardedRef<VisCrosshairRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Crosshair<Datum>>>(null)\n const componentRef = useRef<Crosshair<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Crosshair<Datum>>)\n\n const c = new Crosshair<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-crosshair 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 VisCrosshair: (<Datum>(props: VisCrosshairProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisCrosshairFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,wBAAwB,UAAU;AAG/C,SAAS,eAAuB,OAAiC,MAA0D;AACzH,QAAM,MAAM,OAA8C,IAAI;AAC9D,QAAM,eAAe,OAAqC,MAAS;AAGnE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,UAAiB,KAAK;AACpC,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,eAAiF,MAAM,KAAK,MAAM,WAAW,cAAc,GAAG,aAAa;"}
@@ -1,11 +1,13 @@
1
- import { Ref } from 'react';
2
- import { Donut, DonutConfigInterface } from '@unovis/ts';
3
- export declare type VisDonutRef<Datum> = {
4
- component?: Donut<Datum>;
5
- };
6
- export declare type VisDonutProps<Datum> = DonutConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisDonutRef<Datum>>;
9
- };
10
- export declare const VisDonutSelectors: typeof import("@unovis/ts/dist/components/donut/style");
11
- export declare const VisDonut: (<Datum>(props: VisDonutProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Donut } from '@unovis/ts/components/donut';
3
+ import { DonutConfigInterface } from '@unovis/ts/components/donut/config';
4
+
5
+ export type VisDonutRef<Datum> = {
6
+ component?: Donut<Datum>;
7
+ };
8
+ export type VisDonutProps<Datum> = DonutConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisDonutRef<Datum>>;
11
+ };
12
+ export declare const VisDonutSelectors: typeof import("@unovis/ts/components/donut/style");
13
+ export declare const VisDonut: (<Datum>(props: VisDonutProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Donut } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisDonutSelectors = Donut.selectors;
6
- function VisDonutFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Donut(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 { Donut } from "@unovis/ts/components/donut";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisDonutSelectors = Donut.selectors;
6
+ function VisDonutFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Donut(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 VisDonut = React.memo(React.forwardRef(VisDonutFC), arePropsEqual);
29
-
30
- export { VisDonut, VisDonutSelectors };
31
+ export {
32
+ VisDonut,
33
+ VisDonutSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/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 { Donut, DonutConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisDonutRef<Datum> = {\n component?: Donut<Datum>;\n}\n\nexport type VisDonutProps<Datum> = DonutConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisDonutRef<Datum>>;\n}\n\nexport const VisDonutSelectors = Donut.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisDonutFC<Datum> (props: VisDonutProps<Datum>, fRef: ForwardedRef<VisDonutRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Donut<Datum>>>(null)\n const componentRef = useRef<Donut<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Donut<Datum>>)\n\n const c = new Donut<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 VisDonut: (<Datum>(props: VisDonutProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisDonutFC), 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/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 { Donut } from '@unovis/ts/components/donut'\nimport { DonutConfigInterface } from '@unovis/ts/components/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 VisDonutRef<Datum> = {\n component?: Donut<Datum>;\n}\n\nexport type VisDonutProps<Datum> = DonutConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisDonutRef<Datum>>;\n}\n\nexport const VisDonutSelectors = Donut.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisDonutFC<Datum> (props: VisDonutProps<Datum>, fRef: ForwardedRef<VisDonutRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Donut<Datum>>>(null)\n const componentRef = useRef<Donut<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Donut<Datum>>)\n\n const c = new Donut<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 VisDonut: (<Datum>(props: VisDonutProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisDonutFC), 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,11 +1,13 @@
1
- import { Ref } from 'react';
2
- import { FreeBrush, FreeBrushConfigInterface } from '@unovis/ts';
3
- export declare type VisFreeBrushRef<Datum> = {
4
- component?: FreeBrush<Datum>;
5
- };
6
- export declare type VisFreeBrushProps<Datum> = FreeBrushConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisFreeBrushRef<Datum>>;
9
- };
10
- export declare const VisFreeBrushSelectors: typeof import("@unovis/ts/dist/components/free-brush/style");
11
- export declare const VisFreeBrush: (<Datum>(props: VisFreeBrushProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { FreeBrush } from '@unovis/ts/components/free-brush';
3
+ import { FreeBrushConfigInterface } from '@unovis/ts/components/free-brush/config';
4
+
5
+ export type VisFreeBrushRef<Datum> = {
6
+ component?: FreeBrush<Datum>;
7
+ };
8
+ export type VisFreeBrushProps<Datum> = FreeBrushConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisFreeBrushRef<Datum>>;
11
+ };
12
+ export declare const VisFreeBrushSelectors: typeof import("@unovis/ts/components/free-brush/style");
13
+ export declare const VisFreeBrush: (<Datum>(props: VisFreeBrushProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { FreeBrush } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisFreeBrushSelectors = FreeBrush.selectors;
6
- function VisFreeBrushFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new FreeBrush(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 { FreeBrush } from "@unovis/ts/components/free-brush";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisFreeBrushSelectors = FreeBrush.selectors;
6
+ function VisFreeBrushFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new FreeBrush(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 VisFreeBrush = React.memo(React.forwardRef(VisFreeBrushFC), arePropsEqual);
29
-
30
- export { VisFreeBrush, VisFreeBrushSelectors };
31
+ export {
32
+ VisFreeBrush,
33
+ VisFreeBrushSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/free-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 { FreeBrush, FreeBrushConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisFreeBrushRef<Datum> = {\n component?: FreeBrush<Datum>;\n}\n\nexport type VisFreeBrushProps<Datum> = FreeBrushConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisFreeBrushRef<Datum>>;\n}\n\nexport const VisFreeBrushSelectors = FreeBrush.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisFreeBrushFC<Datum> (props: VisFreeBrushProps<Datum>, fRef: ForwardedRef<VisFreeBrushRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<FreeBrush<Datum>>>(null)\n const componentRef = useRef<FreeBrush<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<FreeBrush<Datum>>)\n\n const c = new FreeBrush<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 VisFreeBrush: (<Datum>(props: VisFreeBrushProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisFreeBrushFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,qBAAqB,GAAG,SAAS,CAAC,UAAS;AAGxD,SAAS,cAAc,CAAS,KAA+B,EAAE,IAA0C,EAAA;AACzG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAwC,IAAI,CAAC,CAAA;AAC/D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA+B,SAAS,CAAC,CAAA;IAGpE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAiD,CAAA;AAEtE,QAAA,MAAM,CAAC,GAAG,IAAI,SAAS,CAAQ,KAAK,CAAC,CAAA;AACrC,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,YAAY,GAAqE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/free-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 { FreeBrush } from '@unovis/ts/components/free-brush'\nimport { FreeBrushConfigInterface } from '@unovis/ts/components/free-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 VisFreeBrushRef<Datum> = {\n component?: FreeBrush<Datum>;\n}\n\nexport type VisFreeBrushProps<Datum> = FreeBrushConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisFreeBrushRef<Datum>>;\n}\n\nexport const VisFreeBrushSelectors = FreeBrush.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisFreeBrushFC<Datum> (props: VisFreeBrushProps<Datum>, fRef: ForwardedRef<VisFreeBrushRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<FreeBrush<Datum>>>(null)\n const componentRef = useRef<FreeBrush<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<FreeBrush<Datum>>)\n\n const c = new FreeBrush<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 VisFreeBrush: (<Datum>(props: VisFreeBrushProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisFreeBrushFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,wBAAwB,UAAU;AAG/C,SAAS,eAAuB,OAAiC,MAA0D;AACzH,QAAM,MAAM,OAA8C,IAAI;AAC9D,QAAM,eAAe,OAAqC,MAAS;AAGnE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,UAAiB,KAAK;AACpC,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,eAAiF,MAAM,KAAK,MAAM,WAAW,cAAc,GAAG,aAAa;"}
@@ -1,36 +1,39 @@
1
- import { Ref } from 'react';
2
- import { Graph, GraphConfigInterface, GraphInputNode, GraphInputLink } from '@unovis/ts';
3
- export declare type VisGraphRef<N extends GraphInputNode, L extends GraphInputLink> = {
4
- component?: Graph<N, L>;
5
- };
6
- export declare type VisGraphProps<N extends GraphInputNode, L extends GraphInputLink> = GraphConfigInterface<N, L> & {
7
- data?: {
8
- nodes: N[];
9
- links?: L[];
10
- };
11
- ref?: Ref<VisGraphRef<N, L>>;
12
- };
13
- export declare const VisGraphSelectors: {
14
- root: string;
15
- graphGroup: string;
16
- background: string;
17
- node: string;
18
- nodeShape: string;
19
- nodeGauge: string;
20
- nodeSideLabel: string;
21
- nodeLabel: string;
22
- dimmedNode: string;
23
- link: string;
24
- linkLine: string;
25
- linkLabel: string;
26
- dimmedLink: string;
27
- panel: string;
28
- panelRect: string;
29
- panelSelection: string;
30
- panelLabel: string;
31
- panelLabelText: string;
32
- panelSideIcon: string;
33
- panelSideIconShape: string;
34
- panelSideIconSymbol: string;
35
- };
36
- export declare const VisGraph: (<N extends GraphInputNode, L extends GraphInputLink>(props: VisGraphProps<N, L>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Graph } from '@unovis/ts/components/graph';
3
+ import { GraphConfigInterface } from '@unovis/ts/components/graph/config';
4
+ import { GraphInputNode, GraphInputLink } from '@unovis/ts/types/graph';
5
+
6
+ export type VisGraphRef<N extends GraphInputNode, L extends GraphInputLink> = {
7
+ component?: Graph<N, L>;
8
+ };
9
+ export type VisGraphProps<N extends GraphInputNode, L extends GraphInputLink> = GraphConfigInterface<N, L> & {
10
+ data?: {
11
+ nodes: N[];
12
+ links?: L[];
13
+ };
14
+ ref?: Ref<VisGraphRef<N, L>>;
15
+ };
16
+ export declare const VisGraphSelectors: {
17
+ root: string;
18
+ graphGroup: string;
19
+ background: string;
20
+ node: string;
21
+ nodeShape: string;
22
+ nodeGauge: string;
23
+ nodeSideLabel: string;
24
+ nodeLabel: string;
25
+ dimmedNode: string;
26
+ link: string;
27
+ linkLine: string;
28
+ linkLabel: string;
29
+ dimmedLink: string;
30
+ panel: string;
31
+ panelRect: string;
32
+ panelSelection: string;
33
+ panelLabel: string;
34
+ panelLabelText: string;
35
+ panelSideIcon: string;
36
+ panelSideIconShape: string;
37
+ panelSideIconSymbol: string;
38
+ };
39
+ export declare const VisGraph: (<N extends GraphInputNode, L extends GraphInputLink>(props: VisGraphProps<N, L>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Graph } from '@unovis/ts';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisGraphSelectors = Graph.selectors;
6
- function VisGraphFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Graph(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 { Graph } from "@unovis/ts/components/graph";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisGraphSelectors = Graph.selectors;
6
+ function VisGraphFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Graph(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 VisGraph = React.memo(React.forwardRef(VisGraphFC), arePropsEqual);
29
-
30
- export { VisGraph, VisGraphSelectors };
31
+ export {
32
+ VisGraph,
33
+ VisGraphSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/graph/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 { Graph, GraphConfigInterface, GraphInputNode, GraphInputLink } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisGraphRef<N extends GraphInputNode, L extends GraphInputLink> = {\n component?: Graph<N, L>;\n}\n\nexport type VisGraphProps<N extends GraphInputNode, L extends GraphInputLink> = GraphConfigInterface<N, L> & {\n data?: { nodes: N[]; links?: L[] };\n ref?: Ref<VisGraphRef<N, L>>;\n}\n\nexport const VisGraphSelectors = Graph.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisGraphFC<N extends GraphInputNode, L extends GraphInputLink> (props: VisGraphProps<N, L>, fRef: ForwardedRef<VisGraphRef<N, L>>): ReactElement {\n const ref = useRef<VisComponentElement<Graph<N, L>>>(null)\n const componentRef = useRef<Graph<N, L> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Graph<N, L>>)\n\n const c = new Graph<N, L>(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 VisGraph: (<N extends GraphInputNode, L extends GraphInputLink>(props: VisGraphProps<N, L>) => JSX.Element | null) = React.memo(React.forwardRef(VisGraphFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,iBAAiB,GAAG,KAAK,CAAC,UAAS;AAGhD,SAAS,UAAU,CAAsD,KAA0B,EAAE,IAAqC,EAAA;AACxI,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,KAAK,CAAO,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,QAAQ,GAA6G,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/graph/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 { Graph } from '@unovis/ts/components/graph'\nimport { GraphConfigInterface } from '@unovis/ts/components/graph/config'\nimport { GraphInputNode, GraphInputLink } from '@unovis/ts/types/graph'\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 VisGraphRef<N extends GraphInputNode, L extends GraphInputLink> = {\n component?: Graph<N, L>;\n}\n\nexport type VisGraphProps<N extends GraphInputNode, L extends GraphInputLink> = GraphConfigInterface<N, L> & {\n data?: { nodes: N[]; links?: L[] };\n ref?: Ref<VisGraphRef<N, L>>;\n}\n\nexport const VisGraphSelectors = Graph.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisGraphFC<N extends GraphInputNode, L extends GraphInputLink> (props: VisGraphProps<N, L>, fRef: ForwardedRef<VisGraphRef<N, L>>): ReactElement {\n const ref = useRef<VisComponentElement<Graph<N, L>>>(null)\n const componentRef = useRef<Graph<N, L> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Graph<N, L>>)\n\n const c = new Graph<N, L>(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 VisGraph: (<N extends GraphInputNode, L extends GraphInputLink>(props: VisGraphProps<N, L>) => JSX.Element | null) = React.memo(React.forwardRef(VisGraphFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAsBO,MAAM,oBAAoB,MAAM;AAGvC,SAAS,WAAgE,OAA4B,MAAqD;AACxJ,QAAM,MAAM,OAAyC,IAAI;AACzD,QAAM,eAAe,OAAgC,MAAS;AAG9D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,MAAY,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,WAAqH,MAAM,KAAK,MAAM,WAAW,UAAU,GAAG,aAAa;"}