How to use the tiny-svg.create function in tiny-svg

To help you get started, we’ve selected a few tiny-svg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bpmn-io / cmmn-js / lib / draw / CmmnRenderer.js View on Github external
function drawPolygon(parentGfx, points, attrs) {
    var pointsString = points.map(function(point) {
      return point.x + ',' + point.y;
    }).join(' ');

    var polygon = svgCreate('polygon');

    svgAttr(polygon, {
      points: pointsString
    });
    svgAttr(polygon, attrs);

    svgAppend(parentGfx, polygon);

    return polygon;
  }
github bpmn-io / diagram-js / lib / features / outline / Outline.js View on Github external
function createOutline(gfx, bounds) {
    var outline = svgCreate('rect');

    svgAttr(outline, assign({
      x: 10,
      y: 10,
      width: 100,
      height: 100
    }, OUTLINE_STYLE));

    svgAppend(gfx, outline);

    return outline;
  }
github bpmn-io / diagram-js / lib / features / lasso-tool / LassoTool.js View on Github external
create: function(context) {
      var container = canvas.getDefaultLayer(),
          frame;

      frame = context.frame = svgCreate('rect');
      svgAttr(frame, {
        class: 'djs-lasso-overlay',
        width:  1,
        height: 1,
        x: 0,
        y: 0
      });

      svgAppend(container, frame);
    },

tiny-svg

A minimal toolbelt for builing fast SVG-based applications

MIT
Latest version published 2 months ago

Package Health Score

78 / 100
Full package analysis