You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/10/20 13:55:32 UTC

[GitHub] [incubator-echarts] pissang commented on a change in pull request #13304: [5.0] [FEATURE] decal

pissang commented on a change in pull request #13304:
URL: https://github.com/apache/incubator-echarts/pull/13304#discussion_r508523173



##########
File path: src/visual/aria.ts
##########
@@ -17,123 +17,186 @@
 * under the License.
 */
 
-// @ts-nocheck
-
 import * as zrUtil from 'zrender/src/core/util';
-import { retrieveRawValue }
-
-from '../data/helper/dataProvider';
-
-export default function (dom, ecModel) {
-    const ariaModel = ecModel.getModel('aria');
-    if (!ariaModel.get('show')) {
-        return;
-    }
-    else if (ariaModel.get('description')) {
-        dom.setAttribute('aria-label', ariaModel.get('description'));
+import ExtensionAPI from '../ExtensionAPI';
+import {retrieveRawValue} from '../data/helper/dataProvider';
+import GlobalModel from '../model/Global';
+import Model from '../model/Model';
+import {AriaOption} from '../component/aria';
+import {TitleOption} from '../component/title';
+
+export default function (ecModel: GlobalModel, api: ExtensionAPI) {
+    const ariaModel: Model<AriaOption> = ecModel.getModel('aria');
+    if (ariaModel.get('show') === false) {

Review comment:
       still use `show` here.

##########
File path: src/component/aria.ts
##########
@@ -0,0 +1,73 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+import * as echarts from '../echarts';
+import ariaVisual from '../visual/aria';
+
+const PRIORITY_VISUAL_ARIA = echarts.PRIORITY.VISUAL.ARIA;
+
+export interface AriaLabelOption {
+    enabled?: boolean;
+    show?: boolean; // @deprecated use enabled instead

Review comment:
       `deprecated` option can be removed from type declarations.

##########
File path: src/component/aria.ts
##########
@@ -0,0 +1,73 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+import * as echarts from '../echarts';
+import ariaVisual from '../visual/aria';
+
+const PRIORITY_VISUAL_ARIA = echarts.PRIORITY.VISUAL.ARIA;
+
+export interface AriaLabelOption {
+    enabled?: boolean;
+    show?: boolean; // @deprecated use enabled instead
+    description?: string;
+    general?: {
+        withTitle?: string;
+        withoutTitle?: string;
+    };
+    series?: {
+        maxCount?: number;
+        single?: {
+            prefix?: string;
+            withName?: string;
+            withoutName?: string;
+        };
+        multiple?: {
+            prefix?: string;
+            withName?: string;
+            withoutName?: string;
+            separator?: {
+                middle?: string;
+                end?: string;
+            }
+        }
+    },
+    data?: {
+        maxCount?: number;
+        allData?: string;
+        partialData?: string;
+        withName?: string;
+        withoutName?: string;
+        separator?: {
+            middle?: string;
+            end?: string;
+        }
+    }
+}
+
+// Extending is for compating ECharts 4
+export interface AriaOption extends AriaLabelOption {

Review comment:
       deprecated option can be removed from type declarations.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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