@unovis/react 1.7.1 → 1.8.0-vpd-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 (73) hide show
  1. package/components/annotations/index.js +3 -2
  2. package/components/annotations/index.js.map +1 -1
  3. package/components/area/index.js +4 -3
  4. package/components/area/index.js.map +1 -1
  5. package/components/axis/index.js +4 -3
  6. package/components/axis/index.js.map +1 -1
  7. package/components/boxplot/index.js +4 -3
  8. package/components/boxplot/index.js.map +1 -1
  9. package/components/brush/index.js +4 -3
  10. package/components/brush/index.js.map +1 -1
  11. package/components/chord-diagram/index.js +4 -3
  12. package/components/chord-diagram/index.js.map +1 -1
  13. package/components/circular-bar/index.d.ts +13 -0
  14. package/components/circular-bar/index.js +36 -0
  15. package/components/circular-bar/index.js.map +1 -0
  16. package/components/crosshair/index.js +4 -3
  17. package/components/crosshair/index.js.map +1 -1
  18. package/components/donut/index.js +4 -3
  19. package/components/donut/index.js.map +1 -1
  20. package/components/free-brush/index.js +4 -3
  21. package/components/free-brush/index.js.map +1 -1
  22. package/components/graph/index.js +4 -3
  23. package/components/graph/index.js.map +1 -1
  24. package/components/grouped-bar/index.js +4 -3
  25. package/components/grouped-bar/index.js.map +1 -1
  26. package/components/heatmap/index.js +4 -3
  27. package/components/heatmap/index.js.map +1 -1
  28. package/components/line/index.js +4 -3
  29. package/components/line/index.js.map +1 -1
  30. package/components/nested-donut/index.js +4 -3
  31. package/components/nested-donut/index.js.map +1 -1
  32. package/components/plotband/index.js +3 -2
  33. package/components/plotband/index.js.map +1 -1
  34. package/components/plotline/index.js +3 -2
  35. package/components/plotline/index.js.map +1 -1
  36. package/components/radial-bar/index.js +4 -3
  37. package/components/radial-bar/index.js.map +1 -1
  38. package/components/sankey/index.js +4 -3
  39. package/components/sankey/index.js.map +1 -1
  40. package/components/scatter/index.js +4 -3
  41. package/components/scatter/index.js.map +1 -1
  42. package/components/stacked-bar/index.js +4 -3
  43. package/components/stacked-bar/index.js.map +1 -1
  44. package/components/timeline/index.js +4 -3
  45. package/components/timeline/index.js.map +1 -1
  46. package/components/tooltip/index.js +3 -2
  47. package/components/tooltip/index.js.map +1 -1
  48. package/components/topojson-map/index.js +4 -3
  49. package/components/topojson-map/index.js.map +1 -1
  50. package/components/treemap/index.js +4 -3
  51. package/components/treemap/index.js.map +1 -1
  52. package/components/xy-labels/index.js +4 -3
  53. package/components/xy-labels/index.js.map +1 -1
  54. package/components.d.ts +18 -17
  55. package/containers/single-container/index.js +12 -9
  56. package/containers/single-container/index.js.map +1 -1
  57. package/containers/xy-container/index.js +14 -11
  58. package/containers/xy-container/index.js.map +1 -1
  59. package/html-components/bullet-legend/index.js +3 -2
  60. package/html-components/bullet-legend/index.js.map +1 -1
  61. package/html-components/flow-legend/index.js +3 -2
  62. package/html-components/flow-legend/index.js.map +1 -1
  63. package/html-components/leaflet-flow-map/index.js +4 -3
  64. package/html-components/leaflet-flow-map/index.js.map +1 -1
  65. package/html-components/leaflet-map/index.js +4 -3
  66. package/html-components/leaflet-map/index.js.map +1 -1
  67. package/html-components/rolling-pin-legend/index.js +3 -2
  68. package/html-components/rolling-pin-legend/index.js.map +1 -1
  69. package/index.js +3 -0
  70. package/index.js.map +1 -1
  71. package/package.json +2 -3
  72. package/utils/react.js +14 -8
  73. package/utils/react.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/line/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Line } from '@unovis/ts/components/line'\nimport { LineConfigInterface } from '@unovis/ts/components/line/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisLineRef<Datum> = {\n component?: Line<Datum>;\n}\n\nexport type VisLineProps<Datum> = LineConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisLineRef<Datum>>;\n}\n\nexport const VisLineSelectors = Line.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLineFC<Datum> (props: VisLineProps<Datum>, fRef: ForwardedRef<VisLineRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Line<Datum>>>(null)\n const componentRef = useRef<Line<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Line<Datum>>)\n\n const c = new Line<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisLine: (<Datum>(props: VisLineProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLineFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,mBAAmB,KAAK;AAGrC,SAAS,UAAkB,OAA4B,MAAqD;AAC1G,QAAM,MAAM,OAAyC,IAAI;AACzD,QAAM,eAAe,OAAgC,MAAS;AAG9D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,KAAY,KAAK;AAC/B,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,UAAuE,MAAM,KAAK,MAAM,WAAW,SAAS,GAAG,aAAa;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/line/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Line } from '@unovis/ts/components/line'\nimport { LineConfigInterface } from '@unovis/ts/components/line/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisLineRef<Datum> = {\n component?: Line<Datum>;\n}\n\nexport type VisLineProps<Datum> = LineConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisLineRef<Datum>>;\n}\n\nexport const VisLineSelectors = Line.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLineFC<Datum> (props: VisLineProps<Datum>, fRef: ForwardedRef<VisLineRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Line<Datum>>>(null)\n const componentRef = useRef<Line<Datum> | undefined>(undefined)\n // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Line<Datum>>)\n\n const c = new Line<Datum>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisLine: (<Datum>(props: VisLineProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLineFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,mBAAmB,KAAK;AAGrC,SAAS,UAAkB,OAA4B,MAAqD;AAC1G,QAAM,MAAM,OAAyC,IAAI;AACzD,QAAM,eAAe,OAAgC,MAAS;AAE9D,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,KAAY,MAAM;AAChC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,UAAuE,MAAM,KAAK,MAAM,WAAW,SAAS,GAAG,aAAa;"}
@@ -6,9 +6,10 @@ const VisNestedDonutSelectors = NestedDonut.selectors;
6
6
  function VisNestedDonutFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const { data, ...config } = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new NestedDonut(props);
12
+ const c = new NestedDonut(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,8 +19,8 @@ function VisNestedDonutFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- if (props.data) component?.setData(props.data);
22
- component?.setConfig(props);
22
+ if (data !== void 0) component?.setData(data);
23
+ component?.setConfig(config);
23
24
  });
