How to use the cytoscape.use function in cytoscape

To help you get started, we’ve selected a few cytoscape examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plotly / dash-cytoscape / src / lib / extra_index.js View on Github external
/* eslint-disable import/prefer-default-export */
import Cytoscape from './components/Cytoscape.react';
import CytoscapeJS from 'cytoscape';
import coseBilkent from 'cytoscape-cose-bilkent';
import cola from 'cytoscape-cola';
import dagre from 'cytoscape-dagre';
import euler from 'cytoscape-euler';
import klay from 'cytoscape-klay';
import spread from 'cytoscape-spread';

CytoscapeJS.use(coseBilkent);
CytoscapeJS.use(cola);
CytoscapeJS.use(dagre);
CytoscapeJS.use(euler);
CytoscapeJS.use(klay);
CytoscapeJS.use(spread);

export {
    Cytoscape
};
github kiali / kiali-ui / src / components / CytoscapeLayout / ReactCytoscape.tsx View on Github external
import React, { Component } from 'react';
import cytoscape from 'cytoscape';
import cycola from 'cytoscape-cola';
import dagre from 'cytoscape-dagre';
import coseBilkent from 'cytoscape-cose-bilkent';
import klay from 'cytoscape-klay';
import popper from 'cytoscape-popper';
import { PfColors } from '../../components/Pf/PfColors';

cytoscape.use(cycola);
cytoscape.use(dagre);
cytoscape.use(coseBilkent);
cytoscape.use(klay);
cytoscape.use(popper);

interface ReactCytoscapeProps {
  containerID?: string; // the div ID that contains the cy graph
  elements?: any; // defines all the nodes, edges, and groups - this is the low-level graph data
  style?: any;
  styleContainer?: any;
  cytoscapeOptions?: any;
  layout?: any;
  cyRef?: (cy: any) => void; // to be called when cy graph is initially created
}

export default class ReactCytoscape extends Component {
  cy: any;
  container: any;
github GraphWalker / graphwalker-project / graphwalker-studio / src / main / js / components / editor / editor-panel / editor-component.js View on Github external
deleteElement,
  selectElement,
  setStartElement,
  updateElementPosition,
  saveEditorState,
  toggleBreakpoint
} from "../../../redux/actions";
import {Classes, ContextMenu, Divider, Menu, MenuDivider, MenuItem, ResizeSensor} from "@blueprintjs/core";
import { debounce } from "debounce";
import uuid from "uuid/v1"
import Cytoscape from "cytoscape";
import coseBilkent from 'cytoscape-cose-bilkent';
import stylesheet from "./editor-stylesheet";
import "./style.css";

Cytoscape.use( coseBilkent );

class EditorComponent extends Component {

