@unovis/react 1.0.0-beta.3 → 1.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/components/area/index.d.ts +10 -10
  2. package/components/area/index.js +7 -6
  3. package/components/area/index.js.map +1 -1
  4. package/components/axis/index.d.ts +10 -10
  5. package/components/axis/index.js +7 -6
  6. package/components/axis/index.js.map +1 -1
  7. package/components/brush/index.d.ts +10 -10
  8. package/components/brush/index.js +7 -6
  9. package/components/brush/index.js.map +1 -1
  10. package/components/chord-diagram/index.d.ts +13 -13
  11. package/components/crosshair/index.d.ts +10 -10
  12. package/components/crosshair/index.js +7 -6
  13. package/components/crosshair/index.js.map +1 -1
  14. package/components/donut/index.d.ts +10 -10
  15. package/components/donut/index.js +7 -6
  16. package/components/donut/index.js.map +1 -1
  17. package/components/free-brush/index.d.ts +10 -10
  18. package/components/free-brush/index.js +7 -6
  19. package/components/free-brush/index.js.map +1 -1
  20. package/components/graph/index.d.ts +10 -10
  21. package/components/graph/index.js +7 -6
  22. package/components/graph/index.js.map +1 -1
  23. package/components/grouped-bar/index.d.ts +10 -10
  24. package/components/grouped-bar/index.js +7 -6
  25. package/components/grouped-bar/index.js.map +1 -1
  26. package/components/line/index.d.ts +10 -10
  27. package/components/line/index.js +7 -6
  28. package/components/line/index.js.map +1 -1
  29. package/components/sankey/index.d.ts +10 -10
  30. package/components/sankey/index.js +7 -6
  31. package/components/sankey/index.js.map +1 -1
  32. package/components/scatter/index.d.ts +10 -10
  33. package/components/scatter/index.js +7 -6
  34. package/components/scatter/index.js.map +1 -1
  35. package/components/stacked-bar/index.d.ts +10 -10
  36. package/components/stacked-bar/index.js +7 -6
  37. package/components/stacked-bar/index.js.map +1 -1
  38. package/components/timeline/index.d.ts +10 -10
  39. package/components/timeline/index.js +7 -6
  40. package/components/timeline/index.js.map +1 -1
  41. package/components/tooltip/index.d.ts +10 -10
  42. package/components/tooltip/index.js +7 -6
  43. package/components/tooltip/index.js.map +1 -1
  44. package/components/topojson-map/index.d.ts +14 -14
  45. package/components/topojson-map/index.js +7 -6
  46. package/components/topojson-map/index.js.map +1 -1
  47. package/components/xy-labels/index.d.ts +10 -10
  48. package/components/xy-labels/index.js +7 -6
  49. package/components/xy-labels/index.js.map +1 -1
  50. package/components.d.ts +19 -19
  51. package/composites/time-series/index.d.ts +54 -54
  52. package/composites/time-series/style.d.ts +3 -3
  53. package/composites.d.ts +1 -1
  54. package/containers/single-container/index.d.ts +6 -6
  55. package/containers/single-container/index.js +4 -1
  56. package/containers/single-container/index.js.map +1 -1
  57. package/containers/xy-container/index.d.ts +8 -8
  58. package/containers/xy-container/index.js +4 -1
  59. package/containers/xy-container/index.js.map +1 -1
  60. package/containers.d.ts +2 -2
  61. package/html-components/bullet-legend/index.d.ts +3 -3
  62. package/html-components/leaflet-flow-map/index.d.ts +15 -15
  63. package/html-components/leaflet-map/index.d.ts +12 -12
  64. package/index.d.ts +3 -3
  65. package/package.json +5 -3
  66. package/types/dom.d.ts +3 -3
  67. package/utils/react.d.ts +4 -4
  68. package/utils/react.js +1 -1
  69. package/utils/react.js.map +1 -1
  70. package/src/components/area/index.d.ts +0 -10
  71. package/src/components/axis/index.d.ts +0 -10
  72. package/src/components/brush/index.d.ts +0 -10
  73. package/src/components/chord-diagram/index.d.ts +0 -13
  74. package/src/components/crosshair/index.d.ts +0 -10
  75. package/src/components/donut/index.d.ts +0 -10
  76. package/src/components/free-brush/index.d.ts +0 -10
  77. package/src/components/graph/index.d.ts +0 -10
  78. package/src/components/grouped-bar/index.d.ts +0 -10
  79. package/src/components/line/index.d.ts +0 -10
  80. package/src/components/sankey/index.d.ts +0 -10
  81. package/src/components/scatter/index.d.ts +0 -10
  82. package/src/components/stacked-bar/index.d.ts +0 -10
  83. package/src/components/timeline/index.d.ts +0 -10
  84. package/src/components/tooltip/index.d.ts +0 -10
  85. package/src/components/topojson-map/index.d.ts +0 -14
  86. package/src/components/xy-labels/index.d.ts +0 -10
  87. package/src/components.d.ts +0 -19
  88. package/src/composites/time-series/index.d.ts +0 -54
  89. package/src/composites/time-series/style.d.ts +0 -3
  90. package/src/composites.d.ts +0 -1
  91. package/src/containers/single-container/index.d.ts +0 -6
  92. package/src/containers/xy-container/index.d.ts +0 -8
  93. package/src/containers.d.ts +0 -2
  94. package/src/html-components/bullet-legend/index.d.ts +0 -3
  95. package/src/html-components/leaflet-flow-map/index.d.ts +0 -15
  96. package/src/html-components/leaflet-map/index.d.ts +0 -12
  97. package/src/index.d.ts +0 -3
  98. package/src/types/dom.d.ts +0 -3
  99. package/src/utils/react.d.ts +0 -4
