Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prune global-level trace attributes that are already defined in a trace #3158

Merged
merged 11 commits into from Oct 30, 2018

Conversation

antoinerg
Copy link
Contributor

@antoinerg antoinerg commented Oct 25, 2018

Fixes #3058

Prune unsupported global-level trace attributes from

  • Plotly.PlotSchema
  • _fulldata

@antoinerg
Copy link
Contributor Author

The plot-schema.json published as an artifact is actually out of date 😞 . Just created an issue for this problem #3159.


// prune global-level trace attributes that are already defined in a trace
exports.crawl(copyModuleAttributes, function(attr, attrName, attrs, level, fullAttrString) {
delete copyBaseAttributes[fullAttrString];
Copy link
Contributor

@etpinard etpinard Oct 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fullAttrString might look like 'marker.line.width' in general, so we'll need to use Lib.nestedProperty here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @etpinard! Commit 7999517 fixes this :)

exports.crawl(copyModuleAttributes, function(attr, attrName, attrs, level, fullAttrString) {
delete copyBaseAttributes[fullAttrString];
// Prune undefined attributes
if(attr === undefined) delete copyModuleAttributes[fullAttrString];
Copy link
Contributor

@etpinard etpinard Oct 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice touch here, that way we won't have to rely on JSON.stringify to remove keys with undefined values.

@@ -460,11 +460,22 @@ function getTraceAttributes(type) {
// make 'type' the first attribute in the object
attributes.type = null;


var copyBaseAttributes = extendDeepAll({}, baseAttributes),
copyModuleAttributes = extendDeepAll({}, _module.attributes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var a = {},
    b = [];

have gone out of style in our codebase. It might be worth adding an eslint rule for this. From

https://eslint.org/docs/rules/one-var#initialized-and-uninitialized

looks like "one-var": { "initialized": "never", "uninitialized": "consecutive" } is exactly what most of the codebase does already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this in f168ddc and opened an issue (#3162) so I don't forget about adding an eslint rule for this.

@antoinerg
Copy link
Contributor Author

Thank you @etpinard for all your comments! Do you have suggestions for tests?

I could add a simple test for the very bug I was trying to fix but that seems weak:

    it('should prune unsupported global-level trace attributes', function() {
        expect(Plotly.PlotSchema.get().traces.sankey.attributes.hoverinfo.flags.length).toBe(0);
    });

Anyway, I'll keep thinking about it

@etpinard
Copy link
Contributor

I could add a simple test for the very bug I was trying to fix but that seems weak:

Weak perhaps, but good enough to my 👀

@antoinerg
Copy link
Contributor Author

antoinerg commented Oct 26, 2018

Thanks @etpinard!

In commit 7f60f6e, I added the test to plotschema_test.js but I'm thinking it should probably be in sankey_test.js. What do you think?

@etpinard
Copy link
Contributor

Great @antoinerg - are you planning on addressing the _fullData part of #3058 ?

Can you confirm that the only lines changed in plot-schema.json are those hoverinfo flags?

@antoinerg
Copy link
Contributor Author

I'd like to address _fullData as well. @alexcjohnson suggested adding

module.omitGlobalAttrs: ['selectedpoints', 'hoverlabel', 'opacity', 'ids', 'customdata']

but I think that the approach of setting the trace attribute to undefined could also work. Do you have any preference?

@etpinard
Copy link
Contributor

I think that the approach of setting the trace attribute to undefined could also work.

Yep, that will ✅ one part of the story. You'll also need to make sure those omitGlobalAttrs attributes don't get coerced here:

plotly.js/src/plots/plots.js

Lines 1161 to 1199 in 0a310c9

if(visible) {
coerce('customdata');
coerce('ids');
if(Registry.traceIs(traceOut, 'showLegend')) {
traceOut._dfltShowLegend = true;
coerce('showlegend');
coerce('legendgroup');
}
else {
traceOut._dfltShowLegend = false;
}
Registry.getComponentMethod(
'fx',
'supplyDefaults'
)(traceIn, traceOut, defaultColor, layout);
// TODO add per-base-plot-module trace defaults step
if(_module) {
_module.supplyDefaults(traceIn, traceOut, defaultColor, layout);
Lib.coerceHoverinfo(traceIn, traceOut, layout);
}
if(!Registry.traceIs(traceOut, 'noOpacity')) coerce('opacity');
if(Registry.traceIs(traceOut, 'notLegendIsolatable')) {
// This clears out the legendonly state for traces like carpet that
// cannot be isolated in the legend
traceOut.visible = !!traceOut.visible;
}
if(_module && _module.selectPoints) {
coerce('selectedpoints');
}
plots.supplyTransformDefaults(traceIn, traceOut, layout);
}

@antoinerg
Copy link
Contributor Author

antoinerg commented Oct 26, 2018

@etpinard
Comparing dist/plot-schema.json between commit dcdd227ea4ef2380bbf25682049f506be1319ec (the start of this branch) and 7f60f6e (the latest on this branch). Note that this is a json-diff:

 {
   traces: {
     choropleth: {
       attributes: {
         hoverinfo: {
           flags: [
             "location"
             "z"
             "text"
             "name"
-            "name"
           ]
         }
       }
     }
     parcats: {
       attributes: {
         hoverinfo: {
           flags: [
             "count"
             "probability"
-            "z"
-            "text"
-            "name"
           ]
         }
       }
     }
     scattermapbox: {
       attributes: {
         hoverinfo: {
           flags: [
             "lon"
             "lat"
             "text"
             "name"
-            "name"
           ]
         }
       }
     }
     sankey: {
       attributes: {
         hoverinfo: {
           flags: [
-            "x"
-            "y"
-            "z"
-            "text"
-            "name"
           ]
         }
       }
     }
     scattercarpet: {
       attributes: {
         hoverinfo: {
           flags: [
             "a"
             "b"
             "text"
             "name"
-            "name"
           ]
         }
       }
     }
     scatterpolar: {
       attributes: {
         hoverinfo: {
           flags: [
             "r"
             "theta"
             "text"
             "name"
-            "name"
           ]
         }
       }
     }
     scatterpolargl: {
       attributes: {
         hoverinfo: {
           flags: [
             "r"
             "theta"
             "text"
             "name"
-            "name"
           ]
         }
       }
     }
     barpolar: {
       attributes: {
         hoverinfo: {
           flags: [
             "r"
             "theta"
             "text"
             "name"
-            "name"
           ]
         }
       }
     }
   }
 }

Here's the line by line diff: diff -u fdcdd227ea4ef2380bbf25682049f506be1319ec-plot-schema.json 7f60f6ee7a43d291e248c663ae517ff7a82c29d0-plot-schema.json. The order of hoverinfo and hoverlabel is reversed. name comes after uid.

--- fdcdd227ea4ef2380bbf25682049f506be1319ec-plot-schema.json	2018-10-26 15:06:40.086607591 -0400
+++ 7f60f6ee7a43d291e248c663ae517ff7a82c29d0-plot-schema.json	2018-10-26 15:06:03.732597492 -0400
@@ -3761,12 +3761,6 @@
                     "editType": "style",
                     "description": "Sets the opacity of the trace."
                 },
-                "name": {
-                    "valType": "string",
-                    "role": "info",
-                    "editType": "calc+clearAxisTypes",
-                    "description": "Sets the trace name. The trace name appear as the legend item and on hover. For box traces, the name will also be used for the position coordinate, if `x` and `x0` (`y` and `y0` if horizontal) are missing and the position axis is categorical"
-                },
                 "uid": {
                     "valType": "string",
                     "role": "info",
@@ -3954,6 +3948,12 @@
                     "editType": "calc+clearAxisTypes",
                     "description": "Sets the y coordinate of the box. See overview for more info."
                 },
+                "name": {
+                    "valType": "string",
+                    "role": "info",
+                    "editType": "calc+clearAxisTypes",
+                    "description": "Sets the trace name. The trace name appear as the legend item and on hover. For box traces, the name will also be used for the position coordinate, if `x` and `x0` (`y` and `y0` if horizontal) are missing and the position axis is categorical"
+                },
                 "text": {
                     "valType": "string",
                     "role": "info",
@@ -9265,26 +9265,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "label",
-                        "text",
-                        "value",
-                        "percent",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "none",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -9516,6 +9496,26 @@
                     "editType": "calc",
                     "description": "Determines which trace information appear on the graph."
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "label",
+                        "text",
+                        "value",
+                        "percent",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "none",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "textposition": {
                     "valType": "enumerated",
                     "role": "info",
@@ -9858,12 +9858,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "labelssrc": {
                     "valType": "string",
                     "role": "info",
@@ -9888,6 +9882,12 @@
                     "description": "Sets the source reference on plot.ly for  hovertext .",
                     "editType": "none"
                 },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
+                },
                 "textpositionsrc": {
                     "valType": "string",
                     "role": "info",
@@ -11136,26 +11136,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "a",
-                        "b",
-                        "c",
-                        "text",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "none",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -12569,6 +12549,26 @@
                     "editType": "style",
                     "role": "object"
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "a",
+                        "b",
+                        "c",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "none",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "hoveron": {
                     "valType": "flaglist",
                     "flags": [
@@ -12598,12 +12598,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "asrc": {
                     "valType": "string",
                     "role": "info",
@@ -12639,6 +12633,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  textposition .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -12683,12 +12683,6 @@
                     "editType": "style",
                     "description": "Sets the opacity of the trace."
                 },
-                "name": {
-                    "valType": "string",
-                    "role": "info",
-                    "editType": "calc+clearAxisTypes",
-                    "description": "Sets the trace name. The trace name appear as the legend item and on hover. For box traces, the name will also be used for the position coordinate, if `x` and `x0` (`y` and `y0` if horizontal) are missing and the position axis is categorical"
-                },
                 "uid": {
                     "valType": "string",
                     "role": "info",
@@ -12876,6 +12870,12 @@
                     "editType": "calc+clearAxisTypes",
                     "description": "Sets the y coordinate of the box. See overview for more info."
                 },
+                "name": {
+                    "valType": "string",
+                    "role": "info",
+                    "editType": "calc+clearAxisTypes",
+                    "description": "Sets the trace name. The trace name appear as the legend item and on hover. For box traces, the name will also be used for the position coordinate, if `x` and `x0` (`y` and `y0` if horizontal) are missing and the position axis is categorical"
+                },
                 "orientation": {
                     "valType": "enumerated",
                     "values": [
@@ -13672,26 +13672,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "x",
-                        "y",
-                        "z",
-                        "text",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "calc",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -14804,6 +14784,26 @@
                         "editType": "none"
                     }
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "x",
+                        "y",
+                        "z",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "calc",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "error_x": {
                     "visible": {
                         "valType": "boolean",
@@ -15241,12 +15241,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "xsrc": {
                     "valType": "string",
                     "role": "info",
@@ -15276,6 +15270,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  hovertext .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -15311,15 +15311,6 @@
                     "editType": "style",
                     "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items."
                 },
-                "opacity": {
-                    "valType": "number",
-                    "role": "style",
-                    "min": 0,
-                    "max": 1,
-                    "dflt": 1,
-                    "editType": "calc",
-                    "description": "Sets the opacity of the surface."
-                },
                 "name": {
                     "valType": "string",
                     "role": "info",
@@ -15349,26 +15340,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "x",
-                        "y",
-                        "z",
-                        "text",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "calc",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -16365,6 +16336,15 @@
                     "editType": "calc",
                     "role": "object"
                 },
+                "opacity": {
+                    "valType": "number",
+                    "role": "style",
+                    "min": 0,
+                    "max": 1,
+                    "dflt": 1,
+                    "description": "Sets the opacity of the surface.",
+                    "editType": "calc"
+                },
                 "_deprecated": {
                     "zauto": {
                         "description": "Obsolete. Use `cauto` instead.",
@@ -16379,6 +16359,26 @@
                         "editType": "calc"
                     }
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "x",
+                        "y",
+                        "z",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "calc",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "xcalendar": {
                     "valType": "enumerated",
                     "values": [
@@ -16473,12 +16473,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "zsrc": {
                     "valType": "string",
                     "role": "info",
@@ -16508,6 +16502,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  surfacecolor .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -16543,15 +16543,6 @@
                     "editType": "style",
                     "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items."
                 },
-                "opacity": {
-                    "valType": "number",
-                    "role": "style",
-                    "min": 0,
-                    "max": 1,
-                    "dflt": 1,
-                    "editType": "calc",
-                    "description": "Sets the opacity of the surface."
-                },
                 "name": {
                     "valType": "string",
                     "role": "info",
@@ -16581,26 +16572,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "x",
-                        "y",
-                        "z",
-                        "text",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "calc",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -17315,6 +17286,15 @@
                         "editType": "none"
                     }
                 },
+                "opacity": {
+                    "valType": "number",
+                    "role": "style",
+                    "min": 0,
+                    "max": 1,
+                    "dflt": 1,
+                    "description": "Sets the opacity of the surface.",
+                    "editType": "calc"
+                },
                 "flatshading": {
                     "valType": "boolean",
                     "role": "style",
@@ -17447,6 +17427,26 @@
                     },
                     "role": "object"
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "x",
+                        "y",
+                        "z",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "calc",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "xcalendar": {
                     "valType": "enumerated",
                     "values": [
@@ -17541,12 +17541,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "xsrc": {
                     "valType": "string",
                     "role": "info",
@@ -17606,6 +17600,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  facecolor .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -17641,15 +17641,6 @@
                     "editType": "style",
                     "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items."
                 },
-                "opacity": {
-                    "valType": "number",
-                    "role": "style",
-                    "min": 0,
-                    "max": 1,
-                    "dflt": 1,
-                    "editType": "calc",
-                    "description": "Sets the opacity of the surface."
-                },
                 "name": {
                     "valType": "string",
                     "role": "info",
@@ -17679,30 +17670,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "x",
-                        "y",
-                        "z",
-                        "u",
-                        "v",
-                        "w",
-                        "norm",
-                        "text",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "x+y+z+norm+text+name",
-                    "editType": "calc",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -18405,6 +18372,15 @@
                         "editType": "none"
                     }
                 },
+                "opacity": {
+                    "valType": "number",
+                    "role": "style",
+                    "min": 0,
+                    "max": 1,
+                    "dflt": 1,
+                    "description": "Sets the opacity of the surface.",
+                    "editType": "calc"
+                },
                 "lightposition": {
                     "x": {
                         "valType": "number",
@@ -18503,6 +18479,30 @@
                     },
                     "role": "object"
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "x",
+                        "y",
+                        "z",
+                        "u",
+                        "v",
+                        "w",
+                        "norm",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "x+y+z+norm+text+name",
+                    "editType": "calc",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "scene": {
                     "valType": "subplotid",
                     "role": "info",
@@ -18522,12 +18522,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "xsrc": {
                     "valType": "string",
                     "role": "info",
@@ -18569,6 +18563,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  text .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -18604,15 +18604,6 @@
                     "editType": "style",
                     "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items."
                 },
-                "opacity": {
-                    "valType": "number",
-                    "role": "style",
-                    "min": 0,
-                    "max": 1,
-                    "dflt": 1,
-                    "editType": "calc",
-                    "description": "Sets the opacity of the surface."
-                },
                 "name": {
                     "valType": "string",
                     "role": "info",
@@ -18642,31 +18633,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "x",
-                        "y",
-                        "z",
-                        "u",
-                        "v",
-                        "w",
-                        "norm",
-                        "divergence",
-                        "text",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "x+y+z+norm+text+name",
-                    "editType": "calc",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -19393,6 +19359,15 @@
                         "editType": "none"
                     }
                 },
+                "opacity": {
+                    "valType": "number",
+                    "role": "style",
+                    "min": 0,
+                    "max": 1,
+                    "dflt": 1,
+                    "description": "Sets the opacity of the surface.",
+                    "editType": "calc"
+                },
                 "lightposition": {
                     "x": {
                         "valType": "number",
@@ -19491,6 +19466,31 @@
                     },
                     "role": "object"
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "x",
+                        "y",
+                        "z",
+                        "u",
+                        "v",
+                        "w",
+                        "norm",
+                        "divergence",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "x+y+z+norm+text+name",
+                    "editType": "calc",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "scene": {
                     "valType": "subplotid",
                     "role": "info",
@@ -19510,12 +19510,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "xsrc": {
                     "valType": "string",
                     "role": "info",
@@ -19551,6 +19545,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  w .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -19625,26 +19625,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "lon",
-                        "lat",
-                        "location",
-                        "text",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "calc",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -21026,6 +21006,26 @@
                     "editType": "calc",
                     "role": "object"
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "lon",
+                        "lat",
+                        "location",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "calc",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "geo": {
                     "valType": "subplotid",
                     "role": "info",
@@ -21045,12 +21045,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "lonsrc": {
                     "valType": "string",
                     "role": "info",
@@ -21086,6 +21080,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  textposition .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -21159,26 +21159,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "location",
-                        "z",
-                        "text",
-                        "name",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "calc",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -21415,6 +21395,25 @@
                     "editType": "plot",
                     "role": "object"
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "location",
+                        "z",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "calc",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "zauto": {
                     "valType": "boolean",
                     "role": "info",
@@ -21941,12 +21940,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "locationssrc": {
                     "valType": "string",
                     "role": "info",
@@ -21964,6 +21957,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  text .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -22000,15 +21999,6 @@
                     "editType": "style",
                     "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items."
                 },
-                "opacity": {
-                    "valType": "number",
-                    "role": "style",
-                    "min": 0,
-                    "max": 1,
-                    "dflt": 1,
-                    "editType": "calc",
-                    "description": "Sets the opacity of the trace."
-                },
                 "name": {
                     "valType": "string",
                     "role": "info",
@@ -23430,6 +23420,15 @@
                     "editType": "calc",
                     "role": "object"
                 },
+                "opacity": {
+                    "valType": "number",
+                    "role": "style",
+                    "min": 0,
+                    "max": 1,
+                    "dflt": 1,
+                    "editType": "calc",
+                    "description": "Sets the opacity of the trace."
+                },
                 "error_x": {
                     "visible": {
                         "valType": "boolean",
@@ -23803,15 +23802,6 @@
                     "editType": "style",
                     "description": "Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items."
                 },
-                "opacity": {
-                    "valType": "number",
-                    "role": "style",
-                    "min": 0,
-                    "max": 1,
-                    "dflt": 1,
-                    "editType": "calc",
-                    "description": "Sets the opacity of the trace."
-                },
                 "name": {
                     "valType": "string",
                     "role": "info",
@@ -25122,6 +25112,15 @@
                     "editType": "calc",
                     "role": "object"
                 },
+                "opacity": {
+                    "valType": "number",
+                    "role": "style",
+                    "min": 0,
+                    "max": 1,
+                    "dflt": 1,
+                    "editType": "calc",
+                    "description": "Sets the opacity of the trace."
+                },
                 "idssrc": {
                     "valType": "string",
                     "role": "info",
@@ -27526,26 +27525,6 @@
                     "role": "info",
                     "editType": "plot"
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "count",
-                        "probability",
-                        "z",
-                        "text",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "plot",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "stream": {
                     "token": {
                         "valType": "string",
@@ -27645,6 +27624,23 @@
                     },
                     "role": "object"
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "count",
+                        "probability"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "plot",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "hoveron": {
                     "valType": "enumerated",
                     "values": [
@@ -28443,26 +28439,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "lon",
-                        "lat",
-                        "text",
-                        "name",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "calc",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -29364,6 +29340,25 @@
                     "editType": "calc",
                     "role": "object"
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "lon",
+                        "lat",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "calc",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "subplot": {
                     "valType": "subplotid",
                     "role": "info",
@@ -29383,12 +29378,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "lonsrc": {
                     "valType": "string",
                     "role": "info",
@@ -29412,6 +29401,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  hovertext .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -29485,16 +29480,41 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
+                "stream": {
+                    "token": {
+                        "valType": "string",
+                        "noBlank": true,
+                        "strict": true,
+                        "role": "info",
+                        "editType": "calc",
+                        "description": "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details."
+                    },
+                    "maxpoints": {
+                        "valType": "number",
+                        "min": 0,
+                        "max": 10000,
+                        "dflt": 500,
+                        "role": "info",
+                        "editType": "calc",
+                        "description": "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot."
+                    },
+                    "editType": "calc",
+                    "role": "object"
+                },
+                "transforms": {
+                    "items": {
+                        "transform": {
+                            "editType": "calc",
+                            "description": "An array of operations that manipulate the trace data, for example filtering or sorting the data arrays.",
+                            "role": "object"
+                        }
+                    },
+                    "role": "object"
+                },
                 "hoverinfo": {
                     "valType": "flaglist",
                     "role": "info",
-                    "flags": [
-                        "x",
-                        "y",
-                        "z",
-                        "text",
-                        "name"
-                    ],
+                    "flags": [],
                     "extras": [
                         "all",
                         "none",
@@ -29594,37 +29614,6 @@
                         "editType": "none"
                     }
                 },
-                "stream": {
-                    "token": {
-                        "valType": "string",
-                        "noBlank": true,
-                        "strict": true,
-                        "role": "info",
-                        "editType": "calc",
-                        "description": "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details."
-                    },
-                    "maxpoints": {
-                        "valType": "number",
-                        "min": 0,
-                        "max": 10000,
-                        "dflt": 500,
-                        "role": "info",
-                        "editType": "calc",
-                        "description": "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot."
-                    },
-                    "editType": "calc",
-                    "role": "object"
-                },
-                "transforms": {
-                    "items": {
-                        "transform": {
-                            "editType": "calc",
-                            "description": "An array of operations that manipulate the trace data, for example filtering or sorting the data arrays.",
-                            "role": "object"
-                        }
-                    },
-                    "role": "object"
-                },
                 "domain": {
                     "x": {
                         "valType": "info_array",
@@ -32323,26 +32312,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "a",
-                        "b",
-                        "text",
-                        "name",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "none",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -33733,6 +33702,25 @@
                     "editType": "style",
                     "role": "object"
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "a",
+                        "b",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "none",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "hoveron": {
                     "valType": "flaglist",
                     "flags": [
@@ -33769,12 +33757,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "asrc": {
                     "valType": "string",
                     "role": "info",
@@ -33798,6 +33780,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  textposition .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -34970,102 +34958,6 @@
                     "editType": "none",
                     "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
                 },
-                "hoverlabel": {
-                    "bgcolor": {
-                        "valType": "color",
-                        "role": "style",
-                        "arrayOk": true,
-                        "editType": "none",
-                        "description": "Sets the background color of the hover labels for this trace"
-                    },
-                    "bordercolor": {
-                        "valType": "color",
-                        "role": "style",
-                        "arrayOk": true,
-                        "editType": "none",
-                        "description": "Sets the border color of the hover labels for this trace."
-                    },
-                    "font": {
-                        "family": {
-                            "valType": "string",
-                            "role": "style",
-                            "noBlank": true,
-                            "strict": true,
-                            "editType": "none",
-                            "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.",
-                            "arrayOk": true
-                        },
-                        "size": {
-                            "valType": "number",
-                            "role": "style",
-                            "min": 1,
-                            "editType": "none",
-                            "arrayOk": true
-                        },
-                        "color": {
-                            "valType": "color",
-                            "role": "style",
-                            "editType": "none",
-                            "arrayOk": true
-                        },
-                        "editType": "none",
-                        "description": "Sets the font used in hover labels.",
-                        "role": "object",
-                        "familysrc": {
-                            "valType": "string",
-                            "role": "info",
-                            "description": "Sets the source reference on plot.ly for  family .",
-                            "editType": "none"
-                        },
-                        "sizesrc": {
-                            "valType": "string",
-                            "role": "info",
-                            "description": "Sets the source reference on plot.ly for  size .",
-                            "editType": "none"
-                        },
-                        "colorsrc": {
-                            "valType": "string",
-                            "role": "info",
-                            "description": "Sets the source reference on plot.ly for  color .",
-                            "editType": "none"
-                        }
-                    },
-                    "namelength": {
-                        "valType": "integer",
-                        "min": -1,
-                        "arrayOk": true,
-                        "role": "style",
-                        "editType": "none",
-                        "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis."
-                    },
-                    "editType": "calc",
-                    "split": {
-                        "valType": "boolean",
-                        "role": "info",
-                        "dflt": false,
-                        "editType": "style",
-                        "description": "Show hover information (open, close, high, low) in separate labels."
-                    },
-                    "role": "object",
-                    "bgcolorsrc": {
-                        "valType": "string",
-                        "role": "info",
-                        "description": "Sets the source reference on plot.ly for  bgcolor .",
-                        "editType": "none"
-                    },
-                    "bordercolorsrc": {
-                        "valType": "string",
-                        "role": "info",
-                        "description": "Sets the source reference on plot.ly for  bordercolor .",
-                        "editType": "none"
-                    },
-                    "namelengthsrc": {
-                        "valType": "string",
-                        "role": "info",
-                        "description": "Sets the source reference on plot.ly for  namelength .",
-                        "editType": "none"
-                    }
-                },
                 "stream": {
                     "token": {
                         "valType": "string",
@@ -35247,6 +35139,102 @@
                     "editType": "calc",
                     "description": "Sets the width of the open/close tick marks relative to the *x* minimal interval."
                 },
+                "hoverlabel": {
+                    "bgcolor": {
+                        "valType": "color",
+                        "role": "style",
+                        "arrayOk": true,
+                        "editType": "none",
+                        "description": "Sets the background color of the hover labels for this trace"
+                    },
+                    "bordercolor": {
+                        "valType": "color",
+                        "role": "style",
+                        "arrayOk": true,
+                        "editType": "none",
+                        "description": "Sets the border color of the hover labels for this trace."
+                    },
+                    "font": {
+                        "family": {
+                            "valType": "string",
+                            "role": "style",
+                            "noBlank": true,
+                            "strict": true,
+                            "editType": "none",
+                            "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.",
+                            "arrayOk": true
+                        },
+                        "size": {
+                            "valType": "number",
+                            "role": "style",
+                            "min": 1,
+                            "editType": "none",
+                            "arrayOk": true
+                        },
+                        "color": {
+                            "valType": "color",
+                            "role": "style",
+                            "editType": "none",
+                            "arrayOk": true
+                        },
+                        "editType": "none",
+                        "description": "Sets the font used in hover labels.",
+                        "role": "object",
+                        "familysrc": {
+                            "valType": "string",
+                            "role": "info",
+                            "description": "Sets the source reference on plot.ly for  family .",
+                            "editType": "none"
+                        },
+                        "sizesrc": {
+                            "valType": "string",
+                            "role": "info",
+                            "description": "Sets the source reference on plot.ly for  size .",
+                            "editType": "none"
+                        },
+                        "colorsrc": {
+                            "valType": "string",
+                            "role": "info",
+                            "description": "Sets the source reference on plot.ly for  color .",
+                            "editType": "none"
+                        }
+                    },
+                    "namelength": {
+                        "valType": "integer",
+                        "min": -1,
+                        "arrayOk": true,
+                        "role": "style",
+                        "editType": "none",
+                        "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis."
+                    },
+                    "editType": "calc",
+                    "split": {
+                        "valType": "boolean",
+                        "role": "info",
+                        "dflt": false,
+                        "editType": "style",
+                        "description": "Show hover information (open, close, high, low) in separate labels."
+                    },
+                    "role": "object",
+                    "bgcolorsrc": {
+                        "valType": "string",
+                        "role": "info",
+                        "description": "Sets the source reference on plot.ly for  bgcolor .",
+                        "editType": "none"
+                    },
+                    "bordercolorsrc": {
+                        "valType": "string",
+                        "role": "info",
+                        "description": "Sets the source reference on plot.ly for  bordercolor .",
+                        "editType": "none"
+                    },
+                    "namelengthsrc": {
+                        "valType": "string",
+                        "role": "info",
+                        "description": "Sets the source reference on plot.ly for  namelength .",
+                        "editType": "none"
+                    }
+                },
                 "xcalendar": {
                     "valType": "enumerated",
                     "values": [
@@ -35432,102 +35420,6 @@
                     "editType": "none",
                     "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
                 },
-                "hoverlabel": {
-                    "bgcolor": {
-                        "valType": "color",
-                        "role": "style",
-                        "arrayOk": true,
-                        "editType": "none",
-                        "description": "Sets the background color of the hover labels for this trace"
-                    },
-                    "bordercolor": {
-                        "valType": "color",
-                        "role": "style",
-                        "arrayOk": true,
-                        "editType": "none",
-                        "description": "Sets the border color of the hover labels for this trace."
-                    },
-                    "font": {
-                        "family": {
-                            "valType": "string",
-                            "role": "style",
-                            "noBlank": true,
-                            "strict": true,
-                            "editType": "none",
-                            "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.",
-                            "arrayOk": true
-                        },
-                        "size": {
-                            "valType": "number",
-                            "role": "style",
-                            "min": 1,
-                            "editType": "none",
-                            "arrayOk": true
-                        },
-                        "color": {
-                            "valType": "color",
-                            "role": "style",
-                            "editType": "none",
-                            "arrayOk": true
-                        },
-                        "editType": "none",
-                        "description": "Sets the font used in hover labels.",
-                        "role": "object",
-                        "familysrc": {
-                            "valType": "string",
-                            "role": "info",
-                            "description": "Sets the source reference on plot.ly for  family .",
-                            "editType": "none"
-                        },
-                        "sizesrc": {
-                            "valType": "string",
-                            "role": "info",
-                            "description": "Sets the source reference on plot.ly for  size .",
-                            "editType": "none"
-                        },
-                        "colorsrc": {
-                            "valType": "string",
-                            "role": "info",
-                            "description": "Sets the source reference on plot.ly for  color .",
-                            "editType": "none"
-                        }
-                    },
-                    "namelength": {
-                        "valType": "integer",
-                        "min": -1,
-                        "arrayOk": true,
-                        "role": "style",
-                        "editType": "none",
-                        "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis."
-                    },
-                    "editType": "calc",
-                    "split": {
-                        "valType": "boolean",
-                        "role": "info",
-                        "dflt": false,
-                        "editType": "style",
-                        "description": "Show hover information (open, close, high, low) in separate labels."
-                    },
-                    "role": "object",
-                    "bgcolorsrc": {
-                        "valType": "string",
-                        "role": "info",
-                        "description": "Sets the source reference on plot.ly for  bgcolor .",
-                        "editType": "none"
-                    },
-                    "bordercolorsrc": {
-                        "valType": "string",
-                        "role": "info",
-                        "description": "Sets the source reference on plot.ly for  bordercolor .",
-                        "editType": "none"
-                    },
-                    "namelengthsrc": {
-                        "valType": "string",
-                        "role": "info",
-                        "description": "Sets the source reference on plot.ly for  namelength .",
-                        "editType": "none"
-                    }
-                },
                 "stream": {
                     "token": {
                         "valType": "string",
@@ -35676,6 +35568,102 @@
                     "editType": "calc",
                     "description": "Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es)."
                 },
+                "hoverlabel": {
+                    "bgcolor": {
+                        "valType": "color",
+                        "role": "style",
+                        "arrayOk": true,
+                        "editType": "none",
+                        "description": "Sets the background color of the hover labels for this trace"
+                    },
+                    "bordercolor": {
+                        "valType": "color",
+                        "role": "style",
+                        "arrayOk": true,
+                        "editType": "none",
+                        "description": "Sets the border color of the hover labels for this trace."
+                    },
+                    "font": {
+                        "family": {
+                            "valType": "string",
+                            "role": "style",
+                            "noBlank": true,
+                            "strict": true,
+                            "editType": "none",
+                            "description": "HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts if they aren't available on the system. The plotly service (at https://plot.ly or on-premise) generates images on a server, where only a select number of fonts are installed and supported. These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*, *Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*, *PT Sans Narrow*, *Raleway*, *Times New Roman*.",
+                            "arrayOk": true
+                        },
+                        "size": {
+                            "valType": "number",
+                            "role": "style",
+                            "min": 1,
+                            "editType": "none",
+                            "arrayOk": true
+                        },
+                        "color": {
+                            "valType": "color",
+                            "role": "style",
+                            "editType": "none",
+                            "arrayOk": true
+                        },
+                        "editType": "none",
+                        "description": "Sets the font used in hover labels.",
+                        "role": "object",
+                        "familysrc": {
+                            "valType": "string",
+                            "role": "info",
+                            "description": "Sets the source reference on plot.ly for  family .",
+                            "editType": "none"
+                        },
+                        "sizesrc": {
+                            "valType": "string",
+                            "role": "info",
+                            "description": "Sets the source reference on plot.ly for  size .",
+                            "editType": "none"
+                        },
+                        "colorsrc": {
+                            "valType": "string",
+                            "role": "info",
+                            "description": "Sets the source reference on plot.ly for  color .",
+                            "editType": "none"
+                        }
+                    },
+                    "namelength": {
+                        "valType": "integer",
+                        "min": -1,
+                        "arrayOk": true,
+                        "role": "style",
+                        "editType": "none",
+                        "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis."
+                    },
+                    "editType": "calc",
+                    "split": {
+                        "valType": "boolean",
+                        "role": "info",
+                        "dflt": false,
+                        "editType": "style",
+                        "description": "Show hover information (open, close, high, low) in separate labels."
+                    },
+                    "role": "object",
+                    "bgcolorsrc": {
+                        "valType": "string",
+                        "role": "info",
+                        "description": "Sets the source reference on plot.ly for  bgcolor .",
+                        "editType": "none"
+                    },
+                    "bordercolorsrc": {
+                        "valType": "string",
+                        "role": "info",
+                        "description": "Sets the source reference on plot.ly for  bordercolor .",
+                        "editType": "none"
+                    },
+                    "namelengthsrc": {
+                        "valType": "string",
+                        "role": "info",
+                        "description": "Sets the source reference on plot.ly for  namelength .",
+                        "editType": "none"
+                    }
+                },
                 "xcalendar": {
                     "valType": "enumerated",
                     "values": [
@@ -35873,26 +35861,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "r",
-                        "theta",
-                        "text",
-                        "name",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "none",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -37252,6 +37220,25 @@
                     "editType": "style",
                     "description": "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available."
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "r",
+                        "theta",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "none",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "hoveron": {
                     "valType": "flaglist",
                     "flags": [
@@ -37359,12 +37346,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "rsrc": {
                     "valType": "string",
                     "role": "info",
@@ -37394,6 +37375,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  textposition .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -37468,26 +37455,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "r",
-                        "theta",
-                        "text",
-                        "name",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "none",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -38793,6 +38760,25 @@
                         "editType": "none"
                     }
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "r",
+                        "theta",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "none",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "selected": {
                     "marker": {
                         "opacity": {
@@ -38890,12 +38876,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "rsrc": {
                     "valType": "string",
                     "role": "info",
@@ -38925,6 +38905,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  textposition .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             }
         },
@@ -38999,26 +38985,6 @@
                     "editType": "calc",
                     "description": "Array containing integer indices of selected points. Has an effect only for traces that support selections. Note that an empty array means an empty selection where the `unselected` are turned on for all points, whereas, any other non-array values means no selection all where the `selected` and `unselected` styles have no effect."
                 },
-                "hoverinfo": {
-                    "valType": "flaglist",
-                    "role": "info",
-                    "flags": [
-                        "r",
-                        "theta",
-                        "text",
-                        "name",
-                        "name"
-                    ],
-                    "extras": [
-                        "all",
-                        "none",
-                        "skip"
-                    ],
-                    "arrayOk": true,
-                    "dflt": "all",
-                    "editType": "none",
-                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
-                },
                 "hoverlabel": {
                     "bgcolor": {
                         "valType": "color",
@@ -39848,6 +39814,25 @@
                         "editType": "none"
                     }
                 },
+                "hoverinfo": {
+                    "valType": "flaglist",
+                    "role": "info",
+                    "flags": [
+                        "r",
+                        "theta",
+                        "text",
+                        "name"
+                    ],
+                    "extras": [
+                        "all",
+                        "none",
+                        "skip"
+                    ],
+                    "arrayOk": true,
+                    "dflt": "all",
+                    "editType": "none",
+                    "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired."
+                },
                 "selected": {
                     "marker": {
                         "opacity": {
@@ -39931,12 +39916,6 @@
                     "description": "Sets the source reference on plot.ly for  customdata .",
                     "editType": "none"
                 },
-                "hoverinfosrc": {
-                    "valType": "string",
-                    "role": "info",
-                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
-                    "editType": "none"
-                },
                 "rsrc": {
                     "valType": "string",
                     "role": "info",
@@ -39972,6 +39951,12 @@
                     "role": "info",
                     "description": "Sets the source reference on plot.ly for  text .",
                     "editType": "none"
+                },
+                "hoverinfosrc": {
+                    "valType": "string",
+                    "role": "info",
+                    "description": "Sets the source reference on plot.ly for  hoverinfo .",
+                    "editType": "none"
                 }
             },
             "layoutAttributes": {

@antoinerg
Copy link
Contributor Author

antoinerg commented Oct 26, 2018

@jonmmease Are the following proposed changes to plot-schema.json accurate? Are the only supported hoverinfo flags for parcats "counts" and "probability"?

     parcats: {
       attributes: {
         hoverinfo: {
           flags: [
             "count"
             "probability"
-            "z"
-            "text"
-            "name"
           ]
         }
       }
     }

@etpinard
Copy link
Contributor

Good eye finding that parcats discrepancy. We'll see what @jonmmease replies.

The rest of the diff looks good 👌

@antoinerg
Copy link
Contributor Author

Thanks Étienne 🔍 ! I spotted the difference thanks to json-diff 😄 !

As for _fullData, I was expecting to find a customdata in gd._fullData[0]._module.attributes but I didn't 😕. @alexcjohnson can you point me to an example of a trace with a _fullData that contains an unsupported global-level trace attributes?

@alexcjohnson
Copy link
Contributor

@antoinerg any attribute you set to undefined to keep it out of the schema, it’ll likely still appear in fullData because it’s not coerced by the trace module.

@antoinerg
Copy link
Contributor Author

@alexcjohnson It might be obvious but I just can't see it right now (thank god the weekend is coming!).

Let's consider parcats which has a bunch of undefined in its attributes to keep them out of the schema. What are the leftovers attributes in _fullData[0] that needs pruning.

For convenience here's a link to parcats_basic on local devtools

@antoinerg
Copy link
Contributor Author

antoinerg commented Oct 26, 2018

Thanks to @etpinard for helping me out with this! We went through the list of attributes you mentioned in issue #3058:

module.omitGlobalAttrs: ['selectedpoints', 'hoverlabel', 'opacity', 'ids', 'customdata']

and it seems like the only remaining item to prune off this list is 'hoverlabel'! For example, for parcoords plots, it shows up in _fullData but it shouldn't!

It seems that the other ones are already pruned properly 🎉

@antoinerg antoinerg self-assigned this Oct 29, 2018
@jonmmease
Copy link
Contributor

@antoinerg sorry I missed this! Yes, parcats only supports counts and probability so the changes look good. thanks!

@alexcjohnson
Copy link
Contributor

It seems that the other ones are already pruned properly 🎉

ids, and customdata are valType: 'data_array' - so they'll be ignored unless you provide an array, but if you DO provide an array they still get transferred to _fullData even in traces that don't support them. This is much less important than attributes that have default values that always get pushed into _fullData, but they are still unused and therefore should not be coerced.

> Plotly.newPlot(gd,[{type:'heatmap',z:[[-1,0],[0,1]],customdata:[1]}])
> gd._fullData[0].customdata
< [1]

not something I'd hold this PR up for, but I wouldn't consider #3058 closed until it's addressed.

selectedpoints is OK, it's protected by if(_module && _module.selectPoints)

@antoinerg
Copy link
Contributor Author

Thanks for pointing this out to me @alexcjohnson 🔍 !

I'd rather clean it up in this PR so we can close #3058. Hopefully commit cd0230e gets us there ☺️ !

@etpinard
Copy link
Contributor

transferred to _fullData even in traces that don't support them

Hmm. customdata works for heatmaps: https://codepen.io/etpinard/pen/VENNMg and I suspect it works for all trace types.

@alexcjohnson
Copy link
Contributor

I'd rather clean it up in this PR so we can close #3058.

Great attitude 💪

Hopefully commit cd0230e gets us there ☺️ !

Looks like a good framework to do it, but we may need to go through the trace types, figure out which ones actually can do something useful with these attributes and which can't, and set the attributes undefined in those that can't.

@etpinard
Copy link
Contributor

ids also shows up in the event data (see https://codepen.io/etpinard/pen/MPRRrv) which I'd say is useful for all traces (animatable or not).

@antoinerg
Copy link
Contributor Author

@alexcjohnson Would you consider cleaning up the unsupported attributes for each trace out of scope for the current PR?

@etpinard If there's absolutely no way customdata and ids wouldn't work for all traces, I could easily replace coerceUnlessPruned by coerce as it used to be. I'll let @alexcjohnson comment on this!

@alexcjohnson
Copy link
Contributor

customdata works for heatmaps: https://codepen.io/etpinard/pen/VENNMg and I suspect it works for all trace types.

Ah right, more general than I had realized. But it won't work for all trace types - what would it do for sankey for example? Or any of the histogram types? Or carpet and its contents, that have no hover effects? Anyway again, I wouldn't want to hold up the PR for this but we shouldn't forget about it.

ids also shows up in the event data (see https://codepen.io/etpinard/pen/MPRRrv) which I'd say is useful for all traces (animatable or not).

Not sure about that. The docs for ids are all about animation, so having it there implies that a type is animatable. Does it provide any functionality you can't get from customdata?

@antoinerg
Copy link
Contributor Author

@alexcjohnson I'm not really familiar with customdata and ids so I'll leave it up to @etpinard to answer your questions.

Personally, I really liked your #3158 (comment) because I thought it made sense to include the pruning logic added to plot_schema.js into plots.js to be one-to-one. Right now, if you set an attribute to undefined at the trace-level, it will be omitted from the plot schema so it also shouldn't be in fullData.

I guess this now begs the question: which traces should have ids: undefined and customdata: undefined? Maybe none, maybe some, @etpinard may be able to answer. The current PR does not make any decision about this so hopefully this is nonblocking?

Anyway, thanks again to you two for the thorough reviewing 💪

@alexcjohnson
Copy link
Contributor

alexcjohnson commented Oct 30, 2018

💃 I'd just merge this now and open a maintenance issue about it for discussion. I'm quite sure there are some types that shouldn't have either, and I'd argue that non-animatable traces EITHER shouldn't have ids even if they support customdata OR we should amend the docs to say you can use ids just like customdata... but the consequences of these two attributes still appearing in _fullData are extremely minor.

@etpinard
Copy link
Contributor

Can we remove transforms from traces that don't support them e.g. these traces

image

and possibly more.

@@ -1158,9 +1159,21 @@ plots.supplyTraceDefaults = function(traceIn, traceOut, colorIndex, layout, trac
}
}

function coerceUnlessPruned(attr, dflt, cb) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't need this now that customdata and ids are deemed ok. What if we just add a noHover category to handle the fx.supplyDefaults call below. Oh well, @antoinerg already got a 💃 , so I guess I'm a little late to the party.

Copy link
Contributor

@etpinard etpinard Oct 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But really, at the very least we should add a test checks that parcoords traces don't have hoverlabel in their fullData.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

customdata and ids are deemed ok

I wouldn't go that far 😏 I just didn't want to hold up the rest of this PR for that fairly minor issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But really, at the very least we should add a test checks that parcoords traces don't have hoverlabel in their fullData.

@etpinard Nice catch! It is addressed in commit da03ceb

Copy link
Contributor

@etpinard etpinard Oct 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't go that far I just didn't want to hold up the rest of this PR for that fairly minor issue.

Ok. I wrote up a summary in #3058 (comment), no need to address this now.

That said, I would prefer switching back those coerceUnlessPruned calls to regular coerce calls for customdata and ids as these are never pruned at the moment - which could confuse devs in future iterations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s fine, easy enough to add back later after I convince you to remove those from some types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to see we can meet halfway 😄 ! Commit 55881c6 calls the regular coerce instead of coerceUnlessPruned. @etpinard I left the coerceUnlessPruned function there in case @alexcjohnson convince you later. Let me know if that's OK

@antoinerg
Copy link
Contributor Author

antoinerg commented Oct 30, 2018

Can we remove transforms from traces that don't support them e.g. these traces
and possibly more.

@etpinard transforms are not in _fullData but are indeed in the plot schema :\ . Should I simply go and set transforms: undefined in each traces with _length = null?

@etpinard
Copy link
Contributor

transforms are not in _fullData

That appears correct from:

plotly.js/src/plots/plots.js

Lines 1224 to 1230 in 0124828

plots.supplyTransformDefaults = function(traceIn, traceOut, layout) {
// For now we only allow transforms on 1D traces, ie those that specify a _length.
// If we were to implement 2D transforms, we'd need to have each transform
// describe its own applicability and disable itself when it doesn't apply.
// Also allow transforms that make their own data, but not in globalTransforms
if(!(traceOut._length || hasMakesDataTransform(traceIn))) return;

thanks for checking.

Should I simply go and set transforms: undefined in each traces with _length = null?

That would be a nice start, though that's probably only a subset of all traces that do not support transforms.

@antoinerg
Copy link
Contributor Author

@etpinard Are you OK with me merging this and creating a new PR to deal with #3188 (ie. pruning transforms)?

@etpinard
Copy link
Contributor

I'm ok with it, but it sounds pretty easy to just add a few transforms: undefined in the attribute files. Is there more to the story?

@antoinerg
Copy link
Contributor Author

antoinerg commented Oct 30, 2018

cc @etpinard

I'm ok with it, but it sounds pretty easy to just add a few transforms: undefined in the attribute files. Is there more to the story?

It is indeed that easy! I went ahead and did that in the latest commit 397870b

That would be a nice start, though that's probably only a subset of all traces that do not support transforms.

I guess that's the one I had in mind when I opened #3188. I can definitely close that issue and hunt down all the traces that don't support transforms here. Let me know!

@etpinard
Copy link
Contributor

Well-earned 💃

Will be released in tomorrow's 1.42.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants