@@ -86,6 +86,12 @@ a.anchor-link {
86
86
.jp-RenderedHTMLCommon.jp-RenderedHTML.jp-OutputArea-output.jp-OutputArea-executeResult {
87
87
padding-right : 5px !important ; /* padding after lead-in text */
88
88
}
89
+ .jp-RenderedSVG > svg , .jp-OutputArea-output > svg { /* scale SVG plots */
90
+ width : 75% ;
91
+ }
92
+ .jp-Collapser { /* hide that blue collapse button on the side of cells that does nothing */
93
+ display : none ;
94
+ }
89
95
.CodeMirror pre {
90
96
padding : 0.4em !important ;
91
97
overflow-x : scroll !important ; /* allow scrolling to see full code block */
@@ -97,8 +103,8 @@ a.anchor-link {
97
103
right : 5px !important ;
98
104
bottom : 5px !important ;
99
105
}
100
- .jp-RenderedSVG > svg , .jp-OutputArea-output > svg { /* scale SVG plots */
101
- width : 75 % ;
106
+ .slides { /* pull slides to left */
107
+ margin-left : -20 px !important ;
102
108
}
103
109
:root {
104
110
--jp-ui-font-size1 : 11.5px ; /* size of tables in outputs */
@@ -203,7 +209,8 @@ require(
203
209
if (! isNaN (input)) {
204
210
const requestedSlideNumber = Math .max (Math .min (input, slides .length ) - 1 , 0 );
205
211
const slideIndices = Reveal .getIndices (slides[requestedSlideNumber]);
206
- Reveal .slide (slideIndices .h , slideIndices .v , 100 ); // set fragment to large number to ensure the full slide is displayed
212
+ // set fragment to large number (100) to ensure the full slide is displayed
213
+ Reveal .slide (slideIndices .h , slideIndices .v , 100 );
207
214
}
208
215
else if (typeof input === " string" || input instanceof String ) {
209
216
const slideName = input .replaceAll (' ' , ' -' );
@@ -285,6 +292,26 @@ require(
285
292
() => { window .location = ` #/${ id} ` ; }
286
293
);
287
294
}
295
+
296
+ // fix any collisions in the clip-path introduced from reproducible SVG plots
297
+ // that cause plot components not to render (clipPath objects with duplicate IDs)
298
+ const clipPathIds = {};
299
+ $ (' clipPath' ).each ((index , element ) => {
300
+ const oldId = $ (element).attr (' id' );
301
+ if (oldId in clipPathIds) {
302
+ // change this id and grab the parent SVG
303
+ // and then for all the elements with clip-path switch the id
304
+ const newId = ` ${ oldId}${ clipPathIds[oldId]} ` ;
305
+ $ (element).attr (' id' , newId);
306
+ $ (element).closest (' svg' ).find (' [clip-path]' ).each ((index , item ) => {
307
+ if ($ (item).attr (' clip-path' ) === ` url(#${ oldId} )` ) {
308
+ $ (item).attr (' clip-path' , ` url(#${ newId} )` );
309
+ }
310
+ });
311
+ clipPathIds[oldId] += 1 ;
312
+ }
313
+ else clipPathIds[oldId] = 1 ;
314
+ });
288
315
}
289
316
);
290
317
</script >
0 commit comments