@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.
- package/components/annotations/index.js +3 -2
- package/components/annotations/index.js.map +1 -1
- package/components/area/index.js +4 -3
- package/components/area/index.js.map +1 -1
- package/components/axis/index.js +4 -3
- package/components/axis/index.js.map +1 -1
- package/components/boxplot/index.js +4 -3
- package/components/boxplot/index.js.map +1 -1
- package/components/brush/index.js +4 -3
- package/components/brush/index.js.map +1 -1
- package/components/chord-diagram/index.js +4 -3
- package/components/chord-diagram/index.js.map +1 -1
- package/components/circular-bar/index.d.ts +13 -0
- package/components/circular-bar/index.js +36 -0
- package/components/circular-bar/index.js.map +1 -0
- package/components/crosshair/index.js +4 -3
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/index.js +4 -3
- package/components/donut/index.js.map +1 -1
- package/components/free-brush/index.js +4 -3
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/index.js +4 -3
- package/components/graph/index.js.map +1 -1
- package/components/grouped-bar/index.js +4 -3
- package/components/grouped-bar/index.js.map +1 -1
- package/components/heatmap/index.js +4 -3
- package/components/heatmap/index.js.map +1 -1
- package/components/line/index.js +4 -3
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/index.js +4 -3
- package/components/nested-donut/index.js.map +1 -1
- package/components/plotband/index.js +3 -2
- package/components/plotband/index.js.map +1 -1
- package/components/plotline/index.js +3 -2
- package/components/plotline/index.js.map +1 -1
- package/components/radial-bar/index.js +4 -3
- package/components/radial-bar/index.js.map +1 -1
- package/components/sankey/index.js +4 -3
- package/components/sankey/index.js.map +1 -1
- package/components/scatter/index.js +4 -3
- package/components/scatter/index.js.map +1 -1
- package/components/stacked-bar/index.js +4 -3
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/index.js +4 -3
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/index.js +3 -2
- package/components/tooltip/index.js.map +1 -1
- package/components/topojson-map/index.js +4 -3
- package/components/topojson-map/index.js.map +1 -1
- package/components/treemap/index.js +4 -3
- package/components/treemap/index.js.map +1 -1
- package/components/xy-labels/index.js +4 -3
- package/components/xy-labels/index.js.map +1 -1
- package/components.d.ts +18 -17
- package/containers/single-container/index.js +12 -9
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/index.js +14 -11
- package/containers/xy-container/index.js.map +1 -1
- package/html-components/bullet-legend/index.js +3 -2
- package/html-components/bullet-legend/index.js.map +1 -1
- package/html-components/flow-legend/index.js +3 -2
- package/html-components/flow-legend/index.js.map +1 -1
- package/html-components/leaflet-flow-map/index.js +4 -3
- package/html-components/leaflet-flow-map/index.js.map +1 -1
- package/html-components/leaflet-map/index.js +4 -3
- package/html-components/leaflet-map/index.js.map +1 -1
- package/html-components/rolling-pin-legend/index.js +3 -2
- package/html-components/rolling-pin-legend/index.js.map +1 -1
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/package.json +2 -3
- package/utils/react.js +14 -8
- package/utils/react.js.map +1 -1
|
@@ -6,9 +6,10 @@ const VisAnnotationsSelectors = Annotations.selectors;
|
|
|
6
6
|
function VisAnnotationsFC(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 Annotations(
|
|
12
|
+
const c = new Annotations(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,7 +19,7 @@ function VisAnnotationsFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
component?.setConfig(
|
|
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/annotations/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/annotations/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Annotations } from '@unovis/ts/components/annotations'\nimport { AnnotationsConfigInterface } from '@unovis/ts/components/annotations/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 VisAnnotationsRef = {\n component?: Annotations;\n}\n\nexport type VisAnnotationsProps = AnnotationsConfigInterface & {\n ref?: Ref<VisAnnotationsRef>;\n}\n\nexport const VisAnnotationsSelectors = Annotations.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAnnotationsFC (props: VisAnnotationsProps, fRef: ForwardedRef<VisAnnotationsRef>): ReactElement {\n const ref = useRef<VisComponentElement<Annotations>>(null)\n const componentRef = useRef<Annotations | undefined>(undefined)\n const config = props\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Annotations>)\n\n const c = new Annotations(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-annotations 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 VisAnnotations: ((props: VisAnnotationsProps) => JSX.Element | null) = React.memo(React.forwardRef(VisAnnotationsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBO,MAAM,0BAA0B,YAAY;AAGnD,SAAS,iBAAkB,OAA4B,MAAqD;AAC1G,QAAM,MAAM,OAAyC,IAAI;AACzD,QAAM,eAAe,OAAgC,MAAS;AAC9D,QAAM,SAAS;AAGf,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,YAAY,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;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,qBAAgB,IAAA,CAAU;AACpC;AAIO,MAAM,iBAAuE,MAAM,KAAK,MAAM,WAAW,gBAAgB,GAAG,aAAa;"}
|
package/components/area/index.js
CHANGED
|
@@ -6,9 +6,10 @@ const VisAreaSelectors = Area.selectors;
|
|
|
6
6
|
function VisAreaFC(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 Area(
|
|
12
|
+
const c = new Area(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisAreaFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/area/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/area/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Area } from '@unovis/ts/components/area'\nimport { AreaConfigInterface } from '@unovis/ts/components/area/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 VisAreaRef<Datum> = {\n component?: Area<Datum>;\n}\n\nexport type VisAreaProps<Datum> = AreaConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisAreaRef<Datum>>;\n}\n\nexport const VisAreaSelectors = Area.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAreaFC<Datum> (props: VisAreaProps<Datum>, fRef: ForwardedRef<VisAreaRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Area<Datum>>>(null)\n const componentRef = useRef<Area<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<Area<Datum>>)\n\n const c = new Area<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 VisArea: (<Datum>(props: VisAreaProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisAreaFC), 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;"}
|
package/components/axis/index.js
CHANGED
|
@@ -6,9 +6,10 @@ const VisAxisSelectors = Axis.selectors;
|
|
|
6
6
|
function VisAxisFC(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 Axis(
|
|
12
|
+
const c = new Axis(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisAxisFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/axis/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/axis/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Axis } from '@unovis/ts/components/axis'\nimport { AxisConfigInterface } from '@unovis/ts/components/axis/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 VisAxisRef<Datum> = {\n component?: Axis<Datum>;\n}\n\nexport type VisAxisProps<Datum> = AxisConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisAxisRef<Datum>>;\n}\n\nexport const VisAxisSelectors = Axis.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAxisFC<Datum> (props: VisAxisProps<Datum>, fRef: ForwardedRef<VisAxisRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Axis<Datum>>>(null)\n const componentRef = useRef<Axis<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<Axis<Datum>>)\n\n const c = new Axis<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-axis 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 VisAxis: (<Datum>(props: VisAxisProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisAxisFC), 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,cAAS,IAAA,CAAU;AAC7B;AAIO,MAAM,UAAuE,MAAM,KAAK,MAAM,WAAW,SAAS,GAAG,aAAa;"}
|
|
@@ -6,9 +6,10 @@ const VisBoxplotSelectors = Boxplot.selectors;
|
|
|
6
6
|
function VisBoxplotFC(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 Boxplot(
|
|
12
|
+
const c = new Boxplot(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisBoxplotFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/boxplot/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/boxplot/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Boxplot } from '@unovis/ts/components/boxplot'\nimport { BoxplotConfigInterface } from '@unovis/ts/components/boxplot/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 VisBoxplotRef<Datum> = {\n component?: Boxplot<Datum>;\n}\n\nexport type VisBoxplotProps<Datum> = BoxplotConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisBoxplotRef<Datum>>;\n}\n\nexport const VisBoxplotSelectors = Boxplot.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisBoxplotFC<Datum> (props: VisBoxplotProps<Datum>, fRef: ForwardedRef<VisBoxplotRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Boxplot<Datum>>>(null)\n const componentRef = useRef<Boxplot<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<Boxplot<Datum>>)\n\n const c = new Boxplot<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 VisBoxplot: (<Datum>(props: VisBoxplotProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisBoxplotFC), 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 VisBrushSelectors = Brush.selectors;
|
|
|
6
6
|
function VisBrushFC(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 Brush(
|
|
12
|
+
const c = new Brush(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisBrushFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/brush/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/brush/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Brush } from '@unovis/ts/components/brush'\nimport { BrushConfigInterface } from '@unovis/ts/components/brush/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisBrushRef<Datum> = {\n component?: Brush<Datum>;\n}\n\nexport type VisBrushProps<Datum> = BrushConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisBrushRef<Datum>>;\n}\n\nexport const VisBrushSelectors = Brush.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisBrushFC<Datum> (props: VisBrushProps<Datum>, fRef: ForwardedRef<VisBrushRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Brush<Datum>>>(null)\n const componentRef = useRef<Brush<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<Brush<Datum>>)\n\n const c = new Brush<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 VisBrush: (<Datum>(props: VisBrushProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisBrushFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,oBAAoB,MAAM;AAGvC,SAAS,WAAmB,OAA6B,MAAsD;AAC7G,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,MAAa,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,WAAyE,MAAM,KAAK,MAAM,WAAW,UAAU,GAAG,aAAa;"}
|
|
@@ -6,9 +6,10 @@ const VisChordDiagramSelectors = ChordDiagram.selectors;
|
|
|
6
6
|
function VisChordDiagramFC(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 ChordDiagram(
|
|
12
|
+
const c = new ChordDiagram(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisChordDiagramFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/chord-diagram/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/chord-diagram/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { ChordDiagram } from '@unovis/ts/components/chord-diagram'\nimport { ChordDiagramConfigInterface } from '@unovis/ts/components/chord-diagram/config'\nimport { ChordInputNode, ChordInputLink } from '@unovis/ts/components/chord-diagram/types'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisChordDiagramRef<N extends ChordInputNode, L extends ChordInputLink> = {\n component?: ChordDiagram<N, L>;\n}\n\nexport type VisChordDiagramProps<N extends ChordInputNode, L extends ChordInputLink> = ChordDiagramConfigInterface<N, L> & {\n data?: { nodes: N[]; links?: L[] };\n ref?: Ref<VisChordDiagramRef<N, L>>;\n}\n\nexport const VisChordDiagramSelectors = ChordDiagram.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisChordDiagramFC<N extends ChordInputNode, L extends ChordInputLink> (props: VisChordDiagramProps<N, L>, fRef: ForwardedRef<VisChordDiagramRef<N, L>>): ReactElement {\n const ref = useRef<VisComponentElement<ChordDiagram<N, L>>>(null)\n const componentRef = useRef<ChordDiagram<N, L> | undefined>(undefined)\n // 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<ChordDiagram<N, L>>)\n\n const c = new ChordDiagram<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 VisChordDiagram: (<N extends ChordInputNode, L extends ChordInputLink>(props: VisChordDiagramProps<N, L>) => JSX.Element | null) = React.memo(React.forwardRef(VisChordDiagramFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAsBO,MAAM,2BAA2B,aAAa;AAGrD,SAAS,kBAAuE,OAAmC,MAA4D;AAC7K,QAAM,MAAM,OAAgD,IAAI;AAChE,QAAM,eAAe,OAAuC,MAAS;AAErE,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,aAAmB,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,kBAAmI,MAAM,KAAK,MAAM,WAAW,iBAAiB,GAAG,aAAa;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { CircularBar } from '@unovis/ts/components/circular-bar';
|
|
3
|
+
import { CircularBarConfigInterface } from '@unovis/ts/components/circular-bar/config';
|
|
4
|
+
|
|
5
|
+
export type VisCircularBarRef<Datum> = {
|
|
6
|
+
component?: CircularBar<Datum>;
|
|
7
|
+
};
|
|
8
|
+
export type VisCircularBarProps<Datum> = CircularBarConfigInterface<Datum> & {
|
|
9
|
+
data?: Datum[];
|
|
10
|
+
ref?: Ref<VisCircularBarRef<Datum>>;
|
|
11
|
+
};
|
|
12
|
+
export declare const VisCircularBarSelectors: typeof import("@unovis/ts/components/circular-bar/style");
|
|
13
|
+
export declare const VisCircularBar: (<Datum>(props: VisCircularBarProps<Datum>) => JSX.Element | null);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { useRef, useEffect, useImperativeHandle } from "react";
|
|
2
|
+
import { CircularBar } from "@unovis/ts/components/circular-bar";
|
|
3
|
+
import { arePropsEqual } from "../../utils/react.js";
|
|
4
|
+
import { useContainerRenderOnUpdate } from "../../utils/container.js";
|
|
5
|
+
const VisCircularBarSelectors = CircularBar.selectors;
|
|
6
|
+
function VisCircularBarFC(props, fRef) {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const componentRef = useRef(void 0);
|
|
9
|
+
const { data, ...config } = props;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const element = ref.current;
|
|
12
|
+
const c = new CircularBar(config);
|
|
13
|
+
componentRef.current = c;
|
|
14
|
+
element.__component__ = c;
|
|
15
|
+
return () => {
|
|
16
|
+
componentRef.current = void 0;
|
|
17
|
+
c.destroy();
|
|
18
|
+
};
|
|
19
|
+
}, []);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const component = componentRef.current;
|
|
22
|
+
if (data !== void 0) component?.setData(data);
|
|
23
|
+
component?.setConfig(config);
|
|
24
|
+
});
|
|
25
|
+
useContainerRenderOnUpdate();
|
|
26
|
+
useImperativeHandle(fRef, () => ({ get component() {
|
|
27
|
+
return componentRef.current;
|
|
28
|
+
} }), []);
|
|
29
|
+
return /* @__PURE__ */ React.createElement("vis-component", { ref });
|
|
30
|
+
}
|
|
31
|
+
const VisCircularBar = React.memo(React.forwardRef(VisCircularBarFC), arePropsEqual);
|
|
32
|
+
export {
|
|
33
|
+
VisCircularBar,
|
|
34
|
+
VisCircularBarSelectors
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/circular-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 { CircularBar } from '@unovis/ts/components/circular-bar'\nimport { CircularBarConfigInterface } from '@unovis/ts/components/circular-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 VisCircularBarRef<Datum> = {\n component?: CircularBar<Datum>;\n}\n\nexport type VisCircularBarProps<Datum> = CircularBarConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisCircularBarRef<Datum>>;\n}\n\nexport const VisCircularBarSelectors = CircularBar.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisCircularBarFC<Datum> (props: VisCircularBarProps<Datum>, fRef: ForwardedRef<VisCircularBarRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<CircularBar<Datum>>>(null)\n const componentRef = useRef<CircularBar<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<CircularBar<Datum>>)\n\n const c = new CircularBar<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 VisCircularBar: (<Datum>(props: VisCircularBarProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisCircularBarFC), 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 VisCrosshairSelectors = Crosshair.selectors;
|
|
|
6
6
|
function VisCrosshairFC(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 Crosshair(
|
|
12
|
+
const c = new Crosshair(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisCrosshairFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/crosshair/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/crosshair/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Crosshair } from '@unovis/ts/components/crosshair'\nimport { CrosshairConfigInterface } from '@unovis/ts/components/crosshair/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisCrosshairRef<Datum> = {\n component?: Crosshair<Datum>;\n}\n\nexport type VisCrosshairProps<Datum> = CrosshairConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisCrosshairRef<Datum>>;\n}\n\nexport const VisCrosshairSelectors = Crosshair.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisCrosshairFC<Datum> (props: VisCrosshairProps<Datum>, fRef: ForwardedRef<VisCrosshairRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Crosshair<Datum>>>(null)\n const componentRef = useRef<Crosshair<Datum> | undefined>(undefined)\n // 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<Crosshair<Datum>>)\n\n const c = new Crosshair<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-crosshair ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisCrosshair: (<Datum>(props: VisCrosshairProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisCrosshairFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,wBAAwB,UAAU;AAG/C,SAAS,eAAuB,OAAiC,MAA0D;AACzH,QAAM,MAAM,OAA8C,IAAI;AAC9D,QAAM,eAAe,OAAqC,MAAS;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 VisDonutSelectors = Donut.selectors;
|
|
|
6
6
|
function VisDonutFC(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 Donut(
|
|
12
|
+
const c = new Donut(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisDonutFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/donut/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/donut/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Donut } from '@unovis/ts/components/donut'\nimport { DonutConfigInterface } from '@unovis/ts/components/donut/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisDonutRef<Datum> = {\n component?: Donut<Datum>;\n}\n\nexport type VisDonutProps<Datum> = DonutConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisDonutRef<Datum>>;\n}\n\nexport const VisDonutSelectors = Donut.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisDonutFC<Datum> (props: VisDonutProps<Datum>, fRef: ForwardedRef<VisDonutRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Donut<Datum>>>(null)\n const componentRef = useRef<Donut<Datum> | undefined>(undefined)\n // 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<Donut<Datum>>)\n\n const c = new Donut<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 VisDonut: (<Datum>(props: VisDonutProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisDonutFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,oBAAoB,MAAM;AAGvC,SAAS,WAAmB,OAA6B,MAAsD;AAC7G,QAAM,MAAM,OAA0C,IAAI;AAC1D,QAAM,eAAe,OAAiC,MAAS;AAE/D,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,MAAa,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,WAAyE,MAAM,KAAK,MAAM,WAAW,UAAU,GAAG,aAAa;"}
|
|
@@ -6,9 +6,10 @@ const VisFreeBrushSelectors = FreeBrush.selectors;
|
|
|
6
6
|
function VisFreeBrushFC(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 FreeBrush(
|
|
12
|
+
const c = new FreeBrush(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisFreeBrushFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/free-brush/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/free-brush/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { FreeBrush } from '@unovis/ts/components/free-brush'\nimport { FreeBrushConfigInterface } from '@unovis/ts/components/free-brush/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisFreeBrushRef<Datum> = {\n component?: FreeBrush<Datum>;\n}\n\nexport type VisFreeBrushProps<Datum> = FreeBrushConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisFreeBrushRef<Datum>>;\n}\n\nexport const VisFreeBrushSelectors = FreeBrush.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisFreeBrushFC<Datum> (props: VisFreeBrushProps<Datum>, fRef: ForwardedRef<VisFreeBrushRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<FreeBrush<Datum>>>(null)\n const componentRef = useRef<FreeBrush<Datum> | undefined>(undefined)\n // 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<FreeBrush<Datum>>)\n\n const c = new FreeBrush<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 VisFreeBrush: (<Datum>(props: VisFreeBrushProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisFreeBrushFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,wBAAwB,UAAU;AAG/C,SAAS,eAAuB,OAAiC,MAA0D;AACzH,QAAM,MAAM,OAA8C,IAAI;AAC9D,QAAM,eAAe,OAAqC,MAAS;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 VisGraphSelectors = Graph.selectors;
|
|
|
6
6
|
function VisGraphFC(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 Graph(
|
|
12
|
+
const c = new Graph(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisGraphFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/graph/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/graph/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Graph } from '@unovis/ts/components/graph'\nimport { GraphConfigInterface } from '@unovis/ts/components/graph/config'\nimport { GraphInputNode, GraphInputLink } from '@unovis/ts/types/graph'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisGraphRef<N extends GraphInputNode, L extends GraphInputLink> = {\n component?: Graph<N, L>;\n}\n\nexport type VisGraphProps<N extends GraphInputNode, L extends GraphInputLink> = GraphConfigInterface<N, L> & {\n data?: { nodes: N[]; links?: L[] };\n ref?: Ref<VisGraphRef<N, L>>;\n}\n\nexport const VisGraphSelectors = Graph.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisGraphFC<N extends GraphInputNode, L extends GraphInputLink> (props: VisGraphProps<N, L>, fRef: ForwardedRef<VisGraphRef<N, L>>): ReactElement {\n const ref = useRef<VisComponentElement<Graph<N, L>>>(null)\n const componentRef = useRef<Graph<N, L> | undefined>(undefined)\n // 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<Graph<N, L>>)\n\n const c = new Graph<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 VisGraph: (<N extends GraphInputNode, L extends GraphInputLink>(props: VisGraphProps<N, L>) => JSX.Element | null) = React.memo(React.forwardRef(VisGraphFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAsBO,MAAM,oBAAoB,MAAM;AAGvC,SAAS,WAAgE,OAA4B,MAAqD;AACxJ,QAAM,MAAM,OAAyC,IAAI;AACzD,QAAM,eAAe,OAAgC,MAAS;AAE9D,QAAM,EAAE,MAAM,GAAG,OAAA,IAAW;AAG5B,YAAU,MAAM;AACd,UAAM,UAAW,IAAI;AAErB,UAAM,IAAI,IAAI,MAAY,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,WAAqH,MAAM,KAAK,MAAM,WAAW,UAAU,GAAG,aAAa;"}
|
|
@@ -6,9 +6,10 @@ const VisGroupedBarSelectors = GroupedBar.selectors;
|
|
|
6
6
|
function VisGroupedBarFC(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 GroupedBar(
|
|
12
|
+
const c = new GroupedBar(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisGroupedBarFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/grouped-bar/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/grouped-bar/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { GroupedBar } from '@unovis/ts/components/grouped-bar'\nimport { GroupedBarConfigInterface } from '@unovis/ts/components/grouped-bar/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisGroupedBarRef<Datum> = {\n component?: GroupedBar<Datum>;\n}\n\nexport type VisGroupedBarProps<Datum> = GroupedBarConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisGroupedBarRef<Datum>>;\n}\n\nexport const VisGroupedBarSelectors = GroupedBar.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisGroupedBarFC<Datum> (props: VisGroupedBarProps<Datum>, fRef: ForwardedRef<VisGroupedBarRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<GroupedBar<Datum>>>(null)\n const componentRef = useRef<GroupedBar<Datum> | undefined>(undefined)\n // 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<GroupedBar<Datum>>)\n\n const c = new GroupedBar<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 VisGroupedBar: (<Datum>(props: VisGroupedBarProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisGroupedBarFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,yBAAyB,WAAW;AAGjD,SAAS,gBAAwB,OAAkC,MAA2D;AAC5H,QAAM,MAAM,OAA+C,IAAI;AAC/D,QAAM,eAAe,OAAsC,MAAS;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 VisHeatmapSelectors = Heatmap.selectors;
|
|
|
6
6
|
function VisHeatmapFC(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 Heatmap(
|
|
12
|
+
const c = new Heatmap(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisHeatmapFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
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/heatmap/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/heatmap/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { Heatmap } from '@unovis/ts/components/heatmap'\nimport { HeatmapConfigInterface } from '@unovis/ts/components/heatmap/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\nimport { useContainerRenderOnUpdate } from 'src/utils/container'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisHeatmapRef<Datum> = {\n component?: Heatmap<Datum>;\n}\n\nexport type VisHeatmapProps<Datum> = HeatmapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisHeatmapRef<Datum>>;\n}\n\nexport const VisHeatmapSelectors = Heatmap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisHeatmapFC<Datum> (props: VisHeatmapProps<Datum>, fRef: ForwardedRef<VisHeatmapRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Heatmap<Datum>>>(null)\n const componentRef = useRef<Heatmap<Datum> | undefined>(undefined)\n // 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<Heatmap<Datum>>)\n\n const c = new Heatmap<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 VisHeatmap: (<Datum>(props: VisHeatmapProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisHeatmapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBO,MAAM,sBAAsB,QAAQ;AAG3C,SAAS,aAAqB,OAA+B,MAAwD;AACnH,QAAM,MAAM,OAA4C,IAAI;AAC5D,QAAM,eAAe,OAAmC,MAAS;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;"}
|
package/components/line/index.js
CHANGED
|
@@ -6,9 +6,10 @@ const VisLineSelectors = Line.selectors;
|
|
|
6
6
|
function VisLineFC(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 Line(
|
|
12
|
+
const c = new Line(config);
|
|
12
13
|
componentRef.current = c;
|
|
13
14
|
element.__component__ = c;
|
|
14
15
|
return () => {
|
|
@@ -18,8 +19,8 @@ function VisLineFC(props, fRef) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
const component = componentRef.current;
|
|
21
|
-
if (
|
|
22
|
-
component?.setConfig(
|
|
22
|
+
if (data !== void 0) component?.setData(data);
|
|
23
|
+
component?.setConfig(config);
|
|
23
24
|
});
|
|
24
25
|
useContainerRenderOnUpdate();
|
|
25
26
|
useImperativeHandle(fRef, () => ({ get component() {
|