@@ -649,31 +649,36 @@ export class ContextUsageMeter {
649649 const y2 = cy + radius * Math . sin ( endRad ) ;
650650
651651 const gaugeEl = this . container . createDiv ( { cls : 'qoderian-context-meter-gauge' } ) ;
652- const svg = gaugeEl . ownerDocument . createElementNS ( 'http://www.w3.org/2000/svg' , 'svg' ) ;
653- svg . setAttribute ( 'width' , String ( size ) ) ;
654- svg . setAttribute ( 'height' , String ( size ) ) ;
655- svg . setAttribute ( 'viewBox' , `0 0 ${ size } ${ size } ` ) ;
652+ const svg = gaugeEl . createSvg ( 'svg' , {
653+ attr : {
654+ width : String ( size ) ,
655+ height : String ( size ) ,
656+ viewBox : `0 0 ${ size } ${ size } ` ,
657+ } ,
658+ } ) ;
656659
657660 const pathData = `M ${ x1 } ${ y1 } A ${ radius } ${ radius } 0 1 1 ${ x2 } ${ y2 } ` ;
658- const backgroundPath = gaugeEl . ownerDocument . createElementNS ( 'http://www.w3.org/2000/svg' , 'path' ) ;
659- backgroundPath . classList . add ( 'qoderian-meter-bg' ) ;
660- backgroundPath . setAttribute ( 'd' , pathData ) ;
661- backgroundPath . setAttribute ( 'fill' , 'none' ) ;
662- backgroundPath . setAttribute ( 'stroke-width' , String ( strokeWidth ) ) ;
663- backgroundPath . setAttribute ( 'stroke-linecap' , 'round' ) ;
664-
665- const fillPath = gaugeEl . ownerDocument . createElementNS ( 'http://www.w3.org/2000/svg' , 'path' ) ;
666- fillPath . classList . add ( 'qoderian-meter-fill' ) ;
667- fillPath . setAttribute ( 'd' , pathData ) ;
668- fillPath . setAttribute ( 'fill' , 'none' ) ;
669- fillPath . setAttribute ( 'stroke-width' , String ( strokeWidth ) ) ;
670- fillPath . setAttribute ( 'stroke-linecap' , 'round' ) ;
671- fillPath . setAttribute ( 'stroke-dasharray' , String ( this . circumference ) ) ;
672- fillPath . setAttribute ( 'stroke-dashoffset' , String ( this . circumference ) ) ;
673-
674- svg . appendChild ( backgroundPath ) ;
675- svg . appendChild ( fillPath ) ;
676- gaugeEl . appendChild ( svg ) ;
661+ svg . createSvg ( 'path' , {
662+ cls : 'qoderian-meter-bg' ,
663+ attr : {
664+ d : pathData ,
665+ fill : 'none' ,
666+ 'stroke-width' : String ( strokeWidth ) ,
667+ 'stroke-linecap' : 'round' ,
668+ } ,
669+ } ) ;
670+
671+ const fillPath = svg . createSvg ( 'path' , {
672+ cls : 'qoderian-meter-fill' ,
673+ attr : {
674+ d : pathData ,
675+ fill : 'none' ,
676+ 'stroke-width' : String ( strokeWidth ) ,
677+ 'stroke-linecap' : 'round' ,
678+ 'stroke-dasharray' : String ( this . circumference ) ,
679+ 'stroke-dashoffset' : String ( this . circumference ) ,
680+ } ,
681+ } ) ;
677682 this . fillPath = fillPath ;
678683
679684 this . percentEl = this . container . createSpan ( { cls : 'qoderian-context-meter-percent' } ) ;
0 commit comments