You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2020/06/22 04:13:48 UTC

[incubator-echarts] branch next updated: ts: fix type.

This is an automated email from the ASF dual-hosted git repository.

sushuang pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/next by this push:
     new 662eea3  ts: fix type.
662eea3 is described below

commit 662eea3722b096ea9df13ad110233feafb734f8b
Author: 100pah <su...@gmail.com>
AuthorDate: Mon Jun 22 12:13:22 2020 +0800

    ts: fix type.
---
 src/coord/axisHelper.ts            | 7 +++----
 src/data/helper/dataStackHelper.ts | 6 +++---
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/coord/axisHelper.ts b/src/coord/axisHelper.ts
index 2393f7c..425335a 100644
--- a/src/coord/axisHelper.ts
+++ b/src/coord/axisHelper.ts
@@ -37,7 +37,7 @@ import { AxisBaseOption } from './axisCommonTypes';
 import type CartesianAxisModel from './cartesian/AxisModel';
 import List from '../data/List';
 import { getStackedDimension } from '../data/helper/dataStackHelper';
-import { Dictionary, ScaleDataValue } from '../util/types';
+import { Dictionary, ScaleDataValue, DimensionName } from '../util/types';
 import { ensureScaleRawExtentInfo } from './scaleRawExtentInfo';
 
 
@@ -333,14 +333,13 @@ export function getOptionCategoryInterval(model: Model<AxisBaseOption['axisLabel
  * Set `categoryInterval` as 0 implicitly indicates that
  * show all labels reguardless of overlap.
  * @param {Object} axis axisModel.axis
- * @return {boolean}
  */
-export function shouldShowAllLabels(axis: Axis) {
+export function shouldShowAllLabels(axis: Axis): boolean {
     return axis.type === 'category'
         && getOptionCategoryInterval(axis.getLabelModel()) === 0;
 }
 
-export function getDataDimensionsOnAxis(data: List, axisDim: string) {
+export function getDataDimensionsOnAxis(data: List, axisDim: string): DimensionName[] {
     // Remove duplicated dat dimensions caused by `getStackedDimension`.
     const dataDimMap = {} as Dictionary<boolean>;
     // Currently `mapDimensionsAll` will contian stack result dimension ('__\0ecstackresult').
diff --git a/src/data/helper/dataStackHelper.ts b/src/data/helper/dataStackHelper.ts
index 96aa3f0..5682435 100644
--- a/src/data/helper/dataStackHelper.ts
+++ b/src/data/helper/dataStackHelper.ts
@@ -21,7 +21,7 @@ import {each, isString} from 'zrender/src/core/util';
 import DataDimensionInfo from '../DataDimensionInfo';
 import SeriesModel from '../../model/Series';
 import List from '../List';
-import type { SeriesOption, SeriesStackOptionMixin } from '../../util/types';
+import type { SeriesOption, SeriesStackOptionMixin, DimensionName } from '../../util/types';
 
 interface DataStackResult {
     stackedDimension: string
@@ -154,7 +154,7 @@ export function enableDataStack(
     };
 }
 
-export function isDimensionStacked(data: List, stackedDim: string /*, stackedByDim*/) {
+export function isDimensionStacked(data: List, stackedDim: string /*, stackedByDim*/): boolean {
     // Each single series only maps to one pair of axis. So we do not need to
     // check stackByDim, whatever stacked by a dimension or stacked by index.
     return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension');
@@ -165,7 +165,7 @@ export function isDimensionStacked(data: List, stackedDim: string /*, stackedByD
         // );
 }
 
-export function getStackedDimension(data: List, targetDim: string) {
+export function getStackedDimension(data: List, targetDim: string): DimensionName {
     return isDimensionStacked(data, targetDim)
         ? data.getCalculationInfo('stackResultDimension')
         : targetDim;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org