-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add option to disable WebGL rendering (#2134)
- Advanced Settings section in the Settings menu, with an option to disable WebGL - Read from the server config for default values - web.webgl: default setting for WebGL being enabled or not - web.webgl.editable: disallow the user from enabling WebGL - Contextual Help item to add more info - Tested by adding the following to the deephaven.prop config: ``` web.webgl=false web.webgl.editable=false client.configuration.list=java.version,deephaven.version,barrage.version,http.session.durationMs,file.separator,web.storage.layout.directory,web.storage.notebook.directory,web.webgl,web.webgl.editable ``` --------- Co-authored-by: Don <dsmmcken@gmail.com>
- Loading branch information
Showing
14 changed files
with
212 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
packages/code-studio/src/settings/AdvancedSectionContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React, { useCallback } from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
import { | ||
Content, | ||
ContextualHelp, | ||
Heading, | ||
Switch, | ||
Text, | ||
} from '@deephaven/components'; | ||
import { getWebGL, getWebGLEditable, updateSettings } from '@deephaven/redux'; | ||
import { useAppSelector } from '@deephaven/dashboard'; | ||
|
||
function AdvancedSectionContent(): JSX.Element { | ||
const dispatch = useDispatch(); | ||
const webgl = useAppSelector(getWebGL); | ||
const webglEditable = useAppSelector(getWebGLEditable); | ||
|
||
const handleWebglChange = useCallback( | ||
newValue => { | ||
dispatch(updateSettings({ webgl: newValue })); | ||
}, | ||
[dispatch] | ||
); | ||
|
||
const helpText = webglEditable ? ( | ||
<Text> | ||
WebGL in most cases has significant performance improvements, particularly | ||
when plotting large datasets. However, in some environments (such as | ||
remote desktop environments), WebGL may not use hardware acceleration and | ||
have degraded performance. If you are experiencing issues with WebGL, you | ||
can disable it here. | ||
</Text> | ||
) : ( | ||
<Text> | ||
WebGL is disabled by your system administrator. Contact your system | ||
administrator to enable. | ||
</Text> | ||
); | ||
|
||
return ( | ||
<> | ||
<div className="app-settings-menu-description"> | ||
Advanced settings here. Be careful! | ||
</div> | ||
|
||
<div className="form-row mb-3 pl-1"> | ||
<Switch | ||
isSelected={webgl} | ||
isDisabled={!webglEditable} | ||
onChange={handleWebglChange} | ||
marginEnd="size-0" | ||
> | ||
Enable WebGL | ||
</Switch> | ||
<ContextualHelp variant="info" marginTop="size-50"> | ||
<Heading>Enable WebGL</Heading> | ||
<Content> | ||
<Text>{helpText}</Text> | ||
</Content> | ||
</ContextualHelp> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default AdvancedSectionContent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.