You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/07/27 08:56:50 UTC

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

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

shenyi 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 eede51a  fix(ts): fix type errors.
eede51a is described below

commit eede51ab8f0597b107d99df3cb741c3989ed5515
Author: pissang <bm...@gmail.com>
AuthorDate: Mon Jul 27 16:55:11 2020 +0800

    fix(ts): fix type errors.
---
 src/component/timeline/TimelineModel.ts     | 8 ++++----
 src/component/tooltip/TooltipHTMLContent.ts | 1 +
 src/label/LabelManager.ts                   | 2 +-
 src/util/states.ts                          | 2 +-
 src/util/types.ts                           | 2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/component/timeline/TimelineModel.ts b/src/component/timeline/TimelineModel.ts
index a32218a..4598abd 100644
--- a/src/component/timeline/TimelineModel.ts
+++ b/src/component/timeline/TimelineModel.ts
@@ -54,10 +54,10 @@ export interface TimelineControlStyle extends ItemStyleOption {
     nextIcon?: string
 
     // Can be a percent value relative to itemSize
-    playBtnSize: number | string
-    stopBtnSize: number | string
-    nextBtnSize: number | string
-    prevBtnSize: number | string
+    playBtnSize?: number | string
+    stopBtnSize?: number | string
+    nextBtnSize?: number | string
+    prevBtnSize?: number | string
 }
 
 export interface TimelineCheckpointStyle extends ItemStyleOption,
diff --git a/src/component/tooltip/TooltipHTMLContent.ts b/src/component/tooltip/TooltipHTMLContent.ts
index bbdedad..a7b5494 100644
--- a/src/component/tooltip/TooltipHTMLContent.ts
+++ b/src/component/tooltip/TooltipHTMLContent.ts
@@ -63,6 +63,7 @@ function assembleFont(textStyleModel: Model<TooltipOption['textStyle']>): string
     cssText.push('font:' + textStyleModel.getFont());
 
     fontSize
+        // @ts-ignore, leave it to the tooltip refactor.
         && cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');
 
     each(['decoration', 'align'] as const, function (name) {
diff --git a/src/label/LabelManager.ts b/src/label/LabelManager.ts
index 12ddbc7..1358cd4 100644
--- a/src/label/LabelManager.ts
+++ b/src/label/LabelManager.ts
@@ -81,7 +81,7 @@ interface SavedLabelAttr {
         verticalAlign: ZRTextVerticalAlign
         width: number
         height: number
-        fontSize: number
+        fontSize: number | string
 
         x: number
         y: number
diff --git a/src/util/states.ts b/src/util/states.ts
index 085ec61..4350fac 100644
--- a/src/util/states.ts
+++ b/src/util/states.ts
@@ -188,7 +188,7 @@ function getFromStateStyle(
 function createEmphasisDefaultState(
     el: Displayable,
     stateName: 'emphasis',
-    targetStates?: string[],
+    targetStates: string[],
     state: Displayable['states'][number]
 ) {
     const hasSelect = targetStates && indexOf(targetStates, 'select') >= 0;
diff --git a/src/util/types.ts b/src/util/types.ts
index 8d6ff52..a723cbf 100644
--- a/src/util/types.ts
+++ b/src/util/types.ts
@@ -776,7 +776,7 @@ export interface TextCommonOption extends ShadowOptionMixin {
     fontStyle?: ZRFontStyle
     fontWeight?: ZRFontWeight
     fontFamily?: string
-    fontSize?: number
+    fontSize?: number | string
     align?: HorizontalAlign
     verticalAlign?: VerticalAlign
     // @deprecated


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