From c13a15694c586eee808c6005db4863104ab86414 Mon Sep 17 00:00:00 2001 From: AndiMajore <andi.majore@googlemail.com> Date: Thu, 30 Sep 2021 16:42:28 +0200 Subject: [PATCH] fixed lodash warning message --- angular.json | 3 +++ src/app/main-network.ts | 26 +++++++++++++------------- src/app/network-settings.ts | 6 +++--- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/angular.json b/angular.json index 76d1bb49..c12cc93d 100644 --- a/angular.json +++ b/angular.json @@ -23,6 +23,9 @@ "externals": "replace" } }, + "allowedCommonJsDependencies": [ + "lodash" + ], "outputPath": "dist/netex", "index": "src/index.html", "main": "src/main.ts", diff --git a/src/app/main-network.ts b/src/app/main-network.ts index e2a99291..d00b1769 100644 --- a/src/app/main-network.ts +++ b/src/app/main-network.ts @@ -1,6 +1,6 @@ import { defaultConfig, IConfig } from './config'; import {NodeInteraction, Node, getProteinNodeId, NetexInteraction} from './interfaces'; -import * as merge from 'lodash/fp/merge'; +import * as merge from 'lodash/fp/merge'; export function getDatasetFilename(dataset: Array<[string, string]>): string { return `network-${JSON.stringify(dataset).replace(/[\[\]\",]/g, '')}.json`; @@ -66,10 +66,10 @@ export class ProteinNetwork { /** Maps user input node to network node object * If user input node has no group, fall back to default * If user input node has group that is not defined, throw error - * - * @param customNode - * @param config - * @returns + * + * @param customNode + * @param config + * @returns */ export function mapCustomNode(customNode: any, config: IConfig): Node { let node; @@ -94,10 +94,10 @@ export class ProteinNetwork { /** Maps user input edge to network edge object * If user input edge has no group, fall back to default * If user input edge has group that is not defined, throw error - * - * @param customEdge - * @param config - * @returns + * + * @param customEdge + * @param config + * @returns */ export function mapCustomEdge(customEdge: NodeInteraction, config: IConfig): any { let edge; @@ -120,10 +120,10 @@ export function mapCustomEdge(customEdge: NodeInteraction, config: IConfig): any /** Maps netex retrieved edge to network edge object * Uses the default group for edge objects. - * - * @param customEdge - * @param config - * @returns + * + * @param customEdge + * @param config + * @returns */ export function mapNetexEdge(customEdge: NetexInteraction, config: IConfig): any { const edge = JSON.parse(JSON.stringify(config.edgeGroups.default)); diff --git a/src/app/network-settings.ts b/src/app/network-settings.ts index 7a649fae..cbc58a02 100644 --- a/src/app/network-settings.ts +++ b/src/app/network-settings.ts @@ -3,7 +3,7 @@ import { Node, } from './interfaces'; import { IConfig, defaultConfig} from './config'; -import * as merge from 'lodash/fp/merge'; +import * as merge from 'lodash/fp/merge'; export class NetworkSettings { @@ -92,7 +92,7 @@ export class NetworkSettings { static getColor(color: 'protein' | 'approvedDrug' | 'unapprovedDrug' | 'hostFont' | 'drugFont' | 'nonSeedHost' | 'selectedForAnalysis' | 'selectedForAnalysisText' | - 'edgeHostDrug' | 'edgeHostDrugHighlight' | 'edgeGeneGene' | 'edgeGeneGeneHighlight') + 'edgeHostDrug' | 'edgeHostDrugHighlight' | 'edgeGeneGene' | 'edgeGeneGeneHighlight') /** * Collection of all colors per use-case */ @@ -134,7 +134,7 @@ export class NetworkSettings { } else { node = merge(node, config.nodeGroups[node.group]); } - // note that seed and selected node style are applied after the node style is fetched. + // note that seed and selected node style are applied after the node style is fetched. // this allows to overwrite only attributes of interest, therefor in e.g. seedNode group // certain attributes like shape can remain undefined // use lodash merge to not lose deep attributes, e.g. "font.size" -- GitLab