@unovis/react 1.6.6 → 1.7.0-beta.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 -11
  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 -12
  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 -12
  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 -12
  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 -16
  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 -12
  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 -12
  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 -12
  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 -38
  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 -12
  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 -12
  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 -12
  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 -11
  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 -11
  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 -16
  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 -12
  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 -12
  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 -12
  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 -11
  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 -16
  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 -12
  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 -12
  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 -61
  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 -59
  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 -12
  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 -12
  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 -17
  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 -14
  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 -12
  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 +15 -16
  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,29 +1,34 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Tooltip } from '@unovis/ts/components/tooltip';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisTooltipSelectors = Tooltip.selectors;
6
- function VisTooltipFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Tooltip(props);
12
- componentRef.current = c;
13
- element.__component__ = c;
14
- return () => {
15
- componentRef.current = undefined;
16
- c.destroy();
17
- };
18
- }, []);
19
- useEffect(() => {
20
- const component = componentRef.current;
21
- component === null || component === void 0 ? void 0 : component.setConfig(props);
22
- });
23
- useImperativeHandle(fRef, () => ({ get component() { return componentRef.current; } }), []);
24
- return React.createElement("vis-tooltip", { ref: ref });
25
- }
1
+ import React, { useRef, useEffect, useImperativeHandle } from "react";
2
+ import { Tooltip } from "@unovis/ts/components/tooltip";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisTooltipSelectors = Tooltip.selectors;
6
+ function VisTooltipFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Tooltip(props);
12
+ componentRef.current = c;
13
+ element.__component__ = c;
14
+ return () => {
15
+ componentRef.current = void 0;
16
+ c.destroy();
17
+ };
18
+ }, []);
19
+ useEffect(() => {
20
+ const component = componentRef.current;
21
+ component?.setConfig(props);
22
+ });
23
+ useContainerRenderOnUpdate();
24
+ useImperativeHandle(fRef, () => ({ get component() {
25
+ return componentRef.current;
26
+ } }), []);
27
+ return /* @__PURE__ */ React.createElement("vis-tooltip", { ref });
28
+ }
26
29
  const VisTooltip = React.memo(React.forwardRef(VisTooltipFC), arePropsEqual);
27
-
28
- export { VisTooltip, VisTooltipSelectors };
30
+ export {
31
+ VisTooltip,
32
+ VisTooltipSelectors
33
+ };
29
34
  //# sourceMappingURL=index.js.map
