# j-Diagram

> j-Diagram options: parent, margin, marginxs, marginsm, marginmd, marginlg, reverse

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 81d2acf25ecc10cba25072602d611ba768daf7ea061d10a03a326a89d2d15bf4
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

__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.

```html 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>
```
