@unovis/react 1.0.0-alpha.4

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 (112) hide show
  1. package/LICENSE +193 -0
  2. package/components/area/index.d.ts +10 -0
  3. package/components/area/index.js +25 -0
  4. package/components/area/index.js.map +1 -0
  5. package/components/axis/index.d.ts +10 -0
  6. package/components/axis/index.js +25 -0
  7. package/components/axis/index.js.map +1 -0
  8. package/components/brush/index.d.ts +10 -0
  9. package/components/brush/index.js +25 -0
  10. package/components/brush/index.js.map +1 -0
  11. package/components/chord-diagram/index.d.ts +13 -0
  12. package/components/crosshair/index.d.ts +10 -0
  13. package/components/crosshair/index.js +25 -0
  14. package/components/crosshair/index.js.map +1 -0
  15. package/components/donut/index.d.ts +10 -0
  16. package/components/donut/index.js +25 -0
  17. package/components/donut/index.js.map +1 -0
  18. package/components/free-brush/index.d.ts +10 -0
  19. package/components/free-brush/index.js +25 -0
  20. package/components/free-brush/index.js.map +1 -0
  21. package/components/graph/index.d.ts +10 -0
  22. package/components/graph/index.js +25 -0
  23. package/components/graph/index.js.map +1 -0
  24. package/components/grouped-bar/index.d.ts +10 -0
  25. package/components/grouped-bar/index.js +25 -0
  26. package/components/grouped-bar/index.js.map +1 -0
  27. package/components/line/index.d.ts +10 -0
  28. package/components/line/index.js +25 -0
  29. package/components/line/index.js.map +1 -0
  30. package/components/sankey/index.d.ts +10 -0
  31. package/components/sankey/index.js +25 -0
  32. package/components/sankey/index.js.map +1 -0
  33. package/components/scatter/index.d.ts +10 -0
  34. package/components/scatter/index.js +25 -0
  35. package/components/scatter/index.js.map +1 -0
  36. package/components/stacked-bar/index.d.ts +10 -0
  37. package/components/stacked-bar/index.js +25 -0
  38. package/components/stacked-bar/index.js.map +1 -0
  39. package/components/timeline/index.d.ts +10 -0
  40. package/components/timeline/index.js +25 -0
  41. package/components/timeline/index.js.map +1 -0
  42. package/components/tooltip/index.d.ts +10 -0
  43. package/components/tooltip/index.js +23 -0
  44. package/components/tooltip/index.js.map +1 -0
  45. package/components/topojson-map/index.d.ts +14 -0
  46. package/components/topojson-map/index.js +25 -0
  47. package/components/topojson-map/index.js.map +1 -0
  48. package/components/xy-labels/index.d.ts +10 -0
  49. package/components/xy-labels/index.js +25 -0
  50. package/components/xy-labels/index.js.map +1 -0
  51. package/components.d.ts +19 -0
  52. package/composites/time-series/index.d.ts +54 -0
  53. package/composites/time-series/index.js +63 -0
  54. package/composites/time-series/index.js.map +1 -0
  55. package/composites/time-series/style.d.ts +3 -0
  56. package/composites/time-series/style.js +21 -0
  57. package/composites/time-series/style.js.map +1 -0
  58. package/composites.d.ts +1 -0
  59. package/containers/single-container/index.d.ts +6 -0
  60. package/containers/single-container/index.js +32 -0
  61. package/containers/single-container/index.js.map +1 -0
  62. package/containers/xy-container/index.d.ts +8 -0
  63. package/containers/xy-container/index.js +40 -0
  64. package/containers/xy-container/index.js.map +1 -0
  65. package/containers.d.ts +2 -0
  66. package/html-components/bullet-legend/index.d.ts +3 -0
  67. package/html-components/bullet-legend/index.js +19 -0
  68. package/html-components/bullet-legend/index.js.map +1 -0
  69. package/html-components/leaflet-flow-map/index.d.ts +15 -0
  70. package/html-components/leaflet-flow-map/index.js +24 -0
  71. package/html-components/leaflet-flow-map/index.js.map +1 -0
  72. package/html-components/leaflet-map/index.d.ts +12 -0
  73. package/html-components/leaflet-map/index.js +24 -0
  74. package/html-components/leaflet-map/index.js.map +1 -0
  75. package/index.d.ts +3 -0
  76. package/index.js +23 -0
  77. package/index.js.map +1 -0
  78. package/package.json +42 -0
  79. package/src/components/area/index.d.ts +10 -0
  80. package/src/components/axis/index.d.ts +10 -0
  81. package/src/components/brush/index.d.ts +10 -0
  82. package/src/components/chord-diagram/index.d.ts +13 -0
  83. package/src/components/crosshair/index.d.ts +10 -0
  84. package/src/components/donut/index.d.ts +10 -0
  85. package/src/components/free-brush/index.d.ts +10 -0
  86. package/src/components/graph/index.d.ts +10 -0
  87. package/src/components/grouped-bar/index.d.ts +10 -0
  88. package/src/components/line/index.d.ts +10 -0
  89. package/src/components/sankey/index.d.ts +10 -0
  90. package/src/components/scatter/index.d.ts +10 -0
  91. package/src/components/stacked-bar/index.d.ts +10 -0
  92. package/src/components/timeline/index.d.ts +10 -0
  93. package/src/components/tooltip/index.d.ts +10 -0
  94. package/src/components/topojson-map/index.d.ts +14 -0
  95. package/src/components/xy-labels/index.d.ts +10 -0
  96. package/src/components.d.ts +19 -0
  97. package/src/composites/time-series/index.d.ts +54 -0
  98. package/src/composites/time-series/style.d.ts +3 -0
  99. package/src/composites.d.ts +1 -0
  100. package/src/containers/single-container/index.d.ts +6 -0
  101. package/src/containers/xy-container/index.d.ts +8 -0
  102. package/src/containers.d.ts +2 -0
  103. package/src/html-components/bullet-legend/index.d.ts +3 -0
  104. package/src/html-components/leaflet-flow-map/index.d.ts +15 -0
  105. package/src/html-components/leaflet-map/index.d.ts +12 -0
  106. package/src/index.d.ts +3 -0
  107. package/src/types/dom.d.ts +3 -0
  108. package/src/utils/react.d.ts +4 -0
  109. package/types/dom.d.ts +3 -0
  110. package/utils/react.d.ts +4 -0
  111. package/utils/react.js +27 -0
  112. package/utils/react.js.map +1 -0
