Skip to content
Snippets Groups Projects
Commit c13a1569 authored by AndiMajore's avatar AndiMajore
Browse files

fixed lodash warning message

parent 53e84a1d
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
"externals": "replace" "externals": "replace"
} }
}, },
"allowedCommonJsDependencies": [
"lodash"
],
"outputPath": "dist/netex", "outputPath": "dist/netex",
"index": "src/index.html", "index": "src/index.html",
"main": "src/main.ts", "main": "src/main.ts",
......
import { defaultConfig, IConfig } from './config'; import { defaultConfig, IConfig } from './config';
import {NodeInteraction, Node, getProteinNodeId, NetexInteraction} from './interfaces'; 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 { export function getDatasetFilename(dataset: Array<[string, string]>): string {
return `network-${JSON.stringify(dataset).replace(/[\[\]\",]/g, '')}.json`; return `network-${JSON.stringify(dataset).replace(/[\[\]\",]/g, '')}.json`;
...@@ -66,10 +66,10 @@ export class ProteinNetwork { ...@@ -66,10 +66,10 @@ export class ProteinNetwork {
/** Maps user input node to network node object /** Maps user input node to network node object
* If user input node has no group, fall back to default * If user input node has no group, fall back to default
* If user input node has group that is not defined, throw error * If user input node has group that is not defined, throw error
* *
* @param customNode * @param customNode
* @param config * @param config
* @returns * @returns
*/ */
export function mapCustomNode(customNode: any, config: IConfig): Node { export function mapCustomNode(customNode: any, config: IConfig): Node {
let node; let node;
...@@ -94,10 +94,10 @@ export class ProteinNetwork { ...@@ -94,10 +94,10 @@ export class ProteinNetwork {
/** Maps user input edge to network edge object /** Maps user input edge to network edge object
* If user input edge has no group, fall back to default * If user input edge has no group, fall back to default
* If user input edge has group that is not defined, throw error * If user input edge has group that is not defined, throw error
* *
* @param customEdge * @param customEdge
* @param config * @param config
* @returns * @returns
*/ */
export function mapCustomEdge(customEdge: NodeInteraction, config: IConfig): any { export function mapCustomEdge(customEdge: NodeInteraction, config: IConfig): any {
let edge; let edge;
...@@ -120,10 +120,10 @@ export function mapCustomEdge(customEdge: NodeInteraction, config: IConfig): any ...@@ -120,10 +120,10 @@ export function mapCustomEdge(customEdge: NodeInteraction, config: IConfig): any
/** Maps netex retrieved edge to network edge object /** Maps netex retrieved edge to network edge object
* Uses the default group for edge objects. * Uses the default group for edge objects.
* *
* @param customEdge * @param customEdge
* @param config * @param config
* @returns * @returns
*/ */
export function mapNetexEdge(customEdge: NetexInteraction, config: IConfig): any { export function mapNetexEdge(customEdge: NetexInteraction, config: IConfig): any {
const edge = JSON.parse(JSON.stringify(config.edgeGroups.default)); const edge = JSON.parse(JSON.stringify(config.edgeGroups.default));
......
...@@ -3,7 +3,7 @@ import { ...@@ -3,7 +3,7 @@ import {
Node, Node,
} from './interfaces'; } from './interfaces';
import { IConfig, defaultConfig} from './config'; import { IConfig, defaultConfig} from './config';
import * as merge from 'lodash/fp/merge'; import * as merge from 'lodash/fp/merge';
export class NetworkSettings { export class NetworkSettings {
...@@ -92,7 +92,7 @@ export class NetworkSettings { ...@@ -92,7 +92,7 @@ export class NetworkSettings {
static getColor(color: 'protein' | 'approvedDrug' | 'unapprovedDrug' | 'hostFont' | 'drugFont' | static getColor(color: 'protein' | 'approvedDrug' | 'unapprovedDrug' | 'hostFont' | 'drugFont' |
'nonSeedHost' | 'selectedForAnalysis' | 'selectedForAnalysisText' | 'nonSeedHost' | 'selectedForAnalysis' | 'selectedForAnalysisText' |
'edgeHostDrug' | 'edgeHostDrugHighlight' | 'edgeGeneGene' | 'edgeGeneGeneHighlight') 'edgeHostDrug' | 'edgeHostDrugHighlight' | 'edgeGeneGene' | 'edgeGeneGeneHighlight')
/** /**
* Collection of all colors per use-case * Collection of all colors per use-case
*/ */
...@@ -134,7 +134,7 @@ export class NetworkSettings { ...@@ -134,7 +134,7 @@ export class NetworkSettings {
} else { } else {
node = merge(node, config.nodeGroups[node.group]); 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 // this allows to overwrite only attributes of interest, therefor in e.g. seedNode group
// certain attributes like shape can remain undefined // certain attributes like shape can remain undefined
// use lodash merge to not lose deep attributes, e.g. "font.size" // use lodash merge to not lose deep attributes, e.g. "font.size"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment