Skip to content

Drop pointcloud and heatmapgl from plotly.py API and update plotly.js bundle from master #4815

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

Merged
merged 5 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/apidoc/plotly.graph_objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Simple Traces
Bar
Pie
Heatmap
Heatmapgl
Image
Contour
Table
Expand Down
12 changes: 6 additions & 6 deletions doc/python/3d-bubble-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ fig = go.Figure(data=go.Scatter3d(
))

fig.update_layout(width=800, height=800, title = 'Planets!',
scene = dict(xaxis=dict(title='Distance from Sun', titlefont_color='white'),
yaxis=dict(title='Density', titlefont_color='white'),
zaxis=dict(title='Gravity', titlefont_color='white'),
scene = dict(xaxis=dict(title='Distance from Sun', title_font_color='white'),
yaxis=dict(title='Density', title_font_color='white'),
zaxis=dict(title='Gravity', title_font_color='white'),
bgcolor = 'rgb(20, 24, 54)'
))

Expand Down Expand Up @@ -155,9 +155,9 @@ fig = go.Figure(go.Scatter3d(
))

fig.update_layout(width=800, height=800, title = 'Planets!',
scene = dict(xaxis=dict(title='Distance from Sun', titlefont_color='white'),
yaxis=dict(title='Density', titlefont_color='white'),
zaxis=dict(title='Gravity', titlefont_color='white'),
scene = dict(xaxis=dict(title='Distance from Sun', title_font_color='white'),
yaxis=dict(title='Density', title_font_color='white'),
zaxis=dict(title='Gravity', title_font_color='white'),
bgcolor = 'rgb(20, 24, 54)'
))

Expand Down
2 changes: 1 addition & 1 deletion doc/python/bar-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ fig.update_layout(
xaxis_tickfont_size=14,
yaxis=dict(
title='USD (millions)',
titlefont_size=16,
title_font_size=16,
tickfont_size=14,
),
legend=dict(
Expand Down
2 changes: 1 addition & 1 deletion doc/python/contour-plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ fig = go.Figure(data=
colorbar=dict(
title='Color bar title', # title here
titleside='right',
titlefont=dict(
title_font=dict(
size=14,
family='Arial, sans-serif')
)))
Expand Down
8 changes: 4 additions & 4 deletions doc/python/multiple-axes.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ fig.update_layout(
),
yaxis=dict(
title="yaxis title",
titlefont=dict(
title_font=dict(
color="#1f77b4"
),
tickfont=dict(
Expand All @@ -202,7 +202,7 @@ fig.update_layout(
),
yaxis2=dict(
title="yaxis2 title",
titlefont=dict(
title_font=dict(
color="#ff7f0e"
),
tickfont=dict(
Expand All @@ -215,7 +215,7 @@ fig.update_layout(
),
yaxis3=dict(
title="yaxis3 title",
titlefont=dict(
title_font=dict(
color="#d62728"
),
tickfont=dict(
Expand All @@ -227,7 +227,7 @@ fig.update_layout(
),
yaxis4=dict(
title="yaxis4 title",
titlefont=dict(
title_font=dict(
color="#9467bd"
),
tickfont=dict(
Expand Down
2 changes: 1 addition & 1 deletion doc/python/network-graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ node_trace.text = node_text
fig = go.Figure(data=[edge_trace, node_trace],
layout=go.Layout(
title='<br>Network graph made with Python',
titlefont_size=16,
title_font_size=16,
showlegend=False,
hovermode='closest',
margin=dict(b=20,l=5,r=5,t=40),
Expand Down
10 changes: 5 additions & 5 deletions doc/python/range-slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ fig.update_layout(
tickfont={"color": "#673ab7"},
tickmode="auto",
ticks="",
titlefont={"color": "#673ab7"},
title_font={"color": "#673ab7"},
type="linear",
zeroline=False
),
Expand All @@ -268,7 +268,7 @@ fig.update_layout(
tickfont={"color": "#E91E63"},
tickmode="auto",
ticks="",
titlefont={"color": "#E91E63"},
title_font={"color": "#E91E63"},
type="linear",
zeroline=False
),
Expand All @@ -285,7 +285,7 @@ fig.update_layout(
tickmode="auto",
ticks="",
title="mg/L",
titlefont={"color": "#795548"},
title_font={"color": "#795548"},
type="linear",
zeroline=False
),
Expand All @@ -302,7 +302,7 @@ fig.update_layout(
tickmode="auto",
ticks="",
title="mmol/L",
titlefont={"color": "#607d8b"},
title_font={"color": "#607d8b"},
type="linear",
zeroline=False
),
Expand All @@ -319,7 +319,7 @@ fig.update_layout(
tickmode="auto",
ticks="",
title="mg/Kg",
titlefont={"color": "#2196F3"},
title_font={"color": "#2196F3"},
type="linear",
zeroline=False
)
Expand Down
6 changes: 3 additions & 3 deletions doc/python/setting-graph-size.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fig.update_layout(
ticktext=["Very long label", "long label", "3", "label"],
tickvals=[1, 2, 3, 4],
tickmode="array",
titlefont=dict(size=30),
title_font=dict(size=30),
)
)

Expand Down Expand Up @@ -157,7 +157,7 @@ fig.update_layout(
ticktext=["Very long label", "long label", "3", "label"],
tickvals=[1, 2, 3, 4],
tickmode="array",
titlefont=dict(size=30),
title_font=dict(size=30),
)
)

Expand Down Expand Up @@ -194,7 +194,7 @@ fig.update_layout(
ticktext=["Label", "Very long label", "Other label", "Very very long label"],
tickvals=[1, 2, 3, 4],
tickmode="array",
titlefont=dict(size=30),
title_font=dict(size=30),
)
)

Expand Down
2 changes: 1 addition & 1 deletion doc/python/ternary-plots.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ rawData = [
def makeAxis(title, tickangle):
return {
'title': title,
'titlefont': { 'size': 20 },
'title_font': { 'size': 20 },
'tickangle': tickangle,
'tickfont': { 'size': 15 },
'tickcolor': 'rgba(0,0,0,0)',
Expand Down
8 changes: 4 additions & 4 deletions doc/unconverted/python/cars-exploration.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,19 @@ fig.layout.title = 'Torque and Fuel Efficience'
Check default font size

```python
fig.layout.titlefont.size
fig.layout.title_font.size
```

Increase the title font size

```python
fig.layout.titlefont.size = 22
fig.layout.title_font.size = 22
```

Set `fig.layout.titlefont.family` to `'Rockwell'`
Set `fig.layout.title_font.family` to `'Rockwell'`

```python
fig.layout.titlefont.family = 'Rockwell'
fig.layout.title_font.family = 'Rockwell'
```

### Create New View for Figure
Expand Down
4 changes: 2 additions & 2 deletions packages/python/plotly/codegen/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1277,15 +1277,15 @@ class MappedPropNode(PlotlyNode):
def __init__(self, mapped_prop_node, parent, prop_name, plotly_schema):
"""
Create node that represents a legacy title property.
e.g. layout.titlefont. These properties are now subproperties under
e.g. layout.title_font. These properties are now subproperties under
the sibling `title` property. e.g. layout.title.font.

Parameters
----------
title_node: PlotlyNode
prop_name: str
The name of the propery (without the title prefix)
e.g. 'font' to represent the layout.titlefont property.
e.g. 'font' to represent the layout.title_font property.
"""
node_path = parent.node_path + (prop_name,)
super().__init__(plotly_schema, node_path=node_path, parent=parent)
Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/codegen/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def write_validator_py(outdir, node: PlotlyNode):
"""
if node.is_mapped:
# No validator written for mapped nodes
# e.g. no validator for layout.titlefont since ths is mapped to
# e.g. no validator for layout.title_font since ths is mapped to
# layout.title.font
return

Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/plotly/basedatatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4251,7 +4251,7 @@ class BasePlotlyType(object):
"""

# ### Mapped (deprecated) properties ###
# dict for deprecated property name (e.g. 'titlefont') to tuple
# dict for deprecated property name (e.g. 'title_font') to tuple
# of relative path to new property (e.g. ('title', 'font')
_mapped_properties = {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ def grouptitlefont(self):
Sets the font for group titles in hover (unified modes).
Defaults to `hoverlabel.font`.

The 'grouptitlefont' property is an instance of Grouptitlefont
The 'grouptitlefont' property is an instance of Grouptitle_font
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.hoverlabel.Grouptitlefont`
- An instance of :class:`plotly.graph_objs.layout.hoverlabel.Grouptitle_font`
- A dict of string/value properties that will be passed
to the Grouptitlefont constructor
to the Grouptitle_font constructor

Supported dict properties:

Expand Down Expand Up @@ -290,7 +290,7 @@ def grouptitlefont(self):

Returns
-------
plotly.graph_objs.layout.hoverlabel.Grouptitlefont
plotly.graph_objs.layout.hoverlabel.Grouptitle_font
"""
return self["grouptitlefont"]

Expand Down
8 changes: 4 additions & 4 deletions packages/python/plotly/plotly/graph_objs/layout/_legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ def grouptitlefont(self):
Sets the font for group titles in legend. Defaults to
`legend.font` with its size increased about 10%.

The 'grouptitlefont' property is an instance of Grouptitlefont
The 'grouptitlefont' property is an instance of Grouptitle_font
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.legend.Grouptitlefont`
- An instance of :class:`plotly.graph_objs.layout.legend.Grouptitle_font`
- A dict of string/value properties that will be passed
to the Grouptitlefont constructor
to the Grouptitle_font constructor

Supported dict properties:

Expand Down Expand Up @@ -375,7 +375,7 @@ def grouptitlefont(self):

Returns
-------
plotly.graph_objs.layout.legend.Grouptitlefont
plotly.graph_objs.layout.legend.Grouptitle_font
"""
return self["grouptitlefont"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._font import Font
from ._grouptitlefont import Grouptitlefont
from ._grouptitlefont import Grouptitle_font
else:
from _plotly_utils.importers import relative_import

__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._font.Font", "._grouptitlefont.Grouptitlefont"]
__name__, [], ["._font.Font", "._grouptitlefont.Grouptitle_font"]
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import copy as _copy


class Grouptitlefont(_BaseLayoutHierarchyType):
class Grouptitle_font(_BaseLayoutHierarchyType):

# class properties
# --------------------
Expand Down Expand Up @@ -324,7 +324,7 @@ def __init__(
**kwargs,
):
"""
Construct a new Grouptitlefont object
Construct a new Grouptitle_font object

Sets the font for group titles in hover (unified modes).
Defaults to `hoverlabel.font`.
Expand All @@ -334,7 +334,7 @@ def __init__(
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.layout.hoverla
bel.Grouptitlefont`
bel.Grouptitle_font`
color

family
Expand Down Expand Up @@ -376,9 +376,9 @@ def __init__(

Returns
-------
Grouptitlefont
Grouptitle_font
"""
super(Grouptitlefont, self).__init__("grouptitlefont")
super(Grouptitle_font, self).__init__("grouptitlefont")

if "_parent" in kwargs:
self._parent = kwargs["_parent"]
Expand All @@ -395,9 +395,9 @@ def __init__(
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.layout.hoverlabel.Grouptitlefont
The first argument to the plotly.graph_objs.layout.hoverlabel.Grouptitle_font
constructor must be a dict or
an instance of :class:`plotly.graph_objs.layout.hoverlabel.Grouptitlefont`"""
an instance of :class:`plotly.graph_objs.layout.hoverlabel.Grouptitle_font`"""
)

# Handle skip_invalid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._font import Font
from ._grouptitlefont import Grouptitlefont
from ._grouptitlefont import Grouptitle_font
from ._title import Title
from . import title
else:
Expand All @@ -12,5 +12,5 @@
__all__, __getattr__, __dir__ = relative_import(
__name__,
[".title"],
["._font.Font", "._grouptitlefont.Grouptitlefont", "._title.Title"],
["._font.Font", "._grouptitlefont.Grouptitle_font", "._title.Title"],
)
Loading