@@ -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, Ref, useImperativeHandle, useEffect, useRef } from 'react'\nimport { XYLabels, XYLabelsConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisXYLabelsRef<Datum> = {\n component: XYLabels<Datum>;\n}\n\nexport type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisXYLabelsRef<Datum>>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisXYLabelsFC<Datum> (props: VisXYLabelsProps<Datum>, fRef: ForwardedRef<VisXYLabelsRef<Datum>>): JSX.Element {\n const ref = useRef<VisComponentElement<XYLabels<Datum>>>(null)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<XYLabels<Datum>>)\n element.__component__?.destroy() // Destroy component if exists already (to comply with React 18 strict mode, which renders components twice in dev mode)\n element.__component__ = new XYLabels(props)\n // We don't have a clean up function because the component will be destroyed by its container (e.g. XYContainer or SingleContainer)\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = (ref.current as VisComponentElement<XYLabels<Datum>>).__component__\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: (ref.current as VisComponentElement<XYLabels<Datum>>).__component__ }))\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisXYLabelsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBA,SAAS,aAAa,CAAS,KAA8B,EAAE,IAAyC,EAAA;AACtG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAA;IAG9D,SAAS,CAAC,MAAK;;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAgD,CAAA;AACrE,QAAA,CAAA,EAAA,GAAA,OAAO,CAAC,aAAa,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,OAAO,EAAE,CAAA;QAChC,OAAO,CAAC,aAAa,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAA;KAE5C,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAI,GAAG,CAAC,OAAgD,CAAC,aAAa,CAAA;QACrF,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;AAEF,IAAA,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAG,GAAG,CAAC,OAAgD,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;AACrH,IAAA,OAAO,KAAe,CAAA,aAAA,CAAA,eAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC;AAIY,MAAA,WAAW,GAAoE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { XYLabels, XYLabelsConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisXYLabelsRef<Datum> = {\n component?: XYLabels<Datum>;\n}\n\nexport type VisXYLabelsProps<Datum> = XYLabelsConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisXYLabelsRef<Datum>>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisXYLabelsFC<Datum> (props: VisXYLabelsProps<Datum>, fRef: ForwardedRef<VisXYLabelsRef<Datum>>): JSX.Element {\n const ref = useRef<VisComponentElement<XYLabels<Datum>>>(null)\n const [component, setComponent] = useState<XYLabels<Datum>>()\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<XYLabels<Datum>>)\n\n const c = new XYLabels<Datum>(props)\n setComponent(c)\n element.__component__ = c\n\n return () => c.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n if (props.data) component?.setData(props.data)\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component }), [component])\n return <vis-component ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisXYLabels: (<Datum>(props: VisXYLabelsProps<Datum>) => JSX.Element | null) = React.memo(React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
1
- export * from './components/line';
2
- export * from './components/area';
3
- export * from './components/axis';
4
- export * from './components/brush/';
5
- export * from './components/free-brush';
6
- export * from './components/crosshair/';
7
- export * from './components/donut/';
8
- export * from './components/graph';
9
- export * from './components/grouped-bar/';
10
- export * from './components/scatter/';
11
- export * from './components/sankey';
12
- export * from './components/stacked-bar/';
13
- export * from './components/tooltip/';
14
- export * from './components/timeline/';
15
- export * from './components/topojson-map/';
16
- export * from './components/xy-labels';
17
- export * from './html-components/bullet-legend';
18
- export * from './html-components/leaflet-map';
19
- export * from './html-components/leaflet-flow-map';
1
+ export * from './components/line';
2
+ export * from './components/area';
3
+ export * from './components/axis';
4
+ export * from './components/brush/';
5
+ export * from './components/free-brush';
6
+ export * from './components/crosshair/';
7
+ export * from './components/donut/';
8
+ export * from './components/graph';
9
+ export * from './components/grouped-bar/';
10
+ export * from './components/scatter/';
11
+ export * from './components/sankey';
12
+ export * from './components/stacked-bar/';
13
+ export * from './components/tooltip/';
14
+ export * from './components/timeline/';
15
+ export * from './components/topojson-map/';
16
+ export * from './components/xy-labels';
17
+ export * from './html-components/bullet-legend';
18
+ export * from './html-components/leaflet-map';
19
+ export * from './html-components/leaflet-flow-map';
@@ -1,54 +1,54 @@
1
- import { Spacing } from '@unovis/ts';
2
- export declare type VisTimeSeriesDatum = {
3
- timestamp: number;
4
- value: number;
5
- id?: string;
6
- color?: string;
7
- };
8
- export declare type VisTimeSeriesProps<Datum> = {
9
- data: Datum[];
10
- margin: Spacing;
11
- autoMargin: boolean;
12
- x: (d: Datum, i: number) => number;
13
- y: (d: Datum, i: number) => number;
14
- id: (d: Datum, i: number) => string;
15
- color: (d: Datum, i: number) => string;
16
- cursor: string | ((d: Datum, i: number) => string);
17
- formatXTicks?: (timestamp: number) => string;
18
- formatYTicks?: (timestamp: number) => string;
19
- selectionMinLength: number;
20
- onBrushStart?: (selection: [number, number], e?: {
21
- sourceEvent: MouseEvent;
22
- }, userDriven?: boolean) => void;
23
- onBrushMove?: (selection: [number, number], e?: {
24
- sourceEvent: MouseEvent;
25
- }, userDriven?: boolean) => void;
26
- onBrushEnd?: (selection: [number, number], e?: {
27
- sourceEvent: MouseEvent;
28
- }, userDriven?: boolean) => void;
29
- formatNavXTicks?: (timestamp: number) => string;
30
- xLabel?: string;
31
- yLabel?: string;
32
- crosshairTemplate?: (d: Datum) => string | HTMLElement;
33
- className?: string;
34
- height?: string;
35
- };
36
- export declare function VisTimeSeries<Datum>(props: VisTimeSeriesProps<Datum>): JSX.Element;
37
- export declare namespace VisTimeSeries {
38
- var defaultProps: {
39
- margin: {
40
- top: number;
41
- bottom: number;
42
- left: number;
43
- right: number;
44
- };
45
- autoMargin: boolean;
46
- padding: {};
47
- x: (d: VisTimeSeriesDatum) => number;
48
- y: (d: VisTimeSeriesDatum) => number;
49
- id: (d: VisTimeSeriesDatum) => string | undefined;
50
- color: (d: VisTimeSeriesDatum) => string | undefined;
51
- formatYTicks: (d: number) => string;
52
- crosshairTemplate: (d: VisTimeSeriesDatum) => string;
53
- };
54
- }
1
+ import { Spacing } from '@unovis/ts';
2
+ export declare type VisTimeSeriesDatum = {
3
+ timestamp: number;
4
+ value: number;
5
+ id?: string;
6
+ color?: string;
7
+ };
8
+ export declare type VisTimeSeriesProps<Datum> = {
9
+ data: Datum[];
10
+ margin: Spacing;
11
+ autoMargin: boolean;
12
+ x: (d: Datum, i: number) => number;
13
+ y: (d: Datum, i: number) => number;
14
+ id: (d: Datum, i: number) => string;
15
+ color: (d: Datum, i: number) => string;
16
+ cursor: string | ((d: Datum, i: number) => string);
17
+ formatXTicks?: (timestamp: number) => string;
18
+ formatYTicks?: (timestamp: number) => string;
19
+ selectionMinLength: number;
20
+ onBrushStart?: (selection: [number, number], e?: {
21
+ sourceEvent: MouseEvent;
22
+ }, userDriven?: boolean) => void;
23
+ onBrushMove?: (selection: [number, number], e?: {
24
+ sourceEvent: MouseEvent;
25
+ }, userDriven?: boolean) => void;
26
+ onBrushEnd?: (selection: [number, number], e?: {
27
+ sourceEvent: MouseEvent;
28
+ }, userDriven?: boolean) => void;
29
+ formatNavXTicks?: (timestamp: number) => string;
30
+ xLabel?: string;
31
+ yLabel?: string;
32
+ crosshairTemplate?: (d: Datum) => string | HTMLElement;
33
+ className?: string;
34
+ height?: string;
35
+ };
36
+ export declare function VisTimeSeries<Datum>(props: VisTimeSeriesProps<Datum>): JSX.Element;
37
+ export declare namespace VisTimeSeries {
38
+ var defaultProps: {
39
+ margin: {
40
+ top: number;
41
+ bottom: number;
42
+ left: number;
43
+ right: number;
44
+ };
45
+ autoMargin: boolean;
46
+ padding: {};
47
+ x: (d: VisTimeSeriesDatum) => number;
48
+ y: (d: VisTimeSeriesDatum) => number;
49
+ id: (d: VisTimeSeriesDatum) => string | undefined;
50
+ color: (d: VisTimeSeriesDatum) => string | undefined;
51
+ formatYTicks: (d: number) => string;
52
+ crosshairTemplate: (d: VisTimeSeriesDatum) => string;
53
+ };
54
+ }
@@ -1,3 +1,3 @@
1
- export declare const timeSeriesContainer: string;
2
- export declare const timeSeriesModule: string;
3
- export declare const navigationModule: string;
1
+ export declare const timeSeriesContainer: string;
2
+ export declare const timeSeriesModule: string;
3
+ export declare const navigationModule: string;
package/composites.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './composites/time-series';
1
+ export * from './composites/time-series';
@@ -1,6 +1,6 @@
1
- import { PropsWithChildren } from 'react';
2
- import { SingleContainerConfigInterface } from '@unovis/ts';
3
- export declare type VisSingleContainerProps<Data> = SingleContainerConfigInterface<Data> & {
4
- data?: Data;
5
- };
6
- export declare const VisSingleContainer: (<Data>(props: PropsWithChildren<VisSingleContainerProps<Data>>) => JSX.Element | null);
1
+ import { PropsWithChildren } from 'react';
2
+ import { SingleContainerConfigInterface } from '@unovis/ts';
3
+ export declare type VisSingleContainerProps<Data> = SingleContainerConfigInterface<Data> & {
4
+ data?: Data;
5
+ };
6
+ export declare const VisSingleContainer: (<Data>(props: PropsWithChildren<VisSingleContainerProps<Data>>) => JSX.Element | null);
@@ -6,6 +6,7 @@ function VisSingleContainerFC(props) {
6
6
  const container = useRef(null);
7
7
  const [chart, setChart] = useState();
8
8
  const [data, setData] = useState(undefined);
9
+ const animationFrameRef = useRef(null);
9
10
  const getConfig = () => {
10
11
  var _a, _b, _c, _d;
11
12
  return (Object.assign(Object.assign({}, props), { component: (_b = (_a = container.current) === null || _a === void 0 ? void 0 : _a.querySelector('vis-component')) === null || _b === void 0 ? void 0 : _b.__component__, tooltip: (_d = (_c = container.current) === null || _c === void 0 ? void 0 : _c.querySelector('vis-tooltip')) === null || _d === void 0 ? void 0 : _d.__component__ }));
@@ -22,7 +23,9 @@ function VisSingleContainerFC(props) {
22
23
  chart === null || chart === void 0 ? void 0 : chart.setData(props.data, preventRender);
23
24
  setData(props.data);
24
25
  }
25
- chart === null || chart === void 0 ? void 0 : chart.updateContainer(getConfig());
26
+ if (animationFrameRef.current)
27
+ cancelAnimationFrame(animationFrameRef.current);
28
+ animationFrameRef.current = requestAnimationFrame(() => chart === null || chart === void 0 ? void 0 : chart.updateContainer(getConfig()));
26
29
  });
27
30
  return (React.createElement("div", { ref: container, style: { width: '100%', height: '100%', position: 'relative' } }, props.children));
28
31
  }
