@unovis/react 1.6.6-beta.1 → 1.6.7
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.d.ts +3 -2
- package/components/annotations/index.js +1 -1
- package/components/annotations/index.js.map +1 -1
- package/components/area/index.d.ts +3 -2
- package/components/area/index.js +1 -1
- package/components/area/index.js.map +1 -1
- package/components/axis/index.d.ts +3 -2
- package/components/axis/index.js +1 -1
- package/components/axis/index.js.map +1 -1
- package/components/brush/index.d.ts +3 -2
- package/components/brush/index.js +1 -1
- package/components/brush/index.js.map +1 -1
- package/components/chord-diagram/index.d.ts +4 -2
- package/components/chord-diagram/index.js +1 -1
- package/components/chord-diagram/index.js.map +1 -1
- package/components/crosshair/index.d.ts +3 -2
- package/components/crosshair/index.js +1 -1
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/index.d.ts +3 -2
- package/components/donut/index.js +1 -1
- package/components/donut/index.js.map +1 -1
- package/components/free-brush/index.d.ts +3 -2
- package/components/free-brush/index.js +1 -1
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/index.d.ts +3 -1
- package/components/graph/index.js +1 -1
- package/components/graph/index.js.map +1 -1
- package/components/grouped-bar/index.d.ts +3 -2
- package/components/grouped-bar/index.js +1 -1
- package/components/grouped-bar/index.js.map +1 -1
- package/components/line/index.d.ts +3 -2
- package/components/line/index.js +1 -1
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/index.d.ts +3 -2
- package/components/nested-donut/index.js +1 -1
- package/components/nested-donut/index.js.map +1 -1
- package/components/plotband/index.d.ts +3 -2
- package/components/plotband/index.js +1 -1
- package/components/plotband/index.js.map +1 -1
- package/components/plotline/index.d.ts +3 -2
- package/components/plotline/index.js +1 -1
- package/components/plotline/index.js.map +1 -1
- package/components/sankey/index.d.ts +4 -2
- package/components/sankey/index.js +1 -1
- package/components/sankey/index.js.map +1 -1
- package/components/scatter/index.d.ts +3 -2
- package/components/scatter/index.js +1 -1
- package/components/scatter/index.js.map +1 -1
- package/components/stacked-bar/index.d.ts +3 -2
- package/components/stacked-bar/index.js +1 -1
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/index.d.ts +3 -2
- package/components/timeline/index.js +1 -1
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/index.d.ts +3 -2
- package/components/tooltip/index.js +1 -1
- package/components/tooltip/index.js.map +1 -1
- package/components/topojson-map/index.d.ts +3 -2
- package/components/topojson-map/index.js +1 -1
- package/components/topojson-map/index.js.map +1 -1
- package/components/treemap/index.d.ts +3 -2
- package/components/treemap/index.js +1 -1
- package/components/treemap/index.js.map +1 -1
- package/components/xy-labels/index.d.ts +3 -2
- package/components/xy-labels/index.js +1 -1
- package/components/xy-labels/index.js.map +1 -1
- package/composites/time-series/index.d.ts +1 -1
- package/composites/time-series/index.js +2 -1
- package/composites/time-series/index.js.map +1 -1
- package/containers/single-container/index.d.ts +2 -2
- package/containers/single-container/index.js +1 -1
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/index.d.ts +2 -2
- package/containers/xy-container/index.js +2 -1
- package/containers/xy-container/index.js.map +1 -1
- package/html-components/bullet-legend/index.d.ts +3 -2
- package/html-components/bullet-legend/index.js +1 -1
- package/html-components/bullet-legend/index.js.map +1 -1
- package/html-components/flow-legend/index.d.ts +3 -2
- package/html-components/flow-legend/index.js +1 -1
- package/html-components/flow-legend/index.js.map +1 -1
- package/html-components/leaflet-flow-map/index.d.ts +4 -2
- package/html-components/leaflet-flow-map/index.js +1 -1
- package/html-components/leaflet-flow-map/index.js.map +1 -1
- package/html-components/leaflet-map/index.d.ts +4 -2
- package/html-components/leaflet-map/index.js +1 -1
- package/html-components/leaflet-map/index.js.map +1 -1
- package/html-components/rolling-pin-legend/index.d.ts +3 -2
- package/html-components/rolling-pin-legend/index.js +1 -1
- package/html-components/rolling-pin-legend/index.js.map +1 -1
- package/package.json +2 -2
- package/utils/react.js +1 -1
- package/utils/react.js.map +1 -1
|
@@ -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
|
|
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'\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 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)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C,EAAE,aAAa;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
|
-
import { Sankey
|
|
2
|
+
import { Sankey } from '@unovis/ts/components/sankey';
|
|
3
|
+
import { SankeyConfigInterface } from '@unovis/ts/components/sankey/config';
|
|
4
|
+
import { SankeyInputNode, SankeyInputLink } from '@unovis/ts/components/sankey/types';
|
|
3
5
|
export declare type VisSankeyRef<N extends SankeyInputNode, L extends SankeyInputLink> = {
|
|
4
6
|
component?: Sankey<N, L>;
|
|
5
7
|
};
|
|
@@ -10,5 +12,5 @@ export declare type VisSankeyProps<N extends SankeyInputNode, L extends SankeyIn
|
|
|
10
12
|
};
|
|
11
13
|
ref?: Ref<VisSankeyRef<N, L>>;
|
|
12
14
|
};
|
|
13
|
-
export declare const VisSankeySelectors: typeof import("@unovis/ts/
|
|
15
|
+
export declare const VisSankeySelectors: typeof import("@unovis/ts/components/sankey/style");
|
|
14
16
|
export declare const VisSankey: (<N extends SankeyInputNode, L extends SankeyInputLink>(props: VisSankeyProps<N, L>) => JSX.Element | null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
2
|
-
import { Sankey } from '@unovis/ts';
|
|
2
|
+
import { Sankey } from '@unovis/ts/components/sankey';
|
|
3
3
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
4
|
|
|
5
5
|
const VisSankeySelectors = Sankey.selectors;
|
|
@@ -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
|
|
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'\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 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":";;;;AAqBa,MAAA,kBAAkB,GAAG,MAAM,CAAC,UAAS;AAGlD,SAAS,WAAW,CAAwD,KA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AAC,UAAU,CAAC,WAAW,CAAC,EAAE,aAAa;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
|
-
import { Scatter
|
|
2
|
+
import { Scatter } from '@unovis/ts/components/scatter';
|
|
3
|
+
import { ScatterConfigInterface } from '@unovis/ts/components/scatter/config';
|
|
3
4
|
export declare type VisScatterRef<Datum> = {
|
|
4
5
|
component?: Scatter<Datum>;
|
|
5
6
|
};
|
|
@@ -7,5 +8,5 @@ export declare type VisScatterProps<Datum> = ScatterConfigInterface<Datum> & {
|
|
|
7
8
|
data?: Datum[];
|
|
8
9
|
ref?: Ref<VisScatterRef<Datum>>;
|
|
9
10
|
};
|
|
10
|
-
export declare const VisScatterSelectors: typeof import("@unovis/ts/
|
|
11
|
+
export declare const VisScatterSelectors: typeof import("@unovis/ts/components/scatter/style");
|
|
11
12
|
export declare const VisScatter: (<Datum>(props: VisScatterProps<Datum>) => JSX.Element | null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
2
|
-
import { Scatter } from '@unovis/ts';
|
|
2
|
+
import { Scatter } from '@unovis/ts/components/scatter';
|
|
3
3
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
4
|
|
|
5
5
|
const VisScatterSelectors = Scatter.selectors;
|
|
@@ -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
|
|
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'\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 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":";;;;AAoBa,MAAA,mBAAmB,GAAG,OAAO,CAAC,UAAS;AAGpD,SAAS,YAAY,CAAS,KAA6B,EAAE,IAAwC,EAAA;AACnG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAsC,IAAI,CAAC,CAAA;AAC7D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA6B,SAAS,CAAC,CAAA;IAGlE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA+C,CAAA;AAEpE,QAAA,MAAM,CAAC,GAAG,IAAI,OAAO,CAAQ,KAAK,CAAC,CAAA;AACnC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,UAAU,GAAmE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,aAAa;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
|
-
import { StackedBar
|
|
2
|
+
import { StackedBar } from '@unovis/ts/components/stacked-bar';
|
|
3
|
+
import { StackedBarConfigInterface } from '@unovis/ts/components/stacked-bar/config';
|
|
3
4
|
export declare type VisStackedBarRef<Datum> = {
|
|
4
5
|
component?: StackedBar<Datum>;
|
|
5
6
|
};
|
|
@@ -7,5 +8,5 @@ export declare type VisStackedBarProps<Datum> = StackedBarConfigInterface<Datum>
|
|
|
7
8
|
data?: Datum[];
|
|
8
9
|
ref?: Ref<VisStackedBarRef<Datum>>;
|
|
9
10
|
};
|
|
10
|
-
export declare const VisStackedBarSelectors: typeof import("@unovis/ts/
|
|
11
|
+
export declare const VisStackedBarSelectors: typeof import("@unovis/ts/components/stacked-bar/style");
|
|
11
12
|
export declare const VisStackedBar: (<Datum>(props: VisStackedBarProps<Datum>) => JSX.Element | null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
2
|
-
import { StackedBar } from '@unovis/ts';
|
|
2
|
+
import { StackedBar } from '@unovis/ts/components/stacked-bar';
|
|
3
3
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
4
|
|
|
5
5
|
const VisStackedBarSelectors = StackedBar.selectors;
|
|
@@ -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
|
|
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'\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 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":";;;;AAoBa,MAAA,sBAAsB,GAAG,UAAU,CAAC,UAAS;AAG1D,SAAS,eAAe,CAAS,KAAgC,EAAE,IAA2C,EAAA;AAC5G,IAAA,MAAM,GAAG,GAAG,MAAM,CAAyC,IAAI,CAAC,CAAA;AAChE,IAAA,MAAM,YAAY,GAAG,MAAM,CAAgC,SAAS,CAAC,CAAA;IAGrE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAkD,CAAA;AAEvE,QAAA,MAAM,CAAC,GAAG,IAAI,UAAU,CAAQ,KAAK,CAAC,CAAA;AACtC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,aAAa,GAAsE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,aAAa;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
|
-
import { Timeline
|
|
2
|
+
import { Timeline } from '@unovis/ts/components/timeline';
|
|
3
|
+
import { TimelineConfigInterface } from '@unovis/ts/components/timeline/config';
|
|
3
4
|
export declare type VisTimelineRef<Datum> = {
|
|
4
5
|
component?: Timeline<Datum>;
|
|
5
6
|
};
|
|
@@ -7,5 +8,5 @@ export declare type VisTimelineProps<Datum> = TimelineConfigInterface<Datum> & {
|
|
|
7
8
|
data?: Datum[];
|
|
8
9
|
ref?: Ref<VisTimelineRef<Datum>>;
|
|
9
10
|
};
|
|
10
|
-
export declare const VisTimelineSelectors: typeof import("@unovis/ts/
|
|
11
|
+
export declare const VisTimelineSelectors: typeof import("@unovis/ts/components/timeline/style");
|
|
11
12
|
export declare const VisTimeline: (<Datum>(props: VisTimelineProps<Datum>) => JSX.Element | null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
2
|
-
import { Timeline } from '@unovis/ts';
|
|
2
|
+
import { Timeline } from '@unovis/ts/components/timeline';
|
|
3
3
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
4
|
|
|
5
5
|
const VisTimelineSelectors = Timeline.selectors;
|
|
@@ -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
|
|
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'\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 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":";;;;AAoBa,MAAA,oBAAoB,GAAG,QAAQ,CAAC,UAAS;AAGtD,SAAS,aAAa,CAAS,KAA8B,EAAE,IAAyC,EAAA;AACtG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAA;AAC9D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA8B,SAAS,CAAC,CAAA;IAGnE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAgD,CAAA;AAErE,QAAA,MAAM,CAAC,GAAG,IAAI,QAAQ,CAAQ,KAAK,CAAC,CAAA;AACpC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,WAAW,GAAoE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,aAAa;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
|
-
import { Tooltip
|
|
2
|
+
import { Tooltip } from '@unovis/ts/components/tooltip';
|
|
3
|
+
import { TooltipConfigInterface } from '@unovis/ts/components/tooltip/config';
|
|
3
4
|
export declare type VisTooltipRef = {
|
|
4
5
|
component?: Tooltip;
|
|
5
6
|
};
|
|
6
7
|
export declare type VisTooltipProps = TooltipConfigInterface & {
|
|
7
8
|
ref?: Ref<VisTooltipRef>;
|
|
8
9
|
};
|
|
9
|
-
export declare const VisTooltipSelectors: typeof import("@unovis/ts/
|
|
10
|
+
export declare const VisTooltipSelectors: typeof import("@unovis/ts/components/tooltip/style");
|
|
10
11
|
export declare const VisTooltip: ((props: VisTooltipProps) => JSX.Element | null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
2
|
-
import { Tooltip } from '@unovis/ts';
|
|
2
|
+
import { Tooltip } from '@unovis/ts/components/tooltip';
|
|
3
3
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
4
|
|
|
5
5
|
const VisTooltipSelectors = Tooltip.selectors;
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/tooltip/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Tooltip } from '@unovis/ts/components/tooltip'\nimport { TooltipConfigInterface } from '@unovis/ts/components/tooltip/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTooltipRef = {\n component?: Tooltip;\n}\n\nexport type VisTooltipProps = TooltipConfigInterface & {\n ref?: Ref<VisTooltipRef>;\n}\n\nexport const VisTooltipSelectors = Tooltip.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTooltipFC (props: VisTooltipProps, fRef: ForwardedRef<VisTooltipRef>): ReactElement {\n const ref = useRef<VisComponentElement<Tooltip>>(null)\n const componentRef = useRef<Tooltip | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Tooltip>)\n\n const c = new Tooltip(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-tooltip ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisTooltip: ((props: VisTooltipProps) => JSX.Element | null) = React.memo(React.forwardRef(VisTooltipFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,mBAAmB,GAAG,OAAO,CAAC,UAAS;AAGpD,SAAS,YAAY,CAAE,KAAsB,EAAE,IAAiC,EAAA;AAC9E,IAAA,MAAM,GAAG,GAAG,MAAM,CAA+B,IAAI,CAAC,CAAA;AACtD,IAAA,MAAM,YAAY,GAAG,MAAM,CAAsB,SAAS,CAAC,CAAA;IAG3D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAwC,CAAA;AAE7D,QAAA,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;AAC5B,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QAEtC,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAa,CAAA,aAAA,CAAA,aAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AAClC,CAAC;AAIY,MAAA,UAAU,GAAqD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,aAAa;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
|
-
import { TopoJSONMap
|
|
2
|
+
import { TopoJSONMap } from '@unovis/ts/components/topojson-map';
|
|
3
|
+
import { TopoJSONMapConfigInterface } from '@unovis/ts/components/topojson-map/config';
|
|
3
4
|
export declare type VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum> = {
|
|
4
5
|
component?: TopoJSONMap<AreaDatum, PointDatum, LinkDatum>;
|
|
5
6
|
};
|
|
@@ -11,5 +12,5 @@ export declare type VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum> = Topo
|
|
|
11
12
|
};
|
|
12
13
|
ref?: Ref<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>;
|
|
13
14
|
};
|
|
14
|
-
export declare const VisTopoJSONMapSelectors: typeof import("@unovis/ts/
|
|
15
|
+
export declare const VisTopoJSONMapSelectors: typeof import("@unovis/ts/components/topojson-map/style");
|
|
15
16
|
export declare const VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
2
|
-
import { TopoJSONMap } from '@unovis/ts';
|
|
2
|
+
import { TopoJSONMap } from '@unovis/ts/components/topojson-map';
|
|
3
3
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
4
|
|
|
5
5
|
const VisTopoJSONMapSelectors = TopoJSONMap.selectors;
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/topojson-map/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { TopoJSONMap } from '@unovis/ts/components/topojson-map'\nimport { TopoJSONMapConfigInterface } from '@unovis/ts/components/topojson-map/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum> = {\n component?: TopoJSONMap<AreaDatum, PointDatum, LinkDatum>;\n}\n\nexport type VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum> = TopoJSONMapConfigInterface<AreaDatum, PointDatum, LinkDatum> & {\n data?: {areas?: AreaDatum[]; points?: PointDatum[]; links?: LinkDatum[]};\n ref?: Ref<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>;\n}\n\nexport const VisTopoJSONMapSelectors = TopoJSONMap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTopoJSONMapFC<AreaDatum, PointDatum, LinkDatum> (props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>, fRef: ForwardedRef<VisTopoJSONMapRef<AreaDatum, PointDatum, LinkDatum>>): ReactElement {\n const ref = useRef<VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>>(null)\n const componentRef = useRef<TopoJSONMap<AreaDatum, PointDatum, LinkDatum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<TopoJSONMap<AreaDatum, PointDatum, LinkDatum>>)\n\n const c = new TopoJSONMap<AreaDatum, PointDatum, LinkDatum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisTopoJSONMap: (<AreaDatum, PointDatum, LinkDatum>(props: VisTopoJSONMapProps<AreaDatum, PointDatum, LinkDatum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTopoJSONMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBa,MAAA,uBAAuB,GAAG,WAAW,CAAC,UAAS;AAG5D,SAAS,gBAAgB,CAAoC,KAA4D,EAAE,IAAuE,EAAA;AAChM,IAAA,MAAM,GAAG,GAAG,MAAM,CAAqE,IAAI,CAAC,CAAA;AAC5F,IAAA,MAAM,YAAY,GAAG,MAAM,CAA4D,SAAS,CAAC,CAAA;IAGjG,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA8E,CAAA;AAEnG,QAAA,MAAM,CAAC,GAAG,IAAI,WAAW,CAAmC,KAAK,CAAC,CAAA;AAClE,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,cAAc,GAA6H,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,aAAa;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
|
-
import { Treemap
|
|
2
|
+
import { Treemap } from '@unovis/ts/components/treemap';
|
|
3
|
+
import { TreemapConfigInterface } from '@unovis/ts/components/treemap/config';
|
|
3
4
|
export declare type VisTreemapRef<Datum> = {
|
|
4
5
|
component?: Treemap<Datum>;
|
|
5
6
|
};
|
|
@@ -7,5 +8,5 @@ export declare type VisTreemapProps<Datum> = TreemapConfigInterface<Datum> & {
|
|
|
7
8
|
data?: Datum[];
|
|
8
9
|
ref?: Ref<VisTreemapRef<Datum>>;
|
|
9
10
|
};
|
|
10
|
-
export declare const VisTreemapSelectors: typeof import("@unovis/ts/
|
|
11
|
+
export declare const VisTreemapSelectors: typeof import("@unovis/ts/components/treemap/style");
|
|
11
12
|
export declare const VisTreemap: (<Datum>(props: VisTreemapProps<Datum>) => JSX.Element | null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
2
|
-
import { Treemap } from '@unovis/ts';
|
|
2
|
+
import { Treemap } from '@unovis/ts/components/treemap';
|
|
3
3
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
4
|
|
|
5
5
|
const VisTreemapSelectors = Treemap.selectors;
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/treemap/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Treemap } from '@unovis/ts/components/treemap'\nimport { TreemapConfigInterface } from '@unovis/ts/components/treemap/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTreemapRef<Datum> = {\n component?: Treemap<Datum>;\n}\n\nexport type VisTreemapProps<Datum> = TreemapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisTreemapRef<Datum>>;\n}\n\nexport const VisTreemapSelectors = Treemap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTreemapFC<Datum> (props: VisTreemapProps<Datum>, fRef: ForwardedRef<VisTreemapRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<Treemap<Datum>>>(null)\n const componentRef = useRef<Treemap<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Treemap<Datum>>)\n\n const c = new Treemap<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisTreemap: (<Datum>(props: VisTreemapProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisTreemapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBa,MAAA,mBAAmB,GAAG,OAAO,CAAC,UAAS;AAGpD,SAAS,YAAY,CAAS,KAA6B,EAAE,IAAwC,EAAA;AACnG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAsC,IAAI,CAAC,CAAA;AAC7D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA6B,SAAS,CAAC,CAAA;IAGlE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA+C,CAAA;AAEpE,QAAA,MAAM,CAAC,GAAG,IAAI,OAAO,CAAQ,KAAK,CAAC,CAAA;AACnC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,UAAU,GAAmE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,aAAa;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
|
-
import { XYLabels
|
|
2
|
+
import { XYLabels } from '@unovis/ts/components/xy-labels';
|
|
3
|
+
import { XYLabelsConfigInterface } from '@unovis/ts/components/xy-labels/config';
|
|
3
4
|
export declare type VisXYLabelsRef<Datum> = {
|
|
4
5
|
component?: XYLabels<Datum>;
|
|
5
6
|
};
|
|
@@ -7,5 +8,5 @@ export declare type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {
|
|
|
7
8
|
data?: Datum[];
|
|
8
9
|
ref?: Ref<VisXYLabelsRef<Datum>>;
|
|
9
10
|
};
|
|
10
|
-
export declare const VisXYLabelsSelectors: typeof import("@unovis/ts/
|
|
11
|
+
export declare const VisXYLabelsSelectors: typeof import("@unovis/ts/components/xy-labels/style");
|
|
11
12
|
export declare const VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
2
|
-
import { XYLabels } from '@unovis/ts';
|
|
2
|
+
import { XYLabels } from '@unovis/ts/components/xy-labels';
|
|
3
3
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
4
|
|
|
5
5
|
const VisXYLabelsSelectors = XYLabels.selectors;
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, ReactElement, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { XYLabels } from '@unovis/ts/components/xy-labels'\nimport { XYLabelsConfigInterface } from '@unovis/ts/components/xy-labels/config'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisXYLabelsRef<Datum> = {\n component?: XYLabels<Datum>;\n}\n\nexport type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisXYLabelsRef<Datum>>;\n}\n\nexport const VisXYLabelsSelectors = XYLabels.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisXYLabelsFC<Datum> (props: VisXYLabelsProps<Datum>, fRef: ForwardedRef<VisXYLabelsRef<Datum>>): ReactElement {\n const ref = useRef<VisComponentElement<XYLabels<Datum>>>(null)\n const componentRef = useRef<XYLabels<Datum> | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<XYLabels<Datum>>)\n\n const c = new XYLabels<Datum>(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisXYLabelsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;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,CAAA;AACpC,CAAC;AAIY,MAAA,WAAW,GAAoE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,aAAa;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState, useMemo } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TextAlign } from '@unovis/ts/types/text';
|
|
3
|
+
import { Scale } from '@unovis/ts/types/scale';
|
|
3
4
|
import { VisXYContainer } from '../../containers/xy-container/index.js';
|
|
4
5
|
import { VisArea } from '../../components/area/index.js';
|
|
5
6
|
import { VisAxis } from '../../components/axis/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/composites/time-series/index.tsx"],"sourcesContent":["import React, { useState, useMemo } from 'react'\nimport { Spacing
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/composites/time-series/index.tsx"],"sourcesContent":["import React, { useState, useMemo } from 'react'\nimport { Spacing } from '@unovis/ts/types/spacing'\nimport { TextAlign } from '@unovis/ts/types/text'\nimport { Scale } from '@unovis/ts/types/scale'\nimport { VisXYContainer } from '@unovis/react/containers/xy-container'\nimport { VisArea } from '@unovis/react/components/area'\nimport { VisAxis } from '@unovis/react/components/axis'\nimport { VisCrosshair } from '@unovis/react/components/crosshair'\nimport { VisTooltip } from '@unovis/react/components/tooltip'\nimport { VisBrush } from '@unovis/react/components/brush'\n\nimport s from './style.module.css'\n\nexport type VisTimeSeriesDatum = {\n timestamp: number;\n value: number;\n id?: string;\n color?: string;\n}\n\nexport type VisTimeSeriesProps<Datum> = {\n data: Datum[];\n margin: Spacing;\n autoMargin: boolean;\n\n x: (d: Datum, i: number) => number;\n y: (d: Datum, i: number) => number;\n id: (d: Datum, i: number) => string;\n color: (d: Datum[], i: number) => string | null;\n cursor: string | ((d: Datum, i: number) => string);\n formatXTicks?: (timestamp: number) => string;\n formatYTicks?: (timestamp: number) => string;\n\n selectionMinLength: number;\n onBrushStart?: (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean) => void;\n onBrushMove?: (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean) => void;\n onBrushEnd?: (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean) => void;\n formatNavXTicks?: (timestamp: number) => string;\n\n xLabel?: string;\n yLabel?: string;\n\n crosshairTemplate?: (d: Datum) => string | HTMLElement;\n\n className?: string;\n height?: string;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function VisTimeSeries<Datum> (props: VisTimeSeriesProps<Datum>): JSX.Element {\n const [selectedRange, setSelectedRange] = useState<[number, number] | undefined>(undefined)\n const [animationDuration, setAnimationDuration] = useState<number | undefined>(0)\n const xScale = useMemo(() => Scale.scaleTime(), [])\n const xScaleNav = useMemo(() => Scale.scaleTime(), [])\n\n // On Mount\n // useEffect(() => {}, [])\n\n // On Props Update\n // useEffect(() => {})\n\n // Brush callbacks\n const onBrushStart = useMemo(() => (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean): void => {\n if (userDriven) setAnimationDuration(0)\n props.onBrushStart?.(selection, e, userDriven)\n }, [])\n\n const onBrushMove = useMemo(() => (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean): void => {\n if (userDriven && selectedRange?.[0] !== selection[0] && selectedRange?.[1] !== selection[1]) setSelectedRange(selection)\n props.onBrushMove?.(selection, e, userDriven)\n }, [])\n\n const onBrushEnd = useMemo(() => (selection: [number, number], e?: { sourceEvent: MouseEvent }, userDriven?: boolean): void => {\n if (userDriven && selectedRange?.[0] !== selection[0] && selectedRange?.[1] !== selection[1]) setSelectedRange(selection)\n setAnimationDuration(undefined)\n props.onBrushEnd?.(selection, e, userDriven)\n }, [])\n\n return (\n <div className={`${s.timeSeriesContainer}${props.className ? `.${props.className}` : ''}`} style={{ height: props.height }}>\n <VisXYContainer\n className={s.timeSeriesModule}\n data={props.data}\n xScale={xScale}\n xDomain={selectedRange}\n duration={animationDuration}\n scaleByDomain={true}\n >\n <VisArea\n x={props.x}\n y={props.y}\n color={props.color}\n />\n <VisAxis type='x' numTicks={5} tickFormat={props.formatXTicks} tickTextAlign={TextAlign.Center}/>\n <VisAxis type='y' tickFormat={props.formatYTicks} label={props.yLabel}/>\n <VisTooltip />\n <VisCrosshair template={props.crosshairTemplate}/>\n </VisXYContainer>\n <VisXYContainer className={s.navigationModule} duration={0} xScale={xScaleNav} data={props.data}>\n <VisArea x={props.x} y={props.y} />\n <VisBrush draggable={true} onBrushStart={onBrushStart} onBrushMove={onBrushMove} onBrushEnd={onBrushEnd} />\n <VisAxis type='x' numTicks={5} tickFormat={props.formatXTicks ?? props.formatNavXTicks} tickTextAlign={TextAlign.Right} label={props.xLabel}/>\n <VisAxis type='y' tickFormat={props.formatYTicks} minMaxTicksOnly={true} label={props.yLabel ? ' ' : undefined}/>\n </VisXYContainer>\n </div>\n )\n}\n\nVisTimeSeries.defaultProps = {\n margin: { top: 10, bottom: 10, left: 10, right: 10 },\n autoMargin: true,\n padding: {},\n\n x: (d: VisTimeSeriesDatum) => d.timestamp,\n y: (d: VisTimeSeriesDatum) => d.value,\n id: (d: VisTimeSeriesDatum) => d.id,\n color: (d: VisTimeSeriesDatum[]) => null,\n\n formatYTicks: (d: number) => d.toFixed(1),\n\n crosshairTemplate: (d: VisTimeSeriesDatum) =>\n `<div>Date: ${new Date(d.timestamp).toLocaleDateString()}</div><div>Value: ${d.value?.toFixed(1)}</div>`,\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAiDM,SAAU,aAAa,CAAS,KAAgC,EAAA;;IACpE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAA+B,SAAS,CAAC,CAAA;IAC3F,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAqB,CAAC,CAAC,CAAA;AACjF,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,S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
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { SingleContainerConfigInterface } from '@unovis/ts';
|
|
2
|
+
import { SingleContainerConfigInterface } from '@unovis/ts/containers/single-container/config';
|
|
3
3
|
export declare type VisSingleContainerProps<Data> = SingleContainerConfigInterface<Data> & {
|
|
4
4
|
data?: Data;
|
|
5
5
|
className?: string;
|
|
6
|
-
style?: React.CSSProperties
|
|
6
|
+
style?: React.CSSProperties | Record<`--${string}`, string | number>;
|
|
7
7
|
};
|
|
8
8
|
export declare const VisSingleContainer: (<Data>(props: PropsWithChildren<VisSingleContainerProps<Data>>) => JSX.Element | null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect } from 'react';
|
|
2
|
-
import { SingleContainer } from '@unovis/ts';
|
|
2
|
+
import { SingleContainer } from '@unovis/ts/containers/single-container';
|
|
3
3
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
4
|
|
|
5
5
|
function VisSingleContainerFC(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.tsx"],"sourcesContent":["// eslint-disable-next-line no-use-before-define\nimport React, { ReactNode, useEffect, useRef, useState, PropsWithChildren } from 'react'\nimport { SingleContainer
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.tsx"],"sourcesContent":["// eslint-disable-next-line no-use-before-define\nimport React, { ReactNode, useEffect, useRef, useState, PropsWithChildren } from 'react'\nimport { SingleContainer } from '@unovis/ts/containers/single-container'\nimport { SingleContainerConfigInterface } from '@unovis/ts/containers/single-container/config'\nimport { ComponentCore } from '@unovis/ts/core/component'\nimport { Tooltip } from '@unovis/ts/components/tooltip'\nimport { Annotations } from '@unovis/ts/components/annotations'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisSingleContainerProps<Data> = SingleContainerConfigInterface<Data> & {\n data?: Data;\n className?: string;\n style?: React.CSSProperties | Record<`--${string}`, string | number>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisSingleContainerFC<Data> (props: PropsWithChildren<VisSingleContainerProps<Data>>): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const prevPropsRef = useRef<PropsWithChildren<VisSingleContainerProps<Data>>>({})\n const chartRef = useRef<SingleContainer<Data> | undefined>(undefined)\n const dataRef = useRef<Data | undefined>(undefined)\n const animationFrameRef = useRef<number | null>(null)\n\n const getConfig = (): SingleContainerConfigInterface<Data> => ({\n ...props,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n component: container.current?.querySelector<VisComponentElement<ComponentCore<Data>>>('vis-component')?.__component__,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tooltip: container.current?.querySelector<VisComponentElement<Tooltip>>('vis-tooltip')?.__component__,\n annotations: container.current?.querySelector<VisComponentElement<Annotations>>('vis-annotations')?.__component__,\n })\n\n // On Mount\n useEffect(() => {\n const c = new SingleContainer<Data>(container.current as HTMLDivElement, getConfig(), props.data)\n chartRef.current = c\n prevPropsRef.current = props\n dataRef.current = props.data\n\n return () => {\n if (animationFrameRef.current) {\n cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = null\n prevPropsRef.current = {}\n }\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const preventRender = true\n\n // Set new Data without re-render\n if (props.data && (props.data !== dataRef.current)) {\n chartRef.current?.setData(props.data, preventRender)\n dataRef.current = props.data\n }\n\n // Update and render\n // ! Experimental: we use `requestAnimationFrame` to make the wrapper compatible with React 18 Strict Mode.\n // React 18 in Strict Mode renders components twice. At the same time, this container will get updated only after\n // the first render of its children (VisSankey, VisGraph, ...) meaning that their wrong instances (the ones\n // that will be destroyed soon) are stored in the `__component__` property of their elements at that moment.\n // So we delay the container update with `requestAnimationFrame` to wait till the new instances of children\n // components are available at `__component__`.\n if (!arePropsEqual(prevPropsRef.current, props)) { // Checking whether the props have changed do avoid multiple renders\n prevPropsRef.current = props\n if (animationFrameRef.current) cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = requestAnimationFrame(() => {\n chartRef.current?.updateContainer(getConfig())\n })\n }\n })\n\n return (\n <div ref={container} className={props.className} style={props.style}>\n {props.children}\n </div>\n )\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisSingleContainer: (<Data>(props: PropsWithChildren<VisSingleContainerProps<Data>>) => JSX.Element | null) =\n React.memo(VisSingleContainerFC, arePropsEqual)\n"],"names":[],"mappings":";;;;AAqBA,SAAS,oBAAoB,CAAQ,KAAuD,EAAA;AAC1F,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;AAC9C,IAAA,MAAM,YAAY,GAAG,MAAM,CAAmD,EAAE,CAAC,CAAA;AACjF,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAoC,SAAS,CAAC,CAAA;AACrE,IAAA,MAAM,OAAO,GAAG,MAAM,CAAmB,SAAS,CAAC,CAAA;AACnD,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAA;IAErD,MAAM,SAAS,GAAG,MAA2C;;QAAC,QAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACzD,KAAK,CAER,EAAA,EAAA,SAAS,EAAE,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,SAAS,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,aAAa,CAA2C,eAAe,CAAC,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,aAAa,EAErH,OAAO,EAAE,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,SAAS,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,K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,aAAa,CAAC,CAAA;AACpD,YAAA,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAA;AAC7B,SAAA;QASD,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;AAC/C,YAAA,YAAY,CAAC,OAAO,GAAG,KAAK,CAAA;YAC5B,IAAI,iBAAiB,CAAC,OAAO;AAAE,gBAAA,oBAAoB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;AAC9E,YAAA,iBAAiB,CAAC,OAAO,GAAG,qBAAqB,CAAC,MAAK;;gBACrD,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,eAAe,CAAC,SAAS,EAAE,CAAC,CAAA;AAChD,aAAC,CAAC,CAAA;AACH,SAAA;AACH,KAAC,CAAC,CAAA;IAEF,QACE,6BAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAA,EAChE,KAAK,CAAC,QAAQ,CACX,EACP;AACH,CAAC;AAIM,MAAM,kBAAkB,GAC7B,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE,aAAa;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { XYContainerConfigInterface } from '@unovis/ts';
|
|
2
|
+
import { XYContainerConfigInterface } from '@unovis/ts/containers/xy-container/config';
|
|
3
3
|
export declare type VisXYContainerProps<Datum> = XYContainerConfigInterface<Datum> & {
|
|
4
4
|
data?: Datum[];
|
|
5
5
|
className?: string;
|
|
6
|
-
style?: React.CSSProperties
|
|
6
|
+
style?: React.CSSProperties | Record<`--${string}`, string | number>;
|
|
7
7
|
};
|
|
8
8
|
export declare function VisXYContainerFC<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>): JSX.Element;
|
|
9
9
|
export declare const VisXYContainer: (<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>) => JSX.Element | null);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useEffect } from 'react';
|
|
2
|
-
import { XYContainer
|
|
2
|
+
import { XYContainer } from '@unovis/ts/containers/xy-container';
|
|
3
|
+
import { AxisType } from '@unovis/ts/components/axis/types';
|
|
3
4
|
import { arePropsEqual } from '../../utils/react.js';
|
|
4
5
|
|
|
5
6
|
function VisXYContainerFC(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/containers/xy-container/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport React, { ReactNode, useEffect, useRef, useState, PropsWithChildren } from 'react'\nimport { XYContainer
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/containers/xy-container/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport React, { ReactNode, useEffect, useRef, useState, PropsWithChildren } from 'react'\nimport { XYContainer } from '@unovis/ts/containers/xy-container'\nimport { XYContainerConfigInterface } from '@unovis/ts/containers/xy-container/config'\nimport { XYComponentCore } from '@unovis/ts/core/xy-component'\nimport { Tooltip } from '@unovis/ts/components/tooltip'\nimport { Crosshair } from '@unovis/ts/components/crosshair'\nimport { Axis } from '@unovis/ts/components/axis'\nimport { AxisType } from '@unovis/ts/components/axis/types'\nimport { Annotations } from '@unovis/ts/components/annotations'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisXYContainerProps<Datum> = XYContainerConfigInterface<Datum> & {\n data?: Datum[];\n className?: string;\n style?: React.CSSProperties | Record<`--${string}`, string | number>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function VisXYContainerFC<Datum> (props: PropsWithChildren<VisXYContainerProps<Datum>>): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const prevPropsRef = useRef<PropsWithChildren<VisXYContainerProps<Datum>>>({})\n const chartRef = useRef<XYContainer<Datum> | undefined>(undefined)\n const dataRef = useRef<Datum[] | undefined>(undefined)\n const animationFrameRef = useRef<number | null>(null)\n\n const getConfig = (): XYContainerConfigInterface<Datum> => ({\n components: Array\n .from(container.current?.querySelectorAll<VisComponentElement<XYComponentCore<Datum>>>('vis-component') ?? [])\n .map(c => c.__component__)\n .filter(Boolean) as XYComponentCore<Datum>[],\n tooltip: container.current?.querySelector<VisComponentElement<Tooltip>>('vis-tooltip')?.__component__,\n crosshair: container.current?.querySelector<VisComponentElement<Crosshair<Datum>>>('vis-crosshair')?.__component__,\n annotations: container.current?.querySelector<VisComponentElement<Annotations>>('vis-annotations')?.__component__,\n xAxis: Array\n .from(container.current?.querySelectorAll<VisComponentElement<Axis<Datum>>>('vis-axis') ?? [])\n .map(c => c.__component__)\n .find(c => c.config.type === AxisType.X),\n yAxis: Array\n .from(container.current?.querySelectorAll<VisComponentElement<Axis<Datum>>>('vis-axis') ?? [])\n .map(c => c.__component__)\n .find(c => c.config.type === AxisType.Y),\n margin: { top: 5, left: 5, right: 5, bottom: 5 },\n ...props,\n })\n\n // On Mount\n useEffect(() => {\n const c = new XYContainer<Datum>(container.current as HTMLDivElement, getConfig(), props.data)\n chartRef.current = c\n prevPropsRef.current = props\n dataRef.current = props.data\n\n return () => {\n if (animationFrameRef.current) {\n cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = null\n prevPropsRef.current = {}\n }\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const preventRender = true\n\n // Set new Data without re-render\n if (props.data && (props.data !== dataRef.current)) {\n chartRef.current?.setData(props.data, preventRender)\n dataRef.current = props.data\n }\n\n // Update and render\n // ! Experimental: we use `requestAnimationFrame` to make the wrapper compatible with React 18 Strict Mode.\n // React 18 in Strict Mode renders components twice. At the same time, this container will get updated only after\n // the first render of its children (VisLine, VisArea, ...) meaning that their wrong instances (the ones\n // that will be destroyed soon) are stored in the `__component__` property of their elements at that moment.\n // So we delay the container update with `requestAnimationFrame` to wait till the new instances of children\n // components are available at `__component__`.\n if (!arePropsEqual(prevPropsRef.current, props)) { // Checking whether the props have changed do avoid multiple renders\n prevPropsRef.current = props\n if (animationFrameRef.current) cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = requestAnimationFrame(() => {\n chartRef.current?.updateContainer(getConfig())\n })\n }\n })\n\n return (\n <div ref={container} className={props.className} style={props.style}>\n {props.children}\n </div>\n )\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisXYContainer: (<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>) => JSX.Element | null) =\n React.memo(VisXYContainerFC, arePropsEqual)\n"],"names":[],"mappings":";;;;;AAwBM,SAAU,gBAAgB,CAAS,KAAoD,EAAA;AAC3F,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;AAC9C,IAAA,MAAM,YAAY,GAAG,MAAM,CAAgD,EAAE,CAAC,CAAA;AAC9E,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAiC,SAAS,CAAC,CAAA;AAClE,IAAA,MAAM,OAAO,GAAG,MAAM,CAAsB,SAAS,CAAC,CAAA;AACtD,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAA;IAErD,MAAM,SAAS,GAAG,MAAwC;;QAAC,QAAA,MAAA,CAAA,MAAA,CAAA,EACzD,UAAU,EAAE,KAAK;AACd,iBAAA,IAAI,CAAC,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,SAAS,CAAC,OAAO,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,gBAAgB,CAA8C,eAAe,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,EAAE,C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IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,EAAE;AAClD,YAAA,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;AACpD,YAAA,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAA;AAC7B,SAAA;QASD,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;AAC/C,YAAA,YAAY,CAAC,OAAO,GAAG,KAAK,CAAA;YAC5B,IAAI,iBAAiB,CAAC,OAAO;AAAE,gBAAA,oBAAoB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;AAC9E,YAAA,iBAAiB,CAAC,OAAO,GAAG,qBAAqB,CAAC,MAAK;;gBACrD,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,eAAe,CAAC,SAAS,EAAE,CAAC,CAAA;AAChD,aAAC,CAAC,CAAA;AACH,SAAA;AACH,KAAC,CAAC,CAAA;IAEF,QACE,6BAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAA,EAChE,KAAK,CAAC,QAAQ,CACX,EACP;AACH,CAAC;AAIM,MAAM,cAAc,GACzB,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
|
-
import { BulletLegend
|
|
2
|
+
import { BulletLegend } from '@unovis/ts/components/bullet-legend';
|
|
3
|
+
import { BulletLegendConfigInterface } from '@unovis/ts/components/bullet-legend/config';
|
|
3
4
|
export declare type VisBulletLegendRef = {
|
|
4
5
|
component?: BulletLegend;
|
|
5
6
|
};
|
|
@@ -7,5 +8,5 @@ export declare type VisBulletLegendProps = BulletLegendConfigInterface & {
|
|
|
7
8
|
ref?: Ref<VisBulletLegendRef>;
|
|
8
9
|
className?: string;
|
|
9
10
|
};
|
|
10
|
-
export declare const VisBulletLegendSelectors: typeof import("@unovis/ts/
|
|
11
|
+
export declare const VisBulletLegendSelectors: typeof import("@unovis/ts/components/bullet-legend/style");
|
|
11
12
|
export declare const VisBulletLegend: ((props: VisBulletLegendProps) => JSX.Element | null);
|