Skip to content
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

Added setting to hide Plotly mode bar #4644

Open
wants to merge 1 commit into
base: master
from
Open
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -168,6 +168,14 @@ class OrganizationSettings extends React.Component {
))}
</Select>
</Form.Item>
<Form.Item label="Chart Visualization">
<Checkbox
name="hide_plotly_mode_bar"
checked={formValues.hide_plotly_mode_bar}
onChange={e => this.handleChange("hide_plotly_mode_bar", e.target.checked)}>
Hide Plotly mode bar
</Checkbox>
</Form.Item>
<Form.Item label="Feature Flags">
<Checkbox
name="feature_show_permissions_control"
@@ -3,7 +3,7 @@ import React, { useState, useEffect, useContext } from "react";
import { ErrorBoundaryContext } from "@/components/ErrorBoundary";
import { RendererPropTypes } from "@/visualizations/prop-types";
import resizeObserver from "@/services/resizeObserver";

import { clientConfig } from "@/services/auth";
import getChartData from "../getChartData";
import { Plotly, prepareData, prepareLayout, updateData, applyLayoutFixes } from "../plotly";

@@ -24,7 +24,11 @@ export default function PlotlyChart({ options, data }) {
useEffect(
catchErrors(() => {
if (container) {
const plotlyOptions = { showLink: false, displaylogo: false };
const plotlyOptions = {
showLink: false,
displaylogo: false,
displayModeBar: !clientConfig.hidePlotlyModeBar
};

const chartData = getChartData(data.rows, options);
const plotlyData = prepareData(chartData, options);
@@ -285,6 +285,9 @@ def client_config():
"showPermissionsControl": current_org.get_setting(
"feature_show_permissions_control"
),
"hidePlotlyModeBar": current_org.get_setting(
"hide_plotly_mode_bar"
),
"allowCustomJSVisualizations": settings.FEATURE_ALLOW_CUSTOM_JS_VISUALIZATIONS,
"autoPublishNamedQueries": settings.FEATURE_AUTO_PUBLISH_NAMED_QUERIES,
"extendedAlertOptions": settings.FEATURE_EXTENDED_ALERT_OPTIONS,
@@ -43,6 +43,9 @@
SEND_EMAIL_ON_FAILED_SCHEDULED_QUERIES = parse_boolean(
os.environ.get("REDASH_SEND_EMAIL_ON_FAILED_SCHEDULED_QUERIES", "false")
)
HIDE_PLOTLY_MODE_BAR = parse_boolean(
os.environ.get("HIDE_PLOTLY_MODE_BAR", "false")
)

settings = {
"beacon_consent": None,
@@ -65,4 +68,5 @@
"auth_jwt_auth_header_name": JWT_AUTH_HEADER_NAME,
"feature_show_permissions_control": FEATURE_SHOW_PERMISSIONS_CONTROL,
"send_email_on_failed_scheduled_queries": SEND_EMAIL_ON_FAILED_SCHEDULED_QUERIES,
"hide_plotly_mode_bar": HIDE_PLOTLY_MODE_BAR,
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.