-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pr/janhartmann/2778 into unstable
- Loading branch information
Showing
6 changed files
with
92 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
cytoscape({ | ||
container: document.getElementById('cy'), | ||
boxSelectionEnabled: false, | ||
autounselectify: true, | ||
style: [{ | ||
selector: 'node', | ||
style: { | ||
shape: 'round-rectangle', | ||
'background-image': ['https://live.staticflickr.com/7272/7633179468_3e19e45a0c_b.jpg', 'https://live.staticflickr.com/3063/2751740612_af11fb090b_b.jpg'], | ||
'background-image-containment': ['over', 'inside'], | ||
'background-clip': ['none', 'none'], | ||
'bounds-expansion': 25, | ||
'background-width': [20, 20], | ||
'background-height': [20, 20], | ||
'background-position-x': ['-10','120%'], | ||
'background-position-y': ['-10','-10'], | ||
'background-color': 'lightgray', | ||
'border-color': 'gray', | ||
'border-width': 1, | ||
|
||
'text-halign': 'center', | ||
'text-valign': 'center', | ||
width: 65, | ||
height: 30 | ||
} | ||
}], | ||
elements: { | ||
nodes: [ | ||
{ data: { id: 'inside', name: 'Test', } }, | ||
] | ||
}, | ||
layout: { | ||
name: 'grid', | ||
padding: 10 | ||
} | ||
}); |
16 changes: 16 additions & 0 deletions
16
documentation/demos/background-image-containment/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<!-- This code is for demonstration purposes only. You should not hotlink to Github, Rawgit, or files from the Cytoscape.js documentation in your production apps. --> | ||
<html> | ||
<head> | ||
<link href="style.css" rel="stylesheet" /> | ||
<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>Background Image Containment example</title> | ||
<script src="../../../build/cytoscape.umd.js"></script> | ||
</head> | ||
<body> | ||
<div id="cy"></div> | ||
<!-- Load application code at the end to ensure DOM is loaded --> | ||
<script src="code.js"></script> | ||
</body> | ||
</html> |
20 changes: 20 additions & 0 deletions
20
documentation/demos/background-image-containment/style.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
body { | ||
font: 14px helvetica neue, helvetica, arial, sans-serif; | ||
} | ||
|
||
#cy { | ||
height: 100%; | ||
width: 100%; | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
} | ||
|
||
#info { | ||
color: #c88; | ||
font-size: 1em; | ||
position: absolute; | ||
z-index: -1; | ||
left: 1em; | ||
top: 1em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters