File tree Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ export function canvas ( width : number , height : number ) : HTMLCanvasElement {
2+ const canvas = document . createElement ( "canvas" ) ;
3+ canvas . width = width ;
4+ canvas . height = height ;
5+ return canvas ;
6+ }
Original file line number Diff line number Diff line change 1+ export { canvas } from "./canvas.js" ;
12export { context2d } from "./context2d.js" ;
3+ export { svg } from "./svg.js" ;
4+ export { text } from "./text.js" ;
25export { uid } from "./uid.js" ;
Original file line number Diff line number Diff line change 1+ export function svg ( width : number , height : number ) : SVGSVGElement {
2+ const svg = document . createElementNS ( "http://www.w3.org/2000/svg" , "svg" ) ;
3+ svg . setAttribute ( "viewBox" , `0 0 ${ width } ${ height } ` ) ;
4+ svg . setAttribute ( "width" , `${ width } ` ) ;
5+ svg . setAttribute ( "height" , `${ height } ` ) ;
6+ return svg ;
7+ }
Original file line number Diff line number Diff line change 1+ export function text ( value : string ) : Text {
2+ return document . createTextNode ( value ) ;
3+ }
You can’t perform that action at this time.
0 commit comments