How to use cytoscape-dagre - 8 common examples

To help you get started, we’ve selected a few cytoscape-dagre 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 team-navigitor / naviGITor / src / gitTree.js View on Github external
import React, { Component } from 'react';
import cytoscape from 'cytoscape';
import $ from 'jquery';
import qtip from 'qtip2';
import cydagre from 'cytoscape-dagre';
import dagre from 'dagre';
import cyqtip from 'cytoscape-qtip';
import { ipcRenderer } from 'electron';
import ajax from 'superagent';
import navigator from 'cytoscape-navigator';


// register extension
cyqtip( cytoscape, $ );
cydagre( cytoscape, dagre );
navigator( cytoscape );


export default class GitTree extends Component {
	constructor() {
		super();
	}

	componentDidMount() {
		let localGitAction;
		let localGitNodes = [];
		let localGitEdges = [];
		let globalData;

		// NEED TO UPDATE LIVE ON ANY COMMIT, ONLY GRABS COMMIT WHEN OPEN DIRECTORY
		// find a way to update local changes in the data
github jaegertracing / jaeger-ui / src / components / DependencyGraph / DAG.js View on Github external
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import PropTypes from 'prop-types';
import React from 'react';
import cytoscape from 'cytoscape';
import cydagre from 'cytoscape-dagre';
import dagre from 'dagre';

cydagre(cytoscape, dagre);

export default class DAG extends React.Component {
  static get propTypes() {
    return {
      serviceCalls: PropTypes.arrayOf(
        PropTypes.shape({
          parent: PropTypes.string,
          child: PropTypes.string,
          callCount: PropTypes.number,
        })
      ),
    };
  }
  componentDidMount() {
    const { serviceCalls } = this.props;
    const nodeMap = {};
github rai-project / mlmodelscope / src / components / Model / Cytoscape.js View on Github external
constructor() {
    super();
    cydagre(cytoscape); // register extension
    cycola(cytoscape);
  }
  componentDidMount() {
github team-navigitor / naviGITor / src / dagTree.js View on Github external
import React, { Component } from 'react';
import cytoscape from 'cytoscape';
import $ from 'jquery';
import qtip from 'qtip2';
import cydagre from 'cytoscape-dagre';
import dagre from 'dagre';
import cyqtip from 'cytoscape-qtip';
import { ipcRenderer } from 'electron';

// register extension
cyqtip( cytoscape, $ );
cydagre( cytoscape, dagre );

export default class DagTree extends Component {
	constructor() {
		super();
	}

	componentDidMount() {
		let localGitAction;
		let localGitNodes = [];
		let localGitEdges = [];

		localGitAction = ipcRenderer.on('parsedCommitAll', function(event, data){

			// loop through all local git activity, and store as nodes
			for (var i = 0; i < data.length; i++) {
				localGitNodes.push({
github team-navigitor / naviGITor / src / gitTree / teamGitTree.js View on Github external
import React, { Component } from 'react';
import cytoscape from 'cytoscape';
import $ from 'jquery';
import cydagre from 'cytoscape-dagre';
import dagre from 'dagre';
import { ipcRenderer } from 'electron';
import createGitTree from './createGitTree';

cydagre( cytoscape, dagre );

const BrowserWindow = require('electron').remote.BrowserWindow;
const path = require('path');

export default class TeamGitTree extends Component {
	constructor(props) {
		super(props);
	}

	componentDidMount() {

		let gitTreeId = 'team-git-tree',
				teamGitHistory = this.props.getAppState.teamData,
				teamGitNodes = [],
				teamGitEdges = [];
		// loop through all local git activity, and store as nodes
github keplr-io / quiver / quiver_engine / quiverboard / src / components / ModelGraph / index.js View on Github external
componentDidMount() {

        cydagre(cytoscape, dagre);

        const cyGraph = cytoscape({
            container: this.refs.graphvisContainer,
            elements: computeCytoscapeGraph(this.props.modelConfig),
            layout: {
                name: 'dagre',
                rankDir: 'TD'
            },
            style: [
                {
                    selector: 'node',
                    style: {
                        'content': 'data(id)',
                        'text-opacity': 0.5,
                        'text-valign': 'center',
                        'text-halign': 'right',
github keplr-io / hera / client / src / components / ModelGraph / index.js View on Github external
componentDidMount() {

        cydagre(cytoscape, dagre);

        const cyGraph = cytoscape({
            container: this.refs.graphvisContainer,
            elements: computeCytoscapeGraph(this.props.modelConfig),
            layout: {
                name: 'dagre',
                rankDir: 'LR'
            },
            style: [
                {
                    selector: 'node',
                    style: {
                        'content': 'data(id)',
                        'text-opacity': 0.5,
                        'text-valign': 'bottom',
                        'text-halign': 'center',
github team-navigitor / naviGITor / src / gitTree / createGitTree.js View on Github external
import cytoscape from 'cytoscape';
import cydagre from 'cytoscape-dagre';
import dagre from 'dagre';
import { ipcRenderer } from 'electron';

cydagre( cytoscape, dagre );

export default function createGitTree(gitTreeId, gitNodes, gitEdges) {
	var cy = window.cy = cytoscape({
		container: document.getElementById(gitTreeId),
		boxSelectionEnabled: false,
		autounselectify: true,
		layout: {
			name: 'dagre'
		},
		style: cytoscape.stylesheet()
		.selector('node')
		  .css({
		    'content': 'data(commit)',
		    'width': 65,
		    'height': 65,
		    'text-opacity': 0.5,

cytoscape-dagre

The Dagre layout for DAGs and trees for Cytoscape.js

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis

Popular cytoscape-dagre functions