An example that demonstrates basic features of Chiasm.
The Chiasm plugins demonstrated here are
dummyVis
A placeholder for D3-based visualizations that use SVG.
wave
An example plugin that uses HTML5 Canvas for rendering.
layout
A plugin for nested box layout of arbitrary components.
links
A plugin for connecting components together.
xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<title>Chiasm Foundation</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<!-- A functional reactive model library. github.com/curran/model -->
<script src="https://curran.github.io/model/cdn/model-v0.2.4.js"></script>
<!-- Chiasm core and plugins. github.com/chiasm-project -->
<script src="https://chiasm-project.github.io/chiasm/chiasm-v0.2.0.js"></script>
<script src="https://chiasm-project.github.io/chiasm-component/chiasm-component-v0.2.0.js"></script>
<script src="https://chiasm-project.github.io/chiasm-layout/chiasm-layout-v0.2.1.js"></script>
<script src="https://chiasm-project.github.io/chiasm-links/chiasm-links-v0.2.0.js"></script>
<!-- Custom Chiasm plugins for this example. -->
<script src="dummyVis.js"></script>
<script src="wave.js"></script>
<style>
body {
background-color: black;
}
/* Make the chart container fill the page using CSS. */
#chiasm-container {
position: fixed;
left: 20px;
right: 20px;
top: 20px;
bottom: 20px;
}
</style>
</head>
<body>
<div id="chiasm-container"></div>
<script>
var chiasm = Chiasm();
chiasm.plugins.layout = ChiasmLayout;
chiasm.plugins.links = ChiasmLinks;
chiasm.plugins.dummyVis = DummyVis;
chiasm.plugins.wave = Wave;
chiasm.setConfig({
"layout": {
"plugin": "layout",
"state": {
"containerSelector": "#chiasm-container",
"layout": {
"orientation": "vertical",
"children": [
"A",
{
"orientation": "horizontal",
"children": [
"B",
"wave",
"C"
]
}
]
},
"sizes": {
"wave": {
"size": 3
}
}
}
},
"A": {
"plugin": "dummyVis",
"state": {
"text": "A",
"color": "#a8ffd0"
}
},
"B": {
"plugin": "dummyVis",
"state": {
"text": "B",
"color": "#a8f0ff"
}
},
"C": {
"plugin": "dummyVis",
"state": {
"text": "C",
"color": "#ffe2a8"
}
},
"wave": {
"plugin": "wave",
"state": {
"waterColor": "#005387",
"skyColor": "#7DCDFF"
}
},
"links": {
"plugin": "links",
"state": {
"bindings": [
"B.lineWidth -> C.lineWidth"
]
}
}
});
</script>
</body>
</html>
Modified http://curran.github.io/model/cdn/model-v0.2.4.js to a secure url
Modified http://chiasm-project.github.io/chiasm/chiasm-v0.2.0.js to a secure url
Modified http://chiasm-project.github.io/chiasm-component/chiasm-component-v0.2.0.js to a secure url
Modified http://chiasm-project.github.io/chiasm-layout/chiasm-layout-v0.2.1.js to a secure url
Modified http://chiasm-project.github.io/chiasm-links/chiasm-links-v0.2.0.js to a secure url
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js
https://curran.github.io/model/cdn/model-v0.2.4.js
https://chiasm-project.github.io/chiasm/chiasm-v0.2.0.js
https://chiasm-project.github.io/chiasm-component/chiasm-component-v0.2.0.js
https://chiasm-project.github.io/chiasm-layout/chiasm-layout-v0.2.1.js
https://chiasm-project.github.io/chiasm-links/chiasm-links-v0.2.0.js