| 104 | |
| 105 | |
| 106 | def _get_jconfig(config=None): |
| 107 | configkeys = ( |
| 108 | "staticPlot", |
| 109 | "typesetMath", |
| 110 | "plotlyServerURL", |
| 111 | "editable", |
| 112 | "edits", |
| 113 | "editSelection", |
| 114 | "autosizable", |
| 115 | "responsive", |
| 116 | "fillFrame", |
| 117 | "frameMargins", |
| 118 | "scrollZoom", |
| 119 | "doubleClick", |
| 120 | "doubleClickDelay", |
| 121 | "showAxisDragHandles", |
| 122 | "showAxisRangeEntryBoxes", |
| 123 | "showTips", |
| 124 | "displayNotifier", |
| 125 | "showLink", |
| 126 | "linkText", |
| 127 | "sendData", |
| 128 | "showSources", |
| 129 | "displayModeBar", |
| 130 | "showSendToCloud", |
| 131 | "showEditInChartStudio", |
| 132 | "modeBarButtonsToRemove", |
| 133 | "modeBarButtonsToAdd", |
| 134 | "modeBarButtons", |
| 135 | "toImageButtonOptions", |
| 136 | "displaylogo", |
| 137 | "watermark", |
| 138 | "plotGlPixelRatio", |
| 139 | "setBackground", |
| 140 | "topojsonURL", |
| 141 | "mapboxAccessToken", |
| 142 | "logging", |
| 143 | "notifyOnLogging", |
| 144 | "queueLength", |
| 145 | "locale", |
| 146 | "locales", |
| 147 | ) |
| 148 | |
| 149 | if config and isinstance(config, dict): |
| 150 | # Warn user on unrecognized config options. We make this a warning |
| 151 | # rather than an error since we don't have code generation logic in |
| 152 | # place yet to guarantee that the config options in plotly.py are up |
| 153 | # to date |
| 154 | bad_config = [k for k in config if k not in configkeys] |
| 155 | if bad_config: |
| 156 | warnings.warn( |
| 157 | """ |
| 158 | Unrecognized config options supplied: {bad_config}""".format(bad_config=bad_config) |
| 159 | ) |
| 160 | |
| 161 | clean_config = config |
| 162 | else: |
| 163 | clean_config = {} |