From 4763803a318df0d311579187ced13d87fd25ed7f Mon Sep 17 00:00:00 2001 From: MiniPear Date: Thu, 19 Oct 2023 11:12:06 +0800 Subject: [PATCH 1/2] fix(axis): auto hide when necessary --- .../static/alphabetIntervalRotatePadding.png | Bin 0 -> 13366 bytes .../static/alphabetIntervalSizedPadding.png | Bin 0 -> 13047 bytes .../alphabet-interval-rotate-padding.ts | 26 +++++++++++++++++ .../static/alphabet-interval-sized-padding.ts | 27 ++++++++++++++++++ __tests__/plots/static/index.ts | 2 ++ src/runtime/component.ts | 12 ++++++-- src/runtime/layout.ts | 7 ++++- 7 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 __tests__/integration/snapshots/static/alphabetIntervalRotatePadding.png create mode 100644 __tests__/integration/snapshots/static/alphabetIntervalSizedPadding.png create mode 100644 __tests__/plots/static/alphabet-interval-rotate-padding.ts create mode 100644 __tests__/plots/static/alphabet-interval-sized-padding.ts diff --git a/__tests__/integration/snapshots/static/alphabetIntervalRotatePadding.png b/__tests__/integration/snapshots/static/alphabetIntervalRotatePadding.png new file mode 100644 index 0000000000000000000000000000000000000000..03f395e341499d522012a4a78ee8c9b1b2c5a4cb GIT binary patch literal 13366 zcmdUWXH-*bw{DOvD2nK2BTYa>0jbgz1Qazu0OF*nz5xkh2qhs@ z6Cg+t6{MR$=tV??M2boP2?ox~{=Rd@yxbdfgFXHUAka@ z^XcM*-xK^u?9}?yt&oMM(NsUQvDJZwnwl0qWgg{U_bMOTb@akBi20KvX2edP4!mM^ zQ9+n9<-7<x$ub&xXy{iupSLDy zo$;x?$^?dq?8WX+sJR@Vr^awh?7pdj%PfFVkESY10^;twG`)Q4Tx{5s@d$LkX6zr-`zE(iTmP# zA#h{xn%zVz?4AMp`tNo4n%^&6TMBWRW@YjS=Y3B?al{AJ)O$r0so{P*BggP@4Q-ubuXbn3`w7}I`baM=m$ z+yt_ZuVqFMI&v2kWl!jnFo<=6b(0Q+l%^6o9kYmJMCS?fSE?`QX;NKx+#@o-@A*8_p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Ex&Gjc=&LEXKMCKmzob}1rGj1_k#fMwx8(-0UK_80^Ib5$32%KLzNLLIP zWr%;GSCA;xS9y^7FrgrTcwb;BbSoCz2aRr@$hvF3INO!01Or1*m>wsx{ch@eL=(Y~ zHHtJ=a*O?tS*0+}tAFh!r@OlV5Yi8%?(lcPS8TGwD)P&1YBf93 z5-mpjzD?`l`iU`DOdO(}Jicsmiqw=2?Tn@!{;jp~+oPi{f(g+d+&) zdUkr$=Rm9AZ+c(hztHUt&1XLmn7*R68xpkhV#4vS`LXf?U)h|Qtxs-5ec3K6-j+z9 zFSh6aEf^TuEm8tPu?s5(a_w4fN&quHx`PEc=^&D+n}1qw3d!Dnd6>m{!Z3=q;jFnt zPNRHadI&%G%cK+B2{20bb_Kfqv6^ADDS~SgsCiv`u*JQ7|53;#z>&Yii?Ey;+3{TD zGY|bx_Ee180LmT6QBVM$wwe4%TkRhE4`1={*Cx6{Q^D&9@oQMn)du3<{jdC#|*8ev7cwjfdB6v|FV&qKb;e?96t~-eAFy-*esPznTM;hQ#5yT4W zM7IybQ^_eC0yzXyHVSaK{CEi#&;z#PdRWPm2OM&5tOnU~m{P=7rF15>8_X*wlz{y{ zx(m=u<+5t7NwYWVS?9b*vlLQ8o;&F$43l?VG}`cd=53twE+gOli^ij9-t)ixBhdBs zFmzp-4l$~M{^QBpG`PL0;)dOsCHTKzAnDE&;;mssya&gJ-Mjx+Cz`k7zhCH2lvn+j R32p{4yL{zRxv}T({|5VQ>wy3O literal 0 HcmV?d00001 diff --git a/__tests__/integration/snapshots/static/alphabetIntervalSizedPadding.png b/__tests__/integration/snapshots/static/alphabetIntervalSizedPadding.png new file mode 100644 index 0000000000000000000000000000000000000000..3b6e3984ef40e14628cb27aceda4589599f055e9 GIT binary patch literal 13047 zcmdUWXH=70w{8Fx6@6Ce z`t4_{G-R^J_?_vmi&IIMTUWQ|@=t~%y}D^9>Zdji7ffvcV4`rRQzk5>~QhTab z+21hZ)XpQ6U@e>BASYj%r$fyd*$|&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/static/alphabet-interval-rotate-padding.ts b/__tests__/plots/static/alphabet-interval-rotate-padding.ts new file mode 100644 index 0000000000..0da6551c21 --- /dev/null +++ b/__tests__/plots/static/alphabet-interval-rotate-padding.ts @@ -0,0 +1,26 @@ +import { G2Spec } from '../../../src'; + +export function alphabetIntervalRotatePadding(): G2Spec { + return { + type: 'interval', + transform: [{ type: 'sortX', by: 'y', reverse: true }], + data: { + type: 'fetch', + value: 'data/alphabet.csv', + }, + encode: { + x: 'letter', + y: 'frequency', + color: 'steelblue', + }, + axis: { + x: { labelFormatter: (d) => d + '0000', labelAutoRotate: false }, + }, + viewStyle: { + viewFill: '#4e79a7', + plotFill: '#f28e2c', + mainFill: '#e15759', + contentFill: '#76b7b2', + }, + }; +} diff --git a/__tests__/plots/static/alphabet-interval-sized-padding.ts b/__tests__/plots/static/alphabet-interval-sized-padding.ts new file mode 100644 index 0000000000..2589dc9eed --- /dev/null +++ b/__tests__/plots/static/alphabet-interval-sized-padding.ts @@ -0,0 +1,27 @@ +import { G2Spec } from '../../../src'; + +export function alphabetIntervalSizedPadding(): G2Spec { + return { + type: 'interval', + paddingBottom: 20, + transform: [{ type: 'sortX', by: 'y', reverse: true }], + data: { + type: 'fetch', + value: 'data/alphabet.csv', + }, + encode: { + x: 'letter', + y: 'frequency', + color: 'steelblue', + }, + axis: { + x: { labelFormatter: (d) => d + '0000' }, + }, + viewStyle: { + viewFill: '#4e79a7', + plotFill: '#f28e2c', + mainFill: '#e15759', + contentFill: '#76b7b2', + }, + }; +} diff --git a/__tests__/plots/static/index.ts b/__tests__/plots/static/index.ts index 0c7d856a79..c9603370dc 100644 --- a/__tests__/plots/static/index.ts +++ b/__tests__/plots/static/index.ts @@ -295,3 +295,5 @@ export { intervalPointBullet } from './interval-point-bullet'; export { intervalPointBullets } from './interval-point-bullets'; export { intervalPointBulletDatas } from './interval-point-bullet-datas'; export { mockIntervalLine } from './mock-interval-line'; +export { alphabetIntervalSizedPadding } from './alphabet-interval-sized-padding'; +export { alphabetIntervalRotatePadding } from './alphabet-interval-rotate-padding'; diff --git a/src/runtime/component.ts b/src/runtime/component.ts index 4144e7a392..77b0f9271a 100644 --- a/src/runtime/component.ts +++ b/src/runtime/component.ts @@ -710,7 +710,13 @@ function computeAxisSize( // Get styles to be applied. const style = styleOf(component, position, theme); - const { tickLength = 0, labelSpacing = 0, titleSpacing = 0, ...rest } = style; + const { + tickLength = 0, + labelSpacing = 0, + titleSpacing = 0, + labelAutoRotate, + ...rest + } = style; // Compute Labels. const scale = createScale(component, library); @@ -727,7 +733,9 @@ function computeAxisSize( // rotate 90 deg to display them. if ( overflowX(scale, labelBBoxes, crossSize, crossPadding, tickFilter) && - !labelTransform + !labelTransform && + labelAutoRotate !== false && + labelAutoRotate !== null ) { component.labelTransform = 'rotate(90)'; component.size = maxLabelWidth + paddingTick; diff --git a/src/runtime/layout.ts b/src/runtime/layout.ts index 61c0fd313b..5ad7823d55 100644 --- a/src/runtime/layout.ts +++ b/src/runtime/layout.ts @@ -311,7 +311,6 @@ function computePadding( for (const position of positions) { const key = `padding${capitalizeFirst(camelCase(position))}`; - const insetKey = `inset${capitalizeFirst(camelCase(position))}`; const components = positionComponents.get(position) || []; const value = layout[key]; const defaultSizeOf = (d) => { @@ -342,6 +341,11 @@ function computePadding( } }; + const maybeHide = (d) => { + if (!d.type.startsWith('axis')) return; + if (d.labelAutoHide === undefined) d.labelAutoHide = true; + }; + const isHorizontal = position === 'bottom' || position === 'top'; // !!!Note @@ -356,6 +360,7 @@ function computePadding( // Specified padding. if (typeof value === 'number') { components.forEach(defaultSizeOf); + components.forEach(maybeHide); } else { // Compute padding dynamically. if (components.length === 0) { From af2e72a7f503d71cd83273d662b578454e76fbe1 Mon Sep 17 00:00:00 2001 From: MiniPear Date: Thu, 19 Oct 2023 12:48:58 +0800 Subject: [PATCH 2/2] fix: ci --- .../indices-line-chart-facet-brush-shared.ts | 2 +- .../plots/interaction/indices-line-chart-facet.ts | 2 +- .../static/barley-point-facet-rect-col-z-index.ts | 2 +- __tests__/plots/static/barley-point-facet-rect-col.ts | 2 +- .../income-statement-by-region-interval-custom.ts | 1 - __tests__/plots/static/index.ts | 2 +- ...t-fact-axis.ts => indices-line-chart-facet-axis.ts} | 2 +- __tests__/plots/static/liquid-default.ts | 2 ++ __tests__/plots/static/month-interval-facet-rect.ts | 10 +++------- src/theme/create.ts | 4 ---- 10 files changed, 11 insertions(+), 18 deletions(-) rename __tests__/plots/static/{indices-line-chart-fact-axis.ts => indices-line-chart-facet-axis.ts} (96%) diff --git a/__tests__/plots/interaction/indices-line-chart-facet-brush-shared.ts b/__tests__/plots/interaction/indices-line-chart-facet-brush-shared.ts index 7ab816f8be..a7fbe6600b 100644 --- a/__tests__/plots/interaction/indices-line-chart-facet-brush-shared.ts +++ b/__tests__/plots/interaction/indices-line-chart-facet-brush-shared.ts @@ -20,7 +20,7 @@ export async function indicesLineChartFacetBrushShared(): Promise { type: 'line', frame: false, scale: { y: { nice: true, facet: false } }, - axis: { y: { labelAutoRotate: false } }, + axis: { y: { labelAutoHide: false } }, encode: { x: 'Date', y: 'Close', diff --git a/__tests__/plots/interaction/indices-line-chart-facet.ts b/__tests__/plots/interaction/indices-line-chart-facet.ts index 155eb7b14b..4999bec43c 100644 --- a/__tests__/plots/interaction/indices-line-chart-facet.ts +++ b/__tests__/plots/interaction/indices-line-chart-facet.ts @@ -20,7 +20,7 @@ export async function indicesLineChartFacet(): Promise { type: 'line', frame: false, scale: { y: { nice: true, facet: false } }, - axis: { y: { labelAutoRotate: false } }, + axis: { y: { labelAutoHide: false } }, encode: { x: 'Date', y: 'Close', diff --git a/__tests__/plots/static/barley-point-facet-rect-col-z-index.ts b/__tests__/plots/static/barley-point-facet-rect-col-z-index.ts index 0a3c6ec63c..af031ec475 100644 --- a/__tests__/plots/static/barley-point-facet-rect-col-z-index.ts +++ b/__tests__/plots/static/barley-point-facet-rect-col-z-index.ts @@ -46,7 +46,7 @@ export async function barleyPointFacetRectColZIndex(): Promise { color: 'year', shape: 'hollow', }, - axis: { y: { labelAutoRotate: false } }, + axis: { y: { labelAutoHide: false } }, }, { type: 'lineY', diff --git a/__tests__/plots/static/barley-point-facet-rect-col.ts b/__tests__/plots/static/barley-point-facet-rect-col.ts index 2c5780b1b7..3330255821 100644 --- a/__tests__/plots/static/barley-point-facet-rect-col.ts +++ b/__tests__/plots/static/barley-point-facet-rect-col.ts @@ -45,7 +45,7 @@ export async function barleyPointFacetRectCol(): Promise { color: 'year', shape: 'hollow', }, - axis: { y: { labelAutoRotate: false } }, + axis: { y: { labelAutoHide: false } }, }, ], }; diff --git a/__tests__/plots/static/income-statement-by-region-interval-custom.ts b/__tests__/plots/static/income-statement-by-region-interval-custom.ts index e4d04c1aef..79f3dc852c 100644 --- a/__tests__/plots/static/income-statement-by-region-interval-custom.ts +++ b/__tests__/plots/static/income-statement-by-region-interval-custom.ts @@ -32,7 +32,6 @@ export function incomeStatementByRegionIntervalCustom() { data: incomeStatementByRegion, axis: { x: { - labelAutoRotate: false, labelAutoEllipsis: true, title: false, labelFontSize: 10, diff --git a/__tests__/plots/static/index.ts b/__tests__/plots/static/index.ts index c9603370dc..ab2985742b 100644 --- a/__tests__/plots/static/index.ts +++ b/__tests__/plots/static/index.ts @@ -181,7 +181,7 @@ export { housePricePointShapes } from './house-price-point-shapes'; export { aaplLineSlider } from './aapl-line-slider'; export { aaplLineZIndex } from './aapl-line-z-index'; export { aaplLineSliderTransposed } from './aapl-line-slider-transposed'; -export { indicesLineChartFacetAxis } from './indices-line-chart-fact-axis'; +export { indicesLineChartFacetAxis } from './indices-line-chart-facet-axis'; export { indicesLineChartScaleRelations } from './indices-line-chart-scale-relations'; export { aaplLineClip } from './aapl-line-clip'; export { githubStarIntervalPalette } from './github-star-interval-palette'; diff --git a/__tests__/plots/static/indices-line-chart-fact-axis.ts b/__tests__/plots/static/indices-line-chart-facet-axis.ts similarity index 96% rename from __tests__/plots/static/indices-line-chart-fact-axis.ts rename to __tests__/plots/static/indices-line-chart-facet-axis.ts index 6c898d7c1a..6bc50852b6 100644 --- a/__tests__/plots/static/indices-line-chart-fact-axis.ts +++ b/__tests__/plots/static/indices-line-chart-facet-axis.ts @@ -20,7 +20,7 @@ export async function indicesLineChartFacetAxis(): Promise { frame: false, scale: { y: { nice: true, facet: false } }, axis: { - y: { labelAutoRotate: false }, + y: { labelAutoHide: false }, x: ({ rowIndex }) => rowIndex === 0 ? { position: 'top' } diff --git a/__tests__/plots/static/liquid-default.ts b/__tests__/plots/static/liquid-default.ts index 5ec4dca9b6..d6b0ce08fd 100644 --- a/__tests__/plots/static/liquid-default.ts +++ b/__tests__/plots/static/liquid-default.ts @@ -12,3 +12,5 @@ export function liquidDefault(): G2Spec { }, }; } + +liquidDefault.maxError = 10; diff --git a/__tests__/plots/static/month-interval-facet-rect.ts b/__tests__/plots/static/month-interval-facet-rect.ts index 4688e4b7e6..f126b2f4ad 100644 --- a/__tests__/plots/static/month-interval-facet-rect.ts +++ b/__tests__/plots/static/month-interval-facet-rect.ts @@ -28,19 +28,15 @@ export function monthIntervalFacetRect(): G2Spec { width: 800, data: mockData(), encode: { x: 'day', y: 'week' }, - scale: { - x: { domain: days }, - }, - legend: { - color: { position: 'right', size: 50 }, - }, + scale: { x: { domain: days } }, + legend: { color: { position: 'right', size: 50 } }, paddingLeft: 40, paddingBottom: 40, children: [ { type: 'interval', transform: [{ type: 'stackY' }], - axis: { x: { labelAutoRotate: false } }, + axis: { x: { labelAutoHide: false }, y: { labelAutoHide: false } }, encode: { x: 'activity', y: 'value', diff --git a/src/theme/create.ts b/src/theme/create.ts index 8f73e8808c..9324a2bff8 100644 --- a/src/theme/create.ts +++ b/src/theme/create.ts @@ -236,7 +236,6 @@ export function create({ labelDirection: 'negative', tickDirection: 'negative', titlePosition: 'top', - labelAutoRotate: false, titleSpacing: 12, labelSpacing: 4, titleTextBaseline: 'middle', @@ -244,7 +243,6 @@ export function create({ axisBottom: { gridDirection: 'negative', labelDirection: 'positive', - labelAutoRotate: false, tickDirection: 'positive', titlePosition: 'bottom', titleSpacing: 12, @@ -253,7 +251,6 @@ export function create({ }, axisLeft: { gridDirection: 'positive', - labelAutoRotate: false, labelDirection: 'negative', labelSpacing: 4, tickDirection: 'negative', @@ -269,7 +266,6 @@ export function create({ labelSpacing: 4, tickDirection: 'positive', titlePosition: 'right', - labelAutoRotate: false, titleSpacing: 12, titleTextBaseline: 'top', titleDirection: 'vertical',