-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from neo-technology/feature/graph-editing-inter…
…face Improved graph visualization with editing and exploration
- Loading branch information
Showing
31 changed files
with
1,382 additions
and
197 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { extensionEnabled, getReportTypes } from '../extensions/ExtensionUtils'; | ||
import { useStyleRules } from '../extensions/styling/StyleRuleEvaluator'; | ||
|
||
/** | ||
* Gets the user specified settings and merges it with the defaults from ReportConfig.tsx. | ||
* @param userSettings the user specified settings for the report. | ||
* @param extensions the extensions enabled for the dashboard. | ||
* @param getGlobalParameter a callback to get global parameters for the dashboard. | ||
* @returns a merged list of user settings and defaults as provided in the configuration. | ||
*/ | ||
export const getSettings = ( | ||
userSettings: Record<string, any> | undefined, | ||
extensions: Record<string, any> | undefined, | ||
getGlobalParameter: any | ||
) => { | ||
const settings: Record<string, any> = {}; | ||
const config: Record<string, any> = getReportTypes(extensions).graph.settings; | ||
|
||
if (userSettings == undefined) { | ||
return {}; | ||
} | ||
|
||
Object.keys(config).map((key) => { | ||
settings[key] = userSettings[key] !== undefined ? userSettings[key] : config[key].default; | ||
}); | ||
|
||
settings.styleRules = useStyleRules( | ||
extensionEnabled(extensions, 'styling'), | ||
userSettings && userSettings.styleRules, | ||
getGlobalParameter | ||
); | ||
settings.actionsRules = | ||
extensionEnabled(extensions, 'actions') && settings && userSettings.actionsRules ? userSettings.actionsRules : []; | ||
return settings; | ||
}; |
Oops, something went wrong.