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

Remove heatmapgl and pointcloud traces in Plotly.py #4792

Closed
LiamConnors opened this issue Oct 10, 2024 · 0 comments · Fixed by #4815
Closed

Remove heatmapgl and pointcloud traces in Plotly.py #4792

LiamConnors opened this issue Oct 10, 2024 · 0 comments · Fixed by #4815
Assignees
Labels
bug something broken P1 needed for current cycle

Comments

@LiamConnors
Copy link
Member

heatmapgl was removed in Plotly.js here plotly/plotly.js#7213

It looks like there are some changes required in Plotly.py that aren't covered by the codegen as after running codegen against plotly.js master branch, all plotly.express examples throw this error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[1], line 4
      1 import plotly.express as px
      2 df = px.data.tips()
----> 4 fig = px.density_contour(df, x="total_bill", y="tip")
      5 fig.show()

File ~/Desktop/plotly.py/packages/python/plotly/plotly/express/_chart_types.py:117, in density_contour(data_frame, x, y, z, color, facet_row, facet_col, facet_col_wrap, facet_row_spacing, facet_col_spacing, hover_name, hover_data, animation_frame, animation_group, category_orders, labels, orientation, color_discrete_sequence, color_discrete_map, marginal_x, marginal_y, trendline, trendline_options, trendline_color_override, trendline_scope, log_x, log_y, range_x, range_y, histfunc, histnorm, nbinsx, nbinsy, text_auto, title, template, width, height)
     72 def density_contour(
     73     data_frame=None,
     74     x=None,
   (...)
    110     height=None,
    111 ) -> go.Figure:
    112     """
    113     In a density contour plot, rows of `data_frame` are grouped together
    114     into contour marks to visualize the 2D distribution of an aggregate
    115     function `histfunc` (e.g. the count or sum) of the value `z`.
    116     """
--> 117     return make_figure(
    118         args=locals(),
    119         constructor=go.Histogram2dContour,
    120         trace_patch=dict(
    121             contours=dict(coloring="none"),
    122             histfunc=histfunc,
    123             histnorm=histnorm,
    124             nbinsx=nbinsx,
    125             nbinsy=nbinsy,
    126             xbingroup="x",
    127             ybingroup="y",
    128         ),
    129     )

File ~/Desktop/plotly.py/packages/python/plotly/plotly/express/_core.py:2383, in make_figure(args, constructor, trace_patch, layout_patch)
   2381 fig.update_layout(layout_patch)
   2382 if "template" in args and args["template"] is not None:
-> 2383     fig.update_layout(template=args["template"], overwrite=True)
   2384 for f in frame_list:
   2385     f["name"] = str(f["name"])

File ~/Desktop/plotly.py/packages/python/plotly/plotly/graph_objs/_figure.py:787, in Figure.update_layout(self, dict1, overwrite, **kwargs)
    761 def update_layout(self, dict1=None, overwrite=False, **kwargs) -> "Figure":
    762     """
    763 
    764     Update the properties of the figure's layout with a dict and/or with
   (...)
    785 
    786     """
--> 787     return super(Figure, self).update_layout(dict1, overwrite, **kwargs)

File ~/Desktop/plotly.py/packages/python/plotly/plotly/basedatatypes.py:1391, in BaseFigure.update_layout(self, dict1, overwrite, **kwargs)
   1367 def update_layout(self, dict1=None, overwrite=False, **kwargs):
   1368     """
   1369     Update the properties of the figure's layout with a dict and/or with
   1370     keyword arguments.
   (...)
   1389         The Figure object that the update_layout method was called on
   1390     """
-> 1391     self.layout.update(dict1, overwrite=overwrite, **kwargs)
   1392     return self

File ~/Desktop/plotly.py/packages/python/plotly/plotly/basedatatypes.py:5119, in BasePlotlyType.update(self, dict1, overwrite, **kwargs)
   5117     with self.figure.batch_update():
   5118         BaseFigure._perform_update(self, dict1, overwrite=overwrite)
-> 5119         BaseFigure._perform_update(self, kwargs, overwrite=overwrite)
   5120 else:
   5121     BaseFigure._perform_update(self, dict1, overwrite=overwrite)

File ~/Desktop/plotly.py/packages/python/plotly/plotly/basedatatypes.py:3892, in BaseFigure._perform_update(plotly_obj, update_obj, overwrite)
   3888 val = update_obj[key]
   3890 if overwrite:
   3891     # Don't recurse and assign property as-is
-> 3892     plotly_obj[key] = val
   3893     continue
   3895 validator = plotly_obj._get_prop_validator(key)

File ~/Desktop/plotly.py/packages/python/plotly/plotly/basedatatypes.py:5894, in BaseLayoutType.__setitem__(self, prop, value)
   5891 match = self._subplot_re_match(prop)
   5892 if match is None:
   5893     # Set as ordinary property
-> 5894     super(BaseLayoutHierarchyType, self).__setitem__(prop, value)
   5895 else:
   5896     # Set as subplotid property
   5897     self._set_subplotid_prop(prop, value)

File ~/Desktop/plotly.py/packages/python/plotly/plotly/basedatatypes.py:4848, in BasePlotlyType.__setitem__(self, prop, value)
   4846 # ### Handle compound property ###
   4847 if isinstance(validator, CompoundValidator):
-> 4848     self._set_compound_prop(prop, value)
   4850 # ### Handle compound array property ###
   4851 elif isinstance(validator, (CompoundArrayValidator, BaseDataValidator)):

File ~/Desktop/plotly.py/packages/python/plotly/plotly/basedatatypes.py:5259, in BasePlotlyType._set_compound_prop(self, prop, val)
   5256 # Import value
   5257 # ------------
   5258 validator = self._get_validator(prop)
-> 5259 val = validator.validate_coerce(val, skip_invalid=self._skip_invalid)
   5261 # Save deep copies of current and new states
   5262 # ------------------------------------------
   5263 curr_val = self._compound_props.get(prop, None)

File ~/Desktop/plotly.py/packages/python/plotly/_plotly_utils/basevalidators.py:2805, in BaseTemplateValidator.validate_coerce(self, v, skip_invalid)
   2799 if v == {} or isinstance(v, self.data_class) and v.to_plotly_json() == {}:
   2800     # Replace empty template with {'data': {'scatter': [{}]}} so that we can
   2801     # tell the difference between an un-initialized template and a template
   2802     # explicitly set to empty.
   2803     return self.data_class(data_scatter=[{}])
-> 2805 return super(BaseTemplateValidator, self).validate_coerce(
   2806     v, skip_invalid=skip_invalid
   2807 )

File ~/Desktop/plotly.py/packages/python/plotly/_plotly_utils/basevalidators.py:2516, in CompoundValidator.validate_coerce(self, v, skip_invalid, _validate)
   2512     v = self.data_class(v, skip_invalid=skip_invalid, _validate=_validate)
   2514 elif isinstance(v, self.data_class):
   2515     # Copy object
-> 2516     v = self.data_class(v)
   2517 else:
   2518     if skip_invalid:

File ~/Desktop/plotly.py/packages/python/plotly/plotly/graph_objs/layout/_template.py:327, in Template.__init__(self, arg, data, layout, **kwargs)
    325 _v = data if data is not None else _v
    326 if _v is not None:
--> 327     self["data"] = _v
    328 _v = arg.pop("layout", None)
    329 _v = layout if layout is not None else _v

File ~/Desktop/plotly.py/packages/python/plotly/plotly/basedatatypes.py:4848, in BasePlotlyType.__setitem__(self, prop, value)
   4846 # ### Handle compound property ###
   4847 if isinstance(validator, CompoundValidator):
-> 4848     self._set_compound_prop(prop, value)
   4850 # ### Handle compound array property ###
   4851 elif isinstance(validator, (CompoundArrayValidator, BaseDataValidator)):

File ~/Desktop/plotly.py/packages/python/plotly/plotly/basedatatypes.py:5259, in BasePlotlyType._set_compound_prop(self, prop, val)
   5256 # Import value
   5257 # ------------
   5258 validator = self._get_validator(prop)
-> 5259 val = validator.validate_coerce(val, skip_invalid=self._skip_invalid)
   5261 # Save deep copies of current and new states
   5262 # ------------------------------------------
   5263 curr_val = self._compound_props.get(prop, None)

File ~/Desktop/plotly.py/packages/python/plotly/_plotly_utils/basevalidators.py:2512, in CompoundValidator.validate_coerce(self, v, skip_invalid, _validate)
   2509     v = self.data_class()
   2511 elif isinstance(v, dict):
-> 2512     v = self.data_class(v, skip_invalid=skip_invalid, _validate=_validate)
   2514 elif isinstance(v, self.data_class):
   2515     # Copy object
   2516     v = self.data_class(v)

File ~/Desktop/plotly.py/packages/python/plotly/plotly/graph_objs/layout/template/_data.py:1791, in Data.__init__(self, arg, barpolar, bar, box, candlestick, carpet, choroplethmapbox, choroplethmap, choropleth, cone, contourcarpet, contour, densitymapbox, densitymap, funnelarea, funnel, heatmap, histogram2dcontour, histogram2d, histogram, icicle, image, indicator, isosurface, mesh3d, ohlc, parcats, parcoords, pie, sankey, scatter3d, scattercarpet, scattergeo, scattergl, scattermapbox, scattermap, scatterpolargl, scatterpolar, scatter, scattersmith, scatterternary, splom, streamtube, sunburst, surface, table, treemap, violin, volume, waterfall, **kwargs)
   1787     self["waterfall"] = _v
   1789 # Process unknown kwargs
   1790 # ----------------------
-> 1791 self._process_kwargs(**dict(arg, **kwargs))
   1793 # Reset skip_invalid
   1794 # ------------------
   1795 self._skip_invalid = False

File ~/Desktop/plotly.py/packages/python/plotly/plotly/basedatatypes.py:4374, in BasePlotlyType._process_kwargs(self, **kwargs)
   4372     self[k] = v
   4373 elif not self._skip_invalid:
-> 4374     raise err

ValueError: Invalid property specified for object of type plotly.graph_objs.layout.template.Data: 'heatmapgl'

Did you mean "heatmap"?

    Valid properties:
        barpolar
            A tuple of :class:`plotly.graph_objects.Barpolar`
            instances or dicts with compatible properties
        bar
            A tuple of :class:`plotly.graph_objects.Bar` instances
            or dicts with compatible properties
        box
            A tuple of :class:`plotly.graph_objects.Box` instances
            or dicts with compatible properties
        candlestick
            A tuple of :class:`plotly.graph_objects.Candlestick`
            instances or dicts with compatible properties
        carpet
            A tuple of :class:`plotly.graph_objects.Carpet`
            instances or dicts with compatible properties
        choroplethmapbox
            A tuple of
            :class:`plotly.graph_objects.Choroplethmapbox`
            instances or dicts with compatible properties
        choroplethmap
            A tuple of :class:`plotly.graph_objects.Choroplethmap`
            instances or dicts with compatible properties
        choropleth
            A tuple of :class:`plotly.graph_objects.Choropleth`
            instances or dicts with compatible properties
        cone
            A tuple of :class:`plotly.graph_objects.Cone` instances
            or dicts with compatible properties
        contourcarpet
            A tuple of :class:`plotly.graph_objects.Contourcarpet`
            instances or dicts with compatible properties
        contour
            A tuple of :class:`plotly.graph_objects.Contour`
            instances or dicts with compatible properties
        densitymapbox
            A tuple of :class:`plotly.graph_objects.Densitymapbox`
            instances or dicts with compatible properties
        densitymap
            A tuple of :class:`plotly.graph_objects.Densitymap`
            instances or dicts with compatible properties
        funnelarea
            A tuple of :class:`plotly.graph_objects.Funnelarea`
            instances or dicts with compatible properties
        funnel
            A tuple of :class:`plotly.graph_objects.Funnel`
            instances or dicts with compatible properties
        heatmap
            A tuple of :class:`plotly.graph_objects.Heatmap`
            instances or dicts with compatible properties
        histogram2dcontour
            A tuple of
            :class:`plotly.graph_objects.Histogram2dContour`
            instances or dicts with compatible properties
        histogram2d
            A tuple of :class:`plotly.graph_objects.Histogram2d`
            instances or dicts with compatible properties
        histogram
            A tuple of :class:`plotly.graph_objects.Histogram`
            instances or dicts with compatible properties
        icicle
            A tuple of :class:`plotly.graph_objects.Icicle`
            instances or dicts with compatible properties
        image
            A tuple of :class:`plotly.graph_objects.Image`
            instances or dicts with compatible properties
        indicator
            A tuple of :class:`plotly.graph_objects.Indicator`
            instances or dicts with compatible properties
        isosurface
            A tuple of :class:`plotly.graph_objects.Isosurface`
            instances or dicts with compatible properties
        mesh3d
            A tuple of :class:`plotly.graph_objects.Mesh3d`
            instances or dicts with compatible properties
        ohlc
            A tuple of :class:`plotly.graph_objects.Ohlc` instances
            or dicts with compatible properties
        parcats
            A tuple of :class:`plotly.graph_objects.Parcats`
            instances or dicts with compatible properties
        parcoords
            A tuple of :class:`plotly.graph_objects.Parcoords`
            instances or dicts with compatible properties
        pie
            A tuple of :class:`plotly.graph_objects.Pie` instances
            or dicts with compatible properties
        sankey
            A tuple of :class:`plotly.graph_objects.Sankey`
            instances or dicts with compatible properties
        scatter3d
            A tuple of :class:`plotly.graph_objects.Scatter3d`
            instances or dicts with compatible properties
        scattercarpet
            A tuple of :class:`plotly.graph_objects.Scattercarpet`
            instances or dicts with compatible properties
        scattergeo
            A tuple of :class:`plotly.graph_objects.Scattergeo`
            instances or dicts with compatible properties
        scattergl
            A tuple of :class:`plotly.graph_objects.Scattergl`
            instances or dicts with compatible properties
        scattermapbox
            A tuple of :class:`plotly.graph_objects.Scattermapbox`
            instances or dicts with compatible properties
        scattermap
            A tuple of :class:`plotly.graph_objects.Scattermap`
            instances or dicts with compatible properties
        scatterpolargl
            A tuple of :class:`plotly.graph_objects.Scatterpolargl`
            instances or dicts with compatible properties
        scatterpolar
            A tuple of :class:`plotly.graph_objects.Scatterpolar`
            instances or dicts with compatible properties
        scatter
            A tuple of :class:`plotly.graph_objects.Scatter`
            instances or dicts with compatible properties
        scattersmith
            A tuple of :class:`plotly.graph_objects.Scattersmith`
            instances or dicts with compatible properties
        scatterternary
            A tuple of :class:`plotly.graph_objects.Scatterternary`
            instances or dicts with compatible properties
        splom
            A tuple of :class:`plotly.graph_objects.Splom`
            instances or dicts with compatible properties
        streamtube
            A tuple of :class:`plotly.graph_objects.Streamtube`
            instances or dicts with compatible properties
        sunburst
            A tuple of :class:`plotly.graph_objects.Sunburst`
            instances or dicts with compatible properties
        surface
            A tuple of :class:`plotly.graph_objects.Surface`
            instances or dicts with compatible properties
        table
            A tuple of :class:`plotly.graph_objects.Table`
            instances or dicts with compatible properties
        treemap
            A tuple of :class:`plotly.graph_objects.Treemap`
            instances or dicts with compatible properties
        violin
            A tuple of :class:`plotly.graph_objects.Violin`
            instances or dicts with compatible properties
        volume
            A tuple of :class:`plotly.graph_objects.Volume`
            instances or dicts with compatible properties
        waterfall
            A tuple of :class:`plotly.graph_objects.Waterfall`
            instances or dicts with compatible properties
        
Did you mean "heatmap"?

Bad property path:
heatmapgl
^^^^^^^^^
@LiamConnors LiamConnors changed the title Remove Remove heatmapgl in Plotly.py Oct 10, 2024
@gvwilson gvwilson added bug something broken P1 needed for current cycle labels Oct 10, 2024
@archmoj archmoj changed the title Remove heatmapgl in Plotly.py Remove heatmapgl and pointcloud traces in Plotly.py Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P1 needed for current cycle
Projects
None yet
3 participants