Skip to content
Snippets Groups Projects
config.ts 4.94 KiB
Newer Older
// https://visjs.github.io/vis-network/docs/network/nodes.html
Michael Hartung's avatar
Michael Hartung committed
export interface NodeGroup {
  shape?: 'circle' | 'triangle' | 'star' | 'square' | 'image' | 'text' | 'ellipse' | 'box' | 'diamond' | 'dot';
  type?: string;
  image?: string;
Maiykol's avatar
Maiykol committed
  detailShowLabel?: boolean;
  font?: any;
  border?: any;
  highlight?: any;
  borderWidth?: number;
  borderWidthSelected?: number;
Michael Hartung's avatar
Michael Hartung committed
}

export interface EdgeGroup {
Maiykol's avatar
Maiykol committed
  groupName: string;
Michael Hartung's avatar
Michael Hartung committed
  color: string;
  // see https://visjs.github.io/vis-network/docs/network/edges.html
  dashes?: false | Array<number>;
Michael Hartung's avatar
Michael Hartung committed
}
export type Identifier = 'symbol'|'uniprot'|'ensg';
export type InteractionDrugProteinDB = 'DrugBank'|'Chembl'|'DGIdb';
export type InteractionProteinProteinDB = 'STRING'|'BioGRID'|'APID';
// TODO: should this be external or integrated in the backend?
export type InteractionDatabase = 'omnipath';

export interface IConfig {
  title: string;
  legendUrl: string;
  legendClass: string;
Michael Hartung's avatar
Michael Hartung committed
  legendPos: 'left' | 'right';
Zakaria Louadi's avatar
Zakaria Louadi committed
  taskName: string;
  showLeftSidebar: boolean;
Zakaria Louadi's avatar
Zakaria Louadi committed
  showOverview: boolean;
  showQuery: boolean;
Zakaria Louadi's avatar
Zakaria Louadi committed
  showItemSelector: boolean;
  showSimpleAnalysis: boolean;
  showAdvAnalysis: boolean;
  showTasks: boolean;
  showSelection: boolean;
  showFooter: boolean;
  showFooterButtonExpression: boolean;
  showFooterButtonScreenshot: boolean;
Michael Hartung's avatar
Michael Hartung committed
  showLegend: boolean;
  showLegendNodes: boolean;
  showLegendEdges: boolean;
Julian Matschinske's avatar
Julian Matschinske committed
  nodeGroups: { [key: string]: NodeGroup };
  edgeGroups: { [key: string]: EdgeGroup };
  interactionDrugProtein: InteractionDrugProteinDB;
  interactionProteinProtein: InteractionProteinProteinDB;
  interactions?: InteractionDatabase;
  identifier?: Identifier;
Maiykol's avatar
Maiykol committed
/**
 * Provide default values
 */

export const defaultConfig: IConfig = {
  title: 'Drugst.one',
Michael Hartung's avatar
Michael Hartung committed
  legendUrl: '', // 'https://exbio.wzw.tum.de/covex/assets/leg1.png' show legend image if set, otherwise default legend
  legendClass: 'legend',
Michael Hartung's avatar
Michael Hartung committed
  legendPos: 'left',
  taskName: 'Run Task X',
Michael Hartung's avatar
Michael Hartung committed
  showLegendNodes: true,
  showLegendEdges: true,
  showLeftSidebar: true,
Zakaria Louadi's avatar
Zakaria Louadi committed
  showOverview: true,
  showQuery: true,
Zakaria Louadi's avatar
Zakaria Louadi committed
  showItemSelector: true,
  showSimpleAnalysis: false,
Zakaria Louadi's avatar
Zakaria Louadi committed
  showAdvAnalysis: true,
  showSelection: true,
Julian Matschinske's avatar
Julian Matschinske committed
  showTasks: true,
Zakaria Louadi's avatar
Zakaria Louadi committed
  showFooter: true,
Michael Hartung's avatar
Michael Hartung committed
  showLegend: true,
  showFooterButtonExpression: true,
  showFooterButtonScreenshot: true,
  interactionDrugProtein: 'DrugBank',
  interactionProteinProtein: 'STRING',
Julian Matschinske's avatar
Julian Matschinske committed
  nodeGroups: {
    // all NodeGroups but the default group must be set, if not provided by the user, they will be taken from here
    // IMPORTANT: node color must be hexacode!
Julian Matschinske's avatar
Julian Matschinske committed
    default: {
Maiykol's avatar
Maiykol committed
      // this default group is used for default node group values
      // and is fallback in case user does not provide any nodeGroup
Maiykol's avatar
Maiykol committed
      groupName: 'Default Node Group',
      color: {
        border: '#FFFF00',
        background: '#FFFF00',
        highlight: {
          border: '#FF0000',
          background: '#FF0000'
        },
      },
Michael Hartung's avatar
Michael Hartung committed
      shape: 'triangle',
Maiykol's avatar
Maiykol committed
      type: 'default type',
Maiykol's avatar
Maiykol committed
      detailShowLabel: false,
        size: 14,
        face: 'arial',
        background: undefined,
        strokeWidth: 0,
        strokeColor: '#ffffff',
        align: 'center',
        bold: false,
        ital: false,
        boldital: false,
        mono: false,
      },
      borderWidth: 1,
Julian Matschinske's avatar
Julian Matschinske committed
    },
    foundNode: {
      groupName: 'Found Nodes',
      color: {
        border: '#F12590',
        background: '##F12590',
        highlight: {
          border: '#F12590',
          background: '#F12590'
        },
      },
      shape: 'circle',
      type: 'default node type',
Julian Matschinske's avatar
Julian Matschinske committed
    },
    foundDrug: {
      groupName: 'Found Drugs',
      color: {
        border: '#F12590',
        background: '##F12590',
        highlight: {
          border: '#F12590',
          background: '#F12590'
        },
      },
      shape: 'star',
Maiykol's avatar
Maiykol committed
      type: 'default drug type',
      // color: '#F8981D',
      // shape: 'circle',
      // type: 'seed',
      // groupName: 'Selected Nodes',
      // color: '#F8981D',
        // background: '#F8981D',
        highlight: {
          border: '#F8981D',
        //   background: '#F8981D'
        },
Julian Matschinske's avatar
Julian Matschinske committed
    }
  },
  edgeGroups: {
    default: {
Maiykol's avatar
Maiykol committed
      // this default group is used for default edge group values
      groupName: 'Default Edge Group',
      color: 'black',
Maiykol's avatar
Maiykol committed
      dashes: false