@semcore/d3-chart 2.7.2 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/Area.js +24 -16
  3. package/lib/cjs/Area.js.map +1 -1
  4. package/lib/cjs/Axis.js +14 -14
  5. package/lib/cjs/Bar.js +13 -10
  6. package/lib/cjs/Bar.js.map +1 -1
  7. package/lib/cjs/Bubble.js +10 -10
  8. package/lib/cjs/Donut.js +12 -9
  9. package/lib/cjs/Donut.js.map +1 -1
  10. package/lib/cjs/Dots.js +14 -11
  11. package/lib/cjs/Dots.js.map +1 -1
  12. package/lib/cjs/HorizontalBar.js +12 -9
  13. package/lib/cjs/HorizontalBar.js.map +1 -1
  14. package/lib/cjs/Hover.js +4 -4
  15. package/lib/cjs/Line.js +16 -11
  16. package/lib/cjs/Line.js.map +1 -1
  17. package/lib/cjs/Plot.js +4 -4
  18. package/lib/cjs/RadialTree.js +11 -11
  19. package/lib/cjs/ReferenceLine.js +10 -10
  20. package/lib/cjs/ScatterPlot.js +7 -7
  21. package/lib/cjs/Tooltip.js +8 -8
  22. package/lib/cjs/Venn.js +22 -13
  23. package/lib/cjs/Venn.js.map +1 -1
  24. package/lib/cjs/a11y/PlotA11yModule.js +3 -3
  25. package/lib/cjs/a11y/PlotA11yView.js +4 -4
  26. package/lib/cjs/style/area.shadow.css +8 -0
  27. package/lib/cjs/style/bar.shadow.css +4 -0
  28. package/lib/cjs/style/donut.shadow.css +4 -0
  29. package/lib/cjs/style/dot.shadow.css +4 -0
  30. package/lib/cjs/style/line.shadow.css +4 -0
  31. package/lib/cjs/style/venn.shadow.css +8 -0
  32. package/lib/cjs/types/Area.d.js.map +1 -1
  33. package/lib/cjs/types/Bar.d.js.map +1 -1
  34. package/lib/cjs/types/Donut.d.js.map +1 -1
  35. package/lib/cjs/types/HorizontalBar.d.js.map +1 -1
  36. package/lib/cjs/types/Line.d.js.map +1 -1
  37. package/lib/cjs/types/Venn.d.js.map +1 -1
  38. package/lib/es6/Area.js +24 -16
  39. package/lib/es6/Area.js.map +1 -1
  40. package/lib/es6/Axis.js +14 -14
  41. package/lib/es6/Bar.js +13 -10
  42. package/lib/es6/Bar.js.map +1 -1
  43. package/lib/es6/Bubble.js +10 -10
  44. package/lib/es6/Donut.js +12 -9
  45. package/lib/es6/Donut.js.map +1 -1
  46. package/lib/es6/Dots.js +14 -11
  47. package/lib/es6/Dots.js.map +1 -1
  48. package/lib/es6/HorizontalBar.js +12 -9
  49. package/lib/es6/HorizontalBar.js.map +1 -1
  50. package/lib/es6/Hover.js +4 -4
  51. package/lib/es6/Line.js +16 -11
  52. package/lib/es6/Line.js.map +1 -1
  53. package/lib/es6/Plot.js +4 -4
  54. package/lib/es6/RadialTree.js +11 -11
  55. package/lib/es6/ReferenceLine.js +10 -10
  56. package/lib/es6/ScatterPlot.js +7 -7
  57. package/lib/es6/Tooltip.js +8 -8
  58. package/lib/es6/Venn.js +22 -13
  59. package/lib/es6/Venn.js.map +1 -1
  60. package/lib/es6/a11y/PlotA11yModule.js +3 -3
  61. package/lib/es6/a11y/PlotA11yView.js +4 -4
  62. package/lib/es6/style/area.shadow.css +8 -0
  63. package/lib/es6/style/bar.shadow.css +4 -0
  64. package/lib/es6/style/donut.shadow.css +4 -0
  65. package/lib/es6/style/dot.shadow.css +4 -0
  66. package/lib/es6/style/line.shadow.css +4 -0
  67. package/lib/es6/style/venn.shadow.css +8 -0
  68. package/lib/es6/types/Area.d.js.map +1 -1
  69. package/lib/es6/types/Bar.d.js.map +1 -1
  70. package/lib/es6/types/Donut.d.js.map +1 -1
  71. package/lib/es6/types/HorizontalBar.d.js.map +1 -1
  72. package/lib/es6/types/Line.d.js.map +1 -1
  73. package/lib/es6/types/Venn.d.js.map +1 -1
  74. package/lib/types/Area.d.ts +4 -0
  75. package/lib/types/Bar.d.ts +2 -0
  76. package/lib/types/Donut.d.ts +2 -0
  77. package/lib/types/HorizontalBar.d.ts +2 -0
  78. package/lib/types/Line.d.ts +2 -0
  79. package/lib/types/Venn.d.ts +4 -0
  80. package/package.json +1 -1
package/lib/es6/Venn.js CHANGED
@@ -26,16 +26,17 @@ var style = (
26
26
  /*__reshadow_css_start__*/
27
27
  _sstyled.insert(
28
28
  /*__inner_css_start__*/
29
- ".___SCircle_1pj0r_gg_{fill:var(--intergalactic-chart-palette-order-green,#59ddaa);stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;fill-opacity:.5;transition-property:cx,cy;transition-duration:var(--duration_1pj0r);transition-timing-function:ease-in-out}.___SCircle_1pj0r_gg_:hover{fill-opacity:.7}.___SCircle_1pj0r_gg_.__color_1pj0r_gg_{fill:var(--color_1pj0r)}.___SIntersection_1pj0r_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;fill-opacity:0}.___SIntersection_1pj0r_gg_:hover{fill-opacity:.1}"
29
+ ".___SCircle_1e4mg_gg_{fill:var(--intergalactic-chart-palette-order-green,#59ddaa);stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;fill-opacity:.5;transition-property:cx,cy;transition-duration:var(--duration_1e4mg);transition-timing-function:ease-in-out}.___SCircle_1e4mg_gg_:hover{fill-opacity:.7}.___SCircle_1e4mg_gg_.__color_1e4mg_gg_{fill:var(--color_1e4mg)}.___SCircle_1e4mg_gg_.__transparent_1e4mg_gg_{opacity:.3}.___SIntersection_1e4mg_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;fill-opacity:0}.___SIntersection_1e4mg_gg_:hover{fill-opacity:.1}.___SIntersection_1e4mg_gg_.__transparent_1e4mg_gg_{opacity:.3}"
30
30
  /*__inner_css_end__*/
31
- , "1pj0r_gg_")
31
+ , "1e4mg_gg_")
32
32
  /*__reshadow_css_end__*/