24
25
  useContainerRenderOnUpdate();
25
26
  useImperativeHandle(fRef, () => ({ get component() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/nested-donut/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { NestedDonut } from '@unovis/ts/components/nested-donut'\nimport { NestedDonutConfigInterface } from '@unovis/ts/components/nested-donut/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisNestedDonutRef<Datum> = {\n component?: NestedDonut<Datum>;\n}\n\nexport type VisNestedDonutProps<Datum> = NestedDonutConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisNestedDonutRef<Datum>>;\n}\n\nexport const VisNestedDonutSelectors = NestedDonut.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisNestedDonutFC<Datum> (props: VisNestedDonutProps<Datum>, fRef: ForwardedRef<VisNestedDonutRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<NestedDonut<Datum>>>(null)\n const componentRef = useRef<NestedDonut<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<NestedDonut<Datum>>)\n\n const c = new NestedDonut<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisNestedDonut: (<Datum>(props: VisNestedDonutProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisNestedDonutFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,0BAA0B,YAAY;AAGnD,SAAS,iBAAyB,OAAmC,MAA4D;AAC/H,QAAM,MAAM,OAAgD,IAAI;AAChE,QAAM,eAAe,OAAuC,MAAS;AAGrE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,YAAmB,KAAK;AACtC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,iBAAqF,MAAM,KAAK,MAAM,WAAW,gBAAgB,GAAG,aAAa;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/nested-donut/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { NestedDonut } from '@unovis/ts/components/nested-donut'\nimport { NestedDonutConfigInterface } from '@unovis/ts/components/nested-donut/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisNestedDonutRef<Datum> = {\n component?: NestedDonut<Datum>;\n}\n\nexport type VisNestedDonutProps<Datum> = NestedDonutConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisNestedDonutRef<Datum>>;\n}\n\nexport const VisNestedDonutSelectors = NestedDonut.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisNestedDonutFC<Datum> (props: VisNestedDonutProps<Datum>, fRef: ForwardedRef<VisNestedDonutRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<NestedDonut<Datum>>>(null)\n const componentRef = useRef<NestedDonut<Datum> | undefined>(undefined)\n // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<NestedDonut<Datum>>)\n\n const c = new NestedDonut<Datum>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisNestedDonut: (<Datum>(props: VisNestedDonutProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisNestedDonutFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,0BAA0B,YAAY;AAGnD,SAAS,iBAAyB,OAAmC,MAA4D;AAC/H,QAAM,MAAM,OAAgD,IAAI;AAChE,QAAM,eAAe,OAAuC,MAAS;AAErE,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,YAAmB,MAAM;AACvC,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,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,iBAAqF,MAAM,KAAK,MAAM,WAAW,gBAAgB,GAAG,aAAa;"}
@@ -6,9 +6,10 @@ const VisPlotbandSelectors = Plotband.selectors;
6
6
  function VisPlotbandFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const config = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new Plotband(props);
12
+ const c = new Plotband(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,7 +19,7 @@ function VisPlotbandFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- component?.setConfig(props);
22
+ component?.setConfig(config);
22
23
  });
23
24
  useContainerRenderOnUpdate();
24
25
  useImperativeHandle(fRef, () => ({ get component() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/plotband/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Plotband } from '@unovis/ts/components/plotband'\nimport { PlotbandConfigInterface } from '@unovis/ts/components/plotband/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisPlotbandRef<Datum> = {\n component?: Plotband<Datum>;\n}\n\nexport type VisPlotbandProps<Datum> = PlotbandConfigInterface<Datum> & {\n ref?: Ref<VisPlotbandRef<Datum>>;\n}\n\nexport const VisPlotbandSelectors = Plotband.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisPlotbandFC<Datum> (props: VisPlotbandProps<Datum>, fRef: ForwardedRef<VisPlotbandRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Plotband<Datum>>>(null)\n const componentRef = useRef<Plotband<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Plotband<Datum>>)\n\n const c = new Plotband<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisPlotband: (<Datum>(props: VisPlotbandProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisPlotbandFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBO,MAAM,uBAAuB,SAAS;AAG7C,SAAS,cAAsB,OAAgC,MAAyD;AACtH,QAAM,MAAM,OAA6C,IAAI;AAC7D,QAAM,eAAe,OAAoC,MAAS;AAGlE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,SAAgB,KAAK;AACnC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAE/B,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,cAA+E,MAAM,KAAK,MAAM,WAAW,aAAa,GAAG,aAAa;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/plotband/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Plotband } from '@unovis/ts/components/plotband'\nimport { PlotbandConfigInterface } from '@unovis/ts/components/plotband/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisPlotbandRef<Datum> = {\n component?: Plotband<Datum>;\n}\n\nexport type VisPlotbandProps<Datum> = PlotbandConfigInterface<Datum> & {\n ref?: Ref<VisPlotbandRef<Datum>>;\n}\n\nexport const VisPlotbandSelectors = Plotband.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisPlotbandFC<Datum> (props: VisPlotbandProps<Datum>, fRef: ForwardedRef<VisPlotbandRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Plotband<Datum>>>(null)\n const componentRef = useRef<Plotband<Datum> | undefined>(undefined)\n const config = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Plotband<Datum>>)\n\n const c = new Plotband<Datum>(config)\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(config)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisPlotband: (<Datum>(props: VisPlotbandProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisPlotbandFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBO,MAAM,uBAAuB,SAAS;AAG7C,SAAS,cAAsB,OAAgC,MAAyD;AACtH,QAAM,MAAM,OAA6C,IAAI;AAC7D,QAAM,eAAe,OAAoC,MAAS;AAClE,QAAM,SAAS;AAGf,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,SAAgB,MAAM;AACpC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAE/B,eAAW,UAAU,MAAM;AAAA,EAC7B,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;"}
@@ -6,9 +6,10 @@ const VisPlotlineSelectors = Plotline.selectors;
6
6
  function VisPlotlineFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const config = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new Plotline(props);
12
+ const c = new Plotline(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,7 +19,7 @@ function VisPlotlineFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- component?.setConfig(props);
22
+ component?.setConfig(config);
22
23
  });
23
24
  useContainerRenderOnUpdate();
24
25
  useImperativeHandle(fRef, () => ({ get component() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/plotline/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 { Plotline } from '@unovis/ts/components/plotline'\nimport { PlotlineConfigInterface } from '@unovis/ts/components/plotline/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 VisPlotlineRef<Datum> = {\n component?: Plotline<Datum>;\n}\n\nexport type VisPlotlineProps<Datum> = PlotlineConfigInterface<Datum> & {\n ref?: Ref<VisPlotlineRef<Datum>>;\n}\n\nexport const VisPlotlineSelectors = Plotline.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisPlotlineFC<Datum> (props: VisPlotlineProps<Datum>, fRef: ForwardedRef<VisPlotlineRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Plotline<Datum>>>(null)\n const componentRef = useRef<Plotline<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Plotline<Datum>>)\n\n const c = new Plotline<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisPlotline: (<Datum>(props: VisPlotlineProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisPlotlineFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBO,MAAM,uBAAuB,SAAS;AAG7C,SAAS,cAAsB,OAAgC,MAAyD;AACtH,QAAM,MAAM,OAA6C,IAAI;AAC7D,QAAM,eAAe,OAAoC,MAAS;AAGlE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,SAAgB,KAAK;AACnC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAE/B,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,cAA+E,MAAM,KAAK,MAAM,WAAW,aAAa,GAAG,aAAa;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/plotline/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Plotline } from '@unovis/ts/components/plotline'\nimport { PlotlineConfigInterface } from '@unovis/ts/components/plotline/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 VisPlotlineRef<Datum> = {\n component?: Plotline<Datum>;\n}\n\nexport type VisPlotlineProps<Datum> = PlotlineConfigInterface<Datum> & {\n ref?: Ref<VisPlotlineRef<Datum>>;\n}\n\nexport const VisPlotlineSelectors = Plotline.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisPlotlineFC<Datum> (props: VisPlotlineProps<Datum>, fRef: ForwardedRef<VisPlotlineRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Plotline<Datum>>>(null)\n const componentRef = useRef<Plotline<Datum> | undefined>(undefined)\n const config = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Plotline<Datum>>)\n\n const c = new Plotline<Datum>(config)\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(config)\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 VisPlotline: (<Datum>(props: VisPlotlineProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisPlotlineFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBO,MAAM,uBAAuB,SAAS;AAG7C,SAAS,cAAsB,OAAgC,MAAyD;AACtH,QAAM,MAAM,OAA6C,IAAI;AAC7D,QAAM,eAAe,OAAoC,MAAS;AAClE,QAAM,SAAS;AAGf,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,SAAgB,MAAM;AACpC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAE/B,eAAW,UAAU,MAAM;AAAA,EAC7B,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;"}
@@ -6,9 +6,10 @@ const VisRadialBarSelectors = RadialBar.selectors;
6
6
  function VisRadialBarFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const { data, ...config } = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new RadialBar(props);
12
+ const c = new RadialBar(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,8 +19,8 @@ function VisRadialBarFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- if (props.data) component?.setData(props.data);
22
- component?.setConfig(props);
22
+ if (data !== void 0) component?.setData(data);
23
+ component?.setConfig(config);
23
24
  });
24
25
  useContainerRenderOnUpdate();
25
26
  useImperativeHandle(fRef, () => ({ get component() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/radial-bar/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { RadialBar } from '@unovis/ts/components/radial-bar'\nimport { RadialBarConfigInterface } from '@unovis/ts/components/radial-bar/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisRadialBarRef<Datum> = {\n component?: RadialBar<Datum>;\n}\n\nexport type VisRadialBarProps<Datum> = RadialBarConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisRadialBarRef<Datum>>;\n}\n\nexport const VisRadialBarSelectors = RadialBar.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisRadialBarFC<Datum> (props: VisRadialBarProps<Datum>, fRef: ForwardedRef<VisRadialBarRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<RadialBar<Datum>>>(null)\n const componentRef = useRef<RadialBar<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<RadialBar<Datum>>)\n\n const c = new RadialBar<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 VisRadialBar: (<Datum>(props: VisRadialBarProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisRadialBarFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,wBAAwB,UAAU;AAG/C,SAAS,eAAuB,OAAiC,MAA0D;AACzH,QAAM,MAAM,OAA8C,IAAI;AAC9D,QAAM,eAAe,OAAqC,MAAS;AAGnE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,UAAiB,KAAK;AACpC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,eAAiF,MAAM,KAAK,MAAM,WAAW,cAAc,GAAG,aAAa;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/radial-bar/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { RadialBar } from '@unovis/ts/components/radial-bar'\nimport { RadialBarConfigInterface } from '@unovis/ts/components/radial-bar/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisRadialBarRef<Datum> = {\n component?: RadialBar<Datum>;\n}\n\nexport type VisRadialBarProps<Datum> = RadialBarConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisRadialBarRef<Datum>>;\n}\n\nexport const VisRadialBarSelectors = RadialBar.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisRadialBarFC<Datum> (props: VisRadialBarProps<Datum>, fRef: ForwardedRef<VisRadialBarRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<RadialBar<Datum>>>(null)\n const componentRef = useRef<RadialBar<Datum> | undefined>(undefined)\n // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<RadialBar<Datum>>)\n\n const c = new RadialBar<Datum>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\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 VisRadialBar: (<Datum>(props: VisRadialBarProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisRadialBarFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,wBAAwB,UAAU;AAG/C,SAAS,eAAuB,OAAiC,MAA0D;AACzH,QAAM,MAAM,OAA8C,IAAI;AAC9D,QAAM,eAAe,OAAqC,MAAS;AAEnE,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,UAAiB,MAAM;AACrC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,eAAiF,MAAM,KAAK,MAAM,WAAW,cAAc,GAAG,aAAa;"}
@@ -6,9 +6,10 @@ const VisSankeySelectors = Sankey.selectors;
6
6
  function VisSankeyFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const { data, ...config } = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new Sankey(props);
12
+ const c = new Sankey(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,8 +19,8 @@ function VisSankeyFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- if (props.data) component?.setData(props.data);
22
- component?.setConfig(props);
22
+ if (data !== void 0) component?.setData(data);
23
+ component?.setConfig(config);
23
24
  });
24
25
  useContainerRenderOnUpdate();
25
26
  useImperativeHandle(fRef, () => ({ get component() {
@@ -1 +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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Sankey } from '@unovis/ts/components/sankey'\nimport { SankeyConfigInterface } from '@unovis/ts/components/sankey/config'\nimport { SankeyInputNode, SankeyInputLink } from '@unovis/ts/components/sankey/types'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type 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?: { nodes: N[]; links?: L[] };\n ref?: Ref<VisSankeyRef<N, L>>;\n}\n\nexport const VisSankeySelectors = Sankey.selectors\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>>): ReactElement {\n const ref = useRef<VisComponentElement<Sankey<N, L>>>(null)\n const componentRef = useRef<Sankey<N, L> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Sankey<N, L>>)\n\n const c = new Sankey<N, L>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n // Ask the container to re-render when this component's config changes (see `useContainerRenderOnUpdate`)\n useContainerRenderOnUpdate()\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisSankey: (<N extends SankeyInputNode, L extends SankeyInputLink>(props: VisSankeyProps<N, L>) => JSX.Element | null) = React.memo(React.forwardRef(VisSankeyFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAsBO,MAAM,qBAAqB,OAAO;AAGzC,SAAS,YAAmE,OAA6B,MAAsD;AAC7J,QAAM,MAAM,OAA0C,IAAI;AAC1D,QAAM,eAAe,OAAiC,MAAS;AAG/D,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,OAAa,KAAK;AAChC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,YAAyH,MAAM,KAAK,MAAM,WAAW,WAAW,GAAG,aAAa;"}
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, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Sankey } from '@unovis/ts/components/sankey'\nimport { SankeyConfigInterface } from '@unovis/ts/components/sankey/config'\nimport { SankeyInputNode, SankeyInputLink } from '@unovis/ts/components/sankey/types'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type 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?: { nodes: N[]; links?: L[] };\n ref?: Ref<VisSankeyRef<N, L>>;\n}\n\nexport const VisSankeySelectors = Sankey.selectors\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>>): ReactElement {\n const ref = useRef<VisComponentElement<Sankey<N, L>>>(null)\n const componentRef = useRef<Sankey<N, L> | undefined>(undefined)\n // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Sankey<N, L>>)\n\n const c = new Sankey<N, L>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\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 VisSankey: (<N extends SankeyInputNode, L extends SankeyInputLink>(props: VisSankeyProps<N, L>) => JSX.Element | null) = React.memo(React.forwardRef(VisSankeyFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAsBO,MAAM,qBAAqB,OAAO;AAGzC,SAAS,YAAmE,OAA6B,MAAsD;AAC7J,QAAM,MAAM,OAA0C,IAAI;AAC1D,QAAM,eAAe,OAAiC,MAAS;AAE/D,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,OAAa,MAAM;AACjC,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,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,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,YAAyH,MAAM,KAAK,MAAM,WAAW,WAAW,GAAG,aAAa;"}
@@ -6,9 +6,10 @@ const VisScatterSelectors = Scatter.selectors;
6
6
  function VisScatterFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const { data, ...config } = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new Scatter(props);
12
+ const c = new Scatter(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,8 +19,8 @@ function VisScatterFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- if (props.data) component?.setData(props.data);
22
- component?.setConfig(props);
22
+ if (data !== void 0) component?.setData(data);
23
+ component?.setConfig(config);
23
24
  });
24
25
  useContainerRenderOnUpdate();
25
26
  useImperativeHandle(fRef, () => ({ get component() {
@@ -1 +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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Scatter } from '@unovis/ts/components/scatter'\nimport { ScatterConfigInterface } from '@unovis/ts/components/scatter/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 VisScatterRef<Datum> = {\n component?: Scatter<Datum>;\n}\n\nexport type VisScatterProps<Datum> = ScatterConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisScatterRef<Datum>>;\n}\n\nexport const VisScatterSelectors = Scatter.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisScatterFC<Datum> (props: VisScatterProps<Datum>, fRef: ForwardedRef<VisScatterRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Scatter<Datum>>>(null)\n const componentRef = useRef<Scatter<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Scatter<Datum>>)\n\n const c = new Scatter<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 VisScatter: (<Datum>(props: VisScatterProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisScatterFC), 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
+ {"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, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Scatter } from '@unovis/ts/components/scatter'\nimport { ScatterConfigInterface } from '@unovis/ts/components/scatter/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 VisScatterRef<Datum> = {\n component?: Scatter<Datum>;\n}\n\nexport type VisScatterProps<Datum> = ScatterConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisScatterRef<Datum>>;\n}\n\nexport const VisScatterSelectors = Scatter.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisScatterFC<Datum> (props: VisScatterProps<Datum>, fRef: ForwardedRef<VisScatterRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Scatter<Datum>>>(null)\n const componentRef = useRef<Scatter<Datum> | undefined>(undefined)\n // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Scatter<Datum>>)\n\n const c = new Scatter<Datum>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\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 VisScatter: (<Datum>(props: VisScatterProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisScatterFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,sBAAsB,QAAQ;AAG3C,SAAS,aAAqB,OAA+B,MAAwD;AACnH,QAAM,MAAM,OAA4C,IAAI;AAC5D,QAAM,eAAe,OAAmC,MAAS;AAEjE,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,QAAe,MAAM;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,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,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;"}
@@ -6,9 +6,10 @@ const VisStackedBarSelectors = StackedBar.selectors;
6
6
  function VisStackedBarFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const { data, ...config } = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new StackedBar(props);
12
+ const c = new StackedBar(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,8 +19,8 @@ function VisStackedBarFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- if (props.data) component?.setData(props.data);
22
- component?.setConfig(props);
22
+ if (data !== void 0) component?.setData(data);
23
+ component?.setConfig(config);
23
24
  });
24
25
  useContainerRenderOnUpdate();
25
26
  useImperativeHandle(fRef, () => ({ get component() {
@@ -1 +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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { StackedBar } from '@unovis/ts/components/stacked-bar'\nimport { StackedBarConfigInterface } from '@unovis/ts/components/stacked-bar/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisStackedBarRef<Datum> = {\n component?: StackedBar<Datum>;\n}\n\nexport type VisStackedBarProps<Datum> = StackedBarConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisStackedBarRef<Datum>>;\n}\n\nexport const VisStackedBarSelectors = StackedBar.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisStackedBarFC<Datum> (props: VisStackedBarProps<Datum>, fRef: ForwardedRef<VisStackedBarRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<StackedBar<Datum>>>(null)\n const componentRef = useRef<StackedBar<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<StackedBar<Datum>>)\n\n const c = new StackedBar<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 VisStackedBar: (<Datum>(props: VisStackedBarProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisStackedBarFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,yBAAyB,WAAW;AAGjD,SAAS,gBAAwB,OAAkC,MAA2D;AAC5H,QAAM,MAAM,OAA+C,IAAI;AAC/D,QAAM,eAAe,OAAsC,MAAS;AAGpE,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,WAAkB,KAAK;AACrC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,MAAM,KAAM,YAAW,QAAQ,MAAM,IAAI;AAC7C,eAAW,UAAU,KAAK;AAAA,EAC5B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,gBAAmF,MAAM,KAAK,MAAM,WAAW,eAAe,GAAG,aAAa;"}
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, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { StackedBar } from '@unovis/ts/components/stacked-bar'\nimport { StackedBarConfigInterface } from '@unovis/ts/components/stacked-bar/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisStackedBarRef<Datum> = {\n component?: StackedBar<Datum>;\n}\n\nexport type VisStackedBarProps<Datum> = StackedBarConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisStackedBarRef<Datum>>;\n}\n\nexport const VisStackedBarSelectors = StackedBar.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisStackedBarFC<Datum> (props: VisStackedBarProps<Datum>, fRef: ForwardedRef<VisStackedBarRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<StackedBar<Datum>>>(null)\n const componentRef = useRef<StackedBar<Datum> | undefined>(undefined)\n // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<StackedBar<Datum>>)\n\n const c = new StackedBar<Datum>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\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 VisStackedBar: (<Datum>(props: VisStackedBarProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisStackedBarFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,yBAAyB,WAAW;AAGjD,SAAS,gBAAwB,OAAkC,MAA2D;AAC5H,QAAM,MAAM,OAA+C,IAAI;AAC/D,QAAM,eAAe,OAAsC,MAAS;AAEpE,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,WAAkB,MAAM;AACtC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,CAAC;AAGD,6BAAA;AAEA,sBAAoB,MAAM,OAAO,EAAE,IAAI,YAAa;AAAE,WAAO,aAAa;AAAA,EAAQ,EAAA,IAAM,EAAE;AAC1F,SAAO,sBAAA,cAAC,mBAAc,IAAA,CAAU;AAClC;AAIO,MAAM,gBAAmF,MAAM,KAAK,MAAM,WAAW,eAAe,GAAG,aAAa;"}
@@ -6,9 +6,10 @@ const VisTimelineSelectors = Timeline.selectors;
6
6
  function VisTimelineFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const { data, ...config } = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new Timeline(props);
12
+ const c = new Timeline(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,8 +19,8 @@ function VisTimelineFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- if (props.data) component?.setData(props.data);
22
- component?.setConfig(props);
22
+ if (data !== void 0) component?.setData(data);
23
+ component?.setConfig(config);
23
24
  });
24
25
  useContainerRenderOnUpdate();
25
26
  useImperativeHandle(fRef, () => ({ get component() {
@@ -1 +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, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Timeline } from '@unovis/ts/components/timeline'\nimport { TimelineConfigInterface } from '@unovis/ts/components/timeline/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 VisTimelineRef<Datum> = {\n component?: Timeline<Datum>;\n}\n\nexport type VisTimelineProps<Datum> = TimelineConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisTimelineRef<Datum>>;\n}\n\nexport const VisTimelineSelectors = Timeline.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTimelineFC<Datum> (props: VisTimelineProps<Datum>, fRef: ForwardedRef<VisTimelineRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Timeline<Datum>>>(null)\n const componentRef = useRef<Timeline<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Timeline<Datum>>)\n\n const c = new Timeline<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 VisTimeline: (<Datum>(props: VisTimelineProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTimelineFC), 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;"}
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, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Timeline } from '@unovis/ts/components/timeline'\nimport { TimelineConfigInterface } from '@unovis/ts/components/timeline/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 VisTimelineRef<Datum> = {\n component?: Timeline<Datum>;\n}\n\nexport type VisTimelineProps<Datum> = TimelineConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisTimelineRef<Datum>>;\n}\n\nexport const VisTimelineSelectors = Timeline.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTimelineFC<Datum> (props: VisTimelineProps<Datum>, fRef: ForwardedRef<VisTimelineRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Timeline<Datum>>>(null)\n const componentRef = useRef<Timeline<Datum> | undefined>(undefined)\n // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Timeline<Datum>>)\n\n const c = new Timeline<Datum>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\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 VisTimeline: (<Datum>(props: VisTimelineProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTimelineFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,uBAAuB,SAAS;AAG7C,SAAS,cAAsB,OAAgC,MAAyD;AACtH,QAAM,MAAM,OAA6C,IAAI;AAC7D,QAAM,eAAe,OAAoC,MAAS;AAElE,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,SAAgB,MAAM;AACpC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,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;"}
@@ -6,9 +6,10 @@ const VisTooltipSelectors = Tooltip.selectors;
6
6
  function VisTooltipFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const config = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new Tooltip(props);
12
+ const c = new Tooltip(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,7 +19,7 @@ function VisTooltipFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- component?.setConfig(props);
22
+ component?.setConfig(config);
22
23
  });
23
24
  useContainerRenderOnUpdate();
24
25
  useImperativeHandle(fRef, () => ({ get component() {
@@ -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'\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
+ {"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 } 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 const config = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Tooltip>)\n\n const c = new Tooltip(config)\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(config)\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;AAC1D,QAAM,SAAS;AAGf,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,QAAQ,MAAM;AAC5B,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,MAAM;AAAA,EAC7B,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;"}
@@ -6,9 +6,10 @@ const VisTopoJSONMapSelectors = TopoJSONMap.selectors;
6
6
  function VisTopoJSONMapFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const { data, ...config } = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new TopoJSONMap(props);
12
+ const c = new TopoJSONMap(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,8 +19,8 @@ function VisTopoJSONMapFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- if (props.data) component?.setData(props.data);
22
- component?.setConfig(props);
22
+ if (data !== void 0) component?.setData(data);
23
+ component?.setConfig(config);
23
24
  });
24
25
  useContainerRenderOnUpdate();
25
26
  useImperativeHandle(fRef, () => ({ get component() {
@@ -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'\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
+ {"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 } 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 // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\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>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\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;AAEhG,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,YAA8C,MAAM;AAClE,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,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,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;"}
@@ -6,9 +6,10 @@ const VisTreemapSelectors = Treemap.selectors;
6
6
  function VisTreemapFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const { data, ...config } = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new Treemap(props);
12
+ const c = new Treemap(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,8 +19,8 @@ function VisTreemapFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- if (props.data) component?.setData(props.data);
22
- component?.setConfig(props);
22
+ if (data !== void 0) component?.setData(data);
23
+ component?.setConfig(config);
23
24
  });
24
25
  useContainerRenderOnUpdate();
25
26
  useImperativeHandle(fRef, () => ({ get component() {
@@ -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'\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
+ {"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 } 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 // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Treemap<Datum>>)\n\n const c = new Treemap<Datum>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\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;AAEjE,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,QAAe,MAAM;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,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,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;"}
@@ -6,9 +6,10 @@ const VisXYLabelsSelectors = XYLabels.selectors;
6
6
  function VisXYLabelsFC(props, fRef) {
7
7
  const ref = useRef(null);
8
8
  const componentRef = useRef(void 0);
9
+ const { data, ...config } = props;
9
10
  useEffect(() => {
10
11
  const element = ref.current;
11
- const c = new XYLabels(props);
12
+ const c = new XYLabels(config);
12
13
  componentRef.current = c;
13
14
  element.__component__ = c;
14
15
  return () => {
@@ -18,8 +19,8 @@ function VisXYLabelsFC(props, fRef) {
18
19
  }, []);
19
20
  useEffect(() => {
20
21
  const component = componentRef.current;
21
- if (props.data) component?.setData(props.data);
22
- component?.setConfig(props);
22
+ if (data !== void 0) component?.setData(data);
23
+ component?.setConfig(config);
23
24
  });
24
25
  useContainerRenderOnUpdate();
25
26
  useImperativeHandle(fRef, () => ({ get component() {
@@ -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'\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;"}
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 } 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 // Separate the config properties from the props that should not be passed to the component\n const { data, ...config } = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<XYLabels<Datum>>)\n\n const c = new XYLabels<Datum>(config)\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 (data !== undefined) component?.setData(data)\n component?.setConfig(config)\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;AAElE,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,SAAgB,MAAM;AACpC,iBAAa,UAAU;AACvB,YAAQ,gBAAgB;AAExB,WAAO,MAAM;AACX,mBAAa,UAAU;AACvB,QAAE,QAAA;AAAA,IACJ;AAAA,EACF,GAAG,CAAA,CAAE;AAGL,YAAU,MAAM;AACd,UAAM,YAAY,aAAa;AAC/B,QAAI,SAAS,OAAW,YAAW,QAAQ,IAAI;AAC/C,eAAW,UAAU,MAAM;AAAA,EAC7B,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,30 +1,31 @@
1
- export * from './components/line';
2
1
  export * from './components/area';
3
2
  export * from './components/axis';
4
3
  export * from './components/boxplot';
5
- export * from './components/brush/';
6
- export * from './components/chord-diagram';
4
+ export * from './components/brush';
7
5
  export * from './components/crosshair';
8
- export * from './components/donut';
9
6
  export * from './components/free-brush';
7
+ export * from './components/grouped-bar';
8
+ export * from './components/line';
9
+ export * from './components/scatter';
10
+ export * from './components/stacked-bar';
11
+ export * from './components/timeline';
12
+ export * from './components/xy-labels';
13
+ export * from './components/plotband';
14
+ export * from './components/plotline';
15
+ export * from './components/chord-diagram';
16
+ export * from './components/donut';
10
17
  export * from './components/graph';
11
- export * from './components/grouped-bar/';
12
18
  export * from './components/heatmap';
13
19
  export * from './components/nested-donut';
14
- export * from './components/scatter/';
20
+ export * from './components/radial-bar';
21
+ export * from './components/circular-bar';
15
22
  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/topojson-map';
23
24
  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';
25
+ export * from './components/tooltip';
26
+ export * from './components/annotations';
28
27
  export * from './html-components/leaflet-map';
29
28
  export * from './html-components/leaflet-flow-map';
29
+ export * from './html-components/bullet-legend';
30
30
  export * from './html-components/flow-legend';
31
+ export * from './html-components/rolling-pin-legend';