@@ -1 +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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Tooltip } from '@unovis/ts/components/tooltip'\nimport { TooltipConfigInterface } from '@unovis/ts/components/tooltip/config'\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 ref?: Ref<VisTooltipRef>;\n}\n\nexport const VisTooltipSelectors = Tooltip.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTooltipFC (props: VisTooltipProps, fRef: ForwardedRef<VisTooltipRef>): ReactElement {\n const ref = useRef<VisComponentElement<Tooltip>>(null)\n const componentRef = useRef<Tooltip | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Tooltip>)\n\n const c = new Tooltip(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-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":";;;;AAmBa,MAAA,mBAAmB,GAAG,OAAO,CAAC,UAAS;AAGpD,SAAS,YAAY,CAAE,KAAsB,EAAE,IAAiC,EAAA;AAC9E,IAAA,MAAM,GAAG,GAAG,MAAM,CAA+B,IAAI,CAAC,CAAA;AACtD,IAAA,MAAM,YAAY,GAAG,MAAM,CAAsB,SAAS,CAAC,CAAA;IAG3D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAwC,CAAA;AAE7D,QAAA,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;AAC5B,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QAEtC,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,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;;;;"}
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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Tooltip } from '@unovis/ts/components/tooltip'\nimport { TooltipConfigInterface } from '@unovis/ts/components/tooltip/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 VisTooltipRef = {\n component?: Tooltip;\n}\n\nexport type VisTooltipProps = TooltipConfigInterface & {\n ref?: Ref<VisTooltipRef>;\n}\n\nexport const VisTooltipSelectors = Tooltip.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTooltipFC (props: VisTooltipProps, fRef: ForwardedRef<VisTooltipRef>): ReactElement {\n const ref = useRef<VisComponentElement<Tooltip>>(null)\n const componentRef = useRef<Tooltip | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Tooltip>)\n\n const c = new Tooltip(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-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":";;;;AAoBO,MAAM,sBAAsB,QAAQ;AAG3C,SAAS,aAAc,OAAwB,MAAiD;AAC9F,QAAM,MAAM,OAAqC,IAAI;AACrD,QAAM,eAAe,OAA4B,MAAS;AAG1D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,QAAQ,KAAK;AAC3B,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAE/B,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,iBAAY,IAAA,CAAU;AAChC;AAIO,MAAM,aAA+D,MAAM,KAAK,MAAM,WAAW,YAAY,GAAG,aAAa;"}
@@ -1,16 +1,17 @@
1
- import { Ref } from 'react';
2
- import { TopoJSONMap } from '@unovis/ts/components/topojson-map';
3
- import { TopoJSONMapConfigInterface } from '@unovis/ts/components/topojson-map/config';
4
- export declare type VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum> = {
5
- component?: TopoJSONMap<AreaDatum, PointDatum, LinkDatum>;
6
- };
7
- export declare type VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum> = TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> & {
8
- data?: {
9
- areas?: AreaDatum[];
10
- points?: PointDatum[];
11
- links?: LinkDatum[];
12
- };
13
- ref?: Ref<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>;
14
- };
15
- export declare const VisTopoJSONMapSelectors: typeof import("@unovis/ts/components/topojson-map/style");
16
- export declare const VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { TopoJSONMap } from '@unovis/ts/components/topojson-map';
3
+ import { TopoJSONMapConfigInterface } from '@unovis/ts/components/topojson-map/config';
4
+
5
+ export type VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum> = {
6
+ component?: TopoJSONMap<AreaDatum, PointDatum, LinkDatum>;
7
+ };
8
+ export type VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum> = TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> & {
9
+ data?: {
10
+ areas?: AreaDatum[];
11
+ points?: PointDatum[];
12
+ links?: LinkDatum[];
13
+ };
14
+ ref?: Ref<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>;
15
+ };
16
+ export declare const VisTopoJSONMapSelectors: typeof import("@unovis/ts/components/topojson-map/style");
17
+ export declare const VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { TopoJSONMap } from '@unovis/ts/components/topojson-map';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisTopoJSONMapSelectors = TopoJSONMap.selectors;
6
- function VisTopoJSONMapFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new TopoJSONMap(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 { TopoJSONMap } from "@unovis/ts/components/topojson-map";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisTopoJSONMapSelectors = TopoJSONMap.selectors;
6
+ function VisTopoJSONMapFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new TopoJSONMap(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 VisTopoJSONMap = React.memo(React.forwardRef(VisTopoJSONMapFC), arePropsEqual);
29
-
30
- export { VisTopoJSONMap, VisTopoJSONMapSelectors };
31
+ export {
32
+ VisTopoJSONMap,
33
+ VisTopoJSONMapSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { TopoJSONMap } from '@unovis/ts/components/topojson-map'\nimport { TopoJSONMapConfigInterface } from '@unovis/ts/components/topojson-map/config'\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\nexport const VisTopoJSONMapSelectors = TopoJSONMap.selectors\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>>): ReactElement {\n const ref = useRef<VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>>(null)\n const componentRef = useRef<TopoJSONMap<AreaDatum, PointDatum, LinkDatum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>)\n\n const c = new TopoJSONMap<AreaDatum, PointDatum, LinkDatum>(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 VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTopoJSONMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBa,MAAA,uBAAuB,GAAG,WAAW,CAAC,UAAS;AAG5D,SAAS,gBAAgB,CAAoC,KAA4D,EAAE,IAAuE,EAAA;AAChM,IAAA,MAAM,GAAG,GAAG,MAAM,CAAqE,IAAI,CAAC,CAAA;AAC5F,IAAA,MAAM,YAAY,GAAG,MAAM,CAA4D,SAAS,CAAC,CAAA;IAGjG,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA8E,CAAA;AAEnG,QAAA,MAAM,CAAC,GAAG,IAAI,WAAW,CAAmC,KAAK,CAAC,CAAA;AAClE,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,cAAc,GAA6H,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,aAAa;;;;"}
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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { TopoJSONMap } from '@unovis/ts/components/topojson-map'\nimport { TopoJSONMapConfigInterface } from '@unovis/ts/components/topojson-map/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 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\nexport const VisTopoJSONMapSelectors = TopoJSONMap.selectors\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>>): ReactElement {\n const ref = useRef<VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>>(null)\n const componentRef = useRef<TopoJSONMap<AreaDatum, PointDatum, LinkDatum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>)\n\n const c = new TopoJSONMap<AreaDatum, PointDatum, LinkDatum>(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 VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTopoJSONMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,0BAA0B,YAAY;AAGnD,SAAS,iBAAoD,OAA8D,MAAuF;AAChN,QAAM,MAAM,OAA2E,IAAI;AAC3F,QAAM,eAAe,OAAkE,MAAS;AAGhG,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,YAA8C,KAAK;AACjE,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,iBAA2I,MAAM,KAAK,MAAM,WAAW,gBAAgB,GAAG,aAAa;"}
@@ -1,12 +1,13 @@
1
- import { Ref } from 'react';
2
- import { Treemap } from '@unovis/ts/components/treemap';
3
- import { TreemapConfigInterface } from '@unovis/ts/components/treemap/config';
4
- export declare type VisTreemapRef<Datum> = {
5
- component?: Treemap<Datum>;
6
- };
7
- export declare type VisTreemapProps<Datum> = TreemapConfigInterface<Datum> & {
8
- data?: Datum[];
9
- ref?: Ref<VisTreemapRef<Datum>>;
10
- };
11
- export declare const VisTreemapSelectors: typeof import("@unovis/ts/components/treemap/style");
12
- export declare const VisTreemap: (<Datum>(props: VisTreemapProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { Treemap } from '@unovis/ts/components/treemap';
3
+ import { TreemapConfigInterface } from '@unovis/ts/components/treemap/config';
4
+
5
+ export type VisTreemapRef<Datum> = {
6
+ component?: Treemap<Datum>;
7
+ };
8
+ export type VisTreemapProps<Datum> = TreemapConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisTreemapRef<Datum>>;
11
+ };
12
+ export declare const VisTreemapSelectors: typeof import("@unovis/ts/components/treemap/style");
13
+ export declare const VisTreemap: (<Datum>(props: VisTreemapProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { Treemap } from '@unovis/ts/components/treemap';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisTreemapSelectors = Treemap.selectors;
6
- function VisTreemapFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new Treemap(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 { Treemap } from "@unovis/ts/components/treemap";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisTreemapSelectors = Treemap.selectors;
6
+ function VisTreemapFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new Treemap(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 VisTreemap = React.memo(React.forwardRef(VisTreemapFC), arePropsEqual);
29
-
30
- export { VisTreemap, VisTreemapSelectors };
31
+ export {
32
+ VisTreemap,
33
+ VisTreemapSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/treemap/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 { Treemap } from '@unovis/ts/components/treemap'\nimport { TreemapConfigInterface } from '@unovis/ts/components/treemap/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTreemapRef<Datum> = {\n component?: Treemap<Datum>;\n}\n\nexport type VisTreemapProps<Datum> = TreemapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisTreemapRef<Datum>>;\n}\n\nexport const VisTreemapSelectors = Treemap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTreemapFC<Datum> (props: VisTreemapProps<Datum>, fRef: ForwardedRef<VisTreemapRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Treemap<Datum>>>(null)\n const componentRef = useRef<Treemap<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Treemap<Datum>>)\n\n const c = new Treemap<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 VisTreemap: (<Datum>(props: VisTreemapProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTreemapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBa,MAAA,mBAAmB,GAAG,OAAO,CAAC,UAAS;AAGpD,SAAS,YAAY,CAAS,KAA6B,EAAE,IAAwC,EAAA;AACnG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAsC,IAAI,CAAC,CAAA;AAC7D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA6B,SAAS,CAAC,CAAA;IAGlE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA+C,CAAA;AAEpE,QAAA,MAAM,CAAC,GAAG,IAAI,OAAO,CAAQ,KAAK,CAAC,CAAA;AACnC,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,UAAU,GAAmE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/treemap/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 { Treemap } from '@unovis/ts/components/treemap'\nimport { TreemapConfigInterface } from '@unovis/ts/components/treemap/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 VisTreemapRef<Datum> = {\n component?: Treemap<Datum>;\n}\n\nexport type VisTreemapProps<Datum> = TreemapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisTreemapRef<Datum>>;\n}\n\nexport const VisTreemapSelectors = Treemap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTreemapFC<Datum> (props: VisTreemapProps<Datum>, fRef: ForwardedRef<VisTreemapRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Treemap<Datum>>>(null)\n const componentRef = useRef<Treemap<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Treemap<Datum>>)\n\n const c = new Treemap<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 VisTreemap: (<Datum>(props: VisTreemapProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTreemapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,sBAAsB,QAAQ;AAG3C,SAAS,aAAqB,OAA+B,MAAwD;AACnH,QAAM,MAAM,OAA4C,IAAI;AAC5D,QAAM,eAAe,OAAmC,MAAS;AAGjE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,QAAe,KAAK;AAClC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,aAA6E,MAAM,KAAK,MAAM,WAAW,YAAY,GAAG,aAAa;"}
@@ -1,12 +1,13 @@
1
- import { Ref } from 'react';
2
- import { XYLabels } from '@unovis/ts/components/xy-labels';
3
- import { XYLabelsConfigInterface } from '@unovis/ts/components/xy-labels/config';
4
- export declare type VisXYLabelsRef<Datum> = {
5
- component?: XYLabels<Datum>;
6
- };
7
- export declare type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {
8
- data?: Datum[];
9
- ref?: Ref<VisXYLabelsRef<Datum>>;
10
- };
11
- export declare const VisXYLabelsSelectors: typeof import("@unovis/ts/components/xy-labels/style");
12
- export declare const VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null);
1
+ import { Ref } from 'react';
2
+ import { XYLabels } from '@unovis/ts/components/xy-labels';
3
+ import { XYLabelsConfigInterface } from '@unovis/ts/components/xy-labels/config';
4
+
5
+ export type VisXYLabelsRef<Datum> = {
6
+ component?: XYLabels<Datum>;
7
+ };
8
+ export type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {
9
+ data?: Datum[];
10
+ ref?: Ref<VisXYLabelsRef<Datum>>;
11
+ };
12
+ export declare const VisXYLabelsSelectors: typeof import("@unovis/ts/components/xy-labels/style");
13
+ export declare const VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null);
@@ -1,31 +1,35 @@
1
- import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
- import { XYLabels } from '@unovis/ts/components/xy-labels';
3
- import { arePropsEqual } from '../../utils/react.js';
4
-
5
- const VisXYLabelsSelectors = XYLabels.selectors;
6
- function VisXYLabelsFC(props, fRef) {
7
- const ref = useRef(null);
8
- const componentRef = useRef(undefined);
9
- useEffect(() => {
10
- const element = ref.current;
11
- const c = new XYLabels(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 { XYLabels } from "@unovis/ts/components/xy-labels";
3
+ import { arePropsEqual } from "../../utils/react.js";
4
+ import { useContainerRenderOnUpdate } from "../../utils/container.js";
5
+ const VisXYLabelsSelectors = XYLabels.selectors;
6
+ function VisXYLabelsFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const componentRef = useRef(void 0);
9
+ useEffect(() => {
10
+ const element = ref.current;
11
+ const c = new XYLabels(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 VisXYLabels = React.memo(React.forwardRef(VisXYLabelsFC), arePropsEqual);
29
-
30
- export { VisXYLabels, VisXYLabelsSelectors };
31
+ export {
32
+ VisXYLabels,
33
+ VisXYLabelsSelectors
34
+ };
31
35
  //# sourceMappingURL=index.js.map
@@ -1 +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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { XYLabels } from '@unovis/ts/components/xy-labels'\nimport { XYLabelsConfigInterface } from '@unovis/ts/components/xy-labels/config'\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\nexport const VisXYLabelsSelectors = XYLabels.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisXYLabelsFC<Datum> (props: VisXYLabelsProps<Datum>, fRef: ForwardedRef<VisXYLabelsRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<XYLabels<Datum>>>(null)\n const componentRef = useRef<XYLabels<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<XYLabels<Datum>>)\n\n const c = new XYLabels<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 VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisXYLabelsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBa,MAAA,oBAAoB,GAAG,QAAQ,CAAC,UAAS;AAGtD,SAAS,aAAa,CAAS,KAA8B,EAAE,IAAyC,EAAA;AACtG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAA;AAC9D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA8B,SAAS,CAAC,CAAA;IAGnE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAgD,CAAA;AAErE,QAAA,MAAM,CAAC,GAAG,IAAI,QAAQ,CAAQ,KAAK,CAAC,CAAA;AACpC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;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,WAAW,GAAoE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,aAAa;;;;"}
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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { XYLabels } from '@unovis/ts/components/xy-labels'\nimport { XYLabelsConfigInterface } from '@unovis/ts/components/xy-labels/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 VisXYLabelsRef<Datum> = {\n component?: XYLabels<Datum>;\n}\n\nexport type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisXYLabelsRef<Datum>>;\n}\n\nexport const VisXYLabelsSelectors = XYLabels.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisXYLabelsFC<Datum> (props: VisXYLabelsProps<Datum>, fRef: ForwardedRef<VisXYLabelsRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<XYLabels<Datum>>>(null)\n const componentRef = useRef<XYLabels<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<XYLabels<Datum>>)\n\n const c = new XYLabels<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 VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisXYLabelsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,uBAAuB,SAAS;AAG7C,SAAS,cAAsB,OAAgC,MAAyD;AACtH,QAAM,MAAM,OAA6C,IAAI;AAC7D,QAAM,eAAe,OAAoC,MAAS;AAGlE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,SAAgB,KAAK;AACnC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;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,cAA+E,MAAM,KAAK,MAAM,WAAW,aAAa,GAAG,aAAa;"}
package/components.d.ts CHANGED
@@ -1,27 +1,30 @@
1
- export * from './components/line';
2
- export * from './components/area';
3
- export * from './components/axis';
4
- export * from './components/brush/';
5
- export * from './components/chord-diagram';
6
- export * from './components/crosshair';
7
- export * from './components/donut';
8
- export * from './components/free-brush';
9
- export * from './components/graph';
10
- export * from './components/grouped-bar/';
11
- export * from './components/nested-donut';
12
- export * from './components/scatter/';
13
- export * from './components/sankey';
14
- export * from './components/stacked-bar/';
15
- export * from './components/tooltip/';
16
- export * from './components/timeline/';
17
- export * from './components/topojson-map/';
18
- export * from './components/xy-labels';
19
- export * from './components/annotations';
20
- export * from './components/plotband';
21
- export * from './components/treemap';
22
- export * from './components/plotline';
23
- export * from './html-components/bullet-legend';
24
- export * from './html-components/rolling-pin-legend';
25
- export * from './html-components/leaflet-map';
26
- export * from './html-components/leaflet-flow-map';
27
- export * from './html-components/flow-legend';
1
+ export * from './components/line';
2
+ export * from './components/area';
3
+ export * from './components/axis';
4
+ export * from './components/boxplot';
5
+ export * from './components/brush/';
6
+ export * from './components/chord-diagram';
7
+ export * from './components/crosshair';
8
+ export * from './components/donut';
9
+ export * from './components/free-brush';
10
+ export * from './components/graph';
11
+ export * from './components/grouped-bar/';
12
+ export * from './components/heatmap';
13
+ export * from './components/nested-donut';
14
+ export * from './components/scatter/';
15
+ export * from './components/sankey';
16
+ export * from './components/stacked-bar/';
17
+ export * from './components/tooltip/';
18
+ export * from './components/timeline/';
19
+ export * from './components/topojson-map/';
20
+ export * from './components/xy-labels';
21
+ export * from './components/annotations';
22
+ export * from './components/plotband';
23
+ export * from './components/treemap';
24
+ export * from './components/plotline';
25
+ export * from './components/radial-bar';
26
+ export * from './html-components/bullet-legend';
27
+ export * from './html-components/rolling-pin-legend';
28
+ export * from './html-components/leaflet-map';
29
+ export * from './html-components/leaflet-flow-map';
30
+ export * from './html-components/flow-legend';
@@ -1,54 +1,55 @@
1
- import { Spacing } from '@unovis/ts/types/spacing';
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 | null;
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[]) => null;
51
- formatYTicks: (d: number) => string;
52
- crosshairTemplate: (d: VisTimeSeriesDatum) => string;
53
- };
54
- }
1
+ import { Spacing } from '@unovis/ts/types/spacing';
2
+
3
+ export type VisTimeSeriesDatum = {
4
+ timestamp: number;
5
+ value: number;
6
+ id?: string;
7
+ color?: string;
8
+ };
9
+ export type VisTimeSeriesProps<Datum> = {
10
+ data: Datum[];
11
+ margin: Spacing;
12
+ autoMargin: boolean;
13
+ x: (d: Datum, i: number) => number;
14
+ y: (d: Datum, i: number) => number;
15
+ id: (d: Datum, i: number) => string;
16
+ color: (d: Datum[], i: number) => string | null;
17
+ cursor: string | ((d: Datum, i: number) => string);
18
+ formatXTicks?: (timestamp: number) => string;
19
+ formatYTicks?: (timestamp: number) => string;
20
+ selectionMinLength: number;
21
+ onBrushStart?: (selection: [number, number], e?: {
22
+ sourceEvent: MouseEvent;
23
+ }, userDriven?: boolean) => void;
24
+ onBrushMove?: (selection: [number, number], e?: {
25
+ sourceEvent: MouseEvent;
26
+ }, userDriven?: boolean) => void;
27
+ onBrushEnd?: (selection: [number, number], e?: {
28
+ sourceEvent: MouseEvent;
29
+ }, userDriven?: boolean) => void;
30
+ formatNavXTicks?: (timestamp: number) => string;
31
+ xLabel?: string;
32
+ yLabel?: string;
33
+ crosshairTemplate?: (d: Datum) => string | HTMLElement;
34
+ className?: string;
35
+ height?: string;
36
+ };
37
+ export declare function VisTimeSeries<Datum>(props: VisTimeSeriesProps<Datum>): JSX.Element;
38
+ export declare namespace VisTimeSeries {
39
+ var defaultProps: {
40
+ margin: {
41
+ top: number;
42
+ bottom: number;
43
+ left: number;
44
+ right: number;
45
+ };
46
+ autoMargin: boolean;
47
+ padding: {};
48
+ x: (d: VisTimeSeriesDatum) => number;
49
+ y: (d: VisTimeSeriesDatum) => number;
50
+ id: (d: VisTimeSeriesDatum) => string | undefined;
51
+ color: (d: VisTimeSeriesDatum[]) => null;
52
+ formatYTicks: (d: number) => string;
53
+ crosshairTemplate: (d: VisTimeSeriesDatum) => string;
54
+ };
55
+ }