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 2018/08/09 21:52:46 UTC

[GitHub] hughhhh commented on a change in pull request #5572: [bugfix] line_multi chart crashed on chosen (#5568)

hughhhh commented on a change in pull request #5572: [bugfix] line_multi chart crashed on chosen (#5568)
URL: https://github.com/apache/incubator-superset/pull/5572#discussion_r209090764
 
 

 ##########
 File path: superset/assets/src/visualizations/line_multi.js
 ##########
 @@ -26,27 +25,25 @@ export default function lineMulti(slice, payload) {
     const fdCopy = {
       ...subslice.form_data,
       filters,
-      since: fd.since,
-      until: fd.until,
+      time_range: fd.time_range,
     };
     const url = getExploreLongUrl(fdCopy, 'json');
-    promises.push(new Promise((resolve, reject) => {
+    return new Promise((resolve, reject) => {
       d3.json(url, (error, response) => {
         if (error) {
           reject(error);
         } else {
-          const data = [];
-          response.data.forEach((datum) => {
-            let key = datum.key;
-            if (fd.prefix_metric_with_slice_name) {
-              key = subslice.slice_name + ': ' + key;
-            }
-            data.push({ key, values: datum.values, type: fdCopy.viz_type, yAxis });
-          });
+          const addPrefix = fd.prefix_metric_with_slice_name;
+          const data = response.data.map(({ key, values }) => ({
+            key: addPrefix ? `${subslice.slice_name}: ${key}` : key,
+            values,
+            type: fdCopy.viz_type,
 
 Review comment:
   nit: put changing values on top 
   ```
   {
               key: addPrefix ? `${subslice.slice_name}: ${key}` : key,
               type: fdCopy.viz_type,
               values,
               yAxis,
   }
   ```

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