@@ -0,0 +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, Ref, useImperativeHandle, useEffect, useRef } 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\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLineFC<Datum> (props: VisLineProps<Datum>, fRef: ForwardedRef<VisLineRef<Datum>>): JSX.Element {\n const ref = useRef<VisComponentElement<Line<Datum>>>(null)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Line<Datum>>)\n element.__component__?.destroy() // Destroy component if exists already (to comply with React 18 strict mode, which renders components twice in dev mode)\n element.__component__ = new Line(props)\n // We don't have a clean up function because the component will be destroyed by its container (e.g. XYContainer or SingleContainer)\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = (ref.current as VisComponentElement<Line<Datum>>).__component__\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: (ref.current as VisComponentElement<Line<Datum>>).__component__ }))\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":";;;;AAoBA,SAAS,SAAS,CAAS,KAA0B,EAAE,IAAqC,EAAA;AAC1F,IAAA,MAAM,GAAG,GAAG,MAAM,CAAmC,IAAI,CAAC,CAAA;IAG1D,SAAS,CAAC,MAAK;;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA4C,CAAA;AACjE,QAAA,CAAA,EAAA,GAAA,OAAO,CAAC,aAAa,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,EAAE,CAAA;QAChC,OAAO,CAAC,aAAa,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAA;KAExC,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAI,GAAG,CAAC,OAA4C,CAAC,aAAa,CAAA;QACjF,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;AAEF,IAAA,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAG,GAAG,CAAC,OAA4C,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;AACjH,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;;;;"}
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'react';
2
+ import { Sankey, SankeyConfigInterface, SankeyInputNode, SankeyInputLink } from '@unovis/ts';
3
+ export declare type VisSankeyRef<N extends SankeyInputNode, L extends SankeyInputLink> = {
4
+ component: Sankey<N, L>;
5
+ };
6
+ export declare type VisSankeyProps<N extends SankeyInputNode, L extends SankeyInputLink> = SankeyConfigInterface<N, L> & {
7
+ data?: any;
8
+ ref?: Ref<VisSankeyRef<N, L>>;
9
+ };
10
+ export declare const VisSankey: (<N extends SankeyInputNode, L extends SankeyInputLink>(props: VisSankeyProps<N, L>) => JSX.Element | null);
@@ -0,0 +1,25 @@
1
+ import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
+ import { Sankey } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
4
+
5
+ function VisSankeyFC(props, fRef) {
6
+ const ref = useRef(null);
7
+ useEffect(() => {
8
+ var _a;
9
+ const element = ref.current;
10
+ (_a = element.__component__) === null || _a === void 0 ? void 0 : _a.destroy();
11
+ element.__component__ = new Sankey(props);
12
+ }, []);
13
+ useEffect(() => {
14
+ const component = ref.current.__component__;
15
+ if (props.data)
16
+ component === null || component === void 0 ? void 0 : component.setData(props.data);
17
+ component === null || component === void 0 ? void 0 : component.setConfig(props);
18
+ });
19
+ useImperativeHandle(fRef, () => ({ component: ref.current.__component__ }));
20
+ return React.createElement("vis-component", { ref: ref });
21
+ }
22
+ const VisSankey = React.memo(React.forwardRef(VisSankeyFC), arePropsEqual);
23
+
24
+ export { VisSankey };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/sankey/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Sankey, SankeyConfigInterface, SankeyInputNode, SankeyInputLink } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisSankeyRef<N extends SankeyInputNode, L extends SankeyInputLink> = {\n component: Sankey<N, L>;\n}\n\nexport type VisSankeyProps<N extends SankeyInputNode, L extends SankeyInputLink> = SankeyConfigInterface<N, L> & {\n data?: any;\n ref?: Ref<VisSankeyRef<N, L>>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisSankeyFC<N extends SankeyInputNode, L extends SankeyInputLink> (props: VisSankeyProps<N, L>, fRef: ForwardedRef<VisSankeyRef<N, L>>): JSX.Element {\n const ref = useRef<VisComponentElement<Sankey<N, L>>>(null)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Sankey<N, L>>)\n element.__component__?.destroy() // Destroy component if exists already (to comply with React 18 strict mode, which renders components twice in dev mode)\n element.__component__ = new Sankey(props)\n // We don't have a clean up function because the component will be destroyed by its container (e.g. XYContainer or SingleContainer)\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = (ref.current as VisComponentElement<Sankey<N, L>>).__component__\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: (ref.current as VisComponentElement<Sankey<N, L>>).__component__ }))\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 VisSankey: (<N extends SankeyInputNode, L extends SankeyInputLink>(props: VisSankeyProps<N, L>) => JSX.Element | null) = React.memo(React.forwardRef(VisSankeyFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBA,SAAS,WAAW,CAAwD,KAA2B,EAAE,IAAsC,EAAA;AAC7I,IAAA,MAAM,GAAG,GAAG,MAAM,CAAoC,IAAI,CAAC,CAAA;IAG3D,SAAS,CAAC,MAAK;;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA6C,CAAA;AAClE,QAAA,CAAA,EAAA,GAAA,OAAO,CAAC,aAAa,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,EAAE,CAAA;QAChC,OAAO,CAAC,aAAa,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,CAAA;KAE1C,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAI,GAAG,CAAC,OAA6C,CAAC,aAAa,CAAA;QAClF,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;AAEF,IAAA,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAG,GAAG,CAAC,OAA6C,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;AAClH,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,SAAS,GAAgH,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,aAAa;;;;"}
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'react';
2
+ import { Scatter, ScatterConfigInterface } from '@unovis/ts';
3
+ export declare type VisScatterRef<Datum> = {
4
+ component: Scatter<Datum>;
5
+ };
6
+ export declare type VisScatterProps<Datum> = ScatterConfigInterface<Datum> & {
7
+ data?: Datum[];
8
+ ref?: Ref<VisScatterRef<Datum>>;
9
+ };
10
+ export declare const VisScatter: (<Datum>(props: VisScatterProps<Datum>) => JSX.Element | null);
@@ -0,0 +1,25 @@
1
+ import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
+ import { Scatter } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
4
+
5
+ function VisScatterFC(props, fRef) {
6
+ const ref = useRef(null);
7
+ useEffect(() => {
8
+ var _a;
9
+ const element = ref.current;
10
+ (_a = element.__component__) === null || _a === void 0 ? void 0 : _a.destroy();
11
+ element.__component__ = new Scatter(props);
12
+ }, []);
13
+ useEffect(() => {
14
+ const component = ref.current.__component__;
15
+ if (props.data)
16
+ component === null || component === void 0 ? void 0 : component.setData(props.data);
17
+ component === null || component === void 0 ? void 0 : component.setConfig(props);
18
+ });
19
+ useImperativeHandle(fRef, () => ({ component: ref.current.__component__ }));
20
+ return React.createElement("vis-component", { ref: ref });
21
+ }
22
+ const VisScatter = React.memo(React.forwardRef(VisScatterFC), arePropsEqual);
23
+
24
+ export { VisScatter };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/scatter/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Scatter, ScatterConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisScatterRef<Datum> = {\n component: Scatter<Datum>;\n}\n\nexport type VisScatterProps<Datum> = ScatterConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisScatterRef<Datum>>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisScatterFC<Datum> (props: VisScatterProps<Datum>, fRef: ForwardedRef<VisScatterRef<Datum>>): JSX.Element {\n const ref = useRef<VisComponentElement<Scatter<Datum>>>(null)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Scatter<Datum>>)\n element.__component__?.destroy() // Destroy component if exists already (to comply with React 18 strict mode, which renders components twice in dev mode)\n element.__component__ = new Scatter(props)\n // We don't have a clean up function because the component will be destroyed by its container (e.g. XYContainer or SingleContainer)\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = (ref.current as VisComponentElement<Scatter<Datum>>).__component__\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: (ref.current as VisComponentElement<Scatter<Datum>>).__component__ }))\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 VisScatter: (<Datum>(props: VisScatterProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisScatterFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBA,SAAS,YAAY,CAAS,KAA6B,EAAE,IAAwC,EAAA;AACnG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAsC,IAAI,CAAC,CAAA;IAG7D,SAAS,CAAC,MAAK;;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA+C,CAAA;AACpE,QAAA,CAAA,EAAA,GAAA,OAAO,CAAC,aAAa,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,EAAE,CAAA;QAChC,OAAO,CAAC,aAAa,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;KAE3C,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAI,GAAG,CAAC,OAA+C,CAAC,aAAa,CAAA;QACpF,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;AAEF,IAAA,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAG,GAAG,CAAC,OAA+C,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;AACpH,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,UAAU,GAAmE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,aAAa;;;;"}
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'react';
2
+ import { StackedBar, StackedBarConfigInterface } from '@unovis/ts';
3
+ export declare type VisStackedBarRef<Datum> = {
4
+ component: StackedBar<Datum>;
5
+ };
6
+ export declare type VisStackedBarProps<Datum> = StackedBarConfigInterface<Datum> & {
7
+ data?: Datum[];
8
+ ref?: Ref<VisStackedBarRef<Datum>>;
9
+ };
10
+ export declare const VisStackedBar: (<Datum>(props: VisStackedBarProps<Datum>) => JSX.Element | null);
@@ -0,0 +1,25 @@
1
+ import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
+ import { StackedBar } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
4
+
5
+ function VisStackedBarFC(props, fRef) {
6
+ const ref = useRef(null);
7
+ useEffect(() => {
8
+ var _a;
9
+ const element = ref.current;
10
+ (_a = element.__component__) === null || _a === void 0 ? void 0 : _a.destroy();
11
+ element.__component__ = new StackedBar(props);
12
+ }, []);
13
+ useEffect(() => {
14
+ const component = ref.current.__component__;
15
+ if (props.data)
16
+ component === null || component === void 0 ? void 0 : component.setData(props.data);
17
+ component === null || component === void 0 ? void 0 : component.setConfig(props);
18
+ });
19
+ useImperativeHandle(fRef, () => ({ component: ref.current.__component__ }));
20
+ return React.createElement("vis-component", { ref: ref });
21
+ }
22
+ const VisStackedBar = React.memo(React.forwardRef(VisStackedBarFC), arePropsEqual);
23
+
24
+ export { VisStackedBar };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/stacked-bar/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { StackedBar, StackedBarConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisStackedBarRef<Datum> = {\n component: StackedBar<Datum>;\n}\n\nexport type VisStackedBarProps<Datum> = StackedBarConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisStackedBarRef<Datum>>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisStackedBarFC<Datum> (props: VisStackedBarProps<Datum>, fRef: ForwardedRef<VisStackedBarRef<Datum>>): JSX.Element {\n const ref = useRef<VisComponentElement<StackedBar<Datum>>>(null)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<StackedBar<Datum>>)\n element.__component__?.destroy() // Destroy component if exists already (to comply with React 18 strict mode, which renders components twice in dev mode)\n element.__component__ = new StackedBar(props)\n // We don't have a clean up function because the component will be destroyed by its container (e.g. XYContainer or SingleContainer)\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = (ref.current as VisComponentElement<StackedBar<Datum>>).__component__\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: (ref.current as VisComponentElement<StackedBar<Datum>>).__component__ }))\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 VisStackedBar: (<Datum>(props: VisStackedBarProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisStackedBarFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBA,SAAS,eAAe,CAAS,KAAgC,EAAE,IAA2C,EAAA;AAC5G,IAAA,MAAM,GAAG,GAAG,MAAM,CAAyC,IAAI,CAAC,CAAA;IAGhE,SAAS,CAAC,MAAK;;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAkD,CAAA;AACvE,QAAA,CAAA,EAAA,GAAA,OAAO,CAAC,aAAa,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,EAAE,CAAA;QAChC,OAAO,CAAC,aAAa,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAA;KAE9C,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAI,GAAG,CAAC,OAAkD,CAAC,aAAa,CAAA;QACvF,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;AAEF,IAAA,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAG,GAAG,CAAC,OAAkD,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;AACvH,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;;;;"}
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'react';
2
+ import { Timeline, TimelineConfigInterface } from '@unovis/ts';
3
+ export declare type VisTimelineRef<Datum> = {
4
+ component: Timeline<Datum>;
5
+ };
6
+ export declare type VisTimelineProps<Datum> = TimelineConfigInterface<Datum> & {
7
+ data?: Datum[];
8
+ ref?: Ref<VisTimelineRef<Datum>>;
9
+ };
10
+ export declare const VisTimeline: (<Datum>(props: VisTimelineProps<Datum>) => JSX.Element | null);
@@ -0,0 +1,25 @@
1
+ import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
+ import { Timeline } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
4
+
5
+ function VisTimelineFC(props, fRef) {
6
+ const ref = useRef(null);
7
+ useEffect(() => {
8
+ var _a;
9
+ const element = ref.current;
10
+ (_a = element.__component__) === null || _a === void 0 ? void 0 : _a.destroy();
11
+ element.__component__ = new Timeline(props);
12
+ }, []);
13
+ useEffect(() => {
14
+ const component = ref.current.__component__;
15
+ if (props.data)
16
+ component === null || component === void 0 ? void 0 : component.setData(props.data);
17
+ component === null || component === void 0 ? void 0 : component.setConfig(props);
18
+ });
19
+ useImperativeHandle(fRef, () => ({ component: ref.current.__component__ }));
20
+ return React.createElement("vis-component", { ref: ref });
21
+ }
22
+ const VisTimeline = React.memo(React.forwardRef(VisTimelineFC), arePropsEqual);
23
+
24
+ export { VisTimeline };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/timeline/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Timeline, TimelineConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTimelineRef<Datum> = {\n component: Timeline<Datum>;\n}\n\nexport type VisTimelineProps<Datum> = TimelineConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisTimelineRef<Datum>>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTimelineFC<Datum> (props: VisTimelineProps<Datum>, fRef: ForwardedRef<VisTimelineRef<Datum>>): JSX.Element {\n const ref = useRef<VisComponentElement<Timeline<Datum>>>(null)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Timeline<Datum>>)\n element.__component__?.destroy() // Destroy component if exists already (to comply with React 18 strict mode, which renders components twice in dev mode)\n element.__component__ = new Timeline(props)\n // We don't have a clean up function because the component will be destroyed by its container (e.g. XYContainer or SingleContainer)\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = (ref.current as VisComponentElement<Timeline<Datum>>).__component__\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: (ref.current as VisComponentElement<Timeline<Datum>>).__component__ }))\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 VisTimeline: (<Datum>(props: VisTimelineProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTimelineFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBA,SAAS,aAAa,CAAS,KAA8B,E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+ component: Tooltip;
5
+ };
6
+ export declare type VisTooltipProps = TooltipConfigInterface & {
7
+ data?: null;
8
+ ref?: Ref<VisTooltipRef>;
9
+ };
10
+ export declare const VisTooltip: ((props: VisTooltipProps) => JSX.Element | null);
@@ -0,0 +1,23 @@
1
+ import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
+ import { Tooltip } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
4
+
5
+ function VisTooltipFC(props, fRef) {
6
+ const ref = useRef(null);
7
+ useEffect(() => {
8
+ var _a;
9
+ const element = ref.current;
10
+ (_a = element.__component__) === null || _a === void 0 ? void 0 : _a.destroy();
11
+ element.__component__ = new Tooltip(props);
12
+ }, []);
13
+ useEffect(() => {
14
+ const component = ref.current.__component__;
15
+ component === null || component === void 0 ? void 0 : component.setConfig(props);
16
+ });
17
+ useImperativeHandle(fRef, () => ({ component: ref.current.__component__ }));
18
+ return React.createElement("vis-tooltip", { ref: ref });
19
+ }
20
+ const VisTooltip = React.memo(React.forwardRef(VisTooltipFC), arePropsEqual);
21
+
22
+ export { VisTooltip };
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/tooltip/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Tooltip, TooltipConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTooltipRef = {\n component: Tooltip;\n}\n\nexport type VisTooltipProps = TooltipConfigInterface & {\n data?: null;\n ref?: Ref<VisTooltipRef>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTooltipFC (props: VisTooltipProps, fRef: ForwardedRef<VisTooltipRef>): JSX.Element {\n const ref = useRef<VisComponentElement<Tooltip>>(null)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Tooltip>)\n element.__component__?.destroy() // Destroy component if exists already (to comply with React 18 strict mode, which renders components twice in dev mode)\n element.__component__ = new Tooltip(props)\n // We don't have a clean up function because the component will be destroyed by its container (e.g. XYContainer or SingleContainer)\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = (ref.current as VisComponentElement<Tooltip>).__component__\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: (ref.current as VisComponentElement<Tooltip>).__component__ }))\n return <vis-tooltip 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 VisTooltip: ((props: VisTooltipProps) => JSX.Element | null) = React.memo(React.forwardRef(VisTooltipFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBA,SAAS,YAAY,CAAE,KAAsB,EAAE,IAAiC,EAAA;AAC9E,IAAA,MAAM,GAAG,GAAG,MAAM,CAA+B,IAAI,CAAC,CAAA;IAGtD,SAAS,CAAC,MAAK;;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAwC,CAAA;AAC7D,QAAA,CAAA,EAAA,GAAA,OAAO,CAAC,aAAa,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,EAAE,CAAA;QAChC,OAAO,CAAC,aAAa,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;KAE3C,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAI,GAAG,CAAC,OAAwC,CAAC,aAAa,CAAA;QAE7E,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;AAEF,IAAA,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAG,GAAG,CAAC,OAAwC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;AAC7G,IAAA,OAAO,KAAa,CAAA,aAAA,CAAA,aAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AAClC,CAAC;AAIY,MAAA,UAAU,GAAqD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,aAAa;;;;"}
@@ -0,0 +1,14 @@
1
+ import { Ref } from 'react';
2
+ import { TopoJSONMap, TopoJSONMapConfigInterface } from '@unovis/ts';
3
+ export declare type VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum> = {
4
+ component: TopoJSONMap<AreaDatum, PointDatum, LinkDatum>;
5
+ };
6
+ export declare type VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum> = TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> & {
7
+ data?: {
8
+ areas?: AreaDatum[];
9
+ points?: PointDatum[];
10
+ links?: LinkDatum[];
11
+ };
12
+ ref?: Ref<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>;
13
+ };
14
+ export declare const VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null);
@@ -0,0 +1,25 @@
1
+ import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
+ import { TopoJSONMap } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
4
+
5
+ function VisTopoJSONMapFC(props, fRef) {
6
+ const ref = useRef(null);
7
+ useEffect(() => {
8
+ var _a;
9
+ const element = ref.current;
10
+ (_a = element.__component__) === null || _a === void 0 ? void 0 : _a.destroy();
11
+ element.__component__ = new TopoJSONMap(props);
12
+ }, []);
13
+ useEffect(() => {
14
+ const component = ref.current.__component__;
15
+ if (props.data)
16
+ component === null || component === void 0 ? void 0 : component.setData(props.data);
17
+ component === null || component === void 0 ? void 0 : component.setConfig(props);
18
+ });
19
+ useImperativeHandle(fRef, () => ({ component: ref.current.__component__ }));
20
+ return React.createElement("vis-component", { ref: ref });
21
+ }
22
+ const VisTopoJSONMap = React.memo(React.forwardRef(VisTopoJSONMapFC), arePropsEqual);
23
+
24
+ export { VisTopoJSONMap };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/topojson-map/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { TopoJSONMap, TopoJSONMapConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum> = {\n component: TopoJSONMap<AreaDatum, PointDatum, LinkDatum>;\n}\n\nexport type VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum> = TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> & {\n data?: {areas?: AreaDatum[]; points?: PointDatum[]; links?: LinkDatum[]};\n ref?: Ref<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTopoJSONMapFC<AreaDatum, PointDatum, LinkDatum> (props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>, fRef: ForwardedRef<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>): JSX.Element {\n const ref = useRef<VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>>(null)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>)\n element.__component__?.destroy() // Destroy component if exists already (to comply with React 18 strict mode, which renders components twice in dev mode)\n element.__component__ = new TopoJSONMap(props)\n // We don't have a clean up function because the component will be destroyed by its container (e.g. XYContainer or SingleContainer)\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = (ref.current as VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>).__component__\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: (ref.current as VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>).__component__ }))\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 VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTopoJSONMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBA,SAAS,gBAAgB,CAAoC,KAA4D,EAAE,IAAuE,EAAA;AAChM,IAAA,MAAM,GAAG,GAAG,MAAM,CAAqE,IAAI,CAAC,CAAA;IAG5F,SAAS,CAAC,MAAK;;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA8E,CAAA;AACnG,QAAA,CAAA,EAAA,GAAA,OAAO,CAAC,aAAa,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,EAAE,CAAA;QAChC,OAAO,CAAC,aAAa,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAA;KAE/C,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAI,GAAG,CAAC,OAA8E,CAAC,aAAa,CAAA;QACnH,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;AAEF,IAAA,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAG,GAAG,CAAC,OAA8E,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;AACnJ,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,cAAc,GAA6H,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,aAAa;;;;"}
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'react';
2
+ import { XYLabels, XYLabelsConfigInterface } from '@unovis/ts';
3
+ export declare type VisXYLabelsRef<Datum> = {
4
+ component: XYLabels<Datum>;
5
+ };
6
+ export declare type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {
7
+ data?: Datum[];
8
+ ref?: Ref<VisXYLabelsRef<Datum>>;
9
+ };
10
+ export declare const VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null);
@@ -0,0 +1,25 @@
1
+ import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
+ import { XYLabels } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
4
+
5
+ function VisXYLabelsFC(props, fRef) {
6
+ const ref = useRef(null);
7
+ useEffect(() => {
8
+ var _a;
9
+ const element = ref.current;
10
+ (_a = element.__component__) === null || _a === void 0 ? void 0 : _a.destroy();
11
+ element.__component__ = new XYLabels(props);
12
+ }, []);
13
+ useEffect(() => {
14
+ const component = ref.current.__component__;
15
+ if (props.data)
16
+ component === null || component === void 0 ? void 0 : component.setData(props.data);
17
+ component === null || component === void 0 ? void 0 : component.setConfig(props);
18
+ });
19
+ useImperativeHandle(fRef, () => ({ component: ref.current.__component__ }));
20
+ return React.createElement("vis-component", { ref: ref });
21
+ }
22
+ const VisXYLabels = React.memo(React.forwardRef(VisXYLabelsFC), arePropsEqual);
23
+
24
+ export { VisXYLabels };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { XYLabels, XYLabelsConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisXYLabelsRef<Datum> = {\n component: XYLabels<Datum>;\n}\n\nexport type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisXYLabelsRef<Datum>>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisXYLabelsFC<Datum> (props: VisXYLabelsProps<Datum>, fRef: ForwardedRef<VisXYLabelsRef<Datum>>): JSX.Element {\n const ref = useRef<VisComponentElement<XYLabels<Datum>>>(null)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<XYLabels<Datum>>)\n element.__component__?.destroy() // Destroy component if exists already (to comply with React 18 strict mode, which renders components twice in dev mode)\n element.__component__ = new XYLabels(props)\n // We don't have a clean up function because the component will be destroyed by its container (e.g. XYContainer or SingleContainer)\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = (ref.current as VisComponentElement<XYLabels<Datum>>).__component__\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: (ref.current as VisComponentElement<XYLabels<Datum>>).__component__ }))\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 VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisXYL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';
2
+ export * from './components/area';
3
+ export * from './components/axis';
4
+ export * from './components/brush/';
5
+ export * from './components/free-brush';
6
+ export * from './components/crosshair/';
7
+ export * from './components/donut/';
8
+ export * from './components/graph';
9
+ export * from './components/grouped-bar/';
10
+ export * from './components/scatter/';
11
+ export * from './components/sankey';
12
+ export * from './components/stacked-bar/';
13
+ export * from './components/tooltip/';
14
+ export * from './components/timeline/';
15
+ export * from './components/topojson-map/';
16
+ export * from './components/xy-labels';
17
+ export * from './html-components/bullet-legend';
18
+ export * from './html-components/leaflet-map';
19
+ export * from './html-components/leaflet-flow-map';
@@ -0,0 +1,54 @@
1
+ import { Spacing } from '@unovis/ts';
2
+ export declare type VisTimeSeriesDatum = {
3
+ timestamp: number;
4
+ value: number;
5
+ id?: string;
6
+ color?: string;
7
+ };
8
+ export declare type VisTimeSeriesProps<Datum> = {
9
+ data: Datum[];
10
+ margin: Spacing;
11
+ autoMargin: boolean;
12
+ x: (d: Datum, i: number) => number;
13
+ y: (d: Datum, i: number) => number;
14
+ id: (d: Datum, i: number) => string;
15
+ color: (d: Datum, i: number) => string;
16
+ cursor: string | ((d: Datum, i: number) => string);
17
+ formatXTicks?: (timestamp: number) => string;
18
+ formatYTicks?: (timestamp: number) => string;
19
+ selectionMinLength: number;
20
+ onBrushStart?: (selection: [number, number], e?: {
21
+ sourceEvent: MouseEvent;
22
+ }, userDriven?: boolean) => void;
23
+ onBrushMove?: (selection: [number, number], e?: {
24
+ sourceEvent: MouseEvent;
25
+ }, userDriven?: boolean) => void;
26
+ onBrushEnd?: (selection: [number, number], e?: {
27
+ sourceEvent: MouseEvent;
28
+ }, userDriven?: boolean) => void;
29
+ formatNavXTicks?: (timestamp: number) => string;
30
+ xLabel?: string;
31
+ yLabel?: string;
32
+ crosshairTemplate?: (d: Datum) => string | HTMLElement;
33
+ className?: string;
34
+ height?: string;
35
+ };
36
+ export declare function VisTimeSeries<Datum>(props: VisTimeSeriesProps<Datum>): JSX.Element;
37
+ export declare namespace VisTimeSeries {
38
+ var defaultProps: {
39
+ margin: {
40
+ top: number;
41
+ bottom: number;
42
+ left: number;
43
+ right: number;
44
+ };
45
+ autoMargin: boolean;
46
+ padding: {};
47
+ x: (d: VisTimeSeriesDatum) => number;
48
+ y: (d: VisTimeSeriesDatum) => number;
49
+ id: (d: VisTimeSeriesDatum) => string | undefined;
50
+ color: (d: VisTimeSeriesDatum) => string | undefined;
51
+ formatYTicks: (d: number) => string;
52
+ crosshairTemplate: (d: VisTimeSeriesDatum) => string;
53
+ };
54
+ }
@@ -0,0 +1,63 @@
1
+ import React, { useState, useMemo } from 'react';
2
+ import { cx } from '@emotion/css';
3
+ import { Scale, TextAlign } from '@unovis/ts';
4
+ import { VisXYContainer } from '../../containers/xy-container/index.js';
5
+ import { VisArea } from '../../components/area/index.js';
6
+ import { VisAxis } from '../../components/axis/index.js';
7
+ import { VisCrosshair } from '../../components/crosshair/index.js';
8
+ import { VisTooltip } from '../../components/tooltip/index.js';
9
+ import { VisBrush } from '../../components/brush/index.js';
10
+ import { timeSeriesContainer, timeSeriesModule, navigationModule } from './style.js';
11
+
12
+ function VisTimeSeries(props) {
13
+ var _a;
14
+ const [selectedRange, setSelectedRange] = useState(undefined);
15
+ const [animationDuration, setAnimationDuration] = useState(0);
16
+ const xScale = useMemo(() => Scale.scaleTime(), []);
17
+ const xScaleNav = useMemo(() => Scale.scaleTime(), []);
18
+ const onBrushStart = useMemo(() => (selection, e, userDriven) => {
19
+ var _a;
20
+ if (userDriven)
21
+ setAnimationDuration(0);
22
+ (_a = props.onBrushStart) === null || _a === void 0 ? void 0 : _a.call(props, selection, e, userDriven);
23
+ }, []);
24
+ const onBrushMove = useMemo(() => (selection, e, userDriven) => {
25
+ var _a;
26
+ if (userDriven && (selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange[0]) !== selection[0] && (selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange[1]) !== selection[1])
27
+ setSelectedRange(selection);
28
+ (_a = props.onBrushMove) === null || _a === void 0 ? void 0 : _a.call(props, selection, e, userDriven);
29
+ }, []);
30
+ const onBrushEnd = useMemo(() => (selection, e, userDriven) => {
31
+ var _a;
32
+ if (userDriven && (selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange[0]) !== selection[0] && (selectedRange === null || selectedRange === void 0 ? void 0 : selectedRange[1]) !== selection[1])
33
+ setSelectedRange(selection);
34
+ setAnimationDuration(undefined);
35
+ (_a = props.onBrushEnd) === null || _a === void 0 ? void 0 : _a.call(props, selection, e, userDriven);
36
+ }, []);
37
+ return (React.createElement("div", { className: cx(timeSeriesContainer, props.className), style: { height: props.height } },
38
+ React.createElement(VisXYContainer, { className: timeSeriesModule, data: props.data, xScale: xScale, xDomain: selectedRange, duration: animationDuration, scaleByDomain: true },
39
+ React.createElement(VisArea, { x: props.x, y: props.y, color: props.color }),
40
+ React.createElement(VisAxis, { type: 'x', numTicks: 5, tickFormat: props.formatXTicks, tickTextAlign: TextAlign.Center }),
41
+ React.createElement(VisAxis, { type: 'y', tickFormat: props.formatYTicks, label: props.yLabel }),
42
+ React.createElement(VisTooltip, null),
43
+ React.createElement(VisCrosshair, { template: props.crosshairTemplate })),
44
+ React.createElement(VisXYContainer, { className: navigationModule, duration: 0, xScale: xScaleNav, data: props.data },
45
+ React.createElement(VisArea, { x: props.x, y: props.y }),
46
+ React.createElement(VisBrush, { draggable: true, onBrushStart: onBrushStart, onBrushMove: onBrushMove, onBrushEnd: onBrushEnd }),
47
+ React.createElement(VisAxis, { type: 'x', numTicks: 5, tickFormat: (_a = props.formatXTicks) !== null && _a !== void 0 ? _a : props.formatNavXTicks, tickTextAlign: TextAlign.Right, label: props.xLabel }),
48
+ React.createElement(VisAxis, { type: 'y', tickFormat: props.formatYTicks, minMaxTicksOnly: true, label: props.yLabel ? ' ' : undefined }))));
49
+ }
50
+ VisTimeSeries.defaultProps = {
51
+ margin: { top: 10, bottom: 10, left: 10, right: 10 },
52
+ autoMargin: true,
53
+ padding: {},
54
+ x: (d) => d.timestamp,
55
+ y: (d) => d.value,
56
+ id: (d) => d.id,
57
+ color: (d) => d.color,
58
+ formatYTicks: (d) => d.toFixed(1),
59
+ crosshairTemplate: (d) => { var _a; return `<div>Date: ${new Date(d.timestamp).toLocaleDateString()}</div><div>Value: ${(_a = d.value) === null || _a === void 0 ? void 0 : _a.toFixed(1)}</div>`; },
60
+ };
61
+
62
+ export { VisTimeSeries };
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/composites/time-series/index.tsx"],"sourcesContent":["import React, { useState, useMemo } from 'react'\nimport { cx } from '@emotion/css'\nimport { Spacing, TextAlign, Scale } from '@unovis/ts'\nimport { VisXYContainer } from '@unovis/react/containers/xy-container'\nimport { VisArea } from '@unovis/react/components/area'\nimport { VisAxis } from '@unovis/react/components/axis'\nimport { VisCrosshair } from '@unovis/react/components/crosshair'\nimport { VisTooltip } from '@unovis/react/components/tooltip'\nimport { VisBrush } from '@unovis/react/components/brush'\n\nimport * as s from './style'\n\nexport type VisTimeSeriesDatum = {\n timestamp: number;\n value: number;\n id?: string;\n color?: string;\n}\n\nexport type VisTimeSeriesProps<Datum> = {\n data: Datum[];\n margin: Spacing;\n autoMargin: boolean;\n\n x: (d: Datum, i: number) => number;\n y: (d: Datum, i: number) => number;\n id: (d: Datum, i: number) => string;\n color: (d: Datum, i: number) => string;\n cursor: string | ((d: Datum, i: number) => string);\n formatXTicks?: (timestamp: number) => string;\n formatYTicks?: (timestamp: number) => string;\n\n selectionMinLength: number;\n onBrushStart?: (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean) => void;\n onBrushMove?: (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean) => void;\n onBrushEnd?: (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean) => void;\n formatNavXTicks?: (timestamp: number) => string;\n\n xLabel?: string;\n yLabel?: string;\n\n crosshairTemplate?: (d: Datum) => string | HTMLElement;\n\n className?: string;\n height?: string;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function VisTimeSeries<Datum> (props: VisTimeSeriesProps<Datum>): JSX.Element {\n const [selectedRange, setSelectedRange] = useState<[number, number] | undefined>(undefined)\n const [animationDuration, setAnimationDuration] = useState<number | undefined>(0)\n const xScale = useMemo(() => Scale.scaleTime(), [])\n const xScaleNav = useMemo(() => Scale.scaleTime(), [])\n\n // On Mount\n // useEffect(() => {}, [])\n\n // On Props Update\n // useEffect(() => {})\n\n // Brush callbacks\n const onBrushStart = useMemo(() => (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean): void => {\n if (userDriven) setAnimationDuration(0)\n props.onBrushStart?.(selection, e, userDriven)\n }, [])\n\n const onBrushMove = useMemo(() => (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean): void => {\n if (userDriven && selectedRange?.[0] !== selection[0] && selectedRange?.[1] !== selection[1]) setSelectedRange(selection)\n props.onBrushMove?.(selection, e, userDriven)\n }, [])\n\n const onBrushEnd = useMemo(() => (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean): void => {\n if (userDriven && selectedRange?.[0] !== selection[0] && selectedRange?.[1] !== selection[1]) setSelectedRange(selection)\n setAnimationDuration(undefined)\n props.onBrushEnd?.(selection, e, userDriven)\n }, [])\n\n return (\n <div className={cx(s.timeSeriesContainer, props.className)} style={{ height: props.height }}>\n <VisXYContainer\n className={s.timeSeriesModule}\n data={props.data}\n xScale={xScale}\n xDomain={selectedRange}\n duration={animationDuration}\n scaleByDomain={true}\n >\n <VisArea\n x={props.x}\n y={props.y}\n color={props.color}\n />\n <VisAxis type='x' numTicks={5} tickFormat={props.formatXTicks} tickTextAlign={TextAlign.Center}/>\n <VisAxis type='y' tickFormat={props.formatYTicks} label={props.yLabel}/>\n <VisTooltip />\n <VisCrosshair template={props.crosshairTemplate}/>\n </VisXYContainer>\n <VisXYContainer className={s.navigationModule} duration={0} xScale={xScaleNav} data={props.data}>\n <VisArea x={props.x} y={props.y} />\n <VisBrush draggable={true} onBrushStart={onBrushStart} onBrushMove={onBrushMove} onBrushEnd={onBrushEnd} />\n <VisAxis type='x' numTicks={5} tickFormat={props.formatXTicks ?? props.formatNavXTicks} tickTextAlign={TextAlign.Right} label={props.xLabel}/>\n <VisAxis type='y' tickFormat={props.formatYTicks} minMaxTicksOnly={true} label={props.yLabel ? ' ' : undefined}/>\n </VisXYContainer>\n </div>\n )\n}\n\nVisTimeSeries.defaultProps = {\n margin: { top: 10, bottom: 10, left: 10, right: 10 },\n autoMargin: true,\n padding: {},\n\n x: (d: VisTimeSeriesDatum) => d.timestamp,\n y: (d: VisTimeSeriesDatum) => d.value,\n id: (d: VisTimeSeriesDatum) => d.id,\n color: (d: VisTimeSeriesDatum) => d.color,\n\n formatYTicks: (d: number) => d.toFixed(1),\n\n crosshairTemplate: (d: VisTimeSeriesDatum) =>\n `<div>Date: ${new Date(d.timestamp).toLocaleDateString()}</div><div>Value: ${d.value?.toFixed(1)}</div>`,\n}\n"],"names":["s.timeSeriesContainer","s.timeSeriesModule","s.navigationModule"],"mappings":";;;;;;;;;;;AAgDM,SAAU,aAAa,CAAS,KAAgC,EAAA;;IACpE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAA+B,SAAS,CAAC,CAAA;IAC3F,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAqB,CAAC,CAAC,CAAA;AACjF,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAA;AACnD,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAA;AAStD,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,SAA2B,EAAE,CAA+B,EAAE,UAAoB,KAAU;;AAC9H,QAAA,IAAI,UAAU;YAAE,oB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,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;AACpD,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,OAAO,EAAE,EAAE;IAEX,CAAC,EAAE,CAAC,CAAqB,KAAK,CAAC,CAAC,SAAS;IACzC,CAAC,EAAE,CAAC,CAAqB,KAAK,CAAC,CAAC,KAAK;IACrC,EAAE,EAAE,CAAC,CAAqB,KAAK,CAAC,CAAC,EAAE;IACnC,KAAK,EAAE,CAAC,CAAqB,KAAK,CAAC,CAAC,KAAK;IAEzC,YAAY,EAAE,CAAC,CAAS,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAEzC,IAAA,iBAAiB,EAAE,CAAC,CAAqB,KAAI,EAAA,IAAA,EAAA,CAAA,CAC3C,OAAA,CAAA,WAAA,EAAc,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,CAAA,kBAAA,EAAqB,CAAA,EAAA,GAAA,CAAC,CAAC,KAAK,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,CAAC,CAAC,CAAC,CAAA,MAAA,CAAQ,CAAA,EAAA;CAC3G;;;;"}
@@ -0,0 +1,3 @@
1
+ export declare const timeSeriesContainer: string;
2
+ export declare const timeSeriesModule: string;
3
+ export declare const navigationModule: string;
@@ -0,0 +1,21 @@
1
+ import { css } from '@emotion/css';
2
+
3
+ const timeSeriesContainer = css `
4
+ position: relative;
5
+ height: 400px;
6
+ width: 100%;
7
+ font-family: sans-serif;
8
+ `;
9
+ const timeSeriesModule = css `
10
+ width: 100%;
11
+ height: 70%;
12
+ position: relative;
13
+ `;
14
+ const navigationModule = css `
15
+ width: 100%;
16
+ height: 30%;
17
+ position: relative;
18
+ `;
19
+
20
+ export { navigationModule, timeSeriesContainer, timeSeriesModule };
21
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sources":["../../../src/composites/time-series/style.ts"],"sourcesContent":["import { css } from '@emotion/css'\n\nexport const timeSeriesContainer = css`\n position: relative;\n height: 400px;\n width: 100%;\n font-family: sans-serif;\n`\n\nexport const timeSeriesModule = css`\n width: 100%;\n height: 70%;\n position: relative;\n`\n\nexport const navigationModule = css`\n width: 100%;\n height: 30%;\n position: relative;\n`\n"],"names":[],"mappings":";;AAEO,MAAM,mBAAmB,GAAG,GAAG,CAAA,CAAA;;;;;EAKrC;AAEM,MAAM,gBAAgB,GAAG,GAAG,CAAA,CAAA;;;;EAIlC;AAEM,MAAM,gBAAgB,GAAG,GAAG,CAAA,CAAA;;;;;;;;"}
@@ -0,0 +1 @@
1
+ export * from './composites/time-series';
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { SingleContainerConfigInterface } from '@unovis/ts';
3
+ export declare type VisSingleContainerProps<Data> = SingleContainerConfigInterface<Data> & {
4
+ data?: Data;
5
+ };
6
+ export declare const VisSingleContainer: (<Data>(props: PropsWithChildren<VisSingleContainerProps<Data>>) => JSX.Element | null);
@@ -0,0 +1,32 @@
1
+ import React, { useRef, useState, useEffect } from 'react';
2
+ import { SingleContainer } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
4
+
5
+ function VisSingleContainerFC(props) {
6
+ const container = useRef(null);
7
+ const [chart, setChart] = useState();
8
+ const [data, setData] = useState(undefined);
9
+ const getConfig = () => {
10
+ var _a, _b, _c, _d;
11
+ return (Object.assign(Object.assign({}, props), { component: (_b = (_a = container.current) === null || _a === void 0 ? void 0 : _a.querySelector('vis-component')) === null || _b === void 0 ? void 0 : _b.__component__, tooltip: (_d = (_c = container.current) === null || _c === void 0 ? void 0 : _c.querySelector('vis-tooltip')) === null || _d === void 0 ? void 0 : _d.__component__ }));
12
+ };
13
+ useEffect(() => {
14
+ setData(props.data);
15
+ const c = new SingleContainer(container.current, getConfig(), props.data);
16
+ setChart(c);
17
+ return () => c.destroy();
18
+ }, []);
19
+ useEffect(() => {
20
+ const preventRender = true;
21
+ if (props.data && (props.data !== data)) {
22
+ chart === null || chart === void 0 ? void 0 : chart.setData(props.data, preventRender);
23
+ setData(props.data);
24
+ }
25
+ chart === null || chart === void 0 ? void 0 : chart.updateContainer(getConfig());
26
+ });
27
+ return (React.createElement("div", { ref: container, style: { width: '100%', height: '100%', position: 'relative' } }, props.children));
28
+ }
29
+ const VisSingleContainer = React.memo(VisSingleContainerFC, arePropsEqual);
30
+
31
+ export { VisSingleContainer };
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.tsx"],"sourcesContent":["// eslint-disable-next-line no-use-before-define\nimport React, { ReactNode, useEffect, useRef, useState, PropsWithChildren } from 'react'\nimport { SingleContainer, SingleContainerConfigInterface, ComponentCore, Tooltip } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisSingleContainerProps<Data> = SingleContainerConfigInterface<Data> & {\n data?: Data;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisSingleContainerFC<Data> (props: PropsWithChildren<VisSingleContainerProps<Data>>): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const [chart, setChart] = useState<SingleContainer<Data>>()\n const [data, setData] = useState<Data | undefined>(undefined)\n\n const getConfig = (): SingleContainerConfigInterface<Data> => ({\n ...props,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n component: container.current?.querySelector<VisComponentElement<ComponentCore<Data>>>('vis-component')?.__component__,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tooltip: container.current?.querySelector<VisComponentElement<Tooltip>>('vis-tooltip')?.__component__,\n })\n\n // On Mount\n useEffect(() => {\n setData(props.data)\n const c = new SingleContainer<Data>(container.current as HTMLDivElement, getConfig(), props.data)\n setChart(c)\n return () => c.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n const preventRender = true\n\n // Set new Data without re-render\n if (props.data && (props.data !== data)) {\n chart?.setData(props.data, preventRender)\n setData(props.data)\n }\n\n // Update Container and render\n chart?.updateContainer(getConfig())\n })\n\n return (\n <div ref={container} style={{ width: '100%', height: '100%', position: 'relative' }}>\n {props.children}\n </div>\n )\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 VisSingleContainer: (<Data>(props: PropsWithChildren<VisSingleContainerProps<Data>>) => JSX.Element | null) =\n React.memo(VisSingleContainerFC, arePropsEqual)\n"],"names":[],"mappings":";;;;AAeA,SAAS,oBAAoB,CAAQ,KAAuD,EAAA;AAC1F,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAyB,CAAA;IAC3D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAmB,SAAS,CAAC,CAAA;IAE7D,MAAM,SAAS,GAAG,MAA2C;;AAAC,QAAA,QACzD,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,CAER,EAAA,EAAA,SAAS,EAAE,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,SAAS,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,aAAa,CAA2C,eAAe,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,aAAa,EAErH,OAAO,EAAE,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,SAAS,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,aAAa,CAA+B,aAAa,CAAC,MAAE,IAA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@@
1
+ import { PropsWithChildren } from 'react';
2
+ import { XYContainerConfigInterface } from '@unovis/ts';
3
+ export declare type VisXYContainerProps<Datum> = XYContainerConfigInterface<Datum> & {
4
+ data?: Datum[];
5
+ className?: string;
6
+ };
7
+ export declare function VisXYContainerFC<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>): JSX.Element;
8
+ export declare const VisXYContainer: (<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>) => JSX.Element | null);