@easyv/charts 1.3.17 → 1.3.18
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.
package/lib/hooks/useAxes.js
CHANGED
|
@@ -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 (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,7 +128,9 @@ var _default = function _default(_ref) {
|
|
|
128
128
|
if (auto === false) {
|
|
129
129
|
switch (mode) {
|
|
130
130
|
case 'count':
|
|
131
|
-
_ticks = (0, _utils2.getYTicks)(_ticks[_ticks.length - 1],
|
|
131
|
+
_ticks = (0, _utils2.getYTicks)(domain[1], domain[0], // _ticks[_ticks.length - 1],
|
|
132
|
+
// _ticks[0],
|
|
133
|
+
+tickCount);
|
|
132
134
|
break;
|
|
133
135
|
|
|
134
136
|
case 'step':
|
package/package.json
CHANGED
|
@@ -67,7 +67,6 @@ const Chart = memo(
|
|
|
67
67
|
} = useContext(chartContext);
|
|
68
68
|
|
|
69
69
|
const svg = createRef();
|
|
70
|
-
|
|
71
70
|
const axes = useAxes({ axes: axesConfig, context });
|
|
72
71
|
const axisX = useCarouselAxisX(axes.get('x'), animation);
|
|
73
72
|
|
|
@@ -138,7 +137,6 @@ const Chart = memo(
|
|
|
138
137
|
bandLength={bandLength}
|
|
139
138
|
/>
|
|
140
139
|
)}
|
|
141
|
-
|
|
142
140
|
{[...axes.values()].reverse().map((item, index) => {
|
|
143
141
|
const config = item.axisType == 'x' ? axisX : item;
|
|
144
142
|
return (
|
package/src/hooks/useAxes.js
CHANGED
|
@@ -97,20 +97,18 @@ export default ({ axes, context: { width, height } }) => {
|
|
|
97
97
|
? [end, start]
|
|
98
98
|
: [0, 0];
|
|
99
99
|
let newDomain = domain;
|
|
100
|
-
if(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);
|
|
104
104
|
scaler.type = type;
|
|
105
105
|
|
|
106
106
|
if (type !== 'ordinal') scaler.nice().clamp(true);
|
|
107
|
-
|
|
108
107
|
const allTicks = ticks
|
|
109
108
|
? ticks
|
|
110
109
|
: scaler.ticks
|
|
111
110
|
? scaler.ticks(tickCount)
|
|
112
111
|
: scaler.domain();
|
|
113
|
-
|
|
114
112
|
let _ticks = allTicks;
|
|
115
113
|
if (type === 'ordinal') {
|
|
116
114
|
if (carousel === false) {
|
|
@@ -121,8 +119,10 @@ export default ({ axes, context: { width, height } }) => {
|
|
|
121
119
|
switch (mode) {
|
|
122
120
|
case 'count':
|
|
123
121
|
_ticks = getYTicks(
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
domain[1],
|
|
123
|
+
domain[0],
|
|
124
|
+
// _ticks[_ticks.length - 1],
|
|
125
|
+
// _ticks[0],
|
|
126
126
|
+tickCount
|
|
127
127
|
);
|
|
128
128
|
break;
|
|
@@ -155,7 +155,6 @@ export default ({ axes, context: { width, height } }) => {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
|
|
159
158
|
tmp.set(axisType, {
|
|
160
159
|
...item,
|
|
161
160
|
scaler,
|