Commit b31ae3d
committed
Don't leave empty dict containers behind when nested properties are set to None
Setting a nested property such as marker.colorbar.thicknessmode to None
left a residual empty {} container in the figure's props, which was then
emitted in the figure JSON. For splom traces this residual
marker.colorbar {} made a later Plotly.restyle of colorbar attributes
misconvert the colorbar thickness and collapse the scatter-matrix layout.
_set_in now treats removal of a non-existent path as a no-op and prunes
emptied dict parents, and property assignment to None prunes emptied
compound-child dicts (lists are preserved as positional placeholders).
Fixes #56151 parent 5cdb606 commit b31ae3d
3 files changed
Lines changed: 83 additions & 0 deletions
File tree
- plotly
- tests/test_core/test_figure_messages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1904 | 1904 | | |
1905 | 1905 | | |
1906 | 1906 | | |
| 1907 | + | |
1907 | 1908 | | |
1908 | 1909 | | |
1909 | 1910 | | |
1910 | 1911 | | |
1911 | 1912 | | |
1912 | 1913 | | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
1913 | 1917 | | |
1914 | 1918 | | |
1915 | 1919 | | |
1916 | 1920 | | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
1917 | 1924 | | |
1918 | 1925 | | |
1919 | 1926 | | |
1920 | 1927 | | |
1921 | 1928 | | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
1922 | 1933 | | |
1923 | 1934 | | |
1924 | 1935 | | |
| |||
1945 | 1956 | | |
1946 | 1957 | | |
1947 | 1958 | | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
1948 | 1969 | | |
1949 | 1970 | | |
1950 | 1971 | | |
| |||
4607 | 4628 | | |
4608 | 4629 | | |
4609 | 4630 | | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
| 4634 | + | |
| 4635 | + | |
| 4636 | + | |
| 4637 | + | |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
4610 | 4653 | | |
4611 | 4654 | | |
4612 | 4655 | | |
| |||
5287 | 5330 | | |
5288 | 5331 | | |
5289 | 5332 | | |
| 5333 | + | |
| 5334 | + | |
| 5335 | + | |
| 5336 | + | |
| 5337 | + | |
| 5338 | + | |
| 5339 | + | |
| 5340 | + | |
5290 | 5341 | | |
5291 | 5342 | | |
5292 | 5343 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
0 commit comments