You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/02/28 06:03:46 UTC

[GitHub] datability-io commented on a change in pull request #6849: Sort Chart Types based on Usage

datability-io commented on a change in pull request #6849: Sort Chart Types based on Usage
URL: https://github.com/apache/incubator-superset/pull/6849#discussion_r261056353
 
 

 ##########
 File path: superset/assets/src/explore/components/controls/VizTypeControl.jsx
 ##########
 @@ -69,6 +69,53 @@ export default class VizTypeControl extends React.PureComponent {
       this.searchRef.focus();
     }
   }
+  buildVizTypeLookup(types) {
+    const lookup = new Map();
+    types.forEach((type) => {
+      lookup.set(type.key, type);
+    });
+
+    for (let i = 0; i < types.length; i++) {
 
 Review comment:
   The 2nd loop is to make sure any viz types that are not listed in the `defaultOrder` will be picked up.  Otherwise we will need to make sure the list actually contains all viz types and every time a new type is added, we also need to decide which position that viz type should be inserted into the `defaultOrder`.  We can probably add test to make sure that.  What do u think?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org