  updateColors = ({ elements }) => {
    const { model: { id }} = this.props;
    const visited = this.props.execution.visited[id];
    elements.forEach(element => {
      const key = `${id},${element.data.id}`;
      element.data.name = element.data.name || "";
      if (this.props.execution.breakpoints[key]) {
        element.data.color = 'Red';
      } else if (visited && visited[element.data.id]) {
        element.data.color = 'LightGreen';
      } else {
        if (this.props.model.startElementId === element.data.id) {
          element.data.color = 'LightGreen';
github Tencent / bk-cmdb / src / ui / src / views / host-details / children / association-graphics.new.vue View on Github external
created () {
            if (typeof cytoscape('core', 'popper') !== 'function') {
                cytoscape.use(popper)
            }
            if (typeof cytoscape('core', 'dagre') !== 'function') {
                cytoscape.use(dagre)
            }
        },
        mounted () {
github Azure-Samples / digital-twins-explorer / client / src / components / GraphViewerComponent / GraphViewerCytoscapeComponent / GraphViewerCytoscapeComponent.js View on Github external
import fcose from "cytoscape-fcose";
import cola from "cytoscape-cola";
import dagre from "cytoscape-dagre";
import klay from "cytoscape-klay";
import dblclick from "cytoscape-dblclick";

import { colors, graphStyles, dagreOptions, colaOptions, klayOptions, fcoseOptions } from "./config";
import { getUniqueRelationshipId } from "../../../utils/utilities";

import "./GraphViewerCytoscapeComponent.scss";

cytoscape.use(klay);
cytoscape.use(dagre);
cytoscape.use(cola);
cytoscape.use(fcose);
cytoscape.use(dblclick);

export const GraphViewerCytoscapeLayouts = {
  "Cola": colaOptions,
  "Dagre": dagreOptions,
  "fCoSE": fcoseOptions,
  "Klay": klayOptions
};

export class GraphViewerCytoscapeComponent extends React.Component {

  constructor(props) {
    super(props);
    this.state = { };
    this.graphControl = null;
    this.selectedNodes = [];
    this.layout = "Klay";
github kiali / kiali-ui / src / components / CytoscapeGraph / CytoscapeReactWrapper.tsx View on Github external
import * as React from 'react';
import * as Cy from 'cytoscape';

import { GraphStyles } from './graphs/GraphStyles';
import canvas from 'cytoscape-canvas';
import cytoscape from 'cytoscape';
import cycola from 'cytoscape-cola';
import dagre from 'cytoscape-dagre';
import coseBilkent from 'cytoscape-cose-bilkent';
import GroupCompoundLayout from './Layout/GroupCompoundLayout';
import popper from 'cytoscape-popper';
const nodeHtmlLabel = require('cy-node-html-label');

cytoscape.use(canvas);
cytoscape.use(cycola);
cytoscape.use(dagre);
cytoscape.use(coseBilkent);
cytoscape.use(popper);
cytoscape('layout', 'group-compound-layout', GroupCompoundLayout);
nodeHtmlLabel(cytoscape);

type CytoscapeReactWrapperProps = {};

type CytoscapeReactWrapperState = {};

const styleContainer: React.CSSProperties = {
  height: '100%'
};

/**
 * The purpose of this wrapper is very simple and minimal - to provide a long-lived <div> element that can be used</div>
github Tencent / bk-cmdb / src / ui / src / views / host-details / children / association-graphics.new.vue View on Github external
created () {
            if (typeof cytoscape('core', 'popper') !== 'function') {
                cytoscape.use(popper)
            }
            if (typeof cytoscape('core', 'dagre') !== 'function') {
                cytoscape.use(dagre)
            }
        },
        mounted () {
github Azure-Samples / digital-twins-explorer / client / src / components / GraphViewerComponent / GraphViewerCytoscapeComponent / GraphViewerCytoscapeComponent.js View on Github external
import React from "react";
import CytoscapeComponent from "react-cytoscapejs";
import cytoscape from "cytoscape";
import fcose from "cytoscape-fcose";
import cola from "cytoscape-cola";
import dagre from "cytoscape-dagre";
import klay from "cytoscape-klay";
import dblclick from "cytoscape-dblclick";

import { colors, graphStyles, dagreOptions, colaOptions, klayOptions, fcoseOptions } from "./config";
import { getUniqueRelationshipId } from "../../../utils/utilities";

import "./GraphViewerCytoscapeComponent.scss";

cytoscape.use(klay);
cytoscape.use(dagre);
cytoscape.use(cola);
cytoscape.use(fcose);
cytoscape.use(dblclick);

export const GraphViewerCytoscapeLayouts = {
  "Cola": colaOptions,
  "Dagre": dagreOptions,
  "fCoSE": fcoseOptions,
  "Klay": klayOptions
};

export class GraphViewerCytoscapeComponent extends React.Component {

  constructor(props) {
    super(props);
github Azure-Samples / digital-twins-explorer / client / src / components / GraphViewerComponent / GraphViewerCytoscapeComponent / GraphViewerCytoscapeComponent.js View on Github external
import cytoscape from "cytoscape";
import fcose from "cytoscape-fcose";
import cola from "cytoscape-cola";
import dagre from "cytoscape-dagre";
import klay from "cytoscape-klay";
import dblclick from "cytoscape-dblclick";

import { colors, graphStyles, dagreOptions, colaOptions, klayOptions, fcoseOptions } from "./config";
import { getUniqueRelationshipId } from "../../../utils/utilities";

import "./GraphViewerCytoscapeComponent.scss";

cytoscape.use(klay);
cytoscape.use(dagre);
cytoscape.use(cola);
cytoscape.use(fcose);
cytoscape.use(dblclick);

export const GraphViewerCytoscapeLayouts = {
  "Cola": colaOptions,
  "Dagre": dagreOptions,
  "fCoSE": fcoseOptions,
  "Klay": klayOptions
};

export class GraphViewerCytoscapeComponent extends React.Component {

  constructor(props) {
    super(props);
    this.state = { };
    this.graphControl = null;
    this.selectedNodes = [];
github idekerlab / hiview / frontend / src / components / CytoscapeViewer / index.jsx View on Github external
import Cytoscape from 'cytoscape'
import COSEBilkent from 'cytoscape-cose-bilkent'

import React, { useEffect, useState } from 'react'
import CytoscapeComponent from 'react-cytoscapejs'

Cytoscape.use(COSEBilkent)

import DEFAULT_STYLE from './visualstyle'
import './style.css'
import Warning from './Warning'
import LoadingPanel from '../PropertyPanel/LoadingPanel'
let cyInstance = null

const BASE_STYLE = { width: '100%', height: '100%', background: '#222522' }

const PRESET_LAYOUT = {
  name: 'preset',
  padding: 6
}

const COCENTRIC_LAYOUT = {
  name: 'concentric',

cytoscape

Graph theory (a.k.a. network) library for analysis and visualisation

MIT
Latest version published 12 days ago

Package Health Score

98 / 100
Full package analysis

Popular cytoscape functions