Decoupled Two-Tab Render Studio & 3-Column IDE
Experience the latest architecture: Tab 1 (The Foundry) gives you a full 3-column Monaco workspace (Source + Template + Output with Transform hook), while Tab 2 (The Canvas) runs clean, unbloated live HTML powered by BroadcastChannel and the JSON-to-DOM engine!
The Mental Model: The Conveyor Belt
In the KeshavSoft ecosystem, 0D (`primitive`) is the mold: it stamps one piece of data into one element. But user interfaces are filled with linear repetition — an array of column definitions stamping into table headers (<th>), width definitions stamping into <col> tags, or record rows stamping into dropdown <option> tags.
Engine 2 (`one-dimension`) is the Conveyor Belt: you place a stream (array) of data objects onto the belt. As each object passes under the stamp, the engine transforms it through a template and emits a continuous, predictable array of sibling element nodes.
- Uniform Stamping (
fromCollection(source, template)): Every item on the conveyor is stamped using the same identical template mold. - Heterogeneous Stamping (
loopWithIndividualTemplate(source, templateKey)): Each item carries its own template specification key, allowing diverse element shapes on a single conveyor pass.
The JSON Transformer Family
How the one-dimensional collection engine fits into the overall declarative rendering ecosystem:
Primitive Engine
Transforms one object with one template into one element node. Resolves ${placeholders} and tag attributes.
One-Dimensional Engine
Transforms a list of objects with one template into a list of sibling element nodes (e.g. <th>, <col>, <option>).
Two-Dimensional Engine
Combines rows and columns across both dimensions to construct full table bodies (<tbody> with nested <tr> and <td>).
The Heart: Pure, Guarded Transformation
Internally, the engine delegates to the primitive engine with guaranteed linear runtime:
import fromCollection from "json-transformer-funcs-one-dimension";
// Signature:
const output = fromCollection(inSource, inTemplate);
// Heart of the implementation:
return inSource.map(element => applyTemplate(inTemplate, element));
inSourcemust be a non-empty Array.- Every item in
inSourcemust be a plain object. inTemplatemust be an Object or String.
- Pure function with zero side effects.
- Preserves array length:
output.length === inSource.length. - Ready for JSON serialization or direct DOM rendering.
Practical Transformation Examples
See how identical engine logic handles table columns and dropdown items seamlessly:
// Source Columns:
const columns = [
{ "columnName": "itemName" },
{ "columnName": "baseUnit" },
{ "columnName": "batches" }
];
// Single Template:
const template = {
"tagName": "th",
"textContent": "${columnName}"
};
// Result:
fromCollection(columns, template);
/*
[
{ "tagName": "th", "textContent": "itemName" },
{ "tagName": "th", "textContent": "baseUnit" },
{ "tagName": "th", "textContent": "batches" }
]
*/
// Source Items:
const items = [
{ "label": "Cash Account", "id": "A101" },
{ "label": "Bank Account", "id": "A102" }
];
// Single Template:
const template = {
"tagName": "option",
"textContent": "${label}",
"attributes": { "value": "${id}" }
};
// Result:
fromCollection(items, template);
/*
[
{ "tagName": "option", "textContent": "Cash Account", "attributes": { "value": "A101" } },
{ "tagName": "option", "textContent": "Bank Account", "attributes": { "value": "A102" } }
]
*/
Interactive 1D Monaco Studios & Playgrounds
Test linear collection mapping live in full-screen Monaco Editor workspaces — from the cutting-edge Two-Tab Live Render Studio (v2) and 3-Column Studio (v3), to the flagship 50/50 Dual-Pane Studio (v1) and legacy generations.