@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.
Files changed (46) hide show
  1. package/CHANGELOG.md +41 -74
  2. package/dist/g2.full.min.js +1 -1
  3. package/dist/g2.lite.min.js +1 -1
  4. package/dist/g2.min.js +1 -1
  5. package/esm/api/utils.d.ts +6 -2
  6. package/esm/api/utils.js +18 -6
  7. package/esm/api/utils.js.map +1 -1
  8. package/esm/interaction/scrollbarFilter.js +8 -10
  9. package/esm/interaction/scrollbarFilter.js.map +1 -1
  10. package/esm/interaction/sliderFilter.d.ts +1 -1
  11. package/esm/interaction/sliderFilter.js +14 -17
  12. package/esm/interaction/sliderFilter.js.map +1 -1
  13. package/esm/interaction/utils.js +1 -5
  14. package/esm/interaction/utils.js.map +1 -1
  15. package/esm/runtime/component.js +4 -2
  16. package/esm/runtime/component.js.map +1 -1
  17. package/esm/runtime/layout.js +7 -1
  18. package/esm/runtime/layout.js.map +1 -1
  19. package/esm/theme/create.d.ts +0 -4
  20. package/esm/theme/create.js +0 -4
  21. package/esm/theme/create.js.map +1 -1
  22. package/lib/api/utils.d.ts +6 -2
  23. package/lib/api/utils.js +19 -7
  24. package/lib/api/utils.js.map +1 -1
  25. package/lib/interaction/scrollbarFilter.js +8 -10
  26. package/lib/interaction/scrollbarFilter.js.map +1 -1
  27. package/lib/interaction/sliderFilter.d.ts +1 -1
  28. package/lib/interaction/sliderFilter.js +14 -17
  29. package/lib/interaction/sliderFilter.js.map +1 -1
  30. package/lib/interaction/utils.js +1 -5
  31. package/lib/interaction/utils.js.map +1 -1
  32. package/lib/runtime/component.js +4 -2
  33. package/lib/runtime/component.js.map +1 -1
  34. package/lib/runtime/layout.js +7 -1
  35. package/lib/runtime/layout.js.map +1 -1
  36. package/lib/theme/create.d.ts +0 -4
  37. package/lib/theme/create.js +0 -4
  38. package/lib/theme/create.js.map +1 -1
  39. package/package.json +4 -2
  40. package/src/api/utils.ts +28 -6
  41. package/src/interaction/scrollbarFilter.ts +11 -10
  42. package/src/interaction/sliderFilter.ts +23 -17
  43. package/src/interaction/utils.ts +1 -5
  44. package/src/runtime/component.ts +10 -2
  45. package/src/runtime/layout.ts +6 -1
  46. package/src/theme/create.ts +0 -4
@@ -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) {
@@ -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',