JSFiddle - React, Tailwind, and code Playground

by martyk

HTML

<link rel="stylesheet" href="http://www.jsplumb.org/css/jsPlumbDemo.css">
<script><!-- because this script has to be placed BEFORE the jsPlumb.org scripts, it cannot be put in jsfiddle's javascript frame -->
    $(document).ready(function() {
        $(".component.window").each(function(i) {
            var left = $(this).offset().left;
            var top = $(this).offset().top;
            $(this).css({
                left: left,
                top: top
            });
        });
        $("#demo.initial").removeClass("initial");
    });
</script>
<script src="http://www.jsplumb.org/js/jquery.jsPlumb-1.3.16-all-min.js"></script>
<script src="http://www.jsplumb.org/js/demo.js"></script>
<script src="http://www.jsplumb.org/js/demo-list.js"></script>
<script src="http://www.jsplumb.org/js/demo-helper-jquery.js"></script>
	<body data-demo-id="demo" data-library="jquery">
	
		<div style="position:absolute">
		    <div id="demo" class="initial">
			    <div class="component window" id="window1"><strong>Window 1</strong><br/><br/>I am plumbed with a Bezier connector to Window 2 and a label, with Blank endpoints.</div>
			    <div class="component window" id="window2"><strong>Window 2</strong><br/><br/>I am plumbed with a Bezier connector to Window 1, and a Bezier connector with Rectangle endpoints to Window 3</div>
		        <div class="component window" id="window3"><strong>Window 3</strong><br/><br/>I am plumbed with a Bezier connector and Rectangle endpoints to Window 2, and a Bezier connector with Dot endpoints and a label to Window 4. My blue endpoint tracks Window 4's position.</div>
		        <div class="component window" id="window4"><strong>Window 4</strong><br/><br/>I am plumbed with a Bezier connector with Dot endpoints to Window 3, and with a Straight connector with Image endpoints to Window 5. My blue endpoint tracks Window 3's position.</div>
		        <div class="component window" id="window5"><strong>Window 5</strong><br/><br/>I am plumbed with a...

CSS

.component {
	
	opacity:0.8; 
	filter:alpha(opacity=80);
	background-color:white;
	color:black;
	font-family:helvetica;
	padding:0.5em; 
	
}

.window { 
	border:2px solid #346789; 
 	width:14em; 
 	height:12em; 
	z-index:20; 
	position:absolute; 
	font-size:0.8em;
	
	/*margin:1em;*/
}

#demo {
    margin-top:60px;
}
#demo.initial .component.window {
    position:relative;
    float:left;
    margin:60px;
}
.label {
	border:1px solid #346789; 
	padding:8px;
	padding:8px;
}
.label:hover {
border-color:#5d94a6;	
}

.l1 { 
	font-size:13px;
	 
}
/* COMMENTING these STATIC positions from the jsPlumb demo CSS to demonstrate that positions can be assigned dynamically!
#window1 {  top:2em;left:2em;}
#window2 { top:14em; left:47em;}
#window3 { top:28em;left:2em; }
#window4 { top:6em; left:26em;}
#window5 {top:40em;left:32em;}
#window6 {top:25em;left:69em;}
#window7 {top:54em;left:4em;}
#window8 {left:63em;top:32em;}
*/
._jsPlumb_connector { z-index:4; }
._jsPlumb_endpoint { z-index:5; }
._jsPlumb_overlay { z-index:6; }
.hl { border:3px solid red; }

/*        SVG styles.  Apart from the fact that SVG uses far less memory than Canvas, you can style it!   
.c1 path, .l1arrow { 
	stroke-dasharray:40 20 40; 
	stroke-linecap:round;
	stroke-opacity:0.5;
	fill-opacity:0.5;	
}
*/