File tree Expand file tree Collapse file tree 1 file changed +84
-0
lines changed Expand file tree Collapse file tree 1 file changed +84
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,90 @@ RectY can be used for range annotations:
133
133
134
134
## Stacking
135
135
136
+ RectX marks can be stacked along the x dimension (over identical y1 values):
137
+
136
138
``` svelte live
139
+ <script>
140
+ import { Plot, RectX } from 'svelteplot';
141
+
142
+ const data = [
143
+ {
144
+ width: 2.5,
145
+ height: 1,
146
+ category: 'A'
147
+ },
148
+ {
149
+ width: 3,
150
+ height: 4,
151
+ category: 'B'
152
+ },
153
+ {
154
+ width: 4,
155
+ height: 3,
156
+ category: 'C'
157
+ }
158
+ ];
159
+ </script>
137
160
161
+ <Plot height={300} color={{ legend: true }}>
162
+ <RectX
163
+ {data}
164
+ x="width"
165
+ y1={0}
166
+ y2="height"
167
+ fill="category"
168
+ insetRight={1} />
169
+ </Plot>
138
170
```
171
+
172
+ ``` svelte
173
+ <Plot>
174
+ <RectX
175
+ {data}
176
+ x="width"
177
+ y1={0}
178
+ y2="height"
179
+ fill="category"
180
+ insetRight={1} />
181
+ </Plot>
182
+ ```
183
+
184
+ [ fork] ( https://svelte.dev/playground/9fe225752dbd43fdb00123dcf7bf9441?version=5 )
185
+
186
+ RectY marks can be stacked along y (over identical x1 values).
187
+
188
+ ``` svelte live
189
+ <script>
190
+ import { Plot, RectY } from 'svelteplot';
191
+
192
+ const data = [
193
+ { width: 2.5, height: 1, category: 'A' },
194
+ { width: 3, height: 4, category: 'B' },
195
+ { width: 4, height: 3, category: 'C' }
196
+ ];
197
+ </script>
198
+
199
+ <Plot height={300} color={{ legend: true }}>
200
+ <RectY
201
+ {data}
202
+ x1={0}
203
+ x2="width"
204
+ y="height"
205
+ fill="category"
206
+ insetBottom={1} />
207
+ </Plot>
208
+ ```
209
+
210
+ ``` svelte
211
+ <Plot>
212
+ <RectY
213
+ {data}
214
+ x1={0}
215
+ x2="width"
216
+ y="height"
217
+ fill="category"
218
+ insetBottom={1} />
219
+ </Plot>
220
+ ```
221
+
222
+ [ fork] ( https://svelte.dev/playground/4db4c6caea4f4329a30c1f18c46ea7d9?version=5.33.2 )
You can’t perform that action at this time.
0 commit comments