Ovilia commented on code in PR #16947:
URL: https://github.com/apache/echarts/pull/16947#discussion_r978241152
##########
src/component/axis/CartesianAxisView.ts:
##########
@@ -135,6 +139,37 @@ const axisElementBuilders: Record<typeof
selfBuilderAttrs[number], AxisElementBu
tickModel: splitLineModel
});
+ if (ticksCoords.length > 2 && (axis.scale as any).getInterval
instanceof Function) {
+ const interval = (axis.scale as IntervalScale).getInterval() ||
null;
+ const precision = (axis.scale as
IntervalScale).getIntervalPrecision instanceof Function
+ ? (axis.scale as IntervalScale).getIntervalPrecision()
+ : null;
+
+ const showMinLine = splitLineModel.get('showMinLine');
+ if (showMinLine === false
+ || (showMinLine === 'auto'
+ && roundNumber(
Review Comment:
Using `roundNumber` to check if it is added as the *nice* extent is not
accurate.
##########
src/component/axis/CartesianAxisView.ts:
##########
@@ -135,6 +139,37 @@ const axisElementBuilders: Record<typeof
selfBuilderAttrs[number], AxisElementBu
tickModel: splitLineModel
});
+ if (ticksCoords.length > 2 && (axis.scale as any).getInterval
instanceof Function) {
Review Comment:
Create a new variable for `axis.scale as IntervalScale`
##########
src/coord/axisCommonTypes.ts:
##########
@@ -244,6 +244,10 @@ interface MinorTickOption {
interface SplitLineOption {
show?: boolean,
+ // null/undefined (true) | true | false | 'auto' (true when nick tick only)
+ showMinLine?: boolean | 'auto',
+ // null/undefined (true) | true | false | 'auto' (true when nick tick only)
Review Comment:
`null/undefined` is not necessary and they should not have a default value
defined here. Instead, the default value should be defined in `axisDefault.ts`.
##########
src/component/axis/CartesianAxisView.ts:
##########
@@ -135,6 +139,37 @@ const axisElementBuilders: Record<typeof
selfBuilderAttrs[number], AxisElementBu
tickModel: splitLineModel
});
+ if (ticksCoords.length > 2 && (axis.scale as any).getInterval
instanceof Function) {
Review Comment:
`instanceof Function` can be omitted. If `getInterval` is not null, we can
expect it to be a function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]