Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// this._leftBorder = leftBorder
// this._bottomBorder = bottomBorder
// var draw = SVG('drawing').size(100, 100)
// this.value = draw.rect(100, 100).fill('#f06')
// }
// static requestHandler(request: Hapi.Request, h: any)
// {
// const instance = new Tile(1, true, true)
// return instance.value
// }
// }
import window from 'svgdom'
const document = window.document
import { SVG, registerWindow } from '@svgdotjs/svg.js'
registerWindow(window , document)
export default class Tile
{
constructor(thickness, leftBorder, bottomBorder)
{
this._thickness = thickness
this._leftBorder = leftBorder
this._bottomBorder = bottomBorder
const canvas = SVG(document.documentElement)
canvas.attr({
'use strict';
const express = require('express');
const port = process.env.PORT || 3000;
const window = require('svgdom');
const SVG = require('svg.js')(window);
require('svg.path.js');
const doc = window.document;
const draw = SVG(doc.documentElement);
const svg2png = require('svg2png');
require('./cat.js');
function getCatSvg() {
// Put everything in a viewbox
draw.viewbox(0, 0, 100, 120);
// Create a background
//draw.rect(1000, 1000).move(-500, -500).fill('yellow');
// Draw the cat
draw.cat();
tape('translate can take an array and set transform attr on svg element', function(test) {
var svg = svgdom.document.documentElement;
d3.select(svg).translate([10, 10]);
test.equal(svg.getAttribute('transform'), 'translate(10,10)');
test.end();
});
tape('translate can take an array and set transform attr on svg element', function(test) {
var svg = svgdom.document.documentElement;
d3.select(svg).translate(function(){ return [10, 10]; });
test.equal(svg.getAttribute('transform'), 'translate(10,10)');
test.end();
});
parserInDoc = false
if(typeof exports === 'object'){
window = require('svgdom')
SVG = require('../../dist/svg.js')
document = window.document
drawing = document.documentElement
imageUrl = 'spec/fixtures/pixel.png'
parserInDoc = true
function tag(name, attrs, children) {
var el = document.createElement(name)
for(var i in attrs){
el.setAttribute(i, attrs[i])
}
for(var i in children){
if(typeof children[i] == 'string')
children[i] = document.createTextNode(children[i])
el.appendChild(children[i])
}