Skip to content

Instantly share code, notes, and snippets.

@maxkfranz
maxkfranz / index.html
Last active April 11, 2017 18:30
Tokyo railways demo
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[Tokyo railways]" />
<meta charset=utf-8 />
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui">
<title>Tokyo railways</title>
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.min.css" rel="stylesheet" />
<link href="style.css" rel="stylesheet">
@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"
@maxkfranz
maxkfranz / tokyo-railways-style.cycss
Last active August 29, 2015 14:08
tokyo-railways-style.cycss
node {
background-color: white;
border-color: black;
content: data(station_name);
width: 20;
height: 20;
min-zoomed-font-size: 12;
color: #fff;
font-size: 16;
}
@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 21, 2017 09:48
Visual style
$(function(){ // on dom ready
var cy = cytoscape({
container: document.getElementById('cy'),
layout: {
name: 'cose',
padding: 10,
randomize: true
},
@maxkfranz
maxkfranz / code.js
Last active October 21, 2015 17:31
Linkouts
$(function(){ // on dom ready
var cy = cytoscape({
container: $('#cy')[0],
boxSelectionEnabled: false,
autounselectify: true,
style: cytoscape.stylesheet()
.selector('node')
@maxkfranz
maxkfranz / code.js
Last active July 5, 2016 14:23
Compound nodes
$(function(){ // on dom ready
var cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: false,
autounselectify: true,
style: [
{
@maxkfranz
maxkfranz / code.js
Last active January 24, 2017 18:50
Animated BFS
$(function(){ // on dom ready
var cy = cytoscape({
container: document.getElementById('cy'),
boxSelectionEnabled: false,
autounselectify: true,
style: cytoscape.stylesheet()
.selector('node')
@maxkfranz
maxkfranz / code.js
Last active August 29, 2015 14:08
GeneMANIA export
$(function(){ // on dom ready
var cy = cytoscape({
container: document.getElementById('cy'),
style: cytoscape.stylesheet()
.selector('node')
.css({
'font-size': 10,
'content': 'data(gene_name)',
@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,