You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: build/render_hook_docs/DECISION_TREE_FORMAT.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ questions:
49
49
-**`scope`** (required): Category or domain this tree applies to (e.g., `documents`, `collections`, `sequences`). Helps AI agents understand the tree's purpose and applicability.
50
50
-**`rootQuestion`** (required): The ID of the starting question
51
51
-**`questions`** (required): Object containing all questions, keyed by ID
52
+
-**`indentWidth`** (optional): Horizontal spacing in pixels between parent and child nodes. Default: 40. Use smaller values (e.g., 20-30) for deeply nested trees to reduce overall width. This is a rendering preference and does not affect the semantic metadata.
52
53
53
54
### Question Object
54
55
@@ -138,6 +139,7 @@ scope: documents
138
139
8. **Add sentiment for suitability trees**: If your tree determines whether something is suitable (not just choosing between options), use `sentiment: "positive"` and `sentiment: "negative"` to provide visual feedback
139
140
9. **Be consistent with sentiment**: In a suitability tree, ensure all positive outcomes have `sentiment: "positive"` and all negative outcomes have `sentiment: "negative"` for clarity
140
141
10. **Control answer order**: The order of `yes` and `no` in the YAML controls the visual layout. For early rejection patterns, put `no` first so negative outcomes appear on the left side of the diagram
142
+
11. **Adjust indent width for deeply nested trees**: If your tree has many levels and becomes too wide, use `indentWidth="25"` (or lower) in the code block fence to reduce horizontal spacing between parent and child nodes
Copy file name to clipboardExpand all lines: build/render_hook_docs/DECISION_TREE_IMPLEMENTATION_NOTES.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,3 +197,60 @@ answerLabel = item.answer || 'Yes'; // Use stored value, not position
197
197
198
198
**Key Insight**: YAML object key order is preserved in JavaScript (since ES2015), and we now respect both the order AND the actual answer values, making the layout fully author-controlled.
199
199
200
+
## 13. Configurable Indent Width for Deeply Nested Trees
201
+
202
+
**Problem**: Deeply nested decision trees (with many levels of questions) can become too wide to fit on the page, requiring horizontal scrolling.
203
+
204
+
**Solution**: Added optional `indentWidth` parameter to the YAML root object that controls the horizontal spacing between parent and child nodes:
205
+
206
+
```yaml
207
+
id: when-to-use-rdi
208
+
scope: rdi
209
+
indentWidth: 25 # Reduce from default 40 to make tree narrower
210
+
rootQuestion: cacheTarget
211
+
questions:
212
+
# ...
213
+
```
214
+
215
+
**Implementation**:
216
+
In `renderDecisionTree()`, the indent width is read from `treeData.indentWidth` with a sensible default:
Copy file name to clipboardExpand all lines: content/integrate/redis-data-integration/when-to-use.md
+17-30Lines changed: 17 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,7 @@ Use the decision tree below to determine whether RDI is a good fit for your arch
71
71
```decision-tree {id="when-to-use-rdi"}
72
72
id: when-to-use-rdi
73
73
scope: rdi
74
+
indentWidth: 25
74
75
rootQuestion: cacheTarget
75
76
questions:
76
77
cacheTarget:
@@ -82,7 +83,7 @@ questions:
82
83
no:
83
84
value: "No"
84
85
outcome:
85
-
label: "RDI is not necessary - you don't need Redis as a cache"
86
+
label: "RDI only works with Redis as the target database"
86
87
id: noRedisCache
87
88
sentiment: "negative"
88
89
yes:
@@ -97,39 +98,24 @@ questions:
97
98
no:
98
99
value: "No"
99
100
outcome:
100
-
label: "RDI won't work - you need a single source database"
101
+
label: "RDI won't work with multiple source databases"
101
102
id: multipleSourcesOrActiveActive
102
103
sentiment: "negative"
103
104
yes:
104
105
value: "Yes"
105
106
nextQuestion: systemOfRecord
106
107
systemOfRecord:
107
108
text: |
108
-
Is the source database your system of record?
109
+
Does your app always *write* to the source database and not to Redis?
109
110
whyAsk: |
110
111
RDI requires the source database to be the authoritative source of truth. If your app writes to Redis first, RDI won't work.
111
112
answers:
112
113
no:
113
114
value: "No"
114
115
outcome:
115
-
label: "RDI won't work - the source database must be the system of record"
116
+
label: "RDI doesn't support syncing data from Redis back to the source database"
116
117
id: notSystemOfRecord
117
118
sentiment: "negative"
118
-
yes:
119
-
value: "Yes"
120
-
nextQuestion: appWritesToDb
121
-
appWritesToDb:
122
-
text: |
123
-
Does your app always write its data to the source database?
124
-
whyAsk: |
125
-
RDI requires the app to write to the source database first. If your app writes to Redis first, RDI cannot maintain consistency.
126
-
answers:
127
-
no:
128
-
value: "No"
129
-
outcome:
130
-
label: "RDI won't work - your app must write to the source database"
131
-
id: appWritesToRedis
132
-
sentiment: "negative"
133
119
yes:
134
120
value: "Yes"
135
121
nextQuestion: consistency
@@ -142,7 +128,7 @@ questions:
142
128
no:
143
129
value: "No"
144
130
outcome:
145
-
label: "RDI is not suitable - you need immediate cache consistency"
131
+
label: "RDI does not provide immediate cache consistency"
146
132
id: needsImmediate
147
133
sentiment: "negative"
148
134
yes:
@@ -195,33 +181,33 @@ questions:
195
181
nextQuestion: dataSize
196
182
dataSize:
197
183
text: |
198
-
Is your total data size not larger than 100GB?
184
+
Is your total data size smaller than 100GB?
199
185
whyAsk: |
200
186
RDI has practical limits on the total data size it can manage. Very large datasets may exceed these limits.
201
187
answers:
202
188
no:
203
189
value: "No"
204
190
outcome:
205
-
label: "RDI may not be suitable - your data set is too large"
191
+
label: "RDI may not be suitable - your data set is probably too large"
206
192
id: dataTooLarge
207
193
sentiment: "negative"
208
194
yes:
209
195
value: "Yes"
210
196
nextQuestion: joins
211
197
joins:
212
198
text: |
213
-
Do you not need to perform join operations on data from several tables into a nested Redis JSON object?
199
+
Do you need to perform join operations on data from several tables into a nested Redis JSON object?
214
200
whyAsk: |
215
201
RDI has limitations with complex join operations. If you need to combine data from multiple tables into nested structures, you may need custom transformations.
216
202
answers:
217
-
no:
218
-
value: "No"
203
+
yes:
204
+
value: "Yes"
219
205
outcome:
220
206
label: "RDI may not be suitable - complex joins are not well supported"
221
207
id: complexJoins
222
208
sentiment: "negative"
223
-
yes:
224
-
value: "Yes"
209
+
no:
210
+
value: "No"
225
211
nextQuestion: transformations
226
212
transformations:
227
213
text: |
@@ -232,22 +218,23 @@ questions:
232
218
no:
233
219
value: "No"
234
220
outcome:
235
-
label: "RDI may not be suitable - required transformations are not supported"
221
+
label: "RDI may not be able to perform the required data transformations"
236
222
id: unsupportedTransformations
237
223
sentiment: "negative"
238
224
yes:
239
225
value: "Yes"
240
226
nextQuestion: adminReview
241
227
adminReview:
242
228
text: |
243
-
Has your database administrator reviewed and confirmed that RDI's requirements for the source database are acceptable?
229
+
Has your database administrator reviewed RDI's requirements for the source database
230
+
and confirmed they are acceptable?
244
231
whyAsk: |
245
232
RDI has specific requirements for the source database (binary logging, permissions, etc.). Your DBA must confirm these are acceptable before proceeding.
246
233
answers:
247
234
no:
248
235
value: "No"
249
236
outcome:
250
-
label: "RDI is not suitable - database administrator has rejected RDI's requirements"
237
+
label: "RDI requirements for the source database can't be met"
0 commit comments