@semcore/d3-chart 2.17.5 → 3.0.0-beta.1

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 (156) hide show
  1. package/CHANGELOG.md +18 -2
  2. package/lib/cjs/Area.js +9 -9
  3. package/lib/cjs/Axis.js +14 -14
  4. package/lib/cjs/Bar.js +11 -10
  5. package/lib/cjs/Bar.js.map +1 -1
  6. package/lib/cjs/Bubble.js +18 -13
  7. package/lib/cjs/Bubble.js.map +1 -1
  8. package/lib/cjs/Donut.js +10 -8
  9. package/lib/cjs/Donut.js.map +1 -1
  10. package/lib/cjs/Dots.js +9 -9
  11. package/lib/cjs/HorizontalBar.js +11 -10
  12. package/lib/cjs/HorizontalBar.js.map +1 -1
  13. package/lib/cjs/Hover.js +33 -11
  14. package/lib/cjs/Hover.js.map +1 -1
  15. package/lib/cjs/Line.js +8 -8
  16. package/lib/cjs/Plot.js +3 -3
  17. package/lib/cjs/Radar.js +82 -71
  18. package/lib/cjs/Radar.js.map +1 -1
  19. package/lib/cjs/RadialTree.js +92 -74
  20. package/lib/cjs/RadialTree.js.map +1 -1
  21. package/lib/cjs/ReferenceLine.js +9 -9
  22. package/lib/cjs/ResponsiveContainer.js +1 -2
  23. package/lib/cjs/ResponsiveContainer.js.map +1 -1
  24. package/lib/cjs/ScatterPlot.js +15 -10
  25. package/lib/cjs/ScatterPlot.js.map +1 -1
  26. package/lib/cjs/Tooltip.js +8 -8
  27. package/lib/cjs/Venn.js +10 -8
  28. package/lib/cjs/Venn.js.map +1 -1
  29. package/lib/cjs/a11y/PlotA11yModule.js +2 -2
  30. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  31. package/lib/cjs/a11y/PlotA11yView.js +3 -3
  32. package/lib/cjs/a11y/hints.js.map +1 -1
  33. package/lib/cjs/a11y/serialize.js.map +1 -1
  34. package/lib/cjs/createElement.d.js +2 -0
  35. package/lib/cjs/createElement.d.js.map +1 -0
  36. package/lib/cjs/types/Area.d.js.map +1 -1
  37. package/lib/cjs/types/Axis.d.js.map +1 -1
  38. package/lib/cjs/types/Bar.d.js.map +1 -1
  39. package/lib/cjs/types/Bubble.d.js.map +1 -1
  40. package/lib/cjs/types/ClipPath.d.js.map +1 -1
  41. package/lib/cjs/types/Donut.d.js.map +1 -1
  42. package/lib/cjs/types/GroupBar.d.js.map +1 -1
  43. package/lib/cjs/types/HorizontalBar.d.js.map +1 -1
  44. package/lib/cjs/types/Hover.d.js.map +1 -1
  45. package/lib/cjs/types/Line.d.js.map +1 -1
  46. package/lib/cjs/types/Plot.d.js +0 -2
  47. package/lib/cjs/types/Plot.d.js.map +1 -1
  48. package/lib/cjs/types/Radar.d.js +2 -0
  49. package/lib/cjs/types/Radar.d.js.map +1 -0
  50. package/lib/cjs/types/ReferenceLine.d.js.map +1 -1
  51. package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
  52. package/lib/cjs/types/ScatterPlot.d.js.map +1 -1
  53. package/lib/cjs/types/StackBar.d.js.map +1 -1
  54. package/lib/cjs/types/StackedArea.d.js.map +1 -1
  55. package/lib/cjs/types/Tooltip.d.js.map +1 -1
  56. package/lib/cjs/types/Venn.d.js.map +1 -1
  57. package/lib/cjs/types/context.d.js.map +1 -1
  58. package/lib/cjs/types/index.d.js.map +1 -1
  59. package/lib/cjs/utils.js.map +1 -1
  60. package/lib/es6/Area.js +9 -9
  61. package/lib/es6/Axis.js +14 -14
  62. package/lib/es6/Bar.js +11 -10
  63. package/lib/es6/Bar.js.map +1 -1
  64. package/lib/es6/Bubble.js +18 -13
  65. package/lib/es6/Bubble.js.map +1 -1
  66. package/lib/es6/Donut.js +10 -8
  67. package/lib/es6/Donut.js.map +1 -1
  68. package/lib/es6/Dots.js +9 -9
  69. package/lib/es6/HorizontalBar.js +11 -10
  70. package/lib/es6/HorizontalBar.js.map +1 -1
  71. package/lib/es6/Hover.js +36 -12
  72. package/lib/es6/Hover.js.map +1 -1
  73. package/lib/es6/Line.js +8 -8
  74. package/lib/es6/Plot.js +3 -3
  75. package/lib/es6/Radar.js +84 -72
  76. package/lib/es6/Radar.js.map +1 -1
  77. package/lib/es6/RadialTree.js +90 -72
  78. package/lib/es6/RadialTree.js.map +1 -1
  79. package/lib/es6/ReferenceLine.js +9 -9
  80. package/lib/es6/ResponsiveContainer.js +0 -1
  81. package/lib/es6/ResponsiveContainer.js.map +1 -1
  82. package/lib/es6/ScatterPlot.js +15 -10
  83. package/lib/es6/ScatterPlot.js.map +1 -1
  84. package/lib/es6/Tooltip.js +8 -8
  85. package/lib/es6/Venn.js +10 -8
  86. package/lib/es6/Venn.js.map +1 -1
  87. package/lib/es6/a11y/PlotA11yModule.js +2 -2
  88. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  89. package/lib/es6/a11y/PlotA11yView.js +3 -3
  90. package/lib/es6/a11y/hints.js.map +1 -1
  91. package/lib/es6/a11y/serialize.js.map +1 -1
  92. package/lib/es6/createElement.d.js +2 -0
  93. package/lib/es6/createElement.d.js.map +1 -0
  94. package/lib/es6/types/Area.d.js.map +1 -1
  95. package/lib/es6/types/Axis.d.js.map +1 -1
  96. package/lib/es6/types/Bar.d.js.map +1 -1
  97. package/lib/es6/types/Bubble.d.js.map +1 -1
  98. package/lib/es6/types/ClipPath.d.js.map +1 -1
  99. package/lib/es6/types/Donut.d.js.map +1 -1
  100. package/lib/es6/types/GroupBar.d.js.map +1 -1
  101. package/lib/es6/types/HorizontalBar.d.js.map +1 -1
  102. package/lib/es6/types/Hover.d.js.map +1 -1
  103. package/lib/es6/types/Line.d.js.map +1 -1
  104. package/lib/es6/types/Plot.d.js +1 -1
  105. package/lib/es6/types/Plot.d.js.map +1 -1
  106. package/lib/es6/types/Radar.d.js +2 -0
  107. package/lib/es6/types/Radar.d.js.map +1 -0
  108. package/lib/es6/types/ReferenceLine.d.js.map +1 -1
  109. package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
  110. package/lib/es6/types/ScatterPlot.d.js.map +1 -1
  111. package/lib/es6/types/StackBar.d.js.map +1 -1
  112. package/lib/es6/types/StackedArea.d.js.map +1 -1
  113. package/lib/es6/types/Tooltip.d.js.map +1 -1
  114. package/lib/es6/types/Venn.d.js.map +1 -1
  115. package/lib/es6/types/context.d.js.map +1 -1
  116. package/lib/es6/types/index.d.js +3 -0
  117. package/lib/es6/types/index.d.js.map +1 -1
  118. package/lib/es6/utils.js.map +1 -1
  119. package/lib/types/Area.d.ts +26 -17
  120. package/lib/types/Axis.d.ts +40 -23
  121. package/lib/types/Bar.d.ts +32 -16
  122. package/lib/types/Bubble.d.ts +30 -12
  123. package/lib/types/ClipPath.d.ts +7 -5
  124. package/lib/types/Donut.d.ts +29 -13
  125. package/lib/types/GroupBar.d.ts +15 -12
  126. package/lib/types/HorizontalBar.d.ts +12 -12
  127. package/lib/types/Hover.d.ts +32 -8
  128. package/lib/types/Line.d.ts +33 -23
  129. package/lib/types/Plot.d.ts +34 -22
  130. package/lib/types/Radar.d.ts +145 -0
  131. package/lib/types/RadialTree.d.ts +53 -28
  132. package/lib/types/ReferenceLine.d.ts +27 -14
  133. package/lib/types/ResponsiveContainer.d.ts +18 -10
  134. package/lib/types/ScatterPlot.d.ts +25 -9
  135. package/lib/types/StackBar.d.ts +20 -14
  136. package/lib/types/StackedArea.d.ts +16 -12
  137. package/lib/types/Tooltip.d.ts +55 -23
  138. package/lib/types/Venn.d.ts +47 -29
  139. package/lib/types/a11y/PlotA11yModule.d.ts +1 -1
  140. package/lib/types/a11y/focus.d.ts +1 -1
  141. package/lib/types/a11y/hints.d.ts +5 -5
  142. package/lib/types/a11y/insights.d.ts +8 -8
  143. package/lib/types/a11y/intl.d.ts +1 -1
  144. package/lib/types/a11y/locale.d.ts +1 -1
  145. package/lib/types/a11y/serialize.d.ts +4 -4
  146. package/lib/types/a11y/summarize.d.ts +1 -1
  147. package/lib/types/context.d.ts +10 -0
  148. package/lib/types/createElement.d.ts +2 -0
  149. package/lib/types/index.d.ts +2 -0
  150. package/lib/types/utils.d.ts +10 -7
  151. package/package.json +10 -10
  152. package/lib/cjs/types/Radar.js +0 -2
  153. package/lib/cjs/types/Radar.js.map +0 -1
  154. package/lib/es6/types/Radar.js +0 -2
  155. package/lib/es6/types/Radar.js.map +0 -1
  156. package/lib/types/types/Radar.d.ts +0 -95
@@ -1,16 +1,40 @@
1
+ import { UnknownProperties } from '@semcore/core';
2
+ import { Context } from './context';
1
3
  import { ReturnEl } from '@semcore/core';
2
- import { MapProps } from './Plot';
3
- import IContext from './context';
4
+ import { TooltipTypeBase } from './Tooltip';
5
+ import { IBoxProps } from '@semcore/flex-box';
6
+ import { IntergalacticD3Component } from './Plot';
4
7
 
5
- export interface IHoverProps extends IContext {
6
- /** Field from data for XAxis */
8
+ /** @deprecated */
9
+ export interface IHoverProps extends HoverProps, UnknownProperties {}
10
+ export type HoverProps = Context & {
11
+ /** Field name from `data` array item for the XAxis */
7
12
  x?: string;
8
- /** Field from data for YAxis */
13
+ /** Field name from `data` array item for the YAxis */
9
14
  y?: string;
10
- }
15
+ };
11
16
 
12
- declare const HoverLine: <T>(props: MapProps<IHoverProps & T>) => ReturnEl;
17
+ type HoverTooltip = (<X, Y>(
18
+ props: {
19
+ /** Field name from `data` array item for the XAxis */
20
+ x?: X;
21
+ /** Field name from `data` array item for the YAxis */
22
+ y?: Y;
23
+ children: (props: {
24
+ /** Index in `data` array of the current item */
25
+ xIndex: X extends string ? string : never;
26
+ /** Index in `data` array of the current item */
27
+ yIndex: Y extends string ? string : never;
28
+ }) => { children: ReturnEl };
29
+ } & Omit<IBoxProps, 'children'>,
30
+ ) => ReturnEl) &
31
+ TooltipTypeBase;
13
32
 
14
- declare const HoverRect: <T>(props: MapProps<IHoverProps & T>) => ReturnEl;
33
+ declare const HoverLine: IntergalacticD3Component<'g', HoverProps> & {
34
+ Tooltip: HoverTooltip;
35
+ };
15
36
 
37
+ declare const HoverRect: IntergalacticD3Component<'g', HoverProps> & {
38
+ Tooltip: HoverTooltip;
39
+ };
16
40
  export { HoverLine, HoverRect };
@@ -1,13 +1,15 @@
1
- import { ReturnEl } from '@semcore/core';
2
- import { MapProps } from './Plot';
3
- import IContext from './context';
1
+ import { UnknownProperties } from '@semcore/core';
2
+ import { Context } from './context';
4
3
  import { CurveFactory } from 'd3-shape';
5
- import { IFadeInOutProps } from '@semcore/animation';
4
+ import { FadeInOutProps } from '@semcore/animation';
5
+ import { IntergalacticD3Component } from './Plot';
6
6
 
7
- export interface ILineProps extends IContext {
8
- /** Field from data for XAxis */
7
+ /** @deprecated */
8
+ export interface ILineProps extends LineProps, UnknownProperties {}
9
+ export type LineProps = Context & {
10
+ /** Field name from `data` array item for the XAxis */
9
11
  x?: string;
10
- /** Field from data for YAxis */
12
+ /** Field name from `data` array item for the YAxis */
11
13
  y?: string;
12
14
  /** Line color
13
15
  * @default '#50aef4'*/
@@ -22,32 +24,40 @@ export interface ILineProps extends IContext {
22
24
  duration?: number;
23
25
  /** Enables element transparency */
24
26
  transparent?: boolean;
25
- }
27
+ };
26
28
 
27
- export interface ILineDotsProps extends IContext, IFadeInOutProps {
28
- /** Show all Dot */
29
- display?: boolean;
30
- /** Hide property */
31
- hide?: boolean;
32
- /** Index active of element */
33
- activeIndex?: number;
34
- }
29
+ /** @deprecated */
30
+ export interface ILineDotsProps extends LineDotsProps, UnknownProperties {}
31
+ export type LineDotsProps = Context &
32
+ FadeInOutProps & {
33
+ /** Show all Dot */
34
+ display?: boolean;
35
+ /** Hide property */
36
+ hide?: boolean;
37
+ /** Index active of element */
38
+ activeIndex?: number;
39
+ };
35
40
 
36
- export interface ILineDotsContext {
41
+ /** @deprecated */
42
+ export interface ILineDotsContext extends LineDotsContext, UnknownProperties {}
43
+ export type LineDotsContext = {
37
44
  /** Value element of data */
45
+ /** @deprecated */
38
46
  value?: any;
39
47
  /** Index element of data */
40
48
  index?: number;
41
- }
49
+ };
42
50
 
43
- export interface ILineNullProps extends IContext {
51
+ /** @deprecated */
52
+ export interface ILineNullProps extends LineNullProps, UnknownProperties {}
53
+ export type LineNullProps = Context & {
44
54
  /** Hide property */
45
55
  hide?: boolean;
46
- }
56
+ };
47
57
 
48
- declare const Line: (<T>(props: MapProps<ILineProps & T>) => ReturnEl) & {
49
- Dots: <T>(props: MapProps<ILineDotsProps & T, ILineDotsContext>) => ReturnEl;
50
- Null: <T>(props: MapProps<ILineNullProps & T>) => ReturnEl;
58
+ declare const Line: IntergalacticD3Component<'line', LineProps, Context> & {
59
+ Dots: IntergalacticD3Component<'circle', LineDotsProps, LineDotsContext>;
60
+ Null: IntergalacticD3Component<'path', LineNullProps>;
51
61
  };
52
62
 
53
63
  export default Line;
@@ -1,25 +1,30 @@
1
- import { IBoxProps } from '@semcore/flex-box';
2
- import { ReturnEl } from '@semcore/core';
3
- import { MapProps } from './Plot';
4
- import IContext from './context';
1
+ import { BoxProps } from '@semcore/flex-box';
2
+ import { UnknownProperties, Intergalactic } from '@semcore/core';
3
+ import { Context } from './context';
5
4
 
6
- export interface IPlotProps extends IContext, IBoxProps {
7
- /** Width of the svg element
8
- * @default 0*/
9
- width?: number;
10
- /** Height of the svg element
11
- * @default 0*/
12
- height?: number;
13
- /** Human readable chart name (e.g "Last market trends") */
14
- label?: string;
15
- /**
16
- * Locale for displaying the days of a week and months, to be transferred to `Intl`
17
- * @default en
18
- * */
19
- locale?: NavigatorLanguage['language'];
20
- /** Optional prop to tune up alt text generating for charts */
21
- a11yAltTextConfig?: PlotSummarizerConfig;
22
- }
5
+ /** @deprecated */
6
+ export interface IPlotProps extends PlotProps, UnknownProperties {}
7
+ export type PlotProps = Context &
8
+ BoxProps & {
9
+ /** Width of the svg element
10
+ * @default 0*/
11
+ width?: number;
12
+ /** Height of the svg element
13
+ * @default 0*/
14
+ height?: number;
15
+ /** Human readable chart name (e.g "Last market trends") */
16
+ label?: string;
17
+ /**
18
+ * Locale for displaying the days of a week and months, to be transferred to `Intl`
19
+ * @default en
20
+ * */
21
+ locale?: NavigatorLanguage['language'];
22
+ /** Optional prop to tune up alt text generating for charts */
23
+ a11yAltTextConfig?: PlotSummarizerConfig;
24
+
25
+ /** @deprecated */
26
+ eventEmitter?: unknown;
27
+ };
23
28
 
24
29
  export type PlotSummarizerConfig = {
25
30
  /** Totally disable automatic data summarization */
@@ -90,12 +95,19 @@ export type PlotSummarizerConfig = {
90
95
  additionalFields?: string[];
91
96
  };
92
97
 
98
+ /** @deprecated */
93
99
  export type MapProps<Props, Ctx = {}, UCProps = {}> = Props & {
94
100
  children?:
95
101
  | ((props: Props & Ctx, handlers: UCProps) => Props | React.PropsWithChildren)
96
102
  | React.ReactNode;
97
103
  };
98
104
 
99
- declare const Plot: <T>(props: MapProps<IPlotProps & T>) => ReturnEl;
105
+ export type IntergalacticD3Component<BaseTag extends Intergalactic.Tag, Props, Context = {}> = (<
106
+ Tag extends Intergalactic.Tag = BaseTag,
107
+ >(
108
+ props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<Tag, Props, Context>,
109
+ ) => Intergalactic.InternalTypings.ComponentRenderingResults) &
110
+ Intergalactic.InternalTypings.ComponentAdditive<BaseTag>;
100
111
 
112
+ declare const Plot: IntergalacticD3Component<'svg', PlotProps, Context>;
101
113
  export default Plot;
@@ -0,0 +1,145 @@
1
+ import { Context } from './context';
2
+ import { UnknownProperties } from '@semcore/core';
3
+ import { CurveFactory } from 'd3-shape';
4
+ import { TooltipType } from './Tooltip';
5
+ import { IntergalacticD3Component } from './Plot';
6
+ import { BoxProps } from '@semcore/flex-box';
7
+
8
+ /** @deprecated */
9
+ export interface IRadarProps extends RadarProps, UnknownProperties {}
10
+ export type RadarProps = Context & {
11
+ /**
12
+ * Scale for radar element
13
+ * */
14
+ /** @deprecated */
15
+ scale: any;
16
+ /**
17
+ * Graph type to be displayed
18
+ * @default 'polygon'
19
+ * */
20
+ type?: 'polygon' | 'circle';
21
+ /**
22
+ * Indent from the edge of svg to graph
23
+ * */
24
+ offset?: number;
25
+
26
+ /**
27
+ * Label font size
28
+ * @default 12
29
+ * */
30
+ textSize?: number;
31
+
32
+ /**
33
+ * Base angle of chart rotation
34
+ * @default 0
35
+ * @example Math.PI/3
36
+ * */
37
+ angleOffset?: number;
38
+ };
39
+
40
+ /** @deprecated */
41
+ export interface IRadarAxisProps extends RadarAxisProps, UnknownProperties {}
42
+ export type RadarAxisProps = Context & {
43
+ /**
44
+ * Sets the field name for categories
45
+ * */
46
+ dataKey: string;
47
+ };
48
+
49
+ /** @deprecated */
50
+ export interface IRadarAxisTicksProps extends RadarAxisTicksProps, UnknownProperties {}
51
+ export type RadarAxisTicksProps = {
52
+ /**
53
+ * Distance between auxiliary lines
54
+ * @default 100
55
+ * */
56
+ tickSize?: number;
57
+ };
58
+
59
+ /** @deprecated */
60
+ export interface IRadarAxisLabelsProps extends RadarAxisLabelsProps, UnknownProperties {}
61
+ export type RadarAxisLabelsProps = {
62
+ /**
63
+ * Indent from graph to label
64
+ * @default 10
65
+ * */
66
+ labelOffset?: number;
67
+ };
68
+
69
+ type RadarAxisLabelsContext = Context & {
70
+ xDirection: 'middle' | 'start' | 'end';
71
+ yDirection: 'alphabetic' | 'mathematical' | 'middle';
72
+ x: number;
73
+ y: number;
74
+ };
75
+
76
+ /** @deprecated */
77
+ export interface IRadialPolygonProps extends RadialPolygonProps, UnknownProperties {}
78
+ export type RadialPolygonProps = Context & {
79
+ /**
80
+ * Sets the field name for data
81
+ * */
82
+ dataKey: string;
83
+ /**
84
+ * Curve method
85
+ * @default curveLinearClosed
86
+ * */
87
+ curve?: CurveFactory;
88
+ /**
89
+ * Sets the color of the entire polygon
90
+ * */
91
+ color?: string;
92
+ /**
93
+ * Sets the fill color
94
+ * */
95
+ fill?: string;
96
+ };
97
+
98
+ /** @deprecated */
99
+ export interface IRadialPolygonLineProps extends RadialPolygonLineProps, UnknownProperties {}
100
+ export type RadialPolygonLineProps = {
101
+ /**
102
+ * Sets the line color
103
+ * */
104
+ color?: string;
105
+ };
106
+
107
+ /** @deprecated */
108
+ export interface IRadialPolygonDotsProps extends RadialPolygonDotsProps, UnknownProperties {}
109
+ export type RadialPolygonDotsProps = {
110
+ /**
111
+ * Sets the dot color
112
+ * */
113
+ color?: string;
114
+ };
115
+
116
+ /** @deprecated */
117
+ export interface IRadarHoverProps extends RadarHoverProps, UnknownProperties {}
118
+ export type RadarHoverProps = BoxProps & Context & {};
119
+
120
+ declare const Radar: IntergalacticD3Component<'g', RadarProps, Context> & {
121
+ Axis: IntergalacticD3Component<'path', RadarAxisProps, Context> & {
122
+ Ticks: IntergalacticD3Component<'path', RadarAxisTicksProps, Context>;
123
+ Labels: IntergalacticD3Component<'text', RadarAxisLabelsProps, RadarAxisLabelsContext>;
124
+ };
125
+ Polygon: IntergalacticD3Component<'path', RadialPolygonProps, Context> & {
126
+ Line: IntergalacticD3Component<'line', RadialPolygonLineProps, Context>;
127
+ Dots: IntergalacticD3Component<'circle', RadialPolygonDotsProps, Context>;
128
+ };
129
+ Hover: IntergalacticD3Component<'path', RadarHoverProps, Context>;
130
+ Tooltip: TooltipType<
131
+ RadarHoverProps & {
132
+ /** Index in `data` array of the current items */
133
+ index: number;
134
+ }
135
+ >;
136
+ };
137
+
138
+ export declare function getLabelOffsetPosition(
139
+ xDirection: 'middle' | 'start' | 'end',
140
+ yDirection: 'alphabetic' | 'mathematical' | 'middle',
141
+ width: number,
142
+ height: number,
143
+ ): [xOffset: number, yOffset: number];
144
+
145
+ export default Radar;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { ReturnEl } from '@semcore/core';
3
- import type { MapProps } from './types';
4
- declare type RadianData = {
2
+ import { UnknownProperties, Intergalactic } from '@semcore/core';
3
+ type RadianData = {
5
4
  /**
6
5
  * Text label on the end of radian.
7
6
  */
@@ -35,11 +34,14 @@ declare type RadianData = {
35
34
  */
36
35
  iconSize?: number;
37
36
  };
38
- export interface IRadialTreeProps {
37
+ /** @deprecated */
38
+ export interface IRadialTreeProps extends RadialTreeProps, UnknownProperties {
39
+ }
40
+ export type RadialTreeProps = {
39
41
  /**
40
42
  * List of radians. `{ label: string; key: string; capSize?: number; icon?: React.FC; color?: string; iconColor?: string; iconSize?: number; }`
41
43
  */
42
- data: RadianData[];
44
+ data?: RadianData[];
43
45
  /**
44
46
  * Angel (in rads) that rotates chart. 0 means that first radian is exactly on top vertical line.
45
47
  * @default 0
@@ -93,26 +95,36 @@ export interface IRadialTreeProps {
93
95
  * Used to define the active radian in controlled way. Active radian is highligted with inreased cap size.
94
96
  */
95
97
  activeKey?: string | null;
98
+ onActiveKeyChange?: (activeKey: string | null) => void;
96
99
  /**
97
100
  * Default value for `activeKey` property.
98
101
  */
99
102
  defaultActiveKey?: string | null;
100
103
  /** Enables element transparency */
101
104
  transparent?: boolean;
105
+ };
106
+ /** @deprecated */
107
+ export interface IRadialTreeRadianProps extends RadialTreeRadianProps, UnknownProperties {
102
108
  }
103
- export interface IRadialTreeRadianProps extends IRadialTreeProps {
109
+ export type RadialTreeRadianProps = RadialTreeProps & {
104
110
  radiansCount?: number;
105
111
  textWidth?: number;
106
112
  onRadianClick?: (key: string) => (event: React.MouseEvent) => void;
113
+ };
114
+ /** @deprecated */
115
+ export interface IRadialTreeRadianInteractiveAreaProps extends RadialTreeRadianInteractiveAreaProps {
107
116
  }
108
- export interface IRadialTreeRadianInteractiveAreaProps {
117
+ export type RadialTreeRadianInteractiveAreaProps = {
109
118
  x1?: number;
110
119
  y1?: number;
111
120
  x2?: number;
112
121
  y2?: number;
113
122
  strokeWidth?: number;
123
+ };
124
+ /** @deprecated */
125
+ export interface IRadialTreeRadianLineProps extends RadialTreeRadianLineProps, UnknownProperties {
114
126
  }
115
- export interface IRadialTreeRadianLineProps {
127
+ export type RadialTreeRadianLineProps = {
116
128
  x1?: number;
117
129
  y1?: number;
118
130
  x2?: number;
@@ -121,8 +133,8 @@ export interface IRadialTreeRadianLineProps {
121
133
  transparent?: boolean;
122
134
  ['data-radial-animation']?: `${string}-line`;
123
135
  ['data-radian-index']?: number;
124
- }
125
- declare type RadialTreeRadianLineAsProps = IRadialTreeRadianLineProps & {
136
+ };
137
+ type RadialTreeRadianLineAsProps = IRadialTreeRadianLineProps & {
126
138
  Element: React.FC<{
127
139
  render: string;
128
140
  transparent: boolean;
@@ -130,7 +142,10 @@ declare type RadialTreeRadianLineAsProps = IRadialTreeRadianLineProps & {
130
142
  styles: React.CSSProperties;
131
143
  };
132
144
  declare const Line: React.FC<RadialTreeRadianLineAsProps>;
133
- export interface IRadialTreeRadianCapProps {
145
+ /** @deprecated */
146
+ export interface IRadialTreeRadianCapProps extends RadialTreeRadianCapProps, UnknownProperties {
147
+ }
148
+ export type RadialTreeRadianCapProps = {
134
149
  x?: number;
135
150
  y?: number;
136
151
  radius?: number;
@@ -138,8 +153,8 @@ export interface IRadialTreeRadianCapProps {
138
153
  transparent?: boolean;
139
154
  ['data-radial-animation']?: `${string}-cap-circle`;
140
155
  ['data-radian-index']?: number;
141
- }
142
- declare type RadialTreeRadianCapAsProps = IRadialTreeRadianCapProps & {
156
+ };
157
+ type RadialTreeRadianCapAsProps = IRadialTreeRadianCapProps & {
143
158
  Element: React.FC<{
144
159
  render: string;
145
160
  transparent: boolean;
@@ -147,7 +162,10 @@ declare type RadialTreeRadianCapAsProps = IRadialTreeRadianCapProps & {
147
162
  styles: React.CSSProperties;
148
163
  };
149
164
  declare const Cap: React.FC<RadialTreeRadianCapAsProps>;
150
- export interface IRadialTreeRadianIconProps {
165
+ /** @deprecated */
166
+ export interface IRadialTreeRadianIconProps extends RadialTreeRadianIconProps, UnknownProperties {
167
+ }
168
+ export type RadialTreeRadianIconProps = {
151
169
  x?: number;
152
170
  y?: number;
153
171
  iconSize?: number;
@@ -157,8 +175,8 @@ export interface IRadialTreeRadianIconProps {
157
175
  tag?: React.FC;
158
176
  isActive?: boolean;
159
177
  transparent?: boolean;
160
- }
161
- declare type RadialTreeRadianIconAsProps = IRadialTreeRadianIconProps & {
178
+ };
179
+ type RadialTreeRadianIconAsProps = IRadialTreeRadianIconProps & {
162
180
  Element: React.FC<{
163
181
  render: string | React.FC;
164
182
  transparent: boolean;
@@ -169,7 +187,10 @@ declare type RadialTreeRadianIconAsProps = IRadialTreeRadianIconProps & {
169
187
  styles: React.CSSProperties;
170
188
  };
171
189
  declare const Icon: React.FC<RadialTreeRadianIconAsProps>;
172
- export interface IRadialTreeRadianLabelProps {
190
+ /** @deprecated */
191
+ export interface IRadialTreeRadianLabelProps extends RadialTreeRadianLabelProps, UnknownProperties {
192
+ }
193
+ export type RadialTreeRadianLabelProps = {
173
194
  x?: number;
174
195
  y?: number;
175
196
  color?: string;
@@ -180,8 +201,8 @@ export interface IRadialTreeRadianLabelProps {
180
201
  isHorizontal?: boolean;
181
202
  angle?: number;
182
203
  transparent?: boolean;
183
- }
184
- declare type RadialTreeRadianLabelAsProps = IRadialTreeRadianLabelProps & {
204
+ };
205
+ type RadialTreeRadianLabelAsProps = IRadialTreeRadianLabelProps & {
185
206
  Element: React.FC<{
186
207
  render: string;
187
208
  } & React.SVGProps<any>>;
@@ -193,20 +214,24 @@ declare type RadialTreeRadianLabelAsProps = IRadialTreeRadianLabelProps & {
193
214
  textSize: number;
194
215
  };
195
216
  declare const Label: React.FC<RadialTreeRadianLabelAsProps>;
196
- export interface IRadialTreeTitleProps {
217
+ /** @deprecated */
218
+ export interface IRadialTreeTitleProps extends RadialTreeTitleProps, UnknownProperties {
219
+ }
220
+ export type RadialTreeTitleProps = {
197
221
  x?: number;
198
222
  y?: number;
199
223
  textSize?: number;
200
224
  ['data-radial-animation']?: `${string}-label`;
201
225
  color?: string;
202
- }
203
- declare const RadialTree: (<T>(props: MapProps<IRadialTreeProps & T, {}, {}>) => ReturnEl) & {
204
- Title: <T_1>(props: MapProps<IRadialTreeTitleProps & T_1, {}, {}>) => ReturnEl;
205
- Radian: (<T_2>(props: MapProps<IRadialTreeRadianProps & T_2, {}, {}>) => ReturnEl) & {
206
- Line: <T_3>(props: MapProps<IRadialTreeRadianLineProps & T_3, {}, {}>) => ReturnEl;
207
- Cap: <T_4>(props: MapProps<IRadialTreeRadianCapProps & T_4, {}, {}>) => ReturnEl;
208
- Icon: <T_5>(props: MapProps<IRadialTreeRadianIconProps & T_5, {}, {}>) => ReturnEl;
209
- Label: <T_6>(props: MapProps<IRadialTreeRadianLabelProps & T_6, {}, {}>) => ReturnEl;
226
+ };
227
+ type IntergalacticD3Component<BaseTag extends Intergalactic.Tag, Props, Context = {}> = (<Tag extends Intergalactic.Tag = Intergalactic.Tag>(props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<Tag, Props, Context>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<BaseTag>;
228
+ declare const RadialTree: (<Tag extends Intergalactic.InternalTypings.ComponentTag = Intergalactic.InternalTypings.ComponentTag>(props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<Tag, RadialTreeProps, {}, never[]>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<"g"> & {
229
+ Title: IntergalacticD3Component<'text', RadialTreeTitleProps>;
230
+ Radian: IntergalacticD3Component<'g', RadialTreeRadianProps> & {
231
+ Line: IntergalacticD3Component<'line', RadialTreeRadianLineProps>;
232
+ Cap: IntergalacticD3Component<'circle', RadialTreeRadianCapProps>;
233
+ Icon: IntergalacticD3Component<'g', RadialTreeRadianIconProps>;
234
+ Label: IntergalacticD3Component<'text', RadialTreeRadianLabelProps>;
210
235
  };
211
236
  };
212
237
  export default RadialTree;
@@ -1,32 +1,45 @@
1
- import { ReturnEl } from '@semcore/core';
2
- import { MapProps } from './Plot';
3
- import IContext from './context';
1
+ import { UnknownProperties } from '@semcore/core';
2
+ import { Context } from './context';
3
+ import { IntergalacticD3Component } from './Plot';
4
4
 
5
- export interface IReferenceLineProps extends IContext {
5
+ /** @deprecated **/
6
+ export interface IReferenceLineProps extends ReferenceLineProps, UnknownProperties {}
7
+ export type ReferenceLineProps = Context & {
6
8
  /** The position of the title relative reference line
7
9
  * @default 'left' */
8
10
  position?: 'top' | 'right' | 'bottom' | 'left';
9
11
  /** Value element of data */
10
- value: any;
11
- }
12
+ /** @deprecated */
13
+ value?: any;
14
+
15
+ title?: string;
16
+ };
12
17
 
13
- export interface IReferenceLineTitleProps extends IContext {
18
+ /** @deprecated **/
19
+ export interface IReferenceLineTitleProps extends ReferenceLineTitleProps, UnknownProperties {}
20
+ export type ReferenceLineTitleProps = Context & {
14
21
  /** The position of the axis relative reference line */
15
22
  position?: 'top' | 'right' | 'bottom' | 'left';
16
23
  /** Value element of data */
24
+ /** @deprecated */
17
25
  value: any;
18
- }
26
+ };
19
27
 
20
- export interface IReferenceLineBackgroundProps extends IContext {
28
+ /** @deprecated **/
29
+ export interface IReferenceLineBackgroundProps
30
+ extends ReferenceLineBackgroundProps,
31
+ UnknownProperties {}
32
+ export type ReferenceLineBackgroundProps = Context & {
21
33
  /** The position of the axis relative reference line */
22
34
  position?: 'top' | 'right' | 'bottom' | 'left';
23
35
  /** Value element of data */
24
- value: any;
25
- }
36
+ /** @deprecated */
37
+ value?: any;
38
+ };
26
39
 
27
- declare const ReferenceLine: (<T>(props: MapProps<IReferenceLineProps & T>) => ReturnEl) & {
28
- Title: <T>(props: MapProps<IReferenceLineTitleProps & T>) => ReturnEl;
29
- Background: <T>(props: MapProps<IReferenceLineBackgroundProps & T>) => ReturnEl;
40
+ declare const ReferenceLine: IntergalacticD3Component<'line', ReferenceLineProps, Context> & {
41
+ Title: IntergalacticD3Component<'text', ReferenceLineTitleProps, Context>;
42
+ Background: IntergalacticD3Component<'rect', ReferenceLineBackgroundProps, Context>;
30
43
  };
31
44
 
32
45
  export default ReferenceLine;
@@ -1,21 +1,29 @@
1
- import { IBoxProps } from '@semcore/flex-box';
2
- import { ReturnEl } from '@semcore/core';
3
- import { MapProps } from './Plot';
1
+ import { BoxProps } from '@semcore/flex-box';
2
+ import { UnknownProperties } from '@semcore/core';
3
+ import { IntergalacticD3Component } from './Plot';
4
4
 
5
- export interface IResponsiveContainerProps extends IBoxProps {
5
+ /** @deprecated */
6
+ export interface IResponsiveContainerProps extends ResponsiveContainerProps, UnknownProperties {}
7
+ export type ResponsiveContainerProps = BoxProps & {
6
8
  /** Relation between height and width dimensions block */
7
9
  aspect?: number;
8
10
  /** Callback which will be called after changing the block size */
9
11
  onResize?: (size: [number, number], entries: ResizeObserverEntry[]) => void;
10
- }
12
+ };
11
13
 
12
- export interface IResponsiveContainerContext {
14
+ /** @deprecated */
15
+ export interface IResponsiveContainerContext
16
+ extends ResponsiveContainerContext,
17
+ UnknownProperties {}
18
+ export type ResponsiveContainerContext = {
13
19
  width?: number;
14
20
  height?: number;
15
- }
21
+ };
16
22
 
17
- declare const ResponsiveContainer: <T>(
18
- props: MapProps<IResponsiveContainerProps & T, IResponsiveContainerContext>,
19
- ) => ReturnEl;
23
+ declare const ResponsiveContainer: IntergalacticD3Component<
24
+ 'div',
25
+ ResponsiveContainerProps,
26
+ ResponsiveContainerContext
27
+ >;
20
28
 
21
29
  export default ResponsiveContainer;