33
33
  , {
34
- "__SCircle": "___SCircle_1pj0r_gg_",
35
- "--duration": "--duration_1pj0r",
36
- "_color": "__color_1pj0r_gg_",
37
- "--color": "--color_1pj0r",
38
- "__SIntersection": "___SIntersection_1pj0r_gg_"
34
+ "__SCircle": "___SCircle_1e4mg_gg_",
35
+ "--duration": "--duration_1e4mg",
36
+ "_color": "__color_1e4mg_gg_",
37
+ "--color": "--color_1e4mg",
38
+ "_transparent": "__transparent_1e4mg_gg_",
39
+ "__SIntersection": "___SIntersection_1e4mg_gg_"
39
40
  });
40
41
 
41
42
  var VennRoot = /*#__PURE__*/function (_Component) {
@@ -128,13 +129,16 @@ var VennRoot = /*#__PURE__*/function (_Component) {
128
129
  data: this.vennData[props.dataKey],
129
130
  originalData: this.asProps.data[props.dataKey],
130
131
  onMouseMove: this.bindHandlerTooltip(true, props),
131
- onMouseLeave: this.bindHandlerTooltip(false, props)
132
+ onMouseLeave: this.bindHandlerTooltip(false, props),
133
+ transparent: this.asProps.transparent
132
134
  };
133
135
  }
134
136
  }, {
135
137
  key: "getIntersectionProps",
136
138
  value: function getIntersectionProps(props) {
137
- var duration = this.asProps.duration;
139
+ var _this$asProps2 = this.asProps,
140
+ duration = _this$asProps2.duration,
141
+ transparent = _this$asProps2.transparent;
138
142
  var dataKeys = props.dataKey.split('/');
139
143
  return {
140
144
  duration: duration,
@@ -144,7 +148,8 @@ var VennRoot = /*#__PURE__*/function (_Component) {
144
148
  }),
145
149
  originalData: this.asProps.data[props.dataKey],
146
150
  onMouseMove: this.bindHandlerTooltip(true, props),
147
- onMouseLeave: this.bindHandlerTooltip(false, props)
151
+ onMouseLeave: this.bindHandlerTooltip(false, props),
152
+ transparent: transparent
148
153
  };
149
154
  }
150
155
  }, {
@@ -187,7 +192,8 @@ function Circle(_ref6) {
187
192
  duration = _ref6.duration,
188
193
  name = _ref6.name,
189
194
  dataKey = _ref6.dataKey,
190
- dataHintsHandler = _ref6.dataHintsHandler;
195
+ dataHintsHandler = _ref6.dataHintsHandler,
196
+ transparent = _ref6.transparent;
191
197
  dataHintsHandler.describeValueEntity(dataKey, name);
192
198
  return _ref = sstyled(styles), /*#__PURE__*/React.createElement(SCircle, _ref.cn("SCircle", {
193
199
  "aria-hidden": true,
@@ -196,6 +202,7 @@ function Circle(_ref6) {
196
202
  "cx": data.x,
197
203
  "cy": data.y,
198
204
  "r": data.radius,
205
+ "transparent": transparent,
199
206
  "use:duration": "".concat(duration, "ms")
200
207
  }));
201
208
  }
@@ -208,7 +215,8 @@ function Intersection(props) {
208
215
  data = props.data,
209
216
  name = props.name,
210
217
  dataKey = props.dataKey,
211
- dataHintsHandler = props.dataHintsHandler;
218
+ dataHintsHandler = props.dataHintsHandler,
219
+ transparent = props.transparent;
212
220
  dataHintsHandler.describeValueEntity(dataKey, name);
213
221
  var renderIntersection = React.useCallback( /*#__PURE__*/React.forwardRef(function (props, ref) {
214
222
  return /*#__PURE__*/React.createElement(FadeInOut, _extends({
@@ -221,7 +229,8 @@ function Intersection(props) {
221
229
  return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SIntersection, _ref2.cn("SIntersection", {
222
230
  "aria-hidden": true,
223
231
  "render": renderIntersection,
224
- "d": intersectionAreaPath(data)
232
+ "d": intersectionAreaPath(data),
233
+ "transparent": transparent
225
234
  }));
226
235
  }
227
236
 
@@ -1 +1 @@
1
- {"version":3,"file":"Venn.js","names":["React","venn","normalizeSolution","scaleSolution","intersectionAreaPath","Component","sstyled","canUseDOM","FadeInOut","createElement","CONSTANT","VennRoot","document","visible","props","x","clientX","y","clientY","eventEmitter","asProps","virtualElement","getBoundingClientRect","generateGetBoundingClientRect","VIRTUAL_ELEMENT","emit","forwardRef","ref","width","height","top","right","bottom","left","data","orientation","orientationOrder","size","vennData","Object","entries","map","dataKey","sets","split","duration","originalData","onMouseMove","bindHandlerTooltip","onMouseLeave","dataKeys","delay","values","filter","d","includes","setid","Element","dataHintsHandler","establishDataType","getVennData","renderElement","style","Math","PI","c1","c2","radius","Circle","SCircle","styles","color","name","describeValueEntity","Intersection","SIntersection","renderIntersection","useCallback","Venn"],"sources":["../../src/Venn.jsx"],"sourcesContent":["import React from 'react';\nimport { venn, normalizeSolution, scaleSolution, intersectionAreaPath } from '@upsetjs/venn.js';\nimport { Component, sstyled } from '@semcore/core';\nimport canUseDOM from '@semcore/utils/lib/canUseDOM';\nimport { FadeInOut } from '@semcore/animation';\nimport createElement from './createElement';\nimport { CONSTANT } from './utils';\n\nimport style from './style/venn.shadow.css';\n\nclass VennRoot extends Component {\n static displayName = 'Venn';\n static style = style;\n\n static defaultProps = {\n orientation: Math.PI / 2,\n orientationOrder: (c1, c2) => c2.radius - c1.radius,\n duration: 500,\n };\n\n virtualElement = canUseDOM() ? document.createElement('div') : {};\n\n generateGetBoundingClientRect(x = 0, y = 0) {\n return () => ({ width: 0, height: 0, top: y, right: x, bottom: y, left: x });\n }\n\n bindHandlerTooltip =\n (visible, props) =>\n ({ clientX: x, clientY: y }) => {\n const { eventEmitter } = this.asProps;\n this.virtualElement.getBoundingClientRect = this.generateGetBoundingClientRect(x, y);\n this.virtualElement[CONSTANT.VIRTUAL_ELEMENT] = true;\n eventEmitter.emit('onTooltipVisible', visible, props, this.virtualElement);\n };\n\n getVennData() {\n const { data, orientation, orientationOrder, size } = this.asProps;\n const [width, height] = size;\n const vennData = Object.entries(data).map(([dataKey, size]) => ({\n sets: dataKey.split('/'),\n size,\n }));\n return scaleSolution(\n normalizeSolution(venn(vennData), orientation, orientationOrder),\n width,\n height,\n 10,\n );\n }\n\n getCircleProps(props) {\n return {\n duration: this.asProps.duration,\n data: this.vennData[props.dataKey],\n originalData: this.asProps.data[props.dataKey],\n onMouseMove: this.bindHandlerTooltip(true, props),\n onMouseLeave: this.bindHandlerTooltip(false, props),\n };\n }\n\n getIntersectionProps(props) {\n const { duration } = this.asProps;\n const dataKeys = props.dataKey.split('/');\n return {\n duration,\n delay: duration,\n data: Object.values(this.vennData).filter((d) => dataKeys.includes(d.setid)),\n originalData: this.asProps.data[props.dataKey],\n onMouseMove: this.bindHandlerTooltip(true, props),\n onMouseLeave: this.bindHandlerTooltip(false, props),\n };\n }\n\n renderElement = React.forwardRef((props, ref) => {\n return <FadeInOut aria-hidden ref={ref} tag=\"g\" visible {...props} />;\n });\n\n render() {\n const Element = this.Element;\n this.asProps.dataHintsHandler.establishDataType('values-set');\n this.vennData = this.getVennData();\n return (\n <Element\n aria-hidden\n render={this.renderElement}\n childrenPosition=\"inside\"\n vennData={this.vennData}\n />\n );\n }\n}\n\nfunction Circle({\n Element: SCircle,\n styles,\n color,\n data,\n duration,\n name,\n dataKey,\n dataHintsHandler,\n}) {\n dataHintsHandler.describeValueEntity(dataKey, name);\n\n return sstyled(styles)(\n <SCircle\n aria-hidden\n render=\"circle\"\n color={color}\n cx={data.x}\n cy={data.y}\n r={data.radius}\n use:duration={`${duration}ms`}\n />,\n );\n}\n\nfunction Intersection(props) {\n const { Element: SIntersection, styles, data, name, dataKey, dataHintsHandler } = props;\n dataHintsHandler.describeValueEntity(dataKey, name);\n\n const renderIntersection = React.useCallback(\n React.forwardRef((props, ref) => {\n return <FadeInOut aria-hidden ref={ref} tag=\"path\" visible {...props} />;\n }),\n [props],\n );\n return sstyled(styles)(\n <SIntersection aria-hidden render={renderIntersection} d={intersectionAreaPath(data)} />,\n );\n}\n\nconst Venn = createElement(VennRoot, { Circle, Intersection });\n\nexport default Venn;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,iBAAf,EAAkCC,aAAlC,EAAiDC,oBAAjD,QAA6E,kBAA7E;AACA,SAASC,SAAT,EAAoBC,OAApB,QAAmC,eAAnC;AACA,OAAOC,SAAP,MAAsB,8BAAtB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,SAASC,QAAT,QAAyB,SAAzB;;;;;;;;;;;;;;;;;;;IAIMC,Q;;;;;;;;;;;;;;;;qEAUaJ,SAAS,KAAKK,QAAQ,CAACH,aAAT,CAAuB,KAAvB,CAAL,GAAqC,E;;yEAO7D,UAACI,OAAD,EAAUC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aleSolution","intersectionAreaPath","Component","sstyled","canUseDOM","FadeInOut","createElement","CONSTANT","VennRoot","document","visible","props","x","clientX","y","clientY","eventEmitter","asProps","virtualElement","getBoundingClientRect","generateGetBoundingClientRect","VIRTUAL_ELEMENT","emit","forwardRef","ref","width","height","top","right","bottom","left","data","orientation","orientationOrder","size","vennData","Object","entries","map","dataKey","sets","split","duration","originalData","onMouseMove","bindHandlerTooltip","onMouseLeave","transparent","dataKeys","delay","values","filter","d","includes","setid","Element","dataHintsHandler","establishDataType","getVennData","renderElement","style","Math","PI","c1","c2","radius","Circle","SCircle","styles","color","name","describeValueEntity","Intersection","SIntersection","renderIntersection","useCallback","Venn"],"sources":["../../src/Venn.jsx"],"sourcesContent":["import React from 'react';\nimport { venn, normalizeSolution, scaleSolution, intersectionAreaPath } from '@upsetjs/venn.js';\nimport { Component, sstyled } from '@semcore/core';\nimport canUseDOM from '@semcore/utils/lib/canUseDOM';\nimport { FadeInOut } from '@semcore/animation';\nimport createElement from './createElement';\nimport { CONSTANT } from './utils';\n\nimport style from './style/venn.shadow.css';\n\nclass VennRoot extends Component {\n static displayName = 'Venn';\n static style = style;\n\n static defaultProps = {\n orientation: Math.PI / 2,\n orientationOrder: (c1, c2) => c2.radius - c1.radius,\n duration: 500,\n };\n\n virtualElement = canUseDOM() ? document.createElement('div') : {};\n\n generateGetBoundingClientRect(x = 0, y = 0) {\n return () => ({ width: 0, height: 0, top: y, right: x, bottom: y, left: x });\n }\n\n bindHandlerTooltip =\n (visible, props) =>\n ({ clientX: x, clientY: y }) => {\n const { eventEmitter } = this.asProps;\n this.virtualElement.getBoundingClientRect = this.generateGetBoundingClientRect(x, y);\n this.virtualElement[CONSTANT.VIRTUAL_ELEMENT] = true;\n eventEmitter.emit('onTooltipVisible', visible, props, this.virtualElement);\n };\n\n getVennData() {\n const { data, orientation, orientationOrder, size } = this.asProps;\n const [width, height] = size;\n const vennData = Object.entries(data).map(([dataKey, size]) => ({\n sets: dataKey.split('/'),\n size,\n }));\n return scaleSolution(\n normalizeSolution(venn(vennData), orientation, orientationOrder),\n width,\n height,\n 10,\n );\n }\n\n getCircleProps(props) {\n return {\n duration: this.asProps.duration,\n data: this.vennData[props.dataKey],\n originalData: this.asProps.data[props.dataKey],\n onMouseMove: this.bindHandlerTooltip(true, props),\n onMouseLeave: this.bindHandlerTooltip(false, props),\n transparent: this.asProps.transparent,\n };\n }\n\n getIntersectionProps(props) {\n const { duration, transparent } = this.asProps;\n const dataKeys = props.dataKey.split('/');\n return {\n duration,\n delay: duration,\n data: Object.values(this.vennData).filter((d) => dataKeys.includes(d.setid)),\n originalData: this.asProps.data[props.dataKey],\n onMouseMove: this.bindHandlerTooltip(true, props),\n onMouseLeave: this.bindHandlerTooltip(false, props),\n transparent,\n };\n }\n\n renderElement = React.forwardRef((props, ref) => {\n return <FadeInOut aria-hidden ref={ref} tag=\"g\" visible {...props} />;\n });\n\n render() {\n const Element = this.Element;\n this.asProps.dataHintsHandler.establishDataType('values-set');\n this.vennData = this.getVennData();\n return (\n <Element\n aria-hidden\n render={this.renderElement}\n childrenPosition=\"inside\"\n vennData={this.vennData}\n />\n );\n }\n}\n\nfunction Circle({\n Element: SCircle,\n styles,\n color,\n data,\n duration,\n name,\n dataKey,\n dataHintsHandler,\n transparent,\n}) {\n dataHintsHandler.describeValueEntity(dataKey, name);\n\n return sstyled(styles)(\n <SCircle\n aria-hidden\n render=\"circle\"\n color={color}\n cx={data.x}\n cy={data.y}\n r={data.radius}\n transparent={transparent}\n use:duration={`${duration}ms`}\n />,\n );\n}\n\nfunction Intersection(props) {\n const {\n Element: SIntersection,\n styles,\n data,\n name,\n dataKey,\n dataHintsHandler,\n transparent,\n } = props;\n dataHintsHandler.describeValueEntity(dataKey, name);\n\n const renderIntersection = React.useCallback(\n React.forwardRef((props, ref) => {\n return <FadeInOut aria-hidden ref={ref} tag=\"path\" visible {...props} />;\n }),\n [props],\n );\n return sstyled(styles)(\n <SIntersection\n aria-hidden\n render={renderIntersection}\n d={intersectionAreaPath(data)}\n transparent={transparent}\n />,\n );\n}\n\nconst Venn = createElement(VennRoot, { Circle, Intersection });\n\nexport default Venn;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,iBAAf,EAAkCC,aAAlC,EAAiDC,oBAAjD,QAA6E,kBAA7E;AACA,SAASC,SAAT,EAAoBC,OAApB,QAAmC,eAAnC;AACA,OAAOC,SAAP,MAAsB,8BAAtB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,SAASC,QAAT,QAAyB,SAAzB;;;;;;;;;;;;;;;;;;;;IAIMC,Q;;;;;;;;;;;;;;;;qEAUaJ,SAAS,KAAKK,QAAQ,CAACH,aAAT,CAAuB,KAAvB,CAAL,GAAqC,E;;yEAO7D,UAACI,OAAD,EAAUC,KAAV;MAAA,OACA,iBAAgC;QAAA,IAApBC,CAAoB,SAA7BC,OAA6B;QAAA,IAARC,CAAQ,SAAjBC,OAAiB;QAC9B,IAAQC,YAAR,GAAyB,MAAKC,OAA9B,CAAQD,YAAR;QACA,MAAKE,cAAL,CAAoBC,qBAApB,GAA4C,MAAKC,6BAAL,CAAmCR,CAAnC,EAAsCE,CAAtC,CAA5C;QACA,MAAKI,cAAL,CAAoBX,QAAQ,CAACc,eAA7B,IAAgD,IAAhD;QACAL,YAAY,CAACM,IAAb,CAAkB,kBAAlB,EAAsCZ,OAAtC,EAA+CC,KAA/C,EAAsD,MAAKO,cAA3D;MACD,CAND;IAAA,C;;iFAgDcrB,KAAK,CAAC0B,UAAN,CAAiB,UAACZ,KAAD,EAAQa,GAAR,EAAgB;MAC/C,oBAAO,oBAAC,SAAD;QAAW,mBAAX;QAAuB,GAAG,EAAEA,GAA5B;QAAiC,GAAG,EAAC,GAArC;QAAyC,OAAO;MAAhD,GAAqDb,KAArD,EAAP;IACD,CAFe,C;;;;;;;WArDhB,yCAA4C;MAAA,IAA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C,KARJ,CAOEoC,WAPF;EASAS,gBAAgB,CAACe,mBAAjB,CAAqChC,OAArC,EAA8C+B,IAA9C;EAEA,IAAMI,kBAAkB,GAAG7E,KAAK,CAAC8E,WAAN,eACzB9E,KAAK,CAAC0B,UAAN,CAAiB,UAACZ,KAAD,EAAQa,GAAR,EAAgB;IAC/B,oBAAO,oBAAC,SAAD;MAAW,mBAAX;MAAuB,GAAG,EAAEA,GAA5B;MAAiC,GAAG,EAAC,MAArC;MAA4C,OAAO;IAAnD,GAAwDb,KAAxD,EAAP;EACD,CAFD,CADyB,EAIzB,CAACA,KAAD,CAJyB,CAA3B;EAMA,eAAOR,OAAO,CAACiE,MAAD,CAAd,eACE,oBAAC,aAAD;IAAA;IAAA,UAEUM,kBAFV;IAAA,KAGKzE,oBAAoB,CAAC8B,IAAD,CAHzB;IAAA,eAIegB;EAJf,GADF;AAQD;;AAED,IAAM6B,IAAI,GAAGtE,aAAa,CAACE,QAAD,EAAW;EAAE0D,MAAM,EAANA,MAAF;EAAUM,YAAY,EAAZA;AAAV,CAAX,CAA1B;AAEA,eAAeI,IAAf"}
@@ -20,12 +20,12 @@ var styles = (
20
20
  /*__reshadow_css_start__*/
21
21
  _sstyled.insert(
22
22
  /*__inner_css_start__*/
23
- ".___SPlotA11yModule_1xf67_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0}.___SPlotA11yModule_1xf67_gg_:focus{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1}"
23
+ ".___SPlotA11yModule_b1w9z_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0}.___SPlotA11yModule_b1w9z_gg_:focus{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1}"
24
24
  /*__inner_css_end__*/
25
- , "1xf67_gg_")
25
+ , "b1w9z_gg_")
26
26
  /*__reshadow_css_end__*/
27
27
  , {
28
- "__SPlotA11yModule": "___SPlotA11yModule_1xf67_gg_"
28
+ "__SPlotA11yModule": "___SPlotA11yModule_b1w9z_gg_"
29
29
  });
30
30
  import { Context as I18nContext, useI18n } from '@semcore/utils/lib/enhances/WithI18n';
31
31
  import { Box } from '@semcore/flex-box';
@@ -27,13 +27,13 @@ var styles = (
27
27
  /*__reshadow_css_start__*/
28
28
  _sstyled.insert(
29
29
  /*__inner_css_start__*/
30
- ".___SPlotA11yView_dnvn9_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0;background-color:var(--intergalactic-bg-primary-neutral,#fff);color:var(--intergalactic-text-primary,#191b23);border:3px solid var(--intergalactic-border-primary,#c4c7cf);font-size:var(--intergalactic-fs-50,10px);padding:2px;width:200px;height:200px;max-width:80%;max-height:80%;overflow:auto}.___SPlotA11yView_dnvn9_gg_:focus,.___SPlotA11yView_dnvn9_gg_.__focus-within_dnvn9_gg_{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1;z-index:var(--intergalactic-z-index-overlay,500);position:relative;display:block}.___SPlotA11yView_dnvn9_gg_:focus,.___SPlotA11yView_dnvn9_gg_:focus-within{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1;z-index:var(--intergalactic-z-index-overlay,500);position:relative;display:block}.___SPlotA11yView_dnvn9_gg_ a{cursor:pointer;text-decoration:underline;margin-bottom:var(--intergalactic-spacing-2x,8px);display:block}.___SPlotA11yView_dnvn9_gg_ table,.___SPlotA11yView_dnvn9_gg_ td,.___SPlotA11yView_dnvn9_gg_ th{border:1px solid var(--intergalactic-border-primary,#c4c7cf)}"
30
+ ".___SPlotA11yView_3pcgq_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0;background-color:var(--intergalactic-bg-primary-neutral,#fff);color:var(--intergalactic-text-primary,#191b23);border:3px solid var(--intergalactic-border-primary,#c4c7cf);font-size:var(--intergalactic-fs-50,10px);padding:2px;width:200px;height:200px;max-width:80%;max-height:80%;overflow:auto}.___SPlotA11yView_3pcgq_gg_:focus,.___SPlotA11yView_3pcgq_gg_.__focus-within_3pcgq_gg_{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1;z-index:var(--intergalactic-z-index-overlay,500);position:relative;display:block}.___SPlotA11yView_3pcgq_gg_:focus,.___SPlotA11yView_3pcgq_gg_:focus-within{-webkit-user-select:all;-moz-user-select:all;user-select:all;pointer-events:all;opacity:1;z-index:var(--intergalactic-z-index-overlay,500);position:relative;display:block}.___SPlotA11yView_3pcgq_gg_ a{cursor:pointer;text-decoration:underline;margin-bottom:var(--intergalactic-spacing-2x,8px);display:block}.___SPlotA11yView_3pcgq_gg_ table,.___SPlotA11yView_3pcgq_gg_ td,.___SPlotA11yView_3pcgq_gg_ th{border:1px solid var(--intergalactic-border-primary,#c4c7cf)}"
31
31
  /*__inner_css_end__*/
32
- , "dnvn9_gg_")
32
+ , "3pcgq_gg_")
33
33
  /*__reshadow_css_end__*/
34
34
  , {
35
- "__SPlotA11yView": "___SPlotA11yView_dnvn9_gg_",
36
- "_focus-within": "__focus-within_dnvn9_gg_"
35
+ "__SPlotA11yView": "___SPlotA11yView_3pcgq_gg_",
36
+ "_focus-within": "__focus-within_3pcgq_gg_"
37
37
  });
38
38
  import { Box } from '@semcore/flex-box';
39
39
  import { useAsyncI18nMessages } from '@semcore/utils/lib/enhances/i18nEnhance';
@@ -9,6 +9,10 @@ SArea[color] {
9
9
  fill: var(--color);
10
10
  }
11
11
 
12
+ SArea[transparent] {
13
+ opacity: 0.3;
14
+ }
15
+
12
16
  SAreaLine {
13
17
  stroke: var(--intergalactic-chart-palette-order-blue, #2bb3ff);
14
18
  stroke-width: 3;
@@ -19,6 +23,10 @@ SAreaLine[color] {
19
23
  stroke: var(--color);
20
24
  }
21
25
 
26
+ SAreaLine[transparent] {
27
+ opacity: 0.3;
28
+ }
29
+
22
30
  SArea,
23
31
  SAreaLine {
24
32
  transition-property: d;
@@ -15,6 +15,10 @@ SBar[hide] {
15
15
  display: none;
16
16
  }
17
17
 
18
+ SBar[transparent] {
19
+ opacity: 0.3;
20
+ }
21
+
18
22
  SBackground {
19
23
  fill: var(--intergalactic-chart-palette-order-other-data, #c4c7cf);
20
24
  }
@@ -9,6 +9,10 @@ SPie[color] {
9
9
  fill: var(--color);
10
10
  }
11
11
 
12
+ SPie[transparent] {
13
+ opacity: 0.3;
14
+ }
15
+
12
16
  SEmptyData {
13
17
  fill: var(--intergalactic-chart-palette-order-null, #e0e1e9);
14
18
  }
@@ -26,3 +26,7 @@ SDot[active] {
26
26
  SDot[color] {
27
27
  fill: var(--color);
28
28
  }
29
+
30
+ SDot[transparent] {
31
+ opacity: 0.3;
32
+ }
@@ -17,6 +17,10 @@ SLine[hide] {
17
17
  display: none;
18
18
  }
19
19
 
20
+ SLine[transparent] {
21
+ opacity: 0.3;
22
+ }
23
+
20
24
  SNull {
21
25
  fill: transparent;
22
26
  stroke: var(-intergalactic-border-primary);
@@ -18,6 +18,10 @@ SCircle[color] {
18
18
  fill: var(--color);
19
19
  }
20
20
 
21
+ SCircle[transparent] {
22
+ opacity: 0.3;
23
+ }
24
+
21
25
  SIntersection {
22
26
  stroke: var(--intergalactic-chart-grid-border, #ffffff);
23
27
  stroke-width: 2px;
@@ -27,3 +31,7 @@ SIntersection {
27
31
  fill-opacity: 0.1;
28
32
  }
29
33
  }
34
+
35
+ SIntersection[transparent] {
36
+ opacity: 0.3;
37
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"Area.d.js","names":[],"sources":["../../../src/types/Area.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\nimport { CurveFactory } from 'd3-shape';\n\nexport interface IAreaProps extends IContext {\n /** Field from data for XAxis */\n x?: string;\n /** Field from data for YAxis*/\n y?: string;\n /** Line color\n * @default '#50aef4'*/\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}\n\nexport interface IAreaDotsProps extends IContext {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n}\n\nexport interface IAreaDotsContext {\n /** Value element of data */\n value?: any;\n /** Index element of data */\n index?: number;\n}\n\nexport interface IAreaNullProps extends IContext {\n /** Hide property */\n hide?: boolean;\n}\n\ndeclare const Area: (<T>(props: MapProps<IAreaProps & T>) => ReturnEl) & {\n Dots: <T>(props: MapProps<IAreaDotsProps & T, IAreaDotsContext>) => ReturnEl;\n Null: <T>(props: MapProps<IAreaNullProps & T>) => ReturnEl;\n Line: <T>(props: MapProps<IContext & T>) => ReturnEl;\n};\n\nexport default Area;\n"],"mappings":""}
1
+ {"version":3,"file":"Area.d.js","names":[],"sources":["../../../src/types/Area.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\nimport { CurveFactory } from 'd3-shape';\n\nexport interface IAreaProps extends IContext {\n /** Field from data for XAxis */\n x?: string;\n /** Field from data for YAxis*/\n y?: string;\n /** Line color\n * @default '#50aef4'*/\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 /** Element opacity property */\n transparent?: boolean;\n}\n\nexport interface IAreaDotsProps extends IContext {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n /** Element opacity property */\n transparent?: boolean;\n}\n\nexport interface IAreaDotsContext {\n /** Value element of data */\n value?: any;\n /** Index element of data */\n index?: number;\n}\n\nexport interface IAreaNullProps extends IContext {\n /** Hide property */\n hide?: boolean;\n}\n\ndeclare const Area: (<T>(props: MapProps<IAreaProps & T>) => ReturnEl) & {\n Dots: <T>(props: MapProps<IAreaDotsProps & T, IAreaDotsContext>) => ReturnEl;\n Null: <T>(props: MapProps<IAreaNullProps & T>) => ReturnEl;\n Line: <T>(props: MapProps<IContext & T>) => ReturnEl;\n};\n\nexport default Area;\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Bar.d.js","names":[],"sources":["../../../src/types/Bar.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\n\nexport interface IBarProps extends IContext {\n /** Field from data for XAxis */\n x?: string;\n /** Field from data for YAxis */\n y?: string;\n /** Line color\n * @default '#50aef4'*/\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of curvature\n * @default 2\n */\n r?: number | number[];\n /** Minimal height\n * @default 4\n */\n hMin?: number;\n /**\n * Bar click handler\n */\n onClick?: (data: { [key: string]: string | number }, event: Event) => void;\n}\n\nexport interface IBarContext {\n /** Value element of data */\n value: any;\n /** Index element of data */\n index: number;\n}\n\nexport interface IBackgroundProps extends IContext {\n /** Coordinate x */\n x?: number | string;\n /** Coordinate y */\n y?: number | string;\n /** Value element of data */\n value?: any;\n /** Width rect */\n width?: number | string;\n /** Height rect */\n height?: number | string;\n}\n\ndeclare const Bar: (<T>(props: MapProps<IBarProps & T, IBarContext>) => ReturnEl) & {\n Background: <T>(props: MapProps<IBackgroundProps & T>) => ReturnEl;\n};\n\nexport default Bar;\n"],"mappings":""}
1
+ {"version":3,"file":"Bar.d.js","names":[],"sources":["../../../src/types/Bar.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\n\nexport interface IBarProps extends IContext {\n /** Field from data for XAxis */\n x?: string;\n /** Field from data for YAxis */\n y?: string;\n /** Line color\n * @default '#50aef4'*/\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of curvature\n * @default 2\n */\n r?: number | number[];\n /** Minimal height\n * @default 4\n */\n hMin?: number;\n /**\n * Bar click handler\n */\n onClick?: (data: { [key: string]: string | number }, event: Event) => void;\n /** Element opacity property */\n transparent?: boolean;\n}\n\nexport interface IBarContext {\n /** Value element of data */\n value: any;\n /** Index element of data */\n index: number;\n}\n\nexport interface IBackgroundProps extends IContext {\n /** Coordinate x */\n x?: number | string;\n /** Coordinate y */\n y?: number | string;\n /** Value element of data */\n value?: any;\n /** Width rect */\n width?: number | string;\n /** Height rect */\n height?: number | string;\n}\n\ndeclare const Bar: (<T>(props: MapProps<IBarProps & T, IBarContext>) => ReturnEl) & {\n Background: <T>(props: MapProps<IBackgroundProps & T>) => ReturnEl;\n};\n\nexport default Bar;\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Donut.d.js","names":[],"sources":["../../../src/types/Donut.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\n\nexport interface IDonutProps extends IContext {\n /** Inner radius\n * @default 0\n * */\n innerRadius?: number;\n /** Outer radius\n * @default calculated by the formula from width, height\n * */\n outerRadius?: number;\n /** Semi donut */\n halfsize?: boolean;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n}\n\nexport interface IPieProps extends IContext {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /** Color pie\n @default #50aef4\n **/\n color?: string;\n /**\n * Active sector\n * */\n active?: boolean;\n}\n\nexport interface IEmptyDataProps extends IContext {}\n\nexport interface ILabelProps extends IContext {}\n\ndeclare const Donut: (<T>(props: MapProps<IDonutProps & T>) => ReturnEl) & {\n Pie: <T>(props: MapProps<IPieProps & T>) => ReturnEl;\n EmptyData: <T>(props: MapProps<IEmptyDataProps & T>) => ReturnEl;\n Label: <T>(props: MapProps<ILabelProps & T>) => ReturnEl;\n};\n\nexport default Donut;\n"],"mappings":""}
1
+ {"version":3,"file":"Donut.d.js","names":[],"sources":["../../../src/types/Donut.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\n\nexport interface IDonutProps extends IContext {\n /** Inner radius\n * @default 0\n * */\n innerRadius?: number;\n /** Outer radius\n * @default calculated by the formula from width, height\n * */\n outerRadius?: number;\n /** Semi donut */\n halfsize?: boolean;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n}\n\nexport interface IPieProps extends IContext {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /** Color pie\n @default #50aef4\n **/\n color?: string;\n /**\n * Active sector\n * */\n active?: boolean;\n /** Element opacity property */\n transparent?: boolean;\n}\n\nexport interface IEmptyDataProps extends IContext {}\n\nexport interface ILabelProps extends IContext {}\n\ndeclare const Donut: (<T>(props: MapProps<IDonutProps & T>) => ReturnEl) & {\n Pie: <T>(props: MapProps<IPieProps & T>) => ReturnEl;\n EmptyData: <T>(props: MapProps<IEmptyDataProps & T>) => ReturnEl;\n Label: <T>(props: MapProps<ILabelProps & T>) => ReturnEl;\n};\n\nexport default Donut;\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"HorizontalBar.d.js","names":[],"sources":["../../../src/types/HorizontalBar.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\nimport { IBarContext, IBackgroundProps } from './Bar';\n\nexport interface IHorizontalBarProps extends IContext {\n /** Field from data for XAxis */\n x?: string;\n /** Field from data for YAxis */\n y?: string;\n /** Line color\n * @default '#50aef4'*/\n color?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of curvature\n * @default 2\n */\n r?: number | number[];\n}\n\ndeclare const HorizontalBar: (<T>(\n props: MapProps<IHorizontalBarProps & T, IBarContext>,\n) => ReturnEl) & {\n Background: <T>(props: MapProps<IBackgroundProps & T>) => ReturnEl;\n};\n\nexport default HorizontalBar;\n"],"mappings":""}
1
+ {"version":3,"file":"HorizontalBar.d.js","names":[],"sources":["../../../src/types/HorizontalBar.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\nimport { IBarContext, IBackgroundProps } from './Bar';\n\nexport interface IHorizontalBarProps extends IContext {\n /** Field from data for XAxis */\n x?: string;\n /** Field from data for YAxis */\n y?: string;\n /** Line color\n * @default '#50aef4'*/\n color?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Radius of curvature\n * @default 2\n */\n r?: number | number[];\n /** Element opacity property */\n transparent?: boolean;\n}\n\ndeclare const HorizontalBar: (<T>(\n props: MapProps<IHorizontalBarProps & T, IBarContext>,\n) => ReturnEl) & {\n Background: <T>(props: MapProps<IBackgroundProps & T>) => ReturnEl;\n};\n\nexport default HorizontalBar;\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\nimport { CurveFactory } from 'd3-shape';\nimport { IFadeInOutProps } from '@semcore/animation';\n\nexport interface ILineProps extends IContext {\n /** Field from data for XAxis */\n x?: string;\n /** Field from data for YAxis */\n y?: string;\n /** Line color\n * @default '#50aef4'*/\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}\n\nexport interface ILineDotsProps extends IContext, IFadeInOutProps {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n}\n\nexport interface ILineDotsContext {\n /** Value element of data */\n value?: any;\n /** Index element of data */\n index?: number;\n}\n\nexport interface ILineNullProps extends IContext {\n /** Hide property */\n hide?: boolean;\n}\n\ndeclare const Line: (<T>(props: MapProps<ILineProps & T>) => ReturnEl) & {\n Dots: <T>(props: MapProps<ILineDotsProps & T, ILineDotsContext>) => ReturnEl;\n Null: <T>(props: MapProps<ILineNullProps & T>) => ReturnEl;\n};\n\nexport default Line;\n"],"mappings":""}
1
+ {"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\nimport { CurveFactory } from 'd3-shape';\nimport { IFadeInOutProps } from '@semcore/animation';\n\nexport interface ILineProps extends IContext {\n /** Field from data for XAxis */\n x?: string;\n /** Field from data for YAxis */\n y?: string;\n /** Line color\n * @default '#50aef4'*/\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 /** Element opacity property */\n transparent?: boolean;\n}\n\nexport interface ILineDotsProps extends IContext, IFadeInOutProps {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n}\n\nexport interface ILineDotsContext {\n /** Value element of data */\n value?: any;\n /** Index element of data */\n index?: number;\n}\n\nexport interface ILineNullProps extends IContext {\n /** Hide property */\n hide?: boolean;\n}\n\ndeclare const Line: (<T>(props: MapProps<ILineProps & T>) => ReturnEl) & {\n Dots: <T>(props: MapProps<ILineDotsProps & T, ILineDotsContext>) => ReturnEl;\n Null: <T>(props: MapProps<ILineNullProps & T>) => ReturnEl;\n};\n\nexport default Line;\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Venn.d.js","names":[],"sources":["../../../src/types/Venn.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\nimport { IFadeInOutProps } from '@semcore/animation';\n\nexport interface IVennProps extends IContext, IFadeInOutProps {\n /**\n * Rotate sets in the chart\n * @default Math.PI / 2\n */\n orientation?: number;\n /**\n * The function for sorting sets inside the chart\n * @default (circle1, circle2) => circle2.radius - circle1.radius\n */\n orientationOrder?: (c1: number, c2: number) => number;\n}\n\nexport interface ICircleProps extends IContext {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /** Color circle\n @default #3AB011\n **/\n color?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n}\n\nexport interface IIntersectionProps extends IContext, IFadeInOutProps {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n}\n\ndeclare const Venn: (<T>(props: MapProps<IVennProps & T>) => ReturnEl) & {\n Circle: <T>(props: MapProps<ICircleProps & T>) => ReturnEl;\n Intersection: <T>(props: MapProps<IIntersectionProps & T>) => ReturnEl;\n};\n\nexport default Venn;\n"],"mappings":""}
1
+ {"version":3,"file":"Venn.d.js","names":[],"sources":["../../../src/types/Venn.d.ts"],"sourcesContent":["import { ReturnEl } from '@semcore/core';\nimport { MapProps } from './Plot';\nimport IContext from './context';\nimport { IFadeInOutProps } from '@semcore/animation';\n\nexport interface IVennProps extends IContext, IFadeInOutProps {\n /**\n * Rotate sets in the chart\n * @default Math.PI / 2\n */\n orientation?: number;\n /**\n * The function for sorting sets inside the chart\n * @default (circle1, circle2) => circle2.radius - circle1.radius\n */\n orientationOrder?: (c1: number, c2: number) => number;\n}\n\nexport interface ICircleProps extends IContext {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /** Color circle\n @default #3AB011\n **/\n color?: string;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Element opacity property */\n transparent?: boolean;\n}\n\nexport interface IIntersectionProps extends IContext, IFadeInOutProps {\n /**\n * Name of the field in the data\n * */\n dataKey: string;\n /** Element opacity property */\n transparent?: boolean;\n}\n\ndeclare const Venn: (<T>(props: MapProps<IVennProps & T>) => ReturnEl) & {\n Circle: <T>(props: MapProps<ICircleProps & T>) => ReturnEl;\n Intersection: <T>(props: MapProps<IIntersectionProps & T>) => ReturnEl;\n};\n\nexport default Venn;\n"],"mappings":""}
@@ -19,6 +19,8 @@ export interface IAreaProps extends IContext {
19
19
  * @default 500
20
20
  */
21
21
  duration?: number;
22
+ /** Element opacity property */
23
+ transparent?: boolean;
22
24
  }
23
25
 
24
26
  export interface IAreaDotsProps extends IContext {
@@ -26,6 +28,8 @@ export interface IAreaDotsProps extends IContext {
26
28
  display?: boolean;
27
29
  /** Hide property */
28
30
  hide?: boolean;
31
+ /** Element opacity property */
32
+ transparent?: boolean;
29
33
  }
30
34
 
31
35
  export interface IAreaDotsContext {
@@ -28,6 +28,8 @@ export interface IBarProps extends IContext {
28
28
  * Bar click handler
29
29
  */
30
30
  onClick?: (data: { [key: string]: string | number }, event: Event) => void;
31
+ /** Element opacity property */
32
+ transparent?: boolean;
31
33
  }
32
34
 
33
35
  export interface IBarContext {
@@ -32,6 +32,8 @@ export interface IPieProps extends IContext {
32
32
  * Active sector
33
33
  * */
34
34
  active?: boolean;
35
+ /** Element opacity property */
36
+ transparent?: boolean;
35
37
  }
36
38
 
37
39
  export interface IEmptyDataProps extends IContext {}
@@ -19,6 +19,8 @@ export interface IHorizontalBarProps extends IContext {
19
19
  * @default 2
20
20
  */
21
21
  r?: number | number[];
22
+ /** Element opacity property */
23
+ transparent?: boolean;
22
24
  }
23
25
 
24
26
  declare const HorizontalBar: (<T>(
@@ -20,6 +20,8 @@ export interface ILineProps extends IContext {
20
20
  * @default 500
21
21
  */
22
22
  duration?: number;
23
+ /** Element opacity property */
24
+ transparent?: boolean;
23
25
  }
24
26
 
25
27
  export interface ILineDotsProps extends IContext, IFadeInOutProps {
@@ -29,6 +29,8 @@ export interface ICircleProps extends IContext {
29
29
  * @default 500
30
30
  */
31
31
  duration?: number;
32
+ /** Element opacity property */
33
+ transparent?: boolean;
32
34
  }
33
35
 
34
36
  export interface IIntersectionProps extends IContext, IFadeInOutProps {
@@ -36,6 +38,8 @@ export interface IIntersectionProps extends IContext, IFadeInOutProps {
36
38
  * Name of the field in the data
37
39
  * */
38
40
  dataKey: string;
41
+ /** Element opacity property */
42
+ transparent?: boolean;
39
43
  }
40
44
 
41
45
  declare const Venn: (<T>(props: MapProps<IVennProps & T>) => ReturnEl) & {
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": "2.7.2",
4
+ "version": "2.8.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",