@disputas/diagram
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -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" | ||
] | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
58974
9
15
1
25
1213
- Removedautoprefixer@^10.4.4
- Removedrollup-plugin-postcss-modules@^2.0.2
- Removed@trysound/sax@0.2.0(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedautoprefixer@10.4.20(transitive)
- Removedboolbase@1.0.0(transitive)
- Removedbrowserslist@4.24.2(transitive)
- Removedcamelcase@7.0.1(transitive)
- Removedcaniuse-api@3.0.0(transitive)
- Removedcaniuse-lite@1.0.30001684(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcolord@2.9.3(transitive)
- Removedconcat-with-sourcemaps@1.1.0(transitive)
- Removedcss-declaration-sorter@6.4.1(transitive)
- Removedcss-select@4.3.0(transitive)
- Removedcss-tree@1.1.3(transitive)
- Removedcss-what@6.1.0(transitive)
- Removedcssesc@3.0.0(transitive)
- Removedcssnano@5.1.15(transitive)
- Removedcssnano-preset-default@5.2.14(transitive)
- Removedcssnano-utils@3.1.0(transitive)
- Removedcsso@4.2.0(transitive)
- Removeddom-serializer@1.4.1(transitive)
- Removeddomelementtype@2.3.0(transitive)
- Removeddomhandler@4.3.1(transitive)
- Removeddomutils@2.8.0(transitive)
- Removedelectron-to-chromium@1.5.67(transitive)
- Removedentities@2.2.0(transitive)
- Removedescalade@3.2.0(transitive)
- Removedestree-walker@0.6.1(transitive)
- Removedeventemitter3@4.0.7(transitive)
- Removedfraction.js@4.3.7(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedgeneric-names@4.0.0(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedicss-replace-symbols@1.1.0(transitive)
- Removedicss-utils@5.1.0(transitive)
- Removedimport-cwd@3.0.0(transitive)
- Removedimport-from@3.0.0(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedlilconfig@2.1.0(transitive)
- Removedloader-utils@3.3.1(transitive)
- Removedlodash.camelcase@4.3.0(transitive)
- Removedlodash.memoize@4.1.2(transitive)
- Removedlodash.uniq@4.5.0(transitive)
- Removedmdn-data@2.0.14(transitive)
- Removednode-releases@2.0.18(transitive)
- Removednormalize-range@0.1.2(transitive)
- Removednormalize-url@6.1.0(transitive)
- Removednth-check@2.1.1(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedp-queue@6.6.2(transitive)
- Removedp-timeout@3.2.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpify@5.0.0(transitive)
- Removedpostcss-calc@8.2.4(transitive)
- Removedpostcss-colormin@5.3.1(transitive)
- Removedpostcss-convert-values@5.1.3(transitive)
- Removedpostcss-discard-comments@5.1.2(transitive)
- Removedpostcss-discard-duplicates@5.1.0(transitive)
- Removedpostcss-discard-empty@5.1.1(transitive)
- Removedpostcss-discard-overridden@5.1.0(transitive)
- Removedpostcss-load-config@3.1.4(transitive)
- Removedpostcss-merge-longhand@5.1.7(transitive)
- Removedpostcss-merge-rules@5.1.4(transitive)
- Removedpostcss-minify-font-values@5.1.0(transitive)
- Removedpostcss-minify-gradients@5.1.1(transitive)
- Removedpostcss-minify-params@5.1.4(transitive)
- Removedpostcss-minify-selectors@5.2.1(transitive)
- Removedpostcss-modules@4.3.16.0.1(transitive)
- Removedpostcss-modules-extract-imports@3.1.0(transitive)
- Removedpostcss-modules-local-by-default@4.1.0(transitive)
- Removedpostcss-modules-scope@3.2.1(transitive)
- Removedpostcss-modules-values@4.0.0(transitive)
- Removedpostcss-normalize-charset@5.1.0(transitive)
- Removedpostcss-normalize-display-values@5.1.0(transitive)
- Removedpostcss-normalize-positions@5.1.1(transitive)
- Removedpostcss-normalize-repeat-style@5.1.1(transitive)
- Removedpostcss-normalize-string@5.1.0(transitive)
- Removedpostcss-normalize-timing-functions@5.1.0(transitive)
- Removedpostcss-normalize-unicode@5.1.1(transitive)
- Removedpostcss-normalize-url@5.1.0(transitive)
- Removedpostcss-normalize-whitespace@5.1.1(transitive)
- Removedpostcss-ordered-values@5.1.3(transitive)
- Removedpostcss-reduce-initial@5.1.2(transitive)
- Removedpostcss-reduce-transforms@5.1.0(transitive)
- Removedpostcss-selector-parser@6.1.27.0.0(transitive)
- Removedpostcss-svgo@5.1.0(transitive)
- Removedpostcss-unique-selectors@5.1.1(transitive)
- Removedpostcss-value-parser@4.2.0(transitive)
- Removedpromise.series@0.2.0(transitive)
- Removedreserved-words@0.1.2(transitive)
- Removedresolve@1.22.8(transitive)
- Removedresolve-from@5.0.0(transitive)
- Removedrollup-plugin-postcss@4.0.2(transitive)
- Removedrollup-plugin-postcss-modules@2.1.1(transitive)
- Removedrollup-pluginutils@2.8.2(transitive)
- Removedsafe-identifier@0.4.2(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedstable@0.1.8(transitive)
- Removedstring-hash@1.1.3(transitive)
- Removedstyle-inject@0.3.0(transitive)
- Removedstylehacks@5.1.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedsvgo@2.8.0(transitive)
- Removedupdate-browserslist-db@1.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedyaml@1.10.2(transitive)