@@ -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, SingleContainerConfigInterface, ComponentCore, Tooltip } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisSingleContainerProps<Data> = SingleContainerConfigInterface<Data> & {\n data?: Data;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisSingleContainerFC<Data> (props: PropsWithChildren<VisSingleContainerProps<Data>>): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const [chart, setChart] = useState<SingleContainer<Data>>()\n const [data, setData] = useState<Data | undefined>(undefined)\n\n const getConfig = (): SingleContainerConfigInterface<Data> => ({\n ...props,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n component: container.current?.querySelector<VisComponentElement<ComponentCore<Data>>>('vis-component')?.__component__,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n tooltip: container.current?.querySelector<VisComponentElement<Tooltip>>('vis-tooltip')?.__component__,\n })\n\n // On Mount\n useEffect(() => {\n setData(props.data)\n const c = new SingleContainer<Data>(container.current as HTMLDivElement, getConfig(), props.data)\n setChart(c)\n return () => c.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n const preventRender = true\n\n // Set new Data without re-render\n if (props.data && (props.data !== data)) {\n chart?.setData(props.data, preventRender)\n setData(props.data)\n }\n\n // Update Container and render\n chart?.updateContainer(getConfig())\n })\n\n return (\n <div ref={container} style={{ width: '100%', height: '100%', position: 'relative' }}>\n {props.children}\n </div>\n )\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisSingleContainer: (<Data>(props: PropsWithChildren<VisSingleContainerProps<Data>>) => JSX.Element | null) =\n React.memo(VisSingleContainerFC, arePropsEqual)\n"],"names":[],"mappings":";;;;AAeA,SAAS,oBAAoB,CAAQ,KAAuD,EAAA;AAC1F,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAyB,CAAA;IAC3D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAmB,SAAS,CAAC,CAAA;IAE7D,MAAM,SAAS,GAAG,MAA2C;;AAAC,QAAA,QACzD,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,CAER,EAAA,EAAA,SAAS,EAAE,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,SAAS,CAAC,OAAO,MAAA,IAAA,IAA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EAAE,CAAC,CAAA;AACrC,KAAC,CAAC,CAAA;IAEF,QACE,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,EAChF,EAAA,KAAK,CAAC,QAAQ,CACX,EACP;AACH,CAAC;AAIM,MAAM,kBAAkB,GAC7B,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.tsx"],"sourcesContent":["// eslint-disable-next-line no-use-before-define\nimport React, { ReactNode, useEffect, useRef, useState, PropsWithChildren } from 'react'\nimport { SingleContainer, SingleContainerConfigInterface, ComponentCore, Tooltip } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisSingleContainerProps<Data> = SingleContainerConfigInterface<Data> & {\n data?: Data;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisSingleContainerFC<Data> (props: PropsWithChildren<VisSingleContainerProps<Data>>): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const [chart, setChart] = useState<SingleContainer<Data>>()\n const [data, setData] = useState<Data | undefined>(undefined)\n 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 })\n\n // On Mount\n useEffect(() => {\n setData(props.data)\n const c = new SingleContainer<Data>(container.current as HTMLDivElement, getConfig(), props.data)\n setChart(c)\n return () => c.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n const preventRender = true\n\n // Set new Data without re-render\n if (props.data && (props.data !== data)) {\n chart?.setData(props.data, preventRender)\n setData(props.data)\n }\n\n // Update 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 (animationFrameRef.current) cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = requestAnimationFrame(() => chart?.updateContainer(getConfig()))\n })\n\n return (\n <div ref={container} style={{ width: '100%', height: '100%', position: 'relative' }}>\n {props.children}\n </div>\n )\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisSingleContainer: (<Data>(props: PropsWithChildren<VisSingleContainerProps<Data>>) => JSX.Element | null) =\n React.memo(VisSingleContainerFC, arePropsEqual)\n"],"names":[],"mappings":";;;;AAeA,SAAS,oBAAoB,CAAQ,KAAuD,EAAA;AAC1F,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAyB,CAAA;IAC3D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAmB,SAAS,CAAC,CAAA;AAC7D,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAA;IAErD,MAAM,SAAS,GAAG,MAA2C;;AAAC,QAAA,QACzD,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,CAER,EAAA,EAAA,SAAS,EAAE,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,SAAS,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA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O,GAAG,qBAAqB,CAAC,MAAM,KAAK,KAAA,IAAA,IAAL,KAAK,KAAL,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,KAAK,CAAE,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AAC9F,KAAC,CAAC,CAAA;IAEF,QACE,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,EAChF,EAAA,KAAK,CAAC,QAAQ,CACX,EACP;AACH,CAAC;AAIM,MAAM,kBAAkB,GAC7B,KAAK,CAAC,IAAI,CAAC,oBAAoB,EAAE,aAAa;;;;"}
@@ -1,8 +1,8 @@
1
- import { PropsWithChildren } from 'react';
2
- import { XYContainerConfigInterface } from '@unovis/ts';
3
- export declare type VisXYContainerProps<Datum> = XYContainerConfigInterface<Datum> & {
4
- data?: Datum[];
5
- className?: string;
6
- };
7
- export declare function VisXYContainerFC<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>): JSX.Element;
8
- export declare const VisXYContainer: (<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>) => JSX.Element | null);
1
+ import { PropsWithChildren } from 'react';
2
+ import { XYContainerConfigInterface } from '@unovis/ts';
3
+ export declare type VisXYContainerProps<Datum> = XYContainerConfigInterface<Datum> & {
4
+ data?: Datum[];
5
+ className?: string;
6
+ };
7
+ export declare function VisXYContainerFC<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>): JSX.Element;
8
+ export declare const VisXYContainer: (<Datum>(props: PropsWithChildren<VisXYContainerProps<Datum>>) => JSX.Element | null);
@@ -6,6 +6,7 @@ function VisXYContainerFC(props) {
6
6
  const container = useRef(null);
7
7
  const [chart, setChart] = useState();
8
8
  const [data, setData] = useState(undefined);
9
+ const animationFrameRef = useRef(null);
9
10
  const getConfig = () => {
10
11
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
11
12
  return (Object.assign({ components: Array
@@ -30,7 +31,9 @@ function VisXYContainerFC(props) {
30
31
  chart === null || chart === void 0 ? void 0 : chart.setData(props.data, preventRender);
31
32
  setData(props.data);
32
33
  }
33
- chart === null || chart === void 0 ? void 0 : chart.updateContainer(getConfig());
34
+ if (animationFrameRef.current)
35
+ cancelAnimationFrame(animationFrameRef.current);
36
+ animationFrameRef.current = requestAnimationFrame(() => chart === null || chart === void 0 ? void 0 : chart.updateContainer(getConfig()));
34
37
  });
35
38
  return (React.createElement("div", { ref: container, className: props.className }, props.children));
36
39
  }
@@ -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, XYContainerConfigInterface, XYComponentCore, Tooltip, Crosshair, Axis, AxisType } from '@unovis/ts'\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}\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 [chart, setChart] = useState<XYContainer<Datum>>()\n const [data, setData] = useState<Datum[] | undefined>(undefined)\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 tooltip: container.current?.querySelector<VisComponentElement<Tooltip>>('vis-tooltip')?.__component__,\n crosshair: container.current?.querySelector<VisComponentElement<Crosshair<Datum>>>('vis-crosshair')?.__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 setData(props.data)\n const c = new XYContainer<Datum>(container.current as HTMLDivElement, getConfig(), props.data)\n setChart(c)\n\n return () => c.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n const preventRender = true\n\n // Set new Data without re-render\n if (props.data && (props.data !== data)) {\n chart?.setData(props.data, preventRender)\n setData(props.data)\n }\n // Update Container and render\n chart?.updateContainer(getConfig())\n })\n\n return (\n <div ref={container} className={props.className}>\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":";;;;AAgBM,SAAU,gBAAgB,CAAS,KAAoD,EAAA;AAC3F,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAsB,CAAA;IACxD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAsB,SAAS,CAAC,CAAA;IAEhE,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,eA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AA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAC5C,EAAA,KAAK,CAAC,QAAQ,CACX,EACP;AACH,CAAC;AAIM,MAAM,cAAc,GACzB,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa;;;;"}
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, XYContainerConfigInterface, XYComponentCore, Tooltip, Crosshair, Axis, AxisType } from '@unovis/ts'\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}\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 [chart, setChart] = useState<XYContainer<Datum>>()\n const [data, setData] = useState<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 tooltip: container.current?.querySelector<VisComponentElement<Tooltip>>('vis-tooltip')?.__component__,\n crosshair: container.current?.querySelector<VisComponentElement<Crosshair<Datum>>>('vis-crosshair')?.__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 setData(props.data)\n const c = new XYContainer<Datum>(container.current as HTMLDivElement, getConfig(), props.data)\n setChart(c)\n\n return () => c.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n const preventRender = true\n\n // Set new Data without re-render\n if (props.data && (props.data !== data)) {\n chart?.setData(props.data, preventRender)\n setData(props.data)\n }\n\n // Update 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 (animationFrameRef.current) cancelAnimationFrame(animationFrameRef.current)\n animationFrameRef.current = requestAnimationFrame(() => chart?.updateContainer(getConfig()))\n })\n\n return (\n <div ref={container} className={props.className}>\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":";;;;AAgBM,SAAU,gBAAgB,CAAS,KAAoD,EAAA;AAC3F,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAsB,CAAA;IACxD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAsB,SAAS,CAAC,CAAA;AAChE,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAA;IAErD,MAAM,SAAS,GAAG,MAAwC;;QAAC,QAAA,MAAA,CAAA,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CAAC,IAAI,CAAC,CAAA;AACpB,SAAA;QASD,IAAI,iBAAiB,CAAC,OAAO;AAAE,YAAA,oBAAoB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;QAC9E,iBAAiB,CAAC,OAAO,GAAG,qBAAqB,CAAC,MAAM,KAAK,KAAA,IAAA,IAAL,KAAK,KAAL,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,KAAK,CAAE,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AAC9F,KAAC,CAAC,CAAA;AAEF,IAAA,QACE,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAC5C,EAAA,KAAK,CAAC,QAAQ,CACX,EACP;AACH,CAAC;AAIM,MAAM,cAAc,GACzB,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa;;;;"}
package/containers.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './containers/xy-container';
2
- export * from './containers/single-container';
1
+ export * from './containers/xy-container';
2
+ export * from './containers/single-container';
@@ -1,3 +1,3 @@
1
- import { BulletLegendConfigInterface } from '@unovis/ts';
2
- export declare type VisBulletLegendProps = BulletLegendConfigInterface;
3
- export declare function VisBulletLegend(props: VisBulletLegendProps): JSX.Element;
1
+ import { BulletLegendConfigInterface } from '@unovis/ts';
2
+ export declare type VisBulletLegendProps = BulletLegendConfigInterface;
3
+ export declare function VisBulletLegend(props: VisBulletLegendProps): JSX.Element;
@@ -1,15 +1,15 @@
1
- import { ForwardedRef, Ref } from 'react';
2
- import { LeafletFlowMap, LeafletFlowMapConfigInterface } from '@unovis/ts';
3
- export declare type VisLeafletFlowMapProps<PointDatum, FlowDatum> = LeafletFlowMapConfigInterface<PointDatum, FlowDatum> & {
4
- data?: {
5
- points: PointDatum[];
6
- flows: FlowDatum[];
7
- };
8
- ref?: Ref<VisLeafletFlowMapRef<PointDatum, FlowDatum>>;
9
- className?: string;
10
- };
11
- export declare type VisLeafletFlowMapRef<PointDatum, FlowDatum> = {
12
- component: LeafletFlowMap<PointDatum, FlowDatum> | undefined;
13
- };
14
- export declare function VisLeafletFlowMapFC<PointDatum, FlowDatum>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>, ref: ForwardedRef<VisLeafletFlowMapRef<PointDatum, FlowDatum>>): JSX.Element;
15
- export declare const VisLeafletFlowMap: (<PointDatum, FlowDatum>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>) => JSX.Element | null);
1
+ import { ForwardedRef, Ref } from 'react';
2
+ import { LeafletFlowMap, LeafletFlowMapConfigInterface } from '@unovis/ts';
3
+ export declare type VisLeafletFlowMapProps<PointDatum, FlowDatum> = LeafletFlowMapConfigInterface<PointDatum, FlowDatum> & {
4
+ data?: {
5
+ points: PointDatum[];
6
+ flows: FlowDatum[];
7
+ };
8
+ ref?: Ref<VisLeafletFlowMapRef<PointDatum, FlowDatum>>;
9
+ className?: string;
10
+ };
11
+ export declare type VisLeafletFlowMapRef<PointDatum, FlowDatum> = {
12
+ component: LeafletFlowMap<PointDatum, FlowDatum> | undefined;
13
+ };
14
+ export declare function VisLeafletFlowMapFC<PointDatum, FlowDatum>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>, ref: ForwardedRef<VisLeafletFlowMapRef<PointDatum, FlowDatum>>): JSX.Element;
15
+ export declare const VisLeafletFlowMap: (<PointDatum, FlowDatum>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>) => JSX.Element | null);
@@ -1,12 +1,12 @@
1
- import { ForwardedRef, Ref } from 'react';
2
- import { LeafletMap, LeafletMapConfigInterface } from '@unovis/ts';
3
- export declare type VisLeafletMapProps<Datum> = LeafletMapConfigInterface<Datum> & {
4
- data?: Datum[];
5
- ref?: Ref<VisLeafletMapRef<Datum>>;
6
- className?: string;
7
- };
8
- export declare type VisLeafletMapRef<Datum> = {
9
- component: LeafletMap<Datum> | undefined;
10
- };
11
- export declare function VisLeafletMapFC<Datum>(props: VisLeafletMapProps<Datum>, ref: ForwardedRef<VisLeafletMapRef<Datum>>): JSX.Element;
12
- export declare const VisLeafletMap: (<Datum>(props: VisLeafletMapProps<Datum>) => JSX.Element | null);
1
+ import { ForwardedRef, Ref } from 'react';
2
+ import { LeafletMap, LeafletMapConfigInterface } from '@unovis/ts';
3
+ export declare type VisLeafletMapProps<Datum> = LeafletMapConfigInterface<Datum> & {
4
+ data?: Datum[];
5
+ ref?: Ref<VisLeafletMapRef<Datum>>;
6
+ className?: string;
7
+ };
8
+ export declare type VisLeafletMapRef<Datum> = {
9
+ component: LeafletMap<Datum> | undefined;
10
+ };
11
+ export declare function VisLeafletMapFC<Datum>(props: VisLeafletMapProps<Datum>, ref: ForwardedRef<VisLeafletMapRef<Datum>>): JSX.Element;
12
+ export declare const VisLeafletMap: (<Datum>(props: VisLeafletMapProps<Datum>) => JSX.Element | null);
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './containers';
2
- export * from './components';
3
- export * from './composites';
1
+ export * from './containers';
2
+ export * from './components';
3
+ export * from './composites';
package/package.json CHANGED
@@ -1,20 +1,22 @@
1
1
  {
2
2
  "name": "@unovis/react",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.5",
4
4
  "description": "React wrapper for Unovis",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
7
+ "type": "module",
8
+ "sideEffects": false,
7
9
  "scripts": {
8
10
  "build": "rimraf dist && tsc --project tsconfig.lib.json --emitDeclarationOnly && rollup --config",
9
11
  "tsc": "tsc",
10
- "generate": "rollup -c ./autogen/rollup.config.js; node .autogen.js; rm .autogen.js",
12
+ "generate": "rollup -c ./autogen/rollup.config.js; node .autogen.cjs; rm .autogen.cjs",
11
13
  "publish-dist": "cp ./package.json ./dist; cp ../../LICENSE ./dist; cd ./dist; npm publish; rm -rf .cache"
12
14
  },
13
15
  "author": "Nikita Rokotyan",
14
16
  "license": "Apache-2.0",
15
17
  "peerDependencies": {
16
18
  "@emotion/css": "^11.7.1",
17
- "@unovis/ts": "1.0.0-beta.3",
19
+ "@unovis/ts": "1.0.0-beta.5",
18
20
  "react": ">=16.8.0",
19
21
  "react-dom": ">=16.8.0"
20
22
  },
package/types/dom.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare type VisComponentElement<T> = HTMLElement & {
2
- __component__: T;
3
- };
1
+ export declare type VisComponentElement<T> = HTMLElement & {
2
+ __component__: T;
3
+ };
package/utils/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
2
- export declare function arePropsEqual<PropTypes extends {
3
- children?: ReactNode;
4
- }>(prevProps: PropTypes, nextProps: PropTypes): boolean;
1
+ import { ReactNode } from 'react';
2
+ export declare function arePropsEqual<PropTypes extends {
3
+ children?: ReactNode;
4
+ }>(prevProps: PropTypes, nextProps: PropTypes): boolean;
package/utils/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import _isEqual from 'lodash/isEqual';
1
+ import _isEqual from 'lodash/isEqual.js';
2
2
 
3
3
  function arePropsEqual(prevProps, nextProps) {
4
4
  if (typeof prevProps.children !== typeof nextProps.children)
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sources":["../../src/utils/react.ts"],"sourcesContent":["import { ReactElement, ReactNode, ReactChild, ReactFragment } from 'react'\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport _isEqual from 'lodash/isEqual'\n\nexport function arePropsEqual<PropTypes extends { children?: ReactNode }> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n if (typeof prevProps.children !== typeof nextProps.children) return false\n\n if (Array.isArray(prevProps.children) && Array.isArray(nextProps.children)) {\n const prevChildren = prevProps.children as ReactElement[]\n const nextChildren = nextProps.children as ReactElement[]\n if (prevChildren.length !== nextChildren.length) return false\n\n for (let i = 0; i < nextChildren.length; i += 1) {\n if (!_isEqual(prevChildren[i].props, nextChildren[i].props)) return false\n }\n }\n\n const propKeys = Array.from(new Set([...Object.keys(prevProps), ...Object.keys(nextProps)])) as (keyof PropTypes)[]\n for (const key of propKeys) {\n if (key === 'children') continue\n if (!(_isEqual(prevProps[key], nextProps[key]))) return false\n }\n\n return true\n}\n"],"names":[],"mappings":";;AAKgB,SAAA,aAAa,CAA8C,SAAoB,EAAE,SAAoB,EAAA;IACnH,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,OAAO,SAAS,CAAC,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAA;AAEzE,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;AAC1E,QAAA,MAAM,YAAY,GAAG,SAAS,CAAC,QAA0B,CAAA;AACzD,QAAA,MAAM,YAAY,GAAG,SAAS,CAAC,QAA0B,CAAA;AACzD,QAAA,IAAI,YAAY,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM;AAAE,YAAA,OAAO,KAAK,CAAA;AAE7D,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;AAC/C,YAAA,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAAE,gBAAA,OAAO,KAAK,CAAA;AAC1E,SAAA;AACF,KAAA;AAED,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAwB,CAAA;AACnH,IAAA,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;QAC1B,IAAI,GAAG,KAAK,UAAU;YAAE,SAAQ;AAChC,QAAA,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK,CAAA;AAC9D,KAAA;AAED,IAAA,OAAO,IAAI,CAAA;AACb;;;;"}
1
+ {"version":3,"file":"react.js","sources":["../../src/utils/react.ts"],"sourcesContent":["import { ReactElement, ReactNode, ReactChild, ReactFragment } from 'react'\nimport _isEqual from 'lodash/isEqual.js'\n\nexport function arePropsEqual<PropTypes extends { children?: ReactNode }> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n if (typeof prevProps.children !== typeof nextProps.children) return false\n\n if (Array.isArray(prevProps.children) && Array.isArray(nextProps.children)) {\n const prevChildren = prevProps.children as ReactElement[]\n const nextChildren = nextProps.children as ReactElement[]\n if (prevChildren.length !== nextChildren.length) return false\n\n for (let i = 0; i < nextChildren.length; i += 1) {\n if (!_isEqual(prevChildren[i].props, nextChildren[i].props)) return false\n }\n }\n\n const propKeys = Array.from(new Set([...Object.keys(prevProps), ...Object.keys(nextProps)])) as (keyof PropTypes)[]\n for (const key of propKeys) {\n if (key === 'children') continue\n if (!(_isEqual(prevProps[key], nextProps[key]))) return false\n }\n\n return true\n}\n"],"names":[],"mappings":";;AAGgB,SAAA,aAAa,CAA8C,SAAoB,EAAE,SAAoB,EAAA;IACnH,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,OAAO,SAAS,CAAC,QAAQ;AAAE,QAAA,OAAO,KAAK,CAAA;AAEzE,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;AAC1E,QAAA,MAAM,YAAY,GAAG,SAAS,CAAC,QAA0B,CAAA;AACzD,QAAA,MAAM,YAAY,GAAG,SAAS,CAAC,QAA0B,CAAA;AACzD,QAAA,IAAI,YAAY,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM;AAAE,YAAA,OAAO,KAAK,CAAA;AAE7D,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;AAC/C,YAAA,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAAE,gBAAA,OAAO,KAAK,CAAA;AAC1E,SAAA;AACF,KAAA;AAED,IAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAwB,CAAA;AACnH,IAAA,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;QAC1B,IAAI,GAAG,KAAK,UAAU;YAAE,SAAQ;AAChC,QAAA,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAAE,YAAA,OAAO,KAAK,CAAA;AAC9D,KAAA;AAED,IAAA,OAAO,IAAI,CAAA;AACb;;;;"}
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { Area, AreaConfigInterface } from '@unovis/ts';
3
- export declare type VisAreaRef<Datum> = {
4
- component: Area<Datum>;
5
- };
6
- export declare type VisAreaProps<Datum> = AreaConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisAreaRef<Datum>>;
9
- };
10
- export declare const VisArea: (<Datum>(props: VisAreaProps<Datum>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { Axis, AxisConfigInterface } from '@unovis/ts';
3
- export declare type VisAxisRef<Datum> = {
4
- component: Axis<Datum>;
5
- };
6
- export declare type VisAxisProps<Datum> = AxisConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisAxisRef<Datum>>;
9
- };
10
- export declare const VisAxis: (<Datum>(props: VisAxisProps<Datum>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { Brush, BrushConfigInterface } from '@unovis/ts';
3
- export declare type VisBrushRef<Datum> = {
4
- component: Brush<Datum>;
5
- };
6
- export declare type VisBrushProps<Datum> = BrushConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisBrushRef<Datum>>;
9
- };
10
- export declare const VisBrush: (<Datum>(props: VisBrushProps<Datum>) => JSX.Element | null);
@@ -1,13 +0,0 @@
1
- import { Ref } from 'react';
2
- import { ChordDiagram, ChordDiagramConfigInterface, ChordInputNode, ChordInputLink } from '@unovis/ts';
3
- export declare type VisChordDiagramRef<N extends ChordInputNode, L extends ChordInputLink> = {
4
- component: ChordDiagram<N, L>;
5
- };
6
- export declare type VisChordDiagramProps<N extends ChordInputNode, L extends ChordInputLink> = ChordDiagramConfigInterface<N, L> & {
7
- data?: {
8
- nodes: N[];
9
- links?: L[];
10
- };
11
- ref?: Ref<VisChordDiagramRef<N, L>>;
12
- };
13
- export declare const VisChordDiagram: (<N extends ChordInputNode, L extends ChordInputLink>(props: VisChordDiagramProps<N, L>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { Crosshair, CrosshairConfigInterface } from '@unovis/ts';
3
- export declare type VisCrosshairRef<Datum> = {
4
- component: Crosshair<Datum>;
5
- };
6
- export declare type VisCrosshairProps<Datum> = CrosshairConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisCrosshairRef<Datum>>;
9
- };
10
- export declare const VisCrosshair: (<Datum>(props: VisCrosshairProps<Datum>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { Donut, DonutConfigInterface } from '@unovis/ts';
3
- export declare type VisDonutRef<Datum> = {
4
- component: Donut<Datum>;
5
- };
6
- export declare type VisDonutProps<Datum> = DonutConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisDonutRef<Datum>>;
9
- };
10
- export declare const VisDonut: (<Datum>(props: VisDonutProps<Datum>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { FreeBrush, FreeBrushConfigInterface } from '@unovis/ts';
3
- export declare type VisFreeBrushRef<Datum> = {
4
- component: FreeBrush<Datum>;
5
- };
6
- export declare type VisFreeBrushProps<Datum> = FreeBrushConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisFreeBrushRef<Datum>>;
9
- };
10
- export declare const VisFreeBrush: (<Datum>(props: VisFreeBrushProps<Datum>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { Graph, GraphConfigInterface, GraphInputNode, GraphInputLink } from '@unovis/ts';
3
- export declare type VisGraphRef<N extends GraphInputNode, L extends GraphInputLink> = {
4
- component: Graph<N, L>;
5
- };
6
- export declare type VisGraphProps<N extends GraphInputNode, L extends GraphInputLink> = GraphConfigInterface<N, L> & {
7
- data?: any;
8
- ref?: Ref<VisGraphRef<N, L>>;
9
- };
10
- export declare const VisGraph: (<N extends GraphInputNode, L extends GraphInputLink>(props: VisGraphProps<N, L>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { GroupedBar, GroupedBarConfigInterface } from '@unovis/ts';
3
- export declare type VisGroupedBarRef<Datum> = {
4
- component: GroupedBar<Datum>;
5
- };
6
- export declare type VisGroupedBarProps<Datum> = GroupedBarConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisGroupedBarRef<Datum>>;
9
- };
10
- export declare const VisGroupedBar: (<Datum>(props: VisGroupedBarProps<Datum>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { Line, LineConfigInterface } from '@unovis/ts';
3
- export declare type VisLineRef<Datum> = {
4
- component: Line<Datum>;
5
- };
6
- export declare type VisLineProps<Datum> = LineConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisLineRef<Datum>>;
9
- };
10
- export declare const VisLine: (<Datum>(props: VisLineProps<Datum>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { Sankey, SankeyConfigInterface, SankeyInputNode, SankeyInputLink } from '@unovis/ts';
3
- export declare type VisSankeyRef<N extends SankeyInputNode, L extends SankeyInputLink> = {
4
- component: Sankey<N, L>;
5
- };
6
- export declare type VisSankeyProps<N extends SankeyInputNode, L extends SankeyInputLink> = SankeyConfigInterface<N, L> & {
7
- data?: any;
8
- ref?: Ref<VisSankeyRef<N, L>>;
9
- };
10
- export declare const VisSankey: (<N extends SankeyInputNode, L extends SankeyInputLink>(props: VisSankeyProps<N, L>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { Scatter, ScatterConfigInterface } from '@unovis/ts';
3
- export declare type VisScatterRef<Datum> = {
4
- component: Scatter<Datum>;
5
- };
6
- export declare type VisScatterProps<Datum> = ScatterConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisScatterRef<Datum>>;
9
- };
10
- export declare const VisScatter: (<Datum>(props: VisScatterProps<Datum>) => JSX.Element | null);
@@ -1,10 +0,0 @@
1
- import { Ref } from 'react';
2
- import { StackedBar, StackedBarConfigInterface } from '@unovis/ts';
3
- export declare type VisStackedBarRef<Datum> = {
4
- component: StackedBar<Datum>;
5
- };
6
- export declare type VisStackedBarProps<Datum> = StackedBarConfigInterface<Datum> & {
7
- data?: Datum[];
8
- ref?: Ref<VisStackedBarRef<Datum>>;
9
- };
10
- export declare const VisStackedBar: (<Datum>(props: VisStackedBarProps<Datum>) => JSX.Element | null);