Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-arrow

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-arrow - npm Package Compare versions

Comparing version 0.0.12 to 0.0.15

src/arrow-1.js

76

dist/d3-arrow.js

@@ -1,2 +0,2 @@

// https://github.com/HarryStevens/d3-arrow#readme Version 0.0.12. Copyright 2020 Harry Stevens.
// https://github.com/HarryStevens/d3-arrow#readme Version 0.0.15. Copyright 2020 Harry Stevens.
(function (global, factory) {

@@ -18,2 +18,39 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :

function draw$1(context, attrs, id, scale, refX, refY, d) {
var defs = context.select("defs");
if (defs.empty()) {
defs = context.append("defs");
}
var path = defs.append("marker").attr("id", id).attr("refX", refX * scale).attr("refY", refY * scale).attr("markerWidth", refX + 2 * scale).attr("markerHeight", refY * 2 * scale).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto-start-reverse").append("path").attr("d", d);
iterate(attrs, path);
}
function arrow1() {
var attrs = {
fill: "black"
};
var id = "d3-arrow-1";
var scale = 1;
function arrow(context) {
draw$1(context, attrs, id, scale, 14, 9, "M 1 1 Q ".concat(8 * scale, " ").concat(6 * scale, " ").concat(16 * scale, " ").concat(9 * scale, " Q ").concat(8 * scale, " ").concat(12 * scale, " 1 ").concat(17 * scale, " L ").concat(4 * scale, " ").concat(9 * scale, " Z"));
}
arrow.id = function (string) {
return arguments.length ? (id = string, arrow) : id;
};
arrow.scale = function (number) {
return arguments.length ? (scale = number, arrow) : scale;
};
arrow.attr = function (key, value) {
return arguments.length === 2 ? (attrs[key] = value, arrow) : attrs[key];
};
return arrow;
}
function arrow5() {

@@ -27,10 +64,3 @@ var attrs = {

function arrow(context) {
var defs = context.select("defs");
if (defs.empty()) {
defs = context.append("defs");
}
var path = defs.append("marker").attr("id", id).attr("refX", 13 * scale).attr("refY", 7 * scale).attr("markerWidth", 15 * scale).attr("markerHeight", 14 * scale).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L ".concat(15 * scale, " ").concat(7 * scale, " L 0 ").concat(14 * scale, " L ").concat(2.5 * scale, " ").concat(7 * scale, " z"));
iterate(attrs, path);
draw$1(context, attrs, id, scale, 14, 8, "M 1 1 L ".concat(16 * scale, " ").concat(8 * scale, " L 1 ").concat(15 * scale, " L ").concat(3.5 * scale, " ").concat(8 * scale, " z"));
}

@@ -63,10 +93,3 @@

function arrow(context) {
var defs = context.select("defs");
if (defs.empty()) {
defs = context.append("defs");
}
var path = defs.append("marker").attr("id", id).attr("refX", 4 * scale).attr("refY", 3.5 * scale).attr("markerWidth", 6 * scale).attr("markerHeight", 7 * scale).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L ".concat(4 * scale, " ").concat(3.5 * scale, " L 0 ").concat(7 * scale));
iterate(attrs, path);
draw$1(context, attrs, id, scale, 5, 4.5, "M 1 1 L ".concat(5 * scale, " ").concat(4.5 * scale, " L 1 ").concat(8 * scale));
}

@@ -99,10 +122,3 @@

function arrow(context) {
var defs = context.select("defs");
if (defs.empty()) {
defs = context.append("defs");
}
var path = defs.append("marker").attr("id", id).attr("refX", 7 * scale).attr("refY", 7 * scale).attr("markerWidth", 8 * scale).attr("markerHeight", 14 * scale).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L ".concat(7 * scale, " ").concat(7 * scale, " L 0 ").concat(14 * scale));
iterate(attrs, path);
draw$1(context, attrs, id, scale, 8, 8, "M 1 1 L ".concat(8 * scale, " ").concat(8 * scale, " L 1 ").concat(15 * scale));
}

@@ -135,10 +151,3 @@

function arrow(context) {
var defs = context.select("defs");
if (defs.empty()) {
defs = context.append("defs");
}
var path = defs.append("marker").attr("id", id).attr("refX", 12 * scale).attr("refY", 9 * scale).attr("markerWidth", 14 * scale).attr("markerHeight", 18 * scale).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L ".concat(12 * scale, " ").concat(9 * scale, " L 0 ").concat(18 * scale));
iterate(attrs, path);
draw(context, attrs, id, scale, 13, 10, "M 1 1 L ".concat(13 * scale, " ").concat(10 * scale, " L 1 ").concat(19 * scale));
}

@@ -161,2 +170,3 @@

exports.arrow1 = arrow1;
exports.arrow10 = arrow10;

@@ -163,0 +173,0 @@ exports.arrow11 = arrow11;

@@ -1,1 +0,1 @@

!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):(t=t||self,r(t.d3=t.d3||{}))}(this,function(t){"use strict";function r(t,r){for(var e=Object.keys(t),a=e.length,n=0;n<a;n++){var o=e[n];r.attr(o,t[o])}}function e(){function t(t){var o=t.select("defs");o.empty()&&(o=t.append("defs"));var c=o.append("marker").attr("id",a).attr("refX",13*n).attr("refY",7*n).attr("markerWidth",15*n).attr("markerHeight",14*n).attr("markerUnits","userSpaceOnUse").attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L ".concat(15*n," ").concat(7*n," L 0 ").concat(14*n," L ").concat(2.5*n," ").concat(7*n," z"));r(e,c)}var e={fill:"black"},a="d3-arrow-5",n=1;return t.id=function(r){return arguments.length?(a=r,t):a},t.scale=function(r){return arguments.length?(n=r,t):n},t.attr=function(r,a){return 2===arguments.length?(e[r]=a,t):e[r]},t}function a(){function t(t){var o=t.select("defs");o.empty()&&(o=t.append("defs"));var c=o.append("marker").attr("id",a).attr("refX",4*n).attr("refY",3.5*n).attr("markerWidth",6*n).attr("markerHeight",7*n).attr("markerUnits","userSpaceOnUse").attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L ".concat(4*n," ").concat(3.5*n," L 0 ").concat(7*n));r(e,c)}var e={fill:"none",stroke:"black","stroke-width":1},a="d3-arrow-10",n=1;return t.id=function(r){return arguments.length?(a=r,t):a},t.scale=function(r){return arguments.length?(n=r,t):n},t.attr=function(r,a){return 2===arguments.length?(e[r]=a,t):e[r]},t}function n(){function t(t){var o=t.select("defs");o.empty()&&(o=t.append("defs"));var c=o.append("marker").attr("id",a).attr("refX",7*n).attr("refY",7*n).attr("markerWidth",8*n).attr("markerHeight",14*n).attr("markerUnits","userSpaceOnUse").attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L ".concat(7*n," ").concat(7*n," L 0 ").concat(14*n));r(e,c)}var e={fill:"none",stroke:"black","stroke-width":1},a="d3-arrow-10",n=1;return t.id=function(r){return arguments.length?(a=r,t):a},t.scale=function(r){return arguments.length?(n=r,t):n},t.attr=function(r,a){return 2===arguments.length?(e[r]=a,t):e[r]},t}function o(){function t(t){var o=t.select("defs");o.empty()&&(o=t.append("defs"));var c=o.append("marker").attr("id",a).attr("refX",12*n).attr("refY",9*n).attr("markerWidth",14*n).attr("markerHeight",18*n).attr("markerUnits","userSpaceOnUse").attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L ".concat(12*n," ").concat(9*n," L 0 ").concat(18*n));r(e,c)}var e={fill:"none",stroke:"black","stroke-width":1},a="d3-arrow-10",n=1;return t.id=function(r){return arguments.length?(a=r,t):a},t.scale=function(r){return arguments.length?(n=r,t):n},t.attr=function(r,a){return 2===arguments.length?(e[r]=a,t):e[r]},t}t.arrow10=a,t.arrow11=n,t.arrow13=o,t.arrow5=e,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):(t=t||self,n(t.d3=t.d3||{}))}(this,function(t){"use strict";function n(t,n){for(var r=Object.keys(t),e=r.length,c=0;c<e;c++){var o=r[c];n.attr(o,t[o])}}function r(t,r,e,c,o,a,u){var i=t.select("defs");i.empty()&&(i=t.append("defs")),n(r,i.append("marker").attr("id",e).attr("refX",o*c).attr("refY",a*c).attr("markerWidth",o+2*c).attr("markerHeight",2*a*c).attr("markerUnits","userSpaceOnUse").attr("orient","auto-start-reverse").append("path").attr("d",u))}function e(){function t(t){r(t,n,e,c,14,9,"M 1 1 Q ".concat(8*c," ").concat(6*c," ").concat(16*c," ").concat(9*c," Q ").concat(8*c," ").concat(12*c," 1 ").concat(17*c," L ").concat(4*c," ").concat(9*c," Z"))}var n={fill:"black"},e="d3-arrow-1",c=1;return t.id=function(n){return arguments.length?(e=n,t):e},t.scale=function(n){return arguments.length?(c=n,t):c},t.attr=function(r,e){return 2===arguments.length?(n[r]=e,t):n[r]},t}function c(){function t(t){r(t,n,e,c,14,8,"M 1 1 L ".concat(16*c," ").concat(8*c," L 1 ").concat(15*c," L ").concat(3.5*c," ").concat(8*c," z"))}var n={fill:"black"},e="d3-arrow-5",c=1;return t.id=function(n){return arguments.length?(e=n,t):e},t.scale=function(n){return arguments.length?(c=n,t):c},t.attr=function(r,e){return 2===arguments.length?(n[r]=e,t):n[r]},t}function o(){function t(t){r(t,n,e,c,5,4.5,"M 1 1 L ".concat(5*c," ").concat(4.5*c," L 1 ").concat(8*c))}var n={fill:"none",stroke:"black","stroke-width":1},e="d3-arrow-10",c=1;return t.id=function(n){return arguments.length?(e=n,t):e},t.scale=function(n){return arguments.length?(c=n,t):c},t.attr=function(r,e){return 2===arguments.length?(n[r]=e,t):n[r]},t}function a(){function t(t){r(t,n,e,c,8,8,"M 1 1 L ".concat(8*c," ").concat(8*c," L 1 ").concat(15*c))}var n={fill:"none",stroke:"black","stroke-width":1},e="d3-arrow-10",c=1;return t.id=function(n){return arguments.length?(e=n,t):e},t.scale=function(n){return arguments.length?(c=n,t):c},t.attr=function(r,e){return 2===arguments.length?(n[r]=e,t):n[r]},t}function u(){function t(t){draw(t,n,r,e,13,10,"M 1 1 L ".concat(13*e," ").concat(10*e," L 1 ").concat(19*e))}var n={fill:"none",stroke:"black","stroke-width":1},r="d3-arrow-10",e=1;return t.id=function(n){return arguments.length?(r=n,t):r},t.scale=function(n){return arguments.length?(e=n,t):e},t.attr=function(r,e){return 2===arguments.length?(n[r]=e,t):n[r]},t}t.arrow1=e,t.arrow10=o,t.arrow11=a,t.arrow13=u,t.arrow5=c,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -0,1 +1,2 @@

export {default as arrow1} from "./src/arrow-1";
export {default as arrow5} from "./src/arrow-5";

@@ -2,0 +3,0 @@ export {default as arrow10} from "./src/arrow-10";

{
"name": "d3-arrow",
"version": "0.0.12",
"version": "0.0.15",
"description": "Attach arrowheads to SVG elements.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -9,3 +9,3 @@ # d3-arrow

```html
<script src="https://unpkg.com/d3-arrow@0.0.12/dist/d3-arrow.min.js"></script>
<script src="https://unpkg.com/d3-arrow@0.0.15/dist/d3-arrow.min.js"></script>
<script>

@@ -40,2 +40,6 @@

<a name="arrow1" href="#arrow1">#</a> d3.<b>arrow1</b>() · [Source](https://github.com/harrystevens/d3-arrow/blob/master/src/arrow-1.js "Source"), [Example](https://observablehq.com/d/7759e56ba89ced03 "Example")
Creates a new arrow generator with an [<i>id</i>](#arrow_id) of "d3-arrow-1" and a [<i>scale</i>](#arrow_scale) of 1.
<a name="arrow5" href="#arrow5">#</a> d3.<b>arrow5</b>() · [Source](https://github.com/harrystevens/d3-arrow/blob/master/src/arrow-5.js "Source"), [Example](https://observablehq.com/d/7759e56ba89ced03 "Example")

@@ -42,0 +46,0 @@

@@ -1,4 +0,4 @@

import { iterate } from "./utils/iterate";
import { draw } from "./utils/draw";
export default function arrow10() {
export default function arrow10(){
let attrs = {

@@ -13,19 +13,11 @@ fill: "none",

function arrow(context){
let defs = context.select("defs");
if (defs.empty()) {
defs = context.append("defs");
}
const path = defs.append("marker")
.attr("id", id)
.attr("refX", 4 * scale)
.attr("refY", 3.5 * scale)
.attr("markerWidth", 6 * scale)
.attr("markerHeight", 7 * scale)
.attr("markerUnits", "userSpaceOnUse")
.attr("orient", "auto-start-reverse")
.append("path")
.attr("d", `M 0 0 L ${4 * scale } ${3.5 * scale} L 0 ${7 * scale}`);
iterate(attrs, path);
draw(
context,
attrs,
id,
scale,
5,
4.5,
`M 1 1 L ${5 * scale } ${4.5 * scale} L 1 ${8 * scale}`
);
}

@@ -32,0 +24,0 @@

@@ -1,2 +0,2 @@

import { iterate } from "./utils/iterate";
import { draw } from "./utils/draw";

@@ -13,19 +13,11 @@ export default function arrow11() {

function arrow(context){
let defs = context.select("defs");
if (defs.empty()) {
defs = context.append("defs");
}
const path = defs.append("marker")
.attr("id", id)
.attr("refX", 7 * scale)
.attr("refY", 7 * scale)
.attr("markerWidth", 8 * scale)
.attr("markerHeight", 14 * scale)
.attr("markerUnits", "userSpaceOnUse")
.attr("orient", "auto-start-reverse")
.append("path")
.attr("d", `M 0 0 L ${7 * scale} ${7 * scale} L 0 ${14 * scale}`);
iterate(attrs, path);
draw(
context,
attrs,
id,
scale,
8,
8,
`M 1 1 L ${8 * scale} ${8 * scale} L 1 ${15 * scale}`
);
}

@@ -32,0 +24,0 @@

@@ -13,19 +13,11 @@ import { iterate } from "./utils/iterate";

function arrow(context){
let defs = context.select("defs");
if (defs.empty()) {
defs = context.append("defs");
}
const path = defs.append("marker")
.attr("id", id)
.attr("refX", 12 * scale)
.attr("refY", 9 * scale)
.attr("markerWidth", 14 * scale)
.attr("markerHeight", 18 * scale)
.attr("markerUnits", "userSpaceOnUse")
.attr("orient", "auto-start-reverse")
.append("path")
.attr("d", `M 0 0 L ${12 * scale} ${9 * scale} L 0 ${18 * scale}`);
iterate(attrs, path);
draw(
context,
attrs,
id,
scale,
13,
10,
`M 1 1 L ${13 * scale} ${10 * scale} L 1 ${19 * scale}`
);
}

@@ -32,0 +24,0 @@

@@ -1,2 +0,2 @@

import { iterate } from "./utils/iterate";
import { draw } from "./utils/draw";

@@ -11,19 +11,11 @@ export default function arrow5() {

function arrow(context){
let defs = context.select("defs");
if (defs.empty()) {
defs = context.append("defs");
}
const path = defs.append("marker")
.attr("id", id)
.attr("refX", 13 * scale)
.attr("refY", 7 * scale)
.attr("markerWidth", 15 * scale)
.attr("markerHeight", 14 * scale)
.attr("markerUnits", "userSpaceOnUse")
.attr("orient", "auto-start-reverse")
.append("path")
.attr("d", `M 0 0 L ${15 * scale} ${7 * scale} L 0 ${14 * scale} L ${2.5 * scale} ${7 * scale} z`);
iterate(attrs, path);
draw(
context,
attrs,
id,
scale,
14,
8,
`M 1 1 L ${16 * scale} ${8 * scale} L 1 ${15 * scale} L ${3.5 * scale} ${8 * scale} z`
);
}

@@ -30,0 +22,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc