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/10 09:21:31 UTC

[incubator-echarts] branch next updated: ts: dataset change to ts.

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 750d604  ts: dataset change to ts.
750d604 is described below

commit 750d604d76e6155d45bb9d8f5928c0aad437c52c
Author: 100pah <su...@gmail.com>
AuthorDate: Wed Jun 10 17:21:08 2020 +0800

    ts: dataset change to ts.
---
 src/component/dataset.ts | 49 +++++++++++++++++++++++++-----------------------
 src/util/types.ts        |  2 +-
 2 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/src/component/dataset.ts b/src/component/dataset.ts
index dbae472..8e16f47 100644
--- a/src/component/dataset.ts
+++ b/src/component/dataset.ts
@@ -17,8 +17,6 @@
 * under the License.
 */
 
-// @ts-nocheck
-
 /**
  * This module is imported by echarts directly.
  *
@@ -31,36 +29,41 @@
 import ComponentModel from '../model/Component';
 import ComponentView from '../view/Component';
 import {detectSourceFormat} from '../data/helper/sourceHelper';
-import { SERIES_LAYOUT_BY_COLUMN } from '../util/types';
-
-ComponentModel.extend({
+import {
+    SERIES_LAYOUT_BY_COLUMN, ComponentOption, SeriesEncodeOptionMixin, OptionSourceData, SeriesLayoutBy
+} from '../util/types';
 
-    type: 'dataset',
 
-    /**
-     * @protected
-     */
-    defaultOption: {
+interface DatasetOption extends
+        Pick<ComponentOption, 'type' | 'id' | 'name'>,
+        Pick<SeriesEncodeOptionMixin, 'dimensions'> {
+    seriesLayoutBy?: SeriesLayoutBy;
+    // null/undefined/'auto': auto detect header, see "src/data/helper/sourceHelper".
+    sourceHeader?: boolean | 'auto';
+    data?: OptionSourceData;
+}
 
-        // 'row', 'column'
-        seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,
+class DatasetModel extends ComponentModel {
 
-        // null/'auto': auto detect header, see "module:echarts/data/helper/sourceHelper"
-        sourceHeader: null,
+    type = 'dataset';
+    static type = 'dataset';
 
-        dimensions: null,
+    static defaultOption: DatasetOption = {
+        seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN
+    };
 
-        source: null
-    },
-
-    optionUpdated: function () {
+    optionUpdated() {
         detectSourceFormat(this);
     }
+}
+
+ComponentModel.registerClass(DatasetModel);
 
-});
 
-ComponentView.extend({
+class DatasetView extends ComponentView {
+    static type = 'dataset';
+    type = 'dataset';
+}
 
-    type: 'dataset'
+ComponentView.registerClass(DatasetView);
 
-});
diff --git a/src/util/types.ts b/src/util/types.ts
index 905f5a6..ebd78cf 100644
--- a/src/util/types.ts
+++ b/src/util/types.ts
@@ -1128,6 +1128,6 @@ export interface SeriesSamplingOptionMixin {
 export interface SeriesEncodeOptionMixin {
     datasetIndex?: number;
     seriesLayoutBy?: SeriesLayoutBy;
-    dimentions?: DimensionName[];
+    dimensions?: DimensionName[];
     encode?: OptionEncode
 }


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