Skip to content

Instantly share code, notes, and snippets.

@maxkfranz
maxkfranz / index.html
Last active March 29, 2021 09:58
cytoscape-dagre demo
<!DOCTYPE>
<html>
<head>
<title>cytoscape-dagre.js demo</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
@maxkfranz
maxkfranz / README
Last active March 8, 2020 09:24
wine-and-cheese-demo
dummy file to create gist
@maxkfranz
maxkfranz / code.js
Last active February 25, 2020 06:42
Images
$(function(){ // on dom ready
// photos from flickr with creative commons license
var cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: false,
autounselectify: true,
@maxkfranz
maxkfranz / tokyo-railways.json
Created October 27, 2014 17:47
tokyo-railways.json
This file has been truncated, but you can view the full file.
{
"format_version" : "1.0",
"generated_by" : "cytoscape-3.1.1",
"target_cytoscapejs_version" : "~2.1",
"data" : {
"selected" : true,
"__Annotations" : [ "" ],
"shared_name" : "main_islands_japan(1)",
"SUID" : 20760,
"name" : "tokyo_only"
const React = require('react');
const h = require('react-hyperscript');
class Textbox extends React.Component {
constructor( props ){
super(props);
// props
// defaultValue, value, onClick
}
@maxkfranz
maxkfranz / code.js
Last active July 5, 2017 14:24
Cytoscape.js & Angular
// a very simple example of angular/cytoscape.js integration
// context (rightclick/2finger) drag to resize in graph
// use text boxes to resize in angular
var app = angular.module('app', []);
// use a factory instead of a directive, because cy.js is not just for visualisation; you need access to the graph model and events etc
app.factory('peopleGraph', [ '$q', function( $q ){
var cy;
@maxkfranz
maxkfranz / wine-and-cheese.json
Created November 14, 2014 18:44
wine-and-cheese.json
{
"format_version" : "1.0",
"generated_by" : "cytoscape-3.2.0",
"target_cytoscapejs_version" : "~2.1",
"data" : {
"selected" : true,
"__Annotations" : [ ],
"shared_name" : "WineCheeseNetwork",
"SUID" : 52,
"name" : "WineCheeseNetwork"
@maxkfranz
maxkfranz / index.html
Last active April 30, 2017 08:02
circle demo
<!DOCTYPE>
<html>
<head>
<title>Circle demo</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
@maxkfranz
maxkfranz / code.js
Last active April 28, 2017 14:10
Initialisation
document.addEventListener('DOMContentLoaded', function(){ // on dom ready
var cy = cytoscape({
container: document.querySelector('#cy'),
boxSelectionEnabled: false,
autounselectify: true,
style: cytoscape.stylesheet()
.selector('node')
@maxkfranz
maxkfranz / code.js
Last active April 27, 2017 08:43
qTip
$(function(){ // on dom ready
var cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: false,
autounselectify: true,
minZoom: 0.5,
maxZoom: 2,