How to use tiny-svg - 10 common examples

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 / diagram-js / test / spec / layout / CroppingConnectionDockingSpec.js View on Github external
function visualizeExpected(canvas, point) {
  var circle = svgCreate('circle');
  svgAttr(circle, {
    dx: point.x,
    dy: point.y,
    r: 4
  });

  svgAppend(canvas._svg, circle);

  return circle;
}
github bpmn-io / diagram-js / lib / features / bendpoints / Bendpoints.js View on Github external
connection.waypoints.forEach(function(p, idx) {
      var bendpoint = addBendpoint(gfx);

      svgAppend(gfx, bendpoint);

      translate(bendpoint, p.x, p.y);
    });
github bpmn-io / cmmn-js / lib / features / replace-preview / CmmnReplacePreview.js View on Github external
function replaceVisualGraphics(gfx, shape) {

    var visual = gfx && getVisual(gfx);

    if (visual) {
      svgRemove(visual);

      visual = svgCreate('g');
      svgClasses(visual).add('djs-visual');

      svgAppend(gfx, visual);

      graphicsFactory.drawShape(visual, shape);
    }

  }
github bptlab / chor-js / lib / draw / ChoreoRenderer.js View on Github external
function drawMarker(type, parentGfx, d, attrs) {
    attrs = assign({ 'data-marker': type }, attrs);
    attrs = styles.computeStyle(attrs, ['no-fill'], {
      strokeWidth: 2,
      stroke: 'black'
    });

    const path = svgCreate('path');
    svgAttr(path, { d: d });
    svgAttr(path, attrs);

    svgAppend(parentGfx, path);

    return path;
  }
github bpmn-io / bpmn-js / lib / draw / BpmnRenderer.js View on Github external
function drawPath(parentGfx, d, attrs) {

    attrs = computeStyle(attrs, [ 'no-fill' ], {
      strokeWidth: 2,
      stroke: 'black'
    });

    var path = svgCreate('path');
    svgAttr(path, { d: d });
    svgAttr(path, attrs);

    svgAppend(parentGfx, path);

    return path;
  }
github bptlab / chor-js / lib / draw / ChoreoRenderer.js View on Github external
function drawMarker(type, parentGfx, d, attrs) {
    attrs = assign({ 'data-marker': type }, attrs);
    attrs = styles.computeStyle(attrs, ['no-fill'], {
      strokeWidth: 2,
      stroke: 'black'
    });

    const path = svgCreate('path');
    svgAttr(path, { d: d });
    svgAttr(path, attrs);

    svgAppend(parentGfx, path);

    return path;
  }
github bpmn-io / bpmn-js / lib / draw / BpmnRenderer.js View on Github external
function drawPath(parentGfx, d, attrs) {

    attrs = computeStyle(attrs, [ 'no-fill' ], {
      strokeWidth: 2,
      stroke: 'black'
    });

    var path = svgCreate('path');
    svgAttr(path, { d: d });
    svgAttr(path, attrs);

    svgAppend(parentGfx, path);

    return path;
  }
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 / cmmn-js / lib / draw / CmmnRenderer.js View on Github external
function drawPath(parentGfx, d, attrs) {

    attrs = computeStyle(attrs, [ 'no-fill' ], {
      strokeWidth: 2,
      stroke: 'black'
    });

    var path = svgCreate('path');
    svgAttr(path, { d: d });
    svgAttr(path, attrs);

    svgAppend(parentGfx, path);

    return path;
  }
github bpmn-io / dmn-js / packages / dmn-js-drd / src / draw / DrdRenderer.js View on Github external
function drawPath(p, d, attrs) {

    attrs = computeStyle(attrs, [ 'no-fill' ], {
      strokeWidth: 2,
      stroke: 'black'
    });

    var path = svgCreate('path');
    svgAttr(path, { d: d });
    svgAttr(path, attrs);

    svgAppend(p, path);

    return path;
  }

tiny-svg

A minimal toolbelt for builing fast SVG-based applications

MIT
Latest version published 3 months ago

Package Health Score

76 / 100
Full package analysis