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

@disputas/diagram

Package Overview
Dependencies
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@disputas/diagram - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

lib/diagram.test.d.ts

1

lib/components.d.ts

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

/// <reference types="react" />
import { Proposition, Argument } from "@disputas/types";

@@ -3,0 +2,0 @@ import { Point, DagreEdgeObject, DagreNode } from "./types";

@@ -6,2 +6,3 @@ 'use strict';

var dagre = require('@disputas/dagre');
var d3Zoom = require('d3-zoom');
var d3 = require('d3');

@@ -17,23 +18,4 @@ var components = require('./components.js');

function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var dagre__default = /*#__PURE__*/_interopDefaultLegacy(dagre);
var d3__namespace = /*#__PURE__*/_interopNamespace(d3);
var useResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(useResizeObserver);

@@ -105,8 +87,7 @@

}); });
var zoom = d3__namespace
.zoom()
var _zoom = d3Zoom.zoom()
.scaleExtent([0.25, 10])
.on("zoom", handleZoom);
function handleZoom(e) {
d3__namespace.select("#main g").attr("transform", e.transform.toString());
d3.select("#main g").attr("transform", e.transform.toString());
}

@@ -126,6 +107,6 @@ function getArgumentsByPropositionId(id) {

events.addEventListener("edge:delete", deleteEdge);
d3__namespace.select("#main")
.call(zoom)
.call(function () { return zoom.scaleBy(d3__namespace.select("#main"), 0.7); })
.call(function () { return zoom.translateBy(d3__namespace.select("#main"), 200, -150); })
d3.select("#main")
.call(_zoom)
.call(function () { return _zoom.scaleBy(d3.select("#main"), 0.7); })
.call(function () { return _zoom.translateBy(d3.select("#main"), 200, -150); })
.on("dblclick.zoom", null);

@@ -140,2 +121,3 @@ },

return function () {
removeHighlight();
events.removeEventListener("node:connect", createSimpleEdge);

@@ -162,3 +144,3 @@ events.removeEventListener("argument:relevance", addRelevanceEdge);

// style={{ width, height }}
id: "main", onClick: function () {
id: "main", "data-testid": "main", onClick: function () {
setFocus(events.FocusNode(""));

@@ -165,0 +147,0 @@ }, ref: svgRef },

@@ -294,8 +294,10 @@ 'use strict';

if (sources.length > 1) {
var sourceGraph1Index = allGraphs.findIndex(function (graph) {
return graph.nodes.some(function (node) { return node.includes(sources[1]); });
sources.forEach(function (sourceId) {
var sourceGraph1Index = allGraphs.findIndex(function (graph) {
return graph.nodes.some(function (node) { return node.includes(sourceId); });
});
allGraphs[sourceGraph1Index].containsConjoined = true;
if (sourceGraph0Index !== sourceGraph1Index)
sourceGraph0Index = combineGraphs(allGraphs, sourceGraph0Index, sourceGraph1Index);
});
allGraphs[sourceGraph1Index].containsConjoined = true;
if (sourceGraph0Index !== sourceGraph1Index)
sourceGraph0Index = combineGraphs(allGraphs, sourceGraph0Index, sourceGraph1Index);
}

@@ -302,0 +304,0 @@ // Relevance argument, handle later.

{
"name": "@disputas/diagram",
"version": "1.0.9",
"version": "1.0.10",
"description": "D3 and Dagre based diagram",

@@ -12,14 +12,26 @@ "main": "lib/index.js",

"author": "Andreas Netteland",
"license": "none",
"license": "UNLICENSED",
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^14.2.0",
"@types/d3": "^7.1.0",
"@types/jest": "^27.5.1",
"@types/react": "^17.0.43",
"gulp": "^4.0.2",
"jest": "^27.3.1",
"jest": "^28.1.0",
"jest-css-modules": "^2.1.0",
"jest-environment-jsdom": "^28.1.0",
"prettier": "^2.4.1",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"rollup": "^2.59.0",
"rollup-plugin-postcss-modules": "^2.0.2",
"rollup-plugin-styles": "^3.14.1",
"rollup-plugin-typescript2": "^0.31.1",
"ts-jest": "^28.0.3",
"ts-node": "^10.8.0",
"tslib": "^2.4.0",
"tslint": "^6.1.3",

@@ -33,14 +45,12 @@ "tslint-config-prettier": "^1.18.0",

"@react-hook/resize-observer": "^1.2.5",
"autoprefixer": "^10.4.4",
"d3": "^7.4.0",
"postcss": "^8.4.12",
"react-icons": "^4.3.1",
"rollup-plugin-postcss-modules": "^2.0.2"
"react-icons": "^4.3.1"
},
"scripts": {
"run:dev": "gulp watch",
"test": "",
"test": "gulp test",
"build": "gulp build",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "tslint -p tsconfig.json",
"lint": "tslint -p tsconfig.json -c tslint.json",
"prepare": "npm run build",

@@ -56,3 +66,20 @@ "prepublishOnly": "npm test && npm run lint",

"tslib": "^2.3.1"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "jsdom",
"transform": {
"^.+\\.ts?$": "ts-jest",
"node_modules/d3": "ts-jest",
"node_modules/internmap": "ts-jest",
"node_modules/robust-predicates": "ts-jest",
"node_modules/delaunator": "ts-jest"
},
"moduleNameMapper": {
"\\.(css|less|scss|sss|styl)$": "<rootDir>/node_modules/jest-css-modules"
},
"transformIgnorePatterns": [
"node_modules"
]
}
}
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