ForgeComponents
en

Components

j-Diagram

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20

Configuration:

  • parent {String} optional, a container with fixed height, can be window. Default value: parent element.
  • margin {Number} optional, a top/bottom margin together (default: 0)
  • marginxs {Number} optional, a top/bottom margin together for xs screen width
  • marginsm optional, a top/bottom margin together for sm screen width
  • marginmd optional, a top/bottom margin together for md screen width
  • marginlg optional, a top/bottom margin together for lg screen width
  • reverse {Boolean}, reverses diagram

Use it with <ui-component name="diagram">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

example.html
<div style="width:600px;height:400px;border:1px solid #E0E0E0">
	<ui-component name="diagram" path="items" class="invisible">
		<script type="text/html">
			<div style="padding:10px;{{ if id === 'AA' }}width:200px;height:150px{{ fi }}{{ if id === 'BC' }}height:100px{{ fi }}">{{ id }}</div>
		</script>
	</ui-component>
</div>

<script>

	var items = [];
	items.push({ id: 'A', items: [{ id: 'AA', items: [{ id: 'AAA' }] }] });
	items.push({ id: 'B', items: [{ id: 'BA' }, { id: 'BB' }, { id: 'BC', items: [{ id: 'BCA' }] }] });
	items.push({ id: 'C', items: [{ id: 'CA', items: [{ id: 'CAA' }] }, { id: 'CB' }, { id: 'CC' }, { id: 'CD', items: [{ id: 'CDA' }] }] });

</script>