Skip to content

Commit b54e422

Browse files
committed
Merge pull request plotly#515 from plotly/no-graph-config-dflts
Remove graph config innards from defaultProps
1 parent c70172d commit b54e422

21 files changed

+51566
-36468
lines changed

packages/dash-core-components/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1414
### Fixed
1515
- Fix unnecessary `loading_state` prop for `Input` component. [#498](https://github.com/plotly/dash-core-components/issues/498)
1616
- Ensure `DatePickerSingle` callbacks fire with cleared dates. [#511](https://github.com/plotly/dash-core-components/pull/511)
17+
- Fixes incorrect default values for `config` prop of `Graph`. [#515](https://github.com/plotly/dash-core-components/pull/515)
1718

1819
## [0.45.0] - 2019-03-25
1920
### Added

packages/dash-core-components/R/dccDatePickerRange.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# AUTO GENERATED FILE - DO NOT EDIT
22

3-
dccDatePickerRange <- function(id=NULL, start_date=NULL, end_date=NULL, min_date_allowed=NULL, max_date_allowed=NULL, initial_visible_month=NULL, start_date_placeholder_text=NULL, end_date_placeholder_text=NULL, day_size=NULL, calendar_orientation=NULL, is_RTL=NULL, reopen_calendar_on_clear=NULL, number_of_months_shown=NULL, with_portal=NULL, with_full_screen_portal=NULL, first_day_of_week=NULL, minimum_nights=NULL, stay_open_on_select=NULL, show_outside_days=NULL, month_format=NULL, display_format=NULL, disabled=NULL, clearable=NULL, style=NULL, className=NULL, updatemode=NULL, loading_state=NULL) {
3+
dccDatePickerRange <- function(id=NULL, start_date=NULL, start_date_id=NULL, end_date_id=NULL, end_date=NULL, min_date_allowed=NULL, max_date_allowed=NULL, initial_visible_month=NULL, start_date_placeholder_text=NULL, end_date_placeholder_text=NULL, day_size=NULL, calendar_orientation=NULL, is_RTL=NULL, reopen_calendar_on_clear=NULL, number_of_months_shown=NULL, with_portal=NULL, with_full_screen_portal=NULL, first_day_of_week=NULL, minimum_nights=NULL, stay_open_on_select=NULL, show_outside_days=NULL, month_format=NULL, display_format=NULL, disabled=NULL, clearable=NULL, style=NULL, className=NULL, updatemode=NULL, loading_state=NULL) {
44

55
component <- list(
6-
props = list(id=id, start_date=start_date, end_date=end_date, min_date_allowed=min_date_allowed, max_date_allowed=max_date_allowed, initial_visible_month=initial_visible_month, start_date_placeholder_text=start_date_placeholder_text, end_date_placeholder_text=end_date_placeholder_text, day_size=day_size, calendar_orientation=calendar_orientation, is_RTL=is_RTL, reopen_calendar_on_clear=reopen_calendar_on_clear, number_of_months_shown=number_of_months_shown, with_portal=with_portal, with_full_screen_portal=with_full_screen_portal, first_day_of_week=first_day_of_week, minimum_nights=minimum_nights, stay_open_on_select=stay_open_on_select, show_outside_days=show_outside_days, month_format=month_format, display_format=display_format, disabled=disabled, clearable=clearable, style=style, className=className, updatemode=updatemode, loading_state=loading_state),
6+
props = list(id=id, start_date=start_date, start_date_id=start_date_id, end_date_id=end_date_id, end_date=end_date, min_date_allowed=min_date_allowed, max_date_allowed=max_date_allowed, initial_visible_month=initial_visible_month, start_date_placeholder_text=start_date_placeholder_text, end_date_placeholder_text=end_date_placeholder_text, day_size=day_size, calendar_orientation=calendar_orientation, is_RTL=is_RTL, reopen_calendar_on_clear=reopen_calendar_on_clear, number_of_months_shown=number_of_months_shown, with_portal=with_portal, with_full_screen_portal=with_full_screen_portal, first_day_of_week=first_day_of_week, minimum_nights=minimum_nights, stay_open_on_select=stay_open_on_select, show_outside_days=show_outside_days, month_format=month_format, display_format=display_format, disabled=disabled, clearable=clearable, style=style, className=className, updatemode=updatemode, loading_state=loading_state),
77
type = 'DatePickerRange',
88
namespace = 'dash_core_components',
9-
propNames = c('id', 'start_date', 'end_date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'start_date_placeholder_text', 'end_date_placeholder_text', 'day_size', 'calendar_orientation', 'is_RTL', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'minimum_nights', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable', 'style', 'className', 'updatemode', 'loading_state'),
9+
propNames = c('id', 'start_date', 'start_date_id', 'end_date_id', 'end_date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'start_date_placeholder_text', 'end_date_placeholder_text', 'day_size', 'calendar_orientation', 'is_RTL', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'minimum_nights', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable', 'style', 'className', 'updatemode', 'loading_state'),
1010
package = 'dashCoreComponents'
1111
)
1212

packages/dash-core-components/R/dccGraph.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# AUTO GENERATED FILE - DO NOT EDIT
22

3-
dccGraph <- function(id=NULL, clickData=NULL, clickAnnotationData=NULL, hoverData=NULL, clear_on_unhover=NULL, selectedData=NULL, relayoutData=NULL, restyleData=NULL, figure=NULL, style=NULL, className=NULL, animate=NULL, animation_options=NULL, config=NULL, loading_state=NULL) {
3+
dccGraph <- function(id=NULL, clickData=NULL, clickAnnotationData=NULL, hoverData=NULL, clear_on_unhover=NULL, selectedData=NULL, relayoutData=NULL, extendData=NULL, restyleData=NULL, figure=NULL, style=NULL, className=NULL, animate=NULL, animation_options=NULL, config=NULL, loading_state=NULL) {
44

55
component <- list(
6-
props = list(id=id, clickData=clickData, clickAnnotationData=clickAnnotationData, hoverData=hoverData, clear_on_unhover=clear_on_unhover, selectedData=selectedData, relayoutData=relayoutData, restyleData=restyleData, figure=figure, style=style, className=className, animate=animate, animation_options=animation_options, config=config, loading_state=loading_state),
6+
props = list(id=id, clickData=clickData, clickAnnotationData=clickAnnotationData, hoverData=hoverData, clear_on_unhover=clear_on_unhover, selectedData=selectedData, relayoutData=relayoutData, extendData=extendData, restyleData=restyleData, figure=figure, style=style, className=className, animate=animate, animation_options=animation_options, config=config, loading_state=loading_state),
77
type = 'Graph',
88
namespace = 'dash_core_components',
9-
propNames = c('id', 'clickData', 'clickAnnotationData', 'hoverData', 'clear_on_unhover', 'selectedData', 'relayoutData', 'restyleData', 'figure', 'style', 'className', 'animate', 'animation_options', 'config', 'loading_state'),
9+
propNames = c('id', 'clickData', 'clickAnnotationData', 'hoverData', 'clear_on_unhover', 'selectedData', 'relayoutData', 'extendData', 'restyleData', 'figure', 'style', 'className', 'animate', 'animation_options', 'config', 'loading_state'),
1010
package = 'dashCoreComponents'
1111
)
1212

packages/dash-core-components/dash_core_components/DatePickerRange.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class DatePickerRange(Component):
2020
- start_date (string; optional): Specifies the starting date for the component.
2121
Accepts datetime.datetime objects or strings
2222
in the format 'YYYY-MM-DD'
23+
- start_date_id (string; optional)
24+
- end_date_id (string; optional)
2325
- end_date (string; optional): Specifies the ending date for the component.
2426
Accepts datetime.datetime objects or strings
2527
in the format 'YYYY-MM-DD'
@@ -86,12 +88,12 @@ class DatePickerRange(Component):
8688
- prop_name (string; optional): Holds which property is loading
8789
- component_name (string; optional): Holds the name of the component that is loading"""
8890
@_explicitize_args
89-
def __init__(self, id=Component.UNDEFINED, start_date=Component.UNDEFINED, end_date=Component.UNDEFINED, min_date_allowed=Component.UNDEFINED, max_date_allowed=Component.UNDEFINED, initial_visible_month=Component.UNDEFINED, start_date_placeholder_text=Component.UNDEFINED, end_date_placeholder_text=Component.UNDEFINED, day_size=Component.UNDEFINED, calendar_orientation=Component.UNDEFINED, is_RTL=Component.UNDEFINED, reopen_calendar_on_clear=Component.UNDEFINED, number_of_months_shown=Component.UNDEFINED, with_portal=Component.UNDEFINED, with_full_screen_portal=Component.UNDEFINED, first_day_of_week=Component.UNDEFINED, minimum_nights=Component.UNDEFINED, stay_open_on_select=Component.UNDEFINED, show_outside_days=Component.UNDEFINED, month_format=Component.UNDEFINED, display_format=Component.UNDEFINED, disabled=Component.UNDEFINED, clearable=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, updatemode=Component.UNDEFINED, loading_state=Component.UNDEFINED, **kwargs):
90-
self._prop_names = ['id', 'start_date', 'end_date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'start_date_placeholder_text', 'end_date_placeholder_text', 'day_size', 'calendar_orientation', 'is_RTL', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'minimum_nights', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable', 'style', 'className', 'updatemode', 'loading_state']
91+
def __init__(self, id=Component.UNDEFINED, start_date=Component.UNDEFINED, start_date_id=Component.UNDEFINED, end_date_id=Component.UNDEFINED, end_date=Component.UNDEFINED, min_date_allowed=Component.UNDEFINED, max_date_allowed=Component.UNDEFINED, initial_visible_month=Component.UNDEFINED, start_date_placeholder_text=Component.UNDEFINED, end_date_placeholder_text=Component.UNDEFINED, day_size=Component.UNDEFINED, calendar_orientation=Component.UNDEFINED, is_RTL=Component.UNDEFINED, reopen_calendar_on_clear=Component.UNDEFINED, number_of_months_shown=Component.UNDEFINED, with_portal=Component.UNDEFINED, with_full_screen_portal=Component.UNDEFINED, first_day_of_week=Component.UNDEFINED, minimum_nights=Component.UNDEFINED, stay_open_on_select=Component.UNDEFINED, show_outside_days=Component.UNDEFINED, month_format=Component.UNDEFINED, display_format=Component.UNDEFINED, disabled=Component.UNDEFINED, clearable=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, updatemode=Component.UNDEFINED, loading_state=Component.UNDEFINED, **kwargs):
92+
self._prop_names = ['id', 'start_date', 'start_date_id', 'end_date_id', 'end_date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'start_date_placeholder_text', 'end_date_placeholder_text', 'day_size', 'calendar_orientation', 'is_RTL', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'minimum_nights', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable', 'style', 'className', 'updatemode', 'loading_state']
9193
self._type = 'DatePickerRange'
9294
self._namespace = 'dash_core_components'
9395
self._valid_wildcard_attributes = []
94-
self.available_properties = ['id', 'start_date', 'end_date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'start_date_placeholder_text', 'end_date_placeholder_text', 'day_size', 'calendar_orientation', 'is_RTL', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'minimum_nights', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable', 'style', 'className', 'updatemode', 'loading_state']
96+
self.available_properties = ['id', 'start_date', 'start_date_id', 'end_date_id', 'end_date', 'min_date_allowed', 'max_date_allowed', 'initial_visible_month', 'start_date_placeholder_text', 'end_date_placeholder_text', 'day_size', 'calendar_orientation', 'is_RTL', 'reopen_calendar_on_clear', 'number_of_months_shown', 'with_portal', 'with_full_screen_portal', 'first_day_of_week', 'minimum_nights', 'stay_open_on_select', 'show_outside_days', 'month_format', 'display_format', 'disabled', 'clearable', 'style', 'className', 'updatemode', 'loading_state']
9597
self.available_wildcard_properties = []
9698

9799
_explicit_args = kwargs.pop('_explicit_args')

packages/dash-core-components/dash_core_components/Graph.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ class Graph(Component):
5151
Only applies if `animate` is `true`
5252
- config (optional): Plotly.js config options.
5353
See https://plot.ly/javascript/configuration-options/
54-
for more info.. config has the following type: dict containing keys 'staticPlot', 'editable', 'edits', 'autosizable', 'queueLength', 'fillFrame', 'frameMargins', 'scrollZoom', 'doubleClick', 'showTips', 'showAxisDragHandles', 'showAxisRangeEntryBoxes', 'showLink', 'sendData', 'linkText', 'displayModeBar', 'modeBarButtonsToRemove', 'modeBarButtonsToAdd', 'modeBarButtons', 'displaylogo', 'plotGlPixelRatio', 'topojsonURL', 'mapboxAccessToken'.
54+
for more info.. config has the following type: dict containing keys 'staticPlot', 'plotlyServerURL', 'editable', 'edits', 'autosizable', 'responsive', 'queueLength', 'fillFrame', 'frameMargins', 'scrollZoom', 'doubleClick', 'showTips', 'showAxisDragHandles', 'showAxisRangeEntryBoxes', 'showLink', 'sendData', 'linkText', 'displayModeBar', 'showSendToCloud', 'modeBarButtonsToRemove', 'modeBarButtonsToAdd', 'modeBarButtons', 'toImageButtonOptions', 'displaylogo', 'watermark', 'plotGlPixelRatio', 'topojsonURL', 'mapboxAccessToken', 'locale', 'locales'.
5555
Those keys have the following types:
5656
- staticPlot (boolean; optional): no interactivity, for export or image generation
57+
- plotlyServerURL (string; optional): base URL for a Plotly cloud instance, if `showSendToCloud` is enabled
5758
- editable (boolean; optional): we can edit titles, move annotations, etc - sets all pieces of `edits`
5859
unless a separate `edits` config item overrides individual parts
5960
- edits (optional): a set of editable properties. edits has the following type: dict containing keys 'annotationPosition', 'annotationTail', 'annotationText', 'axisTitleText', 'colorbarPosition', 'colorbarTitleText', 'legendPosition', 'legendText', 'shapePosition', 'titleText'.
@@ -72,6 +73,7 @@ class Graph(Component):
7273
- titleText (boolean; optional): the global `layout.title`
7374
- autosizable (boolean; optional): DO autosize once regardless of layout.autosize
7475
(use default width or height values otherwise)
76+
- responsive (boolean; optional): Whether to change layout size when the window size changes
7577
- queueLength (number; optional): set the length of the undo/redo queue
7678
- fillFrame (boolean; optional): if we DO autosize, do we fill the container or the screen?
7779
- frameMargins (number; optional): if we DO autosize, set the frame margins in percents of plot size
@@ -85,6 +87,9 @@ class Graph(Component):
8587
- sendData (boolean; optional): if we show a link, does it contain data or just link to a plotly file?
8688
- linkText (string; optional): text appearing in the sendData link
8789
- displayModeBar (a value equal to: true, false, 'hover'; optional): display the mode bar (true, false, or 'hover')
90+
- showSendToCloud (boolean; optional): should we include a modebar button to send this data to a
91+
Plotly Cloud instance, linked by `plotlyServerURL`.
92+
By default this is false.
8893
- modeBarButtonsToRemove (list; optional): remove mode bar button by name.
8994
All modebar button names at https://github.com/plotly/plotly.js/blob/master/src/components/modebar/buttons.js
9095
Common names include:
@@ -98,12 +103,26 @@ class Graph(Component):
98103
- modeBarButtons (boolean | number | string | dict | list; optional): fully custom mode bar buttons as nested array,
99104
where the outer arrays represents button groups, and
100105
the inner arrays have buttons config objects or names of default buttons
106+
- toImageButtonOptions (optional): . toImageButtonOptions has the following type: dict containing keys 'format', 'filename', 'width', 'height', 'scale'.
107+
Those keys have the following types:
108+
- format (a value equal to: 'jpeg', 'png', 'webp', 'svg'; optional): The file format to create
109+
- filename (string; optional): The name given to the downloaded file
110+
- width (number; optional): Width of the downloaded file, in px
111+
- height (number; optional): Height of the downloaded file, in px
112+
- scale (number; optional): Extra resolution to give the file after
113+
rendering it with the given width and height
101114
- displaylogo (boolean; optional): add the plotly logo on the end of the mode bar
115+
- watermark (boolean; optional): add the plotly logo even with no modebar
102116
- plotGlPixelRatio (number; optional): increase the pixel ratio for Gl plot images
103117
- topojsonURL (string; optional): URL to topojson files used in geo charts
104118
- mapboxAccessToken (boolean | number | string | dict | list; optional): Mapbox access token (required to plot mapbox trace types)
105119
If using an Mapbox Atlas server, set this option to '',
106120
so that plotly.js won't attempt to authenticate to the public Mapbox server.
121+
- locale (string; optional): The locale to use. Locales may be provided with the plot
122+
(`locales` below) or by loading them on the page, see:
123+
https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization
124+
- locales (dict; optional): Localization definitions, if you choose to provide them with the
125+
plot rather than registering them globally.
107126
- loading_state (optional): Object that holds the loading state object coming from dash-renderer. loading_state has the following type: dict containing keys 'is_loading', 'prop_name', 'component_name'.
108127
Those keys have the following types:
109128
- is_loading (boolean; optional): Determines if the component is loading or not

0 commit comments

Comments
 (0)