@antv/g2 5.1.6-beta.0 → 5.1.6
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/CHANGELOG.md +41 -74
- package/dist/g2.full.min.js +1 -1
- package/dist/g2.lite.min.js +1 -1
- package/dist/g2.min.js +1 -1
- package/esm/api/utils.d.ts +6 -2
- package/esm/api/utils.js +18 -6
- package/esm/api/utils.js.map +1 -1
- package/esm/interaction/scrollbarFilter.js +8 -10
- package/esm/interaction/scrollbarFilter.js.map +1 -1
- package/esm/interaction/sliderFilter.d.ts +1 -1
- package/esm/interaction/sliderFilter.js +14 -17
- package/esm/interaction/sliderFilter.js.map +1 -1
- package/esm/interaction/utils.js +1 -5
- package/esm/interaction/utils.js.map +1 -1
- package/esm/runtime/component.js +4 -2
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/layout.js +7 -1
- package/esm/runtime/layout.js.map +1 -1
- package/esm/theme/create.d.ts +0 -4
- package/esm/theme/create.js +0 -4
- package/esm/theme/create.js.map +1 -1
- package/lib/api/utils.d.ts +6 -2
- package/lib/api/utils.js +19 -7
- package/lib/api/utils.js.map +1 -1
- package/lib/interaction/scrollbarFilter.js +8 -10
- package/lib/interaction/scrollbarFilter.js.map +1 -1
- package/lib/interaction/sliderFilter.d.ts +1 -1
- package/lib/interaction/sliderFilter.js +14 -17
- package/lib/interaction/sliderFilter.js.map +1 -1
- package/lib/interaction/utils.js +1 -5
- package/lib/interaction/utils.js.map +1 -1
- package/lib/runtime/component.js +4 -2
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/layout.js +7 -1
- package/lib/runtime/layout.js.map +1 -1
- package/lib/theme/create.d.ts +0 -4
- package/lib/theme/create.js +0 -4
- package/lib/theme/create.js.map +1 -1
- package/package.json +4 -2
- package/src/api/utils.ts +28 -6
- package/src/interaction/scrollbarFilter.ts +11 -10
- package/src/interaction/sliderFilter.ts +23 -17
- package/src/interaction/utils.ts +1 -5
- package/src/runtime/component.ts +10 -2
- package/src/runtime/layout.ts +6 -1
- package/src/theme/create.ts +0 -4
package/src/runtime/layout.ts
CHANGED
|
@@ -311,7 +311,6 @@ function computePadding(
|
|
|
311
311
|
|
|
312
312
|
for (const position of positions) {
|
|
313
313
|
const key = `padding${capitalizeFirst(camelCase(position))}`;
|
|
314
|
-
const insetKey = `inset${capitalizeFirst(camelCase(position))}`;
|
|
315
314
|
const components = positionComponents.get(position) || [];
|
|
316
315
|
const value = layout[key];
|
|
317
316
|
const defaultSizeOf = (d) => {
|
|
@@ -342,6 +341,11 @@ function computePadding(
|
|
|
342
341
|
}
|
|
343
342
|
};
|
|
344
343
|
|
|
344
|
+
const maybeHide = (d) => {
|
|
345
|
+
if (!d.type.startsWith('axis')) return;
|
|
346
|
+
if (d.labelAutoHide === undefined) d.labelAutoHide = true;
|
|
347
|
+
};
|
|
348
|
+
|
|
345
349
|
const isHorizontal = position === 'bottom' || position === 'top';
|
|
346
350
|
|
|
347
351
|
// !!!Note
|
|
@@ -356,6 +360,7 @@ function computePadding(
|
|
|
356
360
|
// Specified padding.
|
|
357
361
|
if (typeof value === 'number') {
|
|
358
362
|
components.forEach(defaultSizeOf);
|
|
363
|
+
components.forEach(maybeHide);
|
|
359
364
|
} else {
|
|
360
365
|
// Compute padding dynamically.
|
|
361
366
|
if (components.length === 0) {
|
package/src/theme/create.ts
CHANGED
|
@@ -236,7 +236,6 @@ export function create({
|
|
|
236
236
|
labelDirection: 'negative',
|
|
237
237
|
tickDirection: 'negative',
|
|
238
238
|
titlePosition: 'top',
|
|
239
|
-
labelAutoRotate: false,
|
|
240
239
|
titleSpacing: 12,
|
|
241
240
|
labelSpacing: 4,
|
|
242
241
|
titleTextBaseline: 'middle',
|
|
@@ -244,7 +243,6 @@ export function create({
|
|
|
244
243
|
axisBottom: {
|
|
245
244
|
gridDirection: 'negative',
|
|
246
245
|
labelDirection: 'positive',
|
|
247
|
-
labelAutoRotate: false,
|
|
248
246
|
tickDirection: 'positive',
|
|
249
247
|
titlePosition: 'bottom',
|
|
250
248
|
titleSpacing: 12,
|
|
@@ -253,7 +251,6 @@ export function create({
|
|
|
253
251
|
},
|
|
254
252
|
axisLeft: {
|
|
255
253
|
gridDirection: 'positive',
|
|
256
|
-
labelAutoRotate: false,
|
|
257
254
|
labelDirection: 'negative',
|
|
258
255
|
labelSpacing: 4,
|
|
259
256
|
tickDirection: 'negative',
|
|
@@ -269,7 +266,6 @@ export function create({
|
|
|
269
266
|
labelSpacing: 4,
|
|
270
267
|
tickDirection: 'positive',
|
|
271
268
|
titlePosition: 'right',
|
|
272
|
-
labelAutoRotate: false,
|
|
273
269
|
titleSpacing: 12,
|
|
274
270
|
titleTextBaseline: 'top',
|
|
275
271
|
titleDirection: 'vertical',
|