@easyv/charts 1.3.18 → 1.3.19

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.
@@ -78,6 +78,10 @@ var _default = function _default(Component) {
78
78
  var animationOn = on && interval && dataLength;
79
79
  var carousel = (0, _react.useCallback)(function () {
80
80
  if (animationOn) {
81
+ setState({
82
+ currentIndex: 0,
83
+ trigger: 'carousel'
84
+ });
81
85
  timer.current = (0, _d3v.interval)(function () {
82
86
  setState(function (_ref2) {
83
87
  var currentIndex = _ref2.currentIndex;
@@ -110,7 +110,7 @@ var _default = function _default(_ref) {
110
110
  var range = direction === 'horizontal' ? [start, end] : direction === 'vertical' ? [end, start] : [0, 0];
111
111
  var newDomain = domain;
112
112
 
113
- if (mode != "count" && type !== 'ordinal' && !isNaN(domain[1])) {
113
+ if (mode == "count" && type !== 'ordinal' && !isNaN(domain[1])) {
114
114
  newDomain = getNewDomain(domain, mode, step);
115
115
  }
116
116
 
@@ -128,8 +128,8 @@ var _default = function _default(_ref) {
128
128
  if (auto === false) {
129
129
  switch (mode) {
130
130
  case 'count':
131
- _ticks = (0, _utils2.getYTicks)(domain[1], domain[0], // _ticks[_ticks.length - 1],
132
- // _ticks[0],
131
+ _ticks = (0, _utils2.getYTicks)(domain[1], domain[0], // hasNullDomain?_ticks[_ticks.length - 1]:domain[1],
132
+ // hasNullDomain?_ticks[0]:domain[0],
133
133
  +tickCount);
134
134
  break;
135
135
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyv/charts",
3
- "version": "1.3.18",
3
+ "version": "1.3.19",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -55,6 +55,10 @@ export default (Component: ComponentType<any>) =>
55
55
 
56
56
  const carousel = useCallback(() => {
57
57
  if (animationOn) {
58
+ setState({
59
+ currentIndex: 0,
60
+ trigger: 'carousel'
61
+ })
58
62
  timer.current = d3Interval(() => {
59
63
  setState(({ currentIndex }) => {
60
64
  const tmp = (currentIndex == null ? 0 : +currentIndex) + 1;
@@ -97,7 +97,7 @@ export default ({ axes, context: { width, height } }) => {
97
97
  ? [end, start]
98
98
  : [0, 0];
99
99
  let newDomain = domain;
100
- if(mode != "count" && type !== 'ordinal' && !isNaN(domain[1])){
100
+ if(mode == "count" && type !== 'ordinal' && !isNaN(domain[1])){
101
101
  newDomain = getNewDomain(domain, mode, step);
102
102
  }
103
103
  const scaler = scales[type]().domain(newDomain).range(range);
@@ -121,8 +121,8 @@ export default ({ axes, context: { width, height } }) => {
121
121
  _ticks = getYTicks(
122
122
  domain[1],
123
123
  domain[0],
124
- // _ticks[_ticks.length - 1],
125
- // _ticks[0],
124
+ // hasNullDomain?_ticks[_ticks.length - 1]:domain[1],
125
+ // hasNullDomain?_ticks[0]:domain[0],
126
126
  +tickCount
127
127
  );
128
128
  break;