@semcore/d3-chart 3.18.1 → 3.18.2

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 (177) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/README.md +1 -1
  3. package/lib/cjs/Area.js +9 -9
  4. package/lib/cjs/Axis.js +14 -14
  5. package/lib/cjs/Bar.js +8 -8
  6. package/lib/cjs/Bubble.js +10 -10
  7. package/lib/cjs/Donut.js +7 -7
  8. package/lib/cjs/Dots.js +10 -10
  9. package/lib/cjs/HorizontalBar.js +8 -8
  10. package/lib/cjs/Hover.js +3 -3
  11. package/lib/cjs/Line.js +13 -11
  12. package/lib/cjs/Line.js.map +1 -1
  13. package/lib/cjs/Plot.js +3 -3
  14. package/lib/cjs/Radar.js +17 -17
  15. package/lib/cjs/RadialTree.js +10 -10
  16. package/lib/cjs/ReferenceLine.js +9 -9
  17. package/lib/cjs/ScatterPlot.js +8 -8
  18. package/lib/cjs/ScatterPlot.js.map +1 -1
  19. package/lib/cjs/Tooltip.js +8 -8
  20. package/lib/cjs/Venn.js +7 -7
  21. package/lib/cjs/a11y/PlotA11yModule.js +2 -2
  22. package/lib/cjs/a11y/PlotA11yView.js +2 -2
  23. package/lib/cjs/component/Chart/AbstractChart.js +420 -0
  24. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -0
  25. package/lib/cjs/component/Chart/AbstractChart.type.js +2 -0
  26. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -0
  27. package/lib/cjs/component/Chart/AreaChart.js +160 -0
  28. package/lib/cjs/component/Chart/AreaChart.js.map +1 -0
  29. package/lib/cjs/component/Chart/AreaChart.type.js +2 -0
  30. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -0
  31. package/lib/cjs/component/Chart/BarChart.js +253 -0
  32. package/lib/cjs/component/Chart/BarChart.js.map +1 -0
  33. package/lib/cjs/component/Chart/BarChart.type.js +2 -0
  34. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -0
  35. package/lib/cjs/component/Chart/BubbleChart.js +145 -0
  36. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -0
  37. package/lib/cjs/component/Chart/BubbleChart.type.js +2 -0
  38. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -0
  39. package/lib/cjs/component/Chart/DonutChart.js +117 -0
  40. package/lib/cjs/component/Chart/DonutChart.js.map +1 -0
  41. package/lib/cjs/component/Chart/DonutChart.type.js +2 -0
  42. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -0
  43. package/lib/cjs/component/Chart/HistogramChart.js +189 -0
  44. package/lib/cjs/component/Chart/HistogramChart.js.map +1 -0
  45. package/lib/cjs/component/Chart/HistogramChart.type.js +2 -0
  46. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -0
  47. package/lib/cjs/component/Chart/LineChart.js +147 -0
  48. package/lib/cjs/component/Chart/LineChart.js.map +1 -0
  49. package/lib/cjs/component/Chart/LineChart.type.js +2 -0
  50. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -0
  51. package/lib/cjs/component/Chart/RadarChart.js +121 -0
  52. package/lib/cjs/component/Chart/RadarChart.js.map +1 -0
  53. package/lib/cjs/component/Chart/RadarChart.type.js +2 -0
  54. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -0
  55. package/lib/cjs/component/Chart/ScatterPlotChart.js +159 -0
  56. package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -0
  57. package/lib/cjs/component/Chart/ScatterPlotChart.type.js +2 -0
  58. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -0
  59. package/lib/cjs/component/Chart/VennChart.js +144 -0
  60. package/lib/cjs/component/Chart/VennChart.js.map +1 -0
  61. package/lib/cjs/component/Chart/VennChart.type.js +2 -0
  62. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -0
  63. package/lib/cjs/component/Chart/index.js +28 -0
  64. package/lib/cjs/component/Chart/index.js.map +1 -0
  65. package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
  66. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  67. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +20 -17
  68. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  69. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -7
  70. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  71. package/lib/cjs/component/ChartLegend/LegendTable/legend-table.shadow.css +5 -2
  72. package/lib/cjs/index.js +7 -0
  73. package/lib/cjs/index.js.map +1 -1
  74. package/lib/cjs/style/donut.shadow.css +3 -0
  75. package/lib/cjs/types/Line.d.js.map +1 -1
  76. package/lib/cjs/types/index.d.js +130 -1
  77. package/lib/cjs/types/index.d.js.map +1 -1
  78. package/lib/es6/Area.js +9 -9
  79. package/lib/es6/Axis.js +14 -14
  80. package/lib/es6/Bar.js +8 -8
  81. package/lib/es6/Bubble.js +10 -10
  82. package/lib/es6/Donut.js +7 -7
  83. package/lib/es6/Dots.js +10 -10
  84. package/lib/es6/HorizontalBar.js +8 -8
  85. package/lib/es6/Hover.js +3 -3
  86. package/lib/es6/Line.js +13 -11
  87. package/lib/es6/Line.js.map +1 -1
  88. package/lib/es6/Plot.js +3 -3
  89. package/lib/es6/Radar.js +17 -17
  90. package/lib/es6/RadialTree.js +10 -10
  91. package/lib/es6/ReferenceLine.js +9 -9
  92. package/lib/es6/ScatterPlot.js +8 -8
  93. package/lib/es6/ScatterPlot.js.map +1 -1
  94. package/lib/es6/Tooltip.js +8 -8
  95. package/lib/es6/Venn.js +7 -7
  96. package/lib/es6/a11y/PlotA11yModule.js +2 -2
  97. package/lib/es6/a11y/PlotA11yView.js +2 -2
  98. package/lib/es6/component/Chart/AbstractChart.js +412 -0
  99. package/lib/es6/component/Chart/AbstractChart.js.map +1 -0
  100. package/lib/es6/component/Chart/AbstractChart.type.js +2 -0
  101. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -0
  102. package/lib/es6/component/Chart/AreaChart.js +152 -0
  103. package/lib/es6/component/Chart/AreaChart.js.map +1 -0
  104. package/lib/es6/component/Chart/AreaChart.type.js +2 -0
  105. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -0
  106. package/lib/es6/component/Chart/BarChart.js +245 -0
  107. package/lib/es6/component/Chart/BarChart.js.map +1 -0
  108. package/lib/es6/component/Chart/BarChart.type.js +2 -0
  109. package/lib/es6/component/Chart/BarChart.type.js.map +1 -0
  110. package/lib/es6/component/Chart/BubbleChart.js +137 -0
  111. package/lib/es6/component/Chart/BubbleChart.js.map +1 -0
  112. package/lib/es6/component/Chart/BubbleChart.type.js +2 -0
  113. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -0
  114. package/lib/es6/component/Chart/DonutChart.js +109 -0
  115. package/lib/es6/component/Chart/DonutChart.js.map +1 -0
  116. package/lib/es6/component/Chart/DonutChart.type.js +2 -0
  117. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -0
  118. package/lib/es6/component/Chart/HistogramChart.js +181 -0
  119. package/lib/es6/component/Chart/HistogramChart.js.map +1 -0
  120. package/lib/es6/component/Chart/HistogramChart.type.js +2 -0
  121. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -0
  122. package/lib/es6/component/Chart/LineChart.js +139 -0
  123. package/lib/es6/component/Chart/LineChart.js.map +1 -0
  124. package/lib/es6/component/Chart/LineChart.type.js +2 -0
  125. package/lib/es6/component/Chart/LineChart.type.js.map +1 -0
  126. package/lib/es6/component/Chart/RadarChart.js +113 -0
  127. package/lib/es6/component/Chart/RadarChart.js.map +1 -0
  128. package/lib/es6/component/Chart/RadarChart.type.js +2 -0
  129. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -0
  130. package/lib/es6/component/Chart/ScatterPlotChart.js +151 -0
  131. package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -0
  132. package/lib/es6/component/Chart/ScatterPlotChart.type.js +2 -0
  133. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -0
  134. package/lib/es6/component/Chart/VennChart.js +136 -0
  135. package/lib/es6/component/Chart/VennChart.js.map +1 -0
  136. package/lib/es6/component/Chart/VennChart.type.js +2 -0
  137. package/lib/es6/component/Chart/VennChart.type.js.map +1 -0
  138. package/lib/es6/component/Chart/index.js +21 -0
  139. package/lib/es6/component/Chart/index.js.map +1 -0
  140. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  141. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  142. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +20 -17
  143. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  144. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -7
  145. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  146. package/lib/es6/component/ChartLegend/LegendTable/legend-table.shadow.css +5 -2
  147. package/lib/es6/index.js +1 -0
  148. package/lib/es6/index.js.map +1 -1
  149. package/lib/es6/style/donut.shadow.css +3 -0
  150. package/lib/es6/types/Line.d.js.map +1 -1
  151. package/lib/es6/types/index.d.js +12 -0
  152. package/lib/es6/types/index.d.js.map +1 -1
  153. package/lib/types/Line.d.ts +7 -2
  154. package/lib/types/component/Chart/AbstractChart.d.ts +50 -0
  155. package/lib/types/component/Chart/AbstractChart.type.d.ts +161 -0
  156. package/lib/types/component/Chart/AreaChart.d.ts +2 -0
  157. package/lib/types/component/Chart/AreaChart.type.d.ts +16 -0
  158. package/lib/types/component/Chart/BarChart.d.ts +2 -0
  159. package/lib/types/component/Chart/BarChart.type.d.ts +19 -0
  160. package/lib/types/component/Chart/BubbleChart.d.ts +2 -0
  161. package/lib/types/component/Chart/BubbleChart.type.d.ts +17 -0
  162. package/lib/types/component/Chart/DonutChart.d.ts +2 -0
  163. package/lib/types/component/Chart/DonutChart.type.d.ts +15 -0
  164. package/lib/types/component/Chart/HistogramChart.d.ts +2 -0
  165. package/lib/types/component/Chart/HistogramChart.type.d.ts +11 -0
  166. package/lib/types/component/Chart/LineChart.d.ts +2 -0
  167. package/lib/types/component/Chart/LineChart.type.d.ts +24 -0
  168. package/lib/types/component/Chart/RadarChart.d.ts +2 -0
  169. package/lib/types/component/Chart/RadarChart.type.d.ts +14 -0
  170. package/lib/types/component/Chart/ScatterPlotChart.d.ts +2 -0
  171. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +13 -0
  172. package/lib/types/component/Chart/VennChart.d.ts +2 -0
  173. package/lib/types/component/Chart/VennChart.type.d.ts +11 -0
  174. package/lib/types/component/Chart/index.d.ts +12 -0
  175. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +2 -2
  176. package/lib/types/index.d.ts +13 -0
  177. package/package.json +2 -2
@@ -1,16 +1,19 @@
1
1
  SLegendTable[columns-count] {
2
+ font-variant-numeric: tabular-nums;
2
3
  display: grid;
3
- grid-template-columns: repeat(var(--columns-count), auto);
4
+ grid-template-columns: auto 0.2fr 0.2fr;
4
5
  align-items: center;
5
6
  height: fit-content;
6
- grid-column-gap: 18px;
7
+ grid-column-gap: 16px;
7
8
  grid-row-gap: 8px;
8
9
  }
9
10
 
10
11
  SColumnItem[size='l'] {
11
12
  font-size: var(--intergalactic-fs-300, 16px);
13
+ text-align: right;
12
14
  }
13
15
 
14
16
  SColumnItem[size='m'] {
15
17
  font-size: var(--intergalactic-fs-200, 14px);
18
+ text-align: right;
16
19
  }
package/lib/es6/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as Plot } from './Plot';
2
2
  export { ChartLegend, ChartLegendTable } from './component/ChartLegend';
3
+ export { default as Chart } from './component/Chart';
3
4
  export { XAxis, YAxis } from './Axis';
4
5
  export { default as Line } from './Line';
5
6
  export { default as Bar } from './Bar';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","Plot","ChartLegend","ChartLegendTable","XAxis","YAxis","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","ScatterPlot","Bubble","RadialTree","Donut","Venn","Radar","getLabelOffsetPosition","Tooltip","ResponsiveContainer","ReferenceLine","HoverLine","HoverRect","minMax","interpolateValue","colors","makeDataHintsContainer"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { default as ReferenceLine } from './ReferenceLine';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport { minMax, interpolateValue } from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;AACvE,SAASC,KAAK,EAAEC,KAAK,QAAQ,QAAQ;AAErC,SAASL,OAAO,IAAIM,IAAI,QAAQ,QAAQ;AAExC,SAASN,OAAO,IAAIO,GAAG,QAAQ,OAAO;AACtC,SAASP,OAAO,IAAIQ,aAAa,QAAQ,iBAAiB;AAC1D,SAASR,OAAO,IAAIS,QAAQ,QAAQ,YAAY;AAChD,SAAST,OAAO,IAAIU,QAAQ,QAAQ,YAAY;AAChD,SAASV,OAAO,IAAIW,IAAI,QAAQ,QAAQ;AACxC,SAASX,OAAO,IAAIY,WAAW,QAAQ,eAAe;AACtD,SAASZ,OAAO,IAAIa,WAAW,QAAQ,eAAe;AACtD,SAASb,OAAO,IAAIc,MAAM,QAAQ,UAAU;AAC5C,SAASd,OAAO,IAAIe,UAAU,QAAQ,cAAc;AACpD,SAASf,OAAO,IAAIgB,KAAK,QAAQ,SAAS;AAC1C,SAAShB,OAAO,IAAIiB,IAAI,QAAQ,QAAQ;AACxC,SAASjB,OAAO,IAAIkB,KAAK,EAAEC,sBAAsB,QAAQ,SAAS;AAElE,SAASnB,OAAO,IAAIoB,OAAO,QAAQ,WAAW;AAE9C,SAASpB,OAAO,IAAIqB,mBAAmB,QAAQ,uBAAuB;AACtE,SAASrB,OAAO,IAAIsB,aAAa,QAAQ,iBAAiB;AAE1D,SAASC,SAAS,EAAEC,SAAS,QAAQ,SAAS;AAE9C,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,SAAS;AAClD,SAASC,MAAM,QAAQ,SAAS;AAEhC,SAASC,sBAAsB,QAAQ,cAAc"}
1
+ {"version":3,"file":"index.js","names":["default","Plot","ChartLegend","ChartLegendTable","Chart","XAxis","YAxis","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","ScatterPlot","Bubble","RadialTree","Donut","Venn","Radar","getLabelOffsetPosition","Tooltip","ResponsiveContainer","ReferenceLine","HoverLine","HoverRect","minMax","interpolateValue","colors","makeDataHintsContainer"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { default as Chart } from './component/Chart';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { default as ReferenceLine } from './ReferenceLine';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport { minMax, interpolateValue } from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;AACvE,SAASH,OAAO,IAAII,KAAK,QAAQ,mBAAmB;AACpD,SAASC,KAAK,EAAEC,KAAK,QAAQ,QAAQ;AAErC,SAASN,OAAO,IAAIO,IAAI,QAAQ,QAAQ;AAExC,SAASP,OAAO,IAAIQ,GAAG,QAAQ,OAAO;AACtC,SAASR,OAAO,IAAIS,aAAa,QAAQ,iBAAiB;AAC1D,SAAST,OAAO,IAAIU,QAAQ,QAAQ,YAAY;AAChD,SAASV,OAAO,IAAIW,QAAQ,QAAQ,YAAY;AAChD,SAASX,OAAO,IAAIY,IAAI,QAAQ,QAAQ;AACxC,SAASZ,OAAO,IAAIa,WAAW,QAAQ,eAAe;AACtD,SAASb,OAAO,IAAIc,WAAW,QAAQ,eAAe;AACtD,SAASd,OAAO,IAAIe,MAAM,QAAQ,UAAU;AAC5C,SAASf,OAAO,IAAIgB,UAAU,QAAQ,cAAc;AACpD,SAAShB,OAAO,IAAIiB,KAAK,QAAQ,SAAS;AAC1C,SAASjB,OAAO,IAAIkB,IAAI,QAAQ,QAAQ;AACxC,SAASlB,OAAO,IAAImB,KAAK,EAAEC,sBAAsB,QAAQ,SAAS;AAElE,SAASpB,OAAO,IAAIqB,OAAO,QAAQ,WAAW;AAE9C,SAASrB,OAAO,IAAIsB,mBAAmB,QAAQ,uBAAuB;AACtE,SAAStB,OAAO,IAAIuB,aAAa,QAAQ,iBAAiB;AAE1D,SAASC,SAAS,EAAEC,SAAS,QAAQ,SAAS;AAE9C,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,SAAS;AAClD,SAASC,MAAM,QAAQ,SAAS;AAEhC,SAASC,sBAAsB,QAAQ,cAAc"}
@@ -24,4 +24,7 @@ SEmptyData[color] {
24
24
  SLabel {
25
25
  text-anchor: middle;
26
26
  vertical-anchor: middle;
27
+ font-size: var(--intergalactic-fs-200, 14px);
28
+ line-height: var(--intergalactic-lh-200, 142%);
29
+
27
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { curveCardinal, CurveFactory } from 'd3-shape';\nimport { FadeInOutProps } from '@semcore/animation';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ILineProps extends LineProps, UnknownProperties {}\nexport type LineProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Curve method */\n curve?: CurveFactory;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface ILineDotsProps extends LineDotsProps, UnknownProperties {}\nexport type LineDotsProps = Context &\n Omit<FadeInOutProps, 'display'> & {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n /** Dot radius, radius of active dot is 4/3 times larger\n * @default 6\n */\n radius?: number;\n };\n\n/** @deprecated */\nexport interface ILineDotsContext extends LineDotsContext, UnknownProperties {}\nexport type LineDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface ILineNullProps extends LineNullProps, UnknownProperties {}\nexport type LineNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\nexport type LineAreaProps = Omit<LineProps, 'transparent'> & {\n /**\n * Field name from `data` array for y0 point by the YAxis for the Area\n */\n y0: string;\n /**\n * Field name from `data` array for y1 point by the YAxis for the Area\n */\n y1: string;\n};\n\ndeclare const Line: IntergalacticD3Component<'line', LineProps, Context> & {\n Dots: IntergalacticD3Component<'circle', LineDotsProps, LineDotsContext>;\n Null: IntergalacticD3Component<'path', LineNullProps>;\n Area: IntergalacticD3Component<'path', LineAreaProps>;\n};\n\nexport default Line;\n"],"mappings":""}
1
+ {"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { curveCardinal, CurveFactory } from 'd3-shape';\nimport { FadeInOutProps } from '@semcore/animation';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ILineProps extends LineProps, UnknownProperties {}\nexport type LineProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Curve method */\n curve?: CurveFactory;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface ILineDotsProps extends LineDotsProps, UnknownProperties {}\nexport type LineDotsProps = Context &\n Omit<FadeInOutProps, 'display'> & {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n /** Dot radius, radius of active dot is 4/3 times larger\n * @default 6\n */\n radius?: number;\n };\n\n/** @deprecated */\nexport interface ILineDotsContext extends LineDotsContext, UnknownProperties {}\nexport type LineDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface ILineNullProps extends LineNullProps, UnknownProperties {}\nexport type LineNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\nexport type LineAreaProps = Omit<LineProps, 'transparent'> & {\n /**\n * Field name from `data` (or from `area`, if passed) array for y0 point by the YAxis for the Area\n */\n y0: string;\n /**\n * Field name from `data` (or from `area`, if passed) array for y1 point by the YAxis for the Area\n */\n y1: string;\n\n /**\n * Optional data for render area\n */\n area?: Array<{ [key: string]: number }>;\n};\n\ndeclare const Line: IntergalacticD3Component<'line', LineProps, Context> & {\n Dots: IntergalacticD3Component<'circle', LineDotsProps, LineDotsContext>;\n Null: IntergalacticD3Component<'path', LineNullProps>;\n Area: IntergalacticD3Component<'path', LineAreaProps>;\n};\n\nexport default Line;\n"],"mappings":""}
@@ -60,4 +60,16 @@ export * from './component/ChartLegend/LegendFlex/LegendFlex.type';
60
60
  export * from './component/ChartLegend/LegendTable/LegendTable.type';
61
61
  // @ts-ignore
62
62
  export * from './component/ChartLegend/LegendItem/LegendItem.type';
63
+ export { default as Chart } from './component/Chart';
64
+ export * from './component/Chart/AbstractChart.type';
65
+ export * from './component/Chart/LineChart.type';
66
+ export * from './component/Chart/BarChart.type';
67
+ export * from './component/Chart/HistogramChart.type';
68
+ export * from './component/Chart/ScatterPlotChart.type';
69
+ export * from './component/Chart/AreaChart.type';
70
+ export * from './component/Chart/BubbleChart.type';
71
+ export * from './component/Chart/DonutChart.type';
72
+ export * from './component/Chart/VennChart.type';
73
+ export * from './component/Chart/RadarChart.type';
74
+ export * from './component/Chart/ScatterPlotChart.type';
63
75
  //# sourceMappingURL=index.d.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":["makeDataHintsContainer","default","Plot","ResponsiveContainer","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","Radar","Donut","Tooltip","ScatterPlot","Bubble","ReferenceLine","Venn","RadialTree","ChartLegend","ChartLegendTable"],"sources":["../../../src/types/index.d.ts"],"sourcesContent":["// Utils\nexport declare function minMax(data: any, key: string | number): any;\nexport declare const interpolateValue: Symbol;\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\n// Color\n/**\n * @deprecated\n * This export will be removed in the next major release.\n */\nexport declare const colors: { [key: string]: string };\n\nexport { default as Plot } from './Plot';\nexport * from './Plot';\n\nexport * from './Axis';\nexport * from './Hover';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport * from './ResponsiveContainer';\n\nexport { default as Line } from './Line';\nexport * from './Line';\n\nexport { default as Bar } from './Bar';\nexport * from './Bar';\n\nexport { default as HorizontalBar } from './HorizontalBar';\nexport * from './HorizontalBar';\n\nexport { default as GroupBar } from './GroupBar';\nexport * from './GroupBar';\n\nexport { default as StackBar } from './StackBar';\nexport * from './StackBar';\n\nexport { default as Area } from './Area';\nexport * from './Area';\n\nexport { default as StackedArea } from './StackedArea';\nexport * from './StackedArea';\n\nexport { default as Radar } from './Radar';\nexport * from './Radar';\n\nexport { default as Donut } from './Donut';\nexport * from './Donut';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as ScatterPlot } from './ScatterPlot';\nexport * from './ScatterPlot';\n\nexport { default as Bubble } from './Bubble';\nexport * from './Bubble';\n\nexport { default as ReferenceLine } from './ReferenceLine';\nexport * from './ReferenceLine';\n\nexport { default as Venn } from './Venn';\nexport * from './Venn';\n\n/** It becomes resolvable after building and moving file to lib dir */\n\n// @ts-ignore\nexport { default as RadialTree } from './RadialTree';\n\n// @ts-ignore\nexport * from './RadialTree';\n\n// @ts-ignore\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\n\n// @ts-ignore\nexport * from './component/ChartLegend/LegendFlex/LegendFlex.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendTable/LegendTable.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendItem/LegendItem.type';\n"],"mappings":"AAAA;;AAIA,SAASA,sBAAsB,QAAQ,cAAc;;AAErD;AACA;AACA;AACA;AACA;;AAGA,SAASC,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,cAAc,QAAQ;AACtB,cAAc,SAAS;AAEvB,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,uBAAuB;AACtE,cAAc,uBAAuB;AAErC,SAASF,OAAO,IAAIG,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAASH,OAAO,IAAII,GAAG,QAAQ,OAAO;AACtC,cAAc,OAAO;AAErB,SAASJ,OAAO,IAAIK,aAAa,QAAQ,iBAAiB;AAC1D,cAAc,iBAAiB;AAE/B,SAASL,OAAO,IAAIM,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASN,OAAO,IAAIO,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASP,OAAO,IAAIQ,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAASR,OAAO,IAAIS,WAAW,QAAQ,eAAe;AACtD,cAAc,eAAe;AAE7B,SAAST,OAAO,IAAIU,KAAK,QAAQ,SAAS;AAC1C,cAAc,SAAS;AAEvB,SAASV,OAAO,IAAIW,KAAK,QAAQ,SAAS;AAC1C,cAAc,SAAS;AAEvB,SAASX,OAAO,IAAIY,OAAO,QAAQ,WAAW;AAC9C,cAAc,WAAW;AAEzB,SAASZ,OAAO,IAAIa,WAAW,QAAQ,eAAe;AACtD,cAAc,eAAe;AAE7B,SAASb,OAAO,IAAIc,MAAM,QAAQ,UAAU;AAC5C,cAAc,UAAU;AAExB,SAASd,OAAO,IAAIe,aAAa,QAAQ,iBAAiB;AAC1D,cAAc,iBAAiB;AAE/B,SAASf,OAAO,IAAIgB,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;;AAEtB;;AAEA;AACA,SAAShB,OAAO,IAAIiB,UAAU,QAAQ,cAAc;;AAEpD;AACA,cAAc,cAAc;;AAE5B;AACA,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;;AAEvE;AACA,cAAc,oDAAoD;AAClE;AACA,cAAc,sDAAsD;AACpE;AACA,cAAc,oDAAoD"}
1
+ {"version":3,"file":"index.d.js","names":["makeDataHintsContainer","default","Plot","ResponsiveContainer","Line","Bar","HorizontalBar","GroupBar","StackBar","Area","StackedArea","Radar","Donut","Tooltip","ScatterPlot","Bubble","ReferenceLine","Venn","RadialTree","ChartLegend","ChartLegendTable","Chart"],"sources":["../../../src/types/index.d.ts"],"sourcesContent":["// Utils\nexport declare function minMax(data: any, key: string | number): any;\nexport declare const interpolateValue: Symbol;\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\n// Color\n/**\n * @deprecated\n * This export will be removed in the next major release.\n */\nexport declare const colors: { [key: string]: string };\n\nexport { default as Plot } from './Plot';\nexport * from './Plot';\n\nexport * from './Axis';\nexport * from './Hover';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport * from './ResponsiveContainer';\n\nexport { default as Line } from './Line';\nexport * from './Line';\n\nexport { default as Bar } from './Bar';\nexport * from './Bar';\n\nexport { default as HorizontalBar } from './HorizontalBar';\nexport * from './HorizontalBar';\n\nexport { default as GroupBar } from './GroupBar';\nexport * from './GroupBar';\n\nexport { default as StackBar } from './StackBar';\nexport * from './StackBar';\n\nexport { default as Area } from './Area';\nexport * from './Area';\n\nexport { default as StackedArea } from './StackedArea';\nexport * from './StackedArea';\n\nexport { default as Radar } from './Radar';\nexport * from './Radar';\n\nexport { default as Donut } from './Donut';\nexport * from './Donut';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as ScatterPlot } from './ScatterPlot';\nexport * from './ScatterPlot';\n\nexport { default as Bubble } from './Bubble';\nexport * from './Bubble';\n\nexport { default as ReferenceLine } from './ReferenceLine';\nexport * from './ReferenceLine';\n\nexport { default as Venn } from './Venn';\nexport * from './Venn';\n\n/** It becomes resolvable after building and moving file to lib dir */\n\n// @ts-ignore\nexport { default as RadialTree } from './RadialTree';\n\n// @ts-ignore\nexport * from './RadialTree';\n\n// @ts-ignore\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\n\n// @ts-ignore\nexport * from './component/ChartLegend/LegendFlex/LegendFlex.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendTable/LegendTable.type';\n// @ts-ignore\nexport * from './component/ChartLegend/LegendItem/LegendItem.type';\n\nexport { default as Chart } from './component/Chart';\nexport * from './component/Chart/AbstractChart.type';\nexport * from './component/Chart/LineChart.type';\nexport * from './component/Chart/BarChart.type';\nexport * from './component/Chart/HistogramChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\nexport * from './component/Chart/AreaChart.type';\nexport * from './component/Chart/BubbleChart.type';\nexport * from './component/Chart/DonutChart.type';\nexport * from './component/Chart/VennChart.type';\nexport * from './component/Chart/RadarChart.type';\nexport * from './component/Chart/ScatterPlotChart.type';\n"],"mappings":"AAAA;;AAIA,SAASA,sBAAsB,QAAQ,cAAc;;AAErD;AACA;AACA;AACA;AACA;;AAGA,SAASC,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,cAAc,QAAQ;AACtB,cAAc,SAAS;AAEvB,SAASD,OAAO,IAAIE,mBAAmB,QAAQ,uBAAuB;AACtE,cAAc,uBAAuB;AAErC,SAASF,OAAO,IAAIG,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAASH,OAAO,IAAII,GAAG,QAAQ,OAAO;AACtC,cAAc,OAAO;AAErB,SAASJ,OAAO,IAAIK,aAAa,QAAQ,iBAAiB;AAC1D,cAAc,iBAAiB;AAE/B,SAASL,OAAO,IAAIM,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASN,OAAO,IAAIO,QAAQ,QAAQ,YAAY;AAChD,cAAc,YAAY;AAE1B,SAASP,OAAO,IAAIQ,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;AAEtB,SAASR,OAAO,IAAIS,WAAW,QAAQ,eAAe;AACtD,cAAc,eAAe;AAE7B,SAAST,OAAO,IAAIU,KAAK,QAAQ,SAAS;AAC1C,cAAc,SAAS;AAEvB,SAASV,OAAO,IAAIW,KAAK,QAAQ,SAAS;AAC1C,cAAc,SAAS;AAEvB,SAASX,OAAO,IAAIY,OAAO,QAAQ,WAAW;AAC9C,cAAc,WAAW;AAEzB,SAASZ,OAAO,IAAIa,WAAW,QAAQ,eAAe;AACtD,cAAc,eAAe;AAE7B,SAASb,OAAO,IAAIc,MAAM,QAAQ,UAAU;AAC5C,cAAc,UAAU;AAExB,SAASd,OAAO,IAAIe,aAAa,QAAQ,iBAAiB;AAC1D,cAAc,iBAAiB;AAE/B,SAASf,OAAO,IAAIgB,IAAI,QAAQ,QAAQ;AACxC,cAAc,QAAQ;;AAEtB;;AAEA;AACA,SAAShB,OAAO,IAAIiB,UAAU,QAAQ,cAAc;;AAEpD;AACA,cAAc,cAAc;;AAE5B;AACA,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;;AAEvE;AACA,cAAc,oDAAoD;AAClE;AACA,cAAc,sDAAsD;AACpE;AACA,cAAc,oDAAoD;AAElE,SAASnB,OAAO,IAAIoB,KAAK,QAAQ,mBAAmB;AACpD,cAAc,sCAAsC;AACpD,cAAc,kCAAkC;AAChD,cAAc,iCAAiC;AAC/C,cAAc,uCAAuC;AACrD,cAAc,yCAAyC;AACvD,cAAc,kCAAkC;AAChD,cAAc,oCAAoC;AAClD,cAAc,mCAAmC;AACjD,cAAc,kCAAkC;AAChD,cAAc,mCAAmC;AACjD,cAAc,yCAAyC"}
@@ -60,13 +60,18 @@ export type LineNullProps = Context & {
60
60
 
61
61
  export type LineAreaProps = Omit<LineProps, 'transparent'> & {
62
62
  /**
63
- * Field name from `data` array for y0 point by the YAxis for the Area
63
+ * Field name from `data` (or from `area`, if passed) array for y0 point by the YAxis for the Area
64
64
  */
65
65
  y0: string;
66
66
  /**
67
- * Field name from `data` array for y1 point by the YAxis for the Area
67
+ * Field name from `data` (or from `area`, if passed) array for y1 point by the YAxis for the Area
68
68
  */
69
69
  y1: string;
70
+
71
+ /**
72
+ * Optional data for render area
73
+ */
74
+ area?: Array<{ [key: string]: number }>;
70
75
  };
71
76
 
72
77
  declare const Line: IntergalacticD3Component<'line', LineProps, Context> & {
@@ -0,0 +1,50 @@
1
+ import { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';
2
+ import { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale';
3
+ import { interpolateValue } from '../../utils';
4
+ import React from 'react';
5
+ import { Component } from '@semcore/core';
6
+ import { BaseChartProps, BaseLegendProps, ListData, ObjectData } from './AbstractChart.type';
7
+ type ChartState = {
8
+ dataDefinitions: Array<LegendItem & {
9
+ columns: React.ReactNode[];
10
+ }>;
11
+ highlightedLine: number;
12
+ withTrend: boolean;
13
+ };
14
+ export declare abstract class AbstractChart<D extends ListData | ObjectData, T extends BaseChartProps<D>> extends Component<T, {}, ChartState> {
15
+ static style: {};
16
+ static defaultProps: Partial<BaseChartProps<any>>;
17
+ /**
18
+ * Padding from the end's of chart to the container (except axis sides)
19
+ */
20
+ protected plotPadding: number;
21
+ protected dataHints: import("../../a11y/hints").DataStructureHints;
22
+ state: ChartState;
23
+ constructor(props: T);
24
+ componentDidUpdate(prevProps: T): void;
25
+ protected get defaultDataDefinitions(): Array<LegendItem & {
26
+ columns: React.ReactNode[];
27
+ }>;
28
+ protected abstract get xScale(): ScaleBand<any> | ScaleLinear<any, any> | ScaleTime<any, any>;
29
+ protected abstract get yScale(): ScaleBand<any> | ScaleLinear<any, any> | ScaleTime<any, any>;
30
+ protected abstract renderChart(): React.ReactNode;
31
+ protected abstract renderTooltip(): React.ReactNode;
32
+ protected get dataKeys(): string[];
33
+ protected get xTicks(): number[] | Date[] | undefined;
34
+ protected get yTicks(): number[] | Date[] | undefined;
35
+ protected get flatValues(): Set<number>;
36
+ protected get maxStackedValue(): number;
37
+ protected totalValue(data: ObjectData): number;
38
+ protected setHighlightedLine(index: number): void;
39
+ protected handleChangeVisible(id: string, isVisible: boolean): void;
40
+ protected handleWithTrendChange(isVisible: boolean): void;
41
+ protected handleMouseEnter(id: string): void;
42
+ protected handleMouseLeave(): void;
43
+ protected resolveColor(id: string, index: number): string;
44
+ protected tooltipValueFormatter(value?: string | number | typeof interpolateValue | Date): string;
45
+ protected defaultLegendProps(): Partial<BaseLegendProps>;
46
+ protected renderLegend(): JSX.Element | null;
47
+ protected renderAxis(): React.ReactNode;
48
+ render(): React.ReactNode;
49
+ }
50
+ export {};
@@ -0,0 +1,161 @@
1
+ import React from 'react';
2
+ import { FlexProps } from '@semcore/flex-box';
3
+ import { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';
4
+ import Icon from '@semcore/icon';
5
+ import { BaseChartLegendProps } from '../ChartLegend/BaseLegend.type';
6
+ import { TrendProps } from '../ChartLegend/LegendFlex/LegendFlex.type';
7
+ export type BaseLegendProps = BaseChartLegendProps & {
8
+ /**
9
+ * Disable hover (for transition items legend of each not hovered)
10
+ */
11
+ disableHoverItems?: boolean;
12
+ /**
13
+ * Disable selectable of data items by checkboxes in Legend
14
+ */
15
+ disableSelectItems?: boolean;
16
+ } & ((TrendProps & {
17
+ /**
18
+ * How to render Legend - Flex view. Just list of legend items
19
+ */
20
+ legendType?: never | 'Flex';
21
+ /**
22
+ * Config for Legend items
23
+ */
24
+ legendMap?: LegendDataMap<'Flex'>;
25
+ }) | {
26
+ /**
27
+ * How to render Legend - Table view. Table of legend items with some additional information in columns
28
+ */
29
+ legendType: 'Table';
30
+ /**
31
+ * Config for Legend items
32
+ */
33
+ legendMap?: LegendDataMap<'Table'>;
34
+ });
35
+ export type ObjectData = Record<string, unknown>;
36
+ export type ListData = ObjectData[];
37
+ export type BaseChartProps<T extends ListData | ObjectData> = FlexProps & {
38
+ /**
39
+ * Chart data. For all charts except Donut(Pie), Radar and Venn should be an Array
40
+ */
41
+ data: T;
42
+ /**
43
+ * Width of plot
44
+ */
45
+ plotWidth: number;
46
+ /**
47
+ * Height of plot
48
+ */
49
+ plotHeight: number;
50
+ /**
51
+ * Margin (for Y axis points) from left side of chart container to Y axis
52
+ */
53
+ marginY?: number;
54
+ /**
55
+ * Margin (for X axis points) from bottom of chart container to X axis
56
+ */
57
+ marginX?: number;
58
+ /**
59
+ * invert axis and show horizontal charts (only for Bars!)
60
+ */
61
+ invertAxis?: boolean;
62
+ /**
63
+ * Show X axis
64
+ * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)
65
+ */
66
+ showXAxis?: boolean;
67
+ /**
68
+ * Show Y axis
69
+ * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)
70
+ */
71
+ showYAxis?: boolean;
72
+ /**
73
+ * Map with colors for data items
74
+ */
75
+ colorMap?: Record<string, string>;
76
+ /**
77
+ * Show tooltip's.
78
+ * @default true
79
+ */
80
+ showTooltip?: boolean;
81
+ /**
82
+ * Show sum of values for selected point in tooltip
83
+ */
84
+ showTotalInTooltip?: boolean;
85
+ /**
86
+ * Scale for xAxis (see more in d3-scale)
87
+ */
88
+ xScale?: unknown;
89
+ /**
90
+ * Scale for yAxis (see more in d3-scale)
91
+ */
92
+ yScale?: unknown;
93
+ /**
94
+ * Count of ticks for X axis
95
+ */
96
+ xTicksCount?: number;
97
+ /**
98
+ * Count of ticks for Y axis
99
+ */
100
+ yTicksCount?: number;
101
+ /**
102
+ * Group key for all array-based charts (for get keys of items for legend except that group key)
103
+ */
104
+ groupKey?: string;
105
+ /**
106
+ * function for format axis item text
107
+ */
108
+ axisXValueFormatter?: (value: unknown) => string;
109
+ axisYValueFormatter?: (value: unknown) => string;
110
+ /**
111
+ * Function for format text for tooltip
112
+ */
113
+ tooltipValueFormatter?: (value?: unknown) => string;
114
+ } /**
115
+ * By default, we show the Legend for all charts with more the one data item.
116
+ * For hide the Legend, you should set showLegend prop to `false`.
117
+ */ & ({
118
+ /**
119
+ * Don't show legend
120
+ */
121
+ showLegend?: false;
122
+ legendProps?: never;
123
+ } | {
124
+ /**
125
+ * By default (if showLegend don't set), for one data item on chart,
126
+ * Legend component will be hide, and show for more then 1 data item.
127
+ * If set `true` - Legend component will show always.
128
+ */
129
+ showLegend?: true;
130
+ /**
131
+ * Props for Legend
132
+ */
133
+ legendProps?: Partial<BaseLegendProps>;
134
+ });
135
+ type LegendDataMap<T extends 'Flex' | 'Table'> = Record<LegendItemKey, {
136
+ /**
137
+ * Custom label for legend item (by default use keys from data item object)
138
+ */
139
+ label?: string;
140
+ /**
141
+ * Additional text after label
142
+ */
143
+ additionalInfo?: string;
144
+ /**
145
+ * Count after label
146
+ */
147
+ count?: number;
148
+ /**
149
+ * Custom Icon
150
+ */
151
+ icon?: typeof Icon;
152
+ /**
153
+ * Flag for uncheck some items by default
154
+ */
155
+ defaultChecked?: boolean;
156
+ } & (T extends 'Table' ? {
157
+ columns?: React.ReactNode[];
158
+ } : {
159
+ columns?: never;
160
+ })>;
161
+ export {};
@@ -0,0 +1,2 @@
1
+ import { AreaChartType } from './AreaChart.type';
2
+ export declare const AreaChart: AreaChartType;
@@ -0,0 +1,16 @@
1
+ import { Intergalactic } from '@semcore/core';
2
+ import { Flex } from '@semcore/flex-box';
3
+ import { interpolateValue } from '../../utils';
4
+ import { ScaleLinear, ScaleTime } from 'd3-scale';
5
+ import { CurveFactory } from 'd3-shape';
6
+ import { BaseChartProps } from './AbstractChart.type';
7
+ export type AreaChartData = Array<Record<string, number | typeof interpolateValue | Date>>;
8
+ export type AreaChartProps = BaseChartProps<AreaChartData> & {
9
+ groupKey: string;
10
+ xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;
11
+ yScale?: ScaleLinear<any, any>;
12
+ showDots?: boolean;
13
+ curve?: CurveFactory;
14
+ stacked?: boolean;
15
+ };
16
+ export type AreaChartType = Intergalactic.Component<typeof Flex, AreaChartProps>;
@@ -0,0 +1,2 @@
1
+ import { BarChartType } from './BarChart.type';
2
+ export declare const BarChart: BarChartType;
@@ -0,0 +1,19 @@
1
+ import { Intergalactic } from '@semcore/core';
2
+ import { Flex } from '@semcore/flex-box';
3
+ import { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale';
4
+ import { BaseChartProps } from './AbstractChart.type';
5
+ import { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';
6
+ type TrendItem = {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ export type BarChartData = Array<Record<string, string | number | Date>>;
11
+ export type BarChartProps = BaseChartProps<BarChartData> & {
12
+ groupKey: string;
13
+ xScale?: ScaleBand<any> | ScaleTime<any, any>;
14
+ yScale?: ScaleLinear<any, any>;
15
+ type?: 'stack' | 'group';
16
+ trend?: Record<LegendItemKey, TrendItem[]>;
17
+ };
18
+ export type BarChartType = Intergalactic.Component<typeof Flex, BarChartProps>;
19
+ export {};
@@ -0,0 +1,2 @@
1
+ import { BubbleChartType } from './BubbleChart.type';
2
+ export declare const BubbleChart: BubbleChartType;
@@ -0,0 +1,17 @@
1
+ import { Intergalactic } from '@semcore/core';
2
+ import { Flex } from '@semcore/flex-box';
3
+ import { ScaleLinear } from 'd3-scale';
4
+ import { BaseChartProps } from './AbstractChart.type';
5
+ export type BubbleChartData = Array<{
6
+ x: number;
7
+ y: number;
8
+ value: number;
9
+ label?: string;
10
+ color?: string;
11
+ }>;
12
+ export type BubbleChartProps = BaseChartProps<BubbleChartData> & {
13
+ groupKey?: never;
14
+ xScale?: ScaleLinear<any, any>;
15
+ yScale?: ScaleLinear<any, any>;
16
+ };
17
+ export type BubbleChartType = Intergalactic.Component<typeof Flex, BubbleChartProps>;
@@ -0,0 +1,2 @@
1
+ import { DonutChartType } from './DonutChart.type';
2
+ export declare const DonutChart: DonutChartType;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Intergalactic } from '@semcore/core';
3
+ import { Flex } from '@semcore/flex-box';
4
+ import { ScaleLinear } from 'd3-scale';
5
+ import { BaseChartProps } from './AbstractChart.type';
6
+ export type DonutChartData = Record<string, number>;
7
+ export type DonutChartProps = BaseChartProps<DonutChartData> & {
8
+ groupKey?: never;
9
+ xScale?: ScaleLinear<any, any>;
10
+ yScale?: ScaleLinear<any, any>;
11
+ innerRadius?: number;
12
+ halfsize?: boolean;
13
+ innerLabel?: React.ReactNode;
14
+ };
15
+ export type DonutChartType = Intergalactic.Component<typeof Flex, DonutChartProps>;
@@ -0,0 +1,2 @@
1
+ import { HistogramChartType } from './HistogramChart.type';
2
+ export declare const HistogramChart: HistogramChartType;
@@ -0,0 +1,11 @@
1
+ import { Intergalactic } from '@semcore/core';
2
+ import { Flex } from '@semcore/flex-box';
3
+ import { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale';
4
+ import { BaseChartProps } from './AbstractChart.type';
5
+ export type HistogramChartData = Array<Record<string, number | Date>>;
6
+ export type HistogramChartProps = BaseChartProps<HistogramChartData> & {
7
+ groupKey: string;
8
+ xScale?: ScaleBand<any> | ScaleTime<any, any>;
9
+ yScale?: ScaleLinear<any, any>;
10
+ };
11
+ export type HistogramChartType = Intergalactic.Component<typeof Flex, HistogramChartProps>;
@@ -0,0 +1,2 @@
1
+ import { LineChartType } from './LineChart.type';
2
+ export declare const LineChart: LineChartType;
@@ -0,0 +1,24 @@
1
+ import { Intergalactic } from '@semcore/core';
2
+ import { Flex } from '@semcore/flex-box';
3
+ import { interpolateValue } from '../../utils';
4
+ import { ScaleLinear, ScaleTime } from 'd3-scale';
5
+ import { CurveFactory } from 'd3-shape';
6
+ import { BaseChartProps } from './AbstractChart.type';
7
+ import { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';
8
+ type AreaItem = {
9
+ x: number;
10
+ y0: number;
11
+ y1: number;
12
+ };
13
+ export type LineChartData = Array<Record<string, string | number | typeof interpolateValue | Date>>;
14
+ export type LineChartProps = BaseChartProps<LineChartData> & {
15
+ groupKey: string;
16
+ area?: Record<LegendItemKey, AreaItem[]>;
17
+ xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;
18
+ yScale?: ScaleLinear<any, any>;
19
+ showDots?: boolean;
20
+ curve?: CurveFactory;
21
+ areaCurve?: CurveFactory;
22
+ };
23
+ export type LineChartType = Intergalactic.Component<typeof Flex, LineChartProps>;
24
+ export {};
@@ -0,0 +1,2 @@
1
+ import { RadarChartType } from './RadarChart.type';
2
+ export declare const RadarChart: RadarChartType;
@@ -0,0 +1,14 @@
1
+ import { Intergalactic } from '@semcore/core';
2
+ import { Flex } from '@semcore/flex-box';
3
+ import { ScaleLinear } from 'd3-scale';
4
+ import { BaseChartProps } from './AbstractChart.type';
5
+ export type RadarChartData = Record<string, string[] | number[]>;
6
+ export type RadarChartProps = BaseChartProps<RadarChartData> & {
7
+ groupKey: string;
8
+ scale?: ScaleLinear<any, any>;
9
+ xScale?: never;
10
+ yScale?: never;
11
+ showDots?: boolean;
12
+ circle?: boolean;
13
+ };
14
+ export type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;
@@ -0,0 +1,2 @@
1
+ import { ScatterPlotChartType } from './ScatterPlotChart.type';
2
+ export declare const ScatterPlotChart: ScatterPlotChartType;
@@ -0,0 +1,13 @@
1
+ import { Intergalactic } from '@semcore/core';
2
+ import { Flex } from '@semcore/flex-box';
3
+ import { interpolateValue } from '../../utils';
4
+ import { ScaleLinear, ScaleTime } from 'd3-scale';
5
+ import { BaseChartProps } from './AbstractChart.type';
6
+ export type ScatterPlotChartData = Array<Record<string, number | typeof interpolateValue | Date>>;
7
+ export type ScatterPlotChartProps = BaseChartProps<ScatterPlotChartData> & {
8
+ groupKey: string;
9
+ xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;
10
+ yScale?: ScaleLinear<any, any>;
11
+ valueKey?: string;
12
+ };
13
+ export type ScatterPlotChartType = Intergalactic.Component<typeof Flex, ScatterPlotChartProps>;
@@ -0,0 +1,2 @@
1
+ import { VennChartType } from './VennChart.type';
2
+ export declare const VennChart: VennChartType;
@@ -0,0 +1,11 @@
1
+ import { Intergalactic } from '@semcore/core';
2
+ import { Flex } from '@semcore/flex-box';
3
+ import { ScaleLinear } from 'd3-scale';
4
+ import { BaseChartProps } from './AbstractChart.type';
5
+ export type VennChartData = Record<string, number>;
6
+ export type VennChartProps = BaseChartProps<VennChartData> & {
7
+ groupKey?: never;
8
+ xScale?: ScaleLinear<any, any>;
9
+ yScale?: ScaleLinear<any, any>;
10
+ };
11
+ export type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ Line: import("./LineChart.type").LineChartType;
3
+ Bar: import("./BarChart.type").BarChartType;
4
+ Histogram: import("./HistogramChart.type").HistogramChartType;
5
+ ScatterPlot: import("./ScatterPlotChart.type").ScatterPlotChartType;
6
+ Area: import("./AreaChart.type").AreaChartType;
7
+ Bubble: import("./BubbleChart.type").BubbleChartType;
8
+ Donut: import("./DonutChart.type").DonutChartType;
9
+ Venn: import("./VennChart.type").VennChartType;
10
+ Radar: import("./RadarChart.type").RadarChartType;
11
+ };
12
+ export default _default;
@@ -1,8 +1,8 @@
1
- import { BoxProps } from '@semcore/flex-box';
1
+ import { BoxProps, FlexProps } from '@semcore/flex-box';
2
2
  import { LegendItem, LegendItemKey, ShapeType } from './LegendItem/LegendItem.type';
3
3
  import { DataStructureHints } from '../../a11y/hints';
4
4
  export type LSize = 'm' | 'l';
5
- export type BaseChartLegendProps = {
5
+ export type BaseChartLegendProps = FlexProps & {
6
6
  /**
7
7
  * Size for legend items
8
8
  */
@@ -79,3 +79,16 @@ export * from './component/ChartLegend/LegendFlex/LegendFlex.type';
79
79
  export * from './component/ChartLegend/LegendTable/LegendTable.type';
80
80
  // @ts-ignore
81
81
  export * from './component/ChartLegend/LegendItem/LegendItem.type';
82
+
83
+ export { default as Chart } from './component/Chart';
84
+ export * from './component/Chart/AbstractChart.type';
85
+ export * from './component/Chart/LineChart.type';
86
+ export * from './component/Chart/BarChart.type';
87
+ export * from './component/Chart/HistogramChart.type';
88
+ export * from './component/Chart/ScatterPlotChart.type';
89
+ export * from './component/Chart/AreaChart.type';
90
+ export * from './component/Chart/BubbleChart.type';
91
+ export * from './component/Chart/DonutChart.type';
92
+ export * from './component/Chart/VennChart.type';
93
+ export * from './component/Chart/RadarChart.type';
94
+ export * from './component/Chart/ScatterPlotChart.type';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/d3-chart",
3
3
  "description": "Semrush D3 Chart Component",
4
- "version": "3.18.1",
4
+ "version": "3.18.2",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "@semcore/animation": "2.10.1",
19
19
  "@semcore/divider": "4.10.1",
20
20
  "@semcore/flex-box": "5.10.1",
21
- "@semcore/popper": "5.9.1",
21
+ "@semcore/popper": "5.9.2",
22
22
  "@semcore/utils": "4.10.2",
23
23
  "@types/d3-shape": "^3.1.0",
24
24
  "@upsetjs/venn.js": "1.4.2",