Skip to content

Commit

Permalink
feat: added support to configure the default explorer viz (#13610)
Browse files Browse the repository at this point in the history
* added support to configure the default explorer viz

* code review fix

* lint

Co-authored-by: cccs-jc <cccs-jc@cyber.gc.ca>
Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
  • Loading branch information
3 people authored Mar 26, 2021
1 parent 55ba47e commit 24f805e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion superset-frontend/src/explore/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export function getControlsState(state, inputFormData) {
* */
// Getting a list of active control names for the current viz
const formData = { ...inputFormData };
const vizType = formData.viz_type || 'table';
const vizType =
formData.viz_type || state.common.conf.DEFAULT_VIZ_TYPE || 'table';

handleDeprecatedControls(formData);

Expand Down
3 changes: 3 additions & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ def _try_json_readsha( # pylint: disable=unused-argument
VERSION_SHA_LENGTH = 8
VERSION_SHA = _try_json_readsha(VERSION_INFO_FILE, VERSION_SHA_LENGTH)

# default viz used in chart explorer
DEFAULT_VIZ_TYPE = "table"

ROW_LIMIT = 50000
VIZ_ROW_LIMIT = 10000
# max rows retreieved when requesting samples from datasource in explore view
Expand Down
1 change: 1 addition & 0 deletions superset/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"DISABLE_DATASET_SOURCE_EDIT",
"ENABLE_JAVASCRIPT_CONTROLS",
"DEFAULT_SQLLAB_LIMIT",
"DEFAULT_VIZ_TYPE",
"SQL_MAX_ROW",
"SUPERSET_WEBSERVER_DOMAINS",
"SQLLAB_SAVE_WARNING_MESSAGE",
Expand Down

0 comments on commit 24f805e

Please sign in to comment.