Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #325 from complexdatacollective/feature/entity-res…
Browse files Browse the repository at this point in the history
…olution-v1

Entity resolution v1 reintegration
  • Loading branch information
wwqrd authored Mar 11, 2021
2 parents efdb7db + 38e4d0a commit b20fa56
Show file tree
Hide file tree
Showing 102 changed files with 26,563 additions and 21,252 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
insert_final_newline = true

[*.json]
indent_size = 4
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/forbid-prop-types": "off",
"react/no-array-index-key": "off",
"import/no-extraneous-dependencies": "off",
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"no-mixed-operators": [1, {"allowSamePrecedence": true}]
}
}
1 change: 1 addition & 0 deletions __mocks__/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const ipcRenderer = {
const ipcMain = {
on: jest.fn(),
once: jest.fn(),
removeListener: jest.fn(),
};

const app = {
Expand Down
41,601 changes: 20,557 additions & 21,044 deletions package-lock.json

Large diffs are not rendered by default.

85 changes: 46 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@
"cross-env": "^5.2.0",
"css-loader": "^1.0.0",
"dotenv": "^6.0.0",
"electron": "^9.2.0",
"electron-builder": "^22.8.0",
"electron-devtools-installer": "^2.2.4",
"electron-log": "^4.2.4",
"electron-notarize": "^1.0.0",
"enzyme": "^3.11.0",
"electron": "^9.2.0",
"enzyme-adapter-react-16": "^1.15.3",
"enzyme-to-json": "^3.5.0",
"eslint": "^4.1.1",
"enzyme": "^3.11.0",
"eslint-config-airbnb": "^15.0.1",
"eslint-config-react-app": "^2.1.0",
"eslint-loader": "^2.2.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "5.1.1",
"eslint-plugin-react": "^7.20.6",
"eslint": "^4.1.1",
"eventemitter3": "^4.0.7",
"faker": "^4.1.0",
"file-loader": "^1.1.11",
Expand All @@ -80,11 +80,12 @@
"html-webpack-plugin": "^4.3.0",
"icon-gen": "^1.2.1",
"istanbul-lib-coverage": "^1.2.0",
"jest": "^25.5.4",
"jest-fetch-mock": "^1.6.5",
"jest": "^25.5.4",
"jsdoc": "^3.6.5",
"json-loader": "^0.5.7",
"jssha": "^3.1.0",
"luxon": "^1.22.0",
"mini-css-extract-plugin": "^0.8.0",
"node-sass": "^4.14.1",
"postcss-loader": "^2.1.6",
Expand All @@ -97,6 +98,7 @@
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"regenerator-runtime": "^0.13.7",
"rosie": "^2.0.1",
"sanitize-filename": "^1.6.3",
"sass-lint": "^1.12.1",
"sass-loader": "^7.0.3",
Expand All @@ -105,9 +107,9 @@
"supertest": "^5.0.0",
"swagger-jsdoc": "^3.7.0",
"url-loader": "^1.0.1",
"webpack": "^4.44.1",
"webpack-dev-server": "^3.11.0",
"webpack-manifest-plugin": "^2.0.4",
"webpack": "^4.44.1",
"whatwg-fetch": "2.0.2"
},
"dependencies": {
Expand All @@ -120,14 +122,15 @@
"classnames": "^2.2.6",
"compare-versions": "^3.6.0",
"detect-port": "^1.2.3",
"duplex-child-process": "^1.0.1",
"jszip": "^3.4.0",
"libsodium-wrappers": "^0.7.8",
"lodash": "^4.17.20",
"mdns": "^2.5.1",
"mississippi": "^4.0.0",
"nedb": "^1.8.0",
"object-hash": "^1.3.0",
"prop-types": "^15.6.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-error-overlay": "^5.0.0-next.3e165448",
"react-identicons": "^1.2.4",
Expand All @@ -136,14 +139,17 @@
"react-test-renderer": "^16.13.1",
"react-tooltip": "^4.2.10",
"react-transition-group": "^2.5.0",
"react": "^16.13.1",
"recharts": "^1.0.1",
"recompose": "^0.26.0",
"redux": "^3.6.0",
"redux-actions": "~2.6.5",
"redux-thunk": "^2.3.0",
"redux": "^3.6.0",
"reselect": "^3.0.0",
"restify": "^7.2.1",
"restify-cors-middleware": "^1.1.1",
"restify": "^7.2.1",
"selfsigned": "^1.10.7",
"split": "^1.0.1",
"thread-loader": "^1.1.5",
"uuid": "^3.3.2",
"xmldom": "^0.1.27"
Expand Down Expand Up @@ -176,37 +182,37 @@
"certificateSha1": "512E5573B1961B0ADCAFB21288935F8A3E6E656F"
},
"linux": {
"maintainer": "Joshua Melville <[email protected]>",
"target": [
{
"target": "deb",
"arch": [
"x64",
"arm64"
]
},
{
"target": "rpm",
"arch": [
"x64",
"arm64"
]
},
{
"target": "AppImage",
"arch": [
"x64",
"arm64"
]
},
{
"target": "tar.gz",
"arch": [
"x64",
"arm64"
]
}
]
"maintainer": "Joshua Melville <[email protected]>",
"target": [
{
"target": "deb",
"arch": [
"x64",
"arm64"
]
},
{
"target": "rpm",
"arch": [
"x64",
"arm64"
]
},
{
"target": "AppImage",
"arch": [
"x64",
"arm64"
]
},
{
"target": "tar.gz",
"arch": [
"x64",
"arm64"
]
}
]
},
"publish": [
{
Expand Down Expand Up @@ -253,6 +259,7 @@
],
"testEnvironment": "node",
"testURL": "http://localhost",
"testRegex": "(/__tests__/.*|(\\.|/))(\\.test|-test)\\.[jt]sx?$",
"transform": {
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
Expand Down
20 changes: 20 additions & 0 deletions src/__factories__/Factory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { edge } = require('./edge');
const { node } = require('./node');
const { network } = require('./network');
const { session } = require('./session');
const { transform } = require('./transform');
const { resolution } = require('./resolution');

const Factory = {
edge,
node,
network,
session,
transform,
resolution,
};

module.exports = {
Factory,
default: Factory,
};
23 changes: 23 additions & 0 deletions src/__factories__/edge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { Factory } = require('rosie');
const { times } = require('lodash');

const edge = new Factory()
.option('range', times(100, n => n))
.option('nodes', null)
.attr('from', ['nodes', 'range'], (nodes, range) => {
const ids = nodes ? nodes.map(({ _uid }) => _uid) : range;
return ids[Math.floor(Math.random() * ids.length)];
})
.attr('to', ['nodes', 'range', 'from'], (nodes, range, from) => {
const ids = nodes ? nodes.map(({ _uid }) => _uid) : range;
let to = from;
while (to === from && ids.length > 1) {
to = ids[Math.floor(Math.random() * ids.length)];
}
return to;
});

module.exports = {
default: edge,
edge,
};
18 changes: 18 additions & 0 deletions src/__factories__/network.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { Factory } = require('rosie');
const faker = require('faker');
const { node } = require('./node');
const { edge } = require('./edge');

const network = new Factory()
.option('size', 10)
.attr('sessionVariables', () => ({
caseId: faker.random.uuid(),
}))
.attr('ego', () => node.build())
.attr('nodes', ['size'], size => node.buildList(size))
.attr('edges', ['nodes'], nodes => edge.buildList(Math.ceil(nodes.length / 3), null, { nodes }));

module.exports = {
default: network,
network,
};
15 changes: 15 additions & 0 deletions src/__factories__/node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { Factory } = require('rosie');
const faker = require('faker');

const node = new Factory()
.sequence('_uid')
.attr('type', 'person')
.attr('attributes', () => ({
name: faker.name.findName(),
phrase: faker.random.words(),
}));

module.exports = {
default: node,
node,
};
24 changes: 24 additions & 0 deletions src/__factories__/resolution.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { Factory } = require('rosie');
const { DateTime } = require('luxon');
const uuid = require('uuid/v4');
const { transform } = require('./transform');

const resolution = new Factory()
.option('network', null)
.option('transformCount', null)
.option('attributes', {})
.attr('id', () => uuid())
.sequence('date', i => DateTime.local().minus({ days: i }).toJSDate())
.attr(
'transforms',
['transformCount', 'network', 'attributes'],
(transformCount, network, attributes) => {
const size = transformCount || Math.ceil(network.nodes.length * 0.3);
return transform.buildList(size, { attributes }, { network });
},
);

module.exports = {
default: resolution,
resolution,
};
11 changes: 11 additions & 0 deletions src/__factories__/session.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { Factory } = require('rosie');
const { DateTime } = require('luxon');
const { network } = require('./network');

const session = new Factory().extend(network)
.sequence('date', i => DateTime.local().minus({ days: i }).toJSDate());

module.exports = {
default: session,
session,
};
30 changes: 30 additions & 0 deletions src/__factories__/transform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const { Factory } = require('rosie');
const { uniq } = require('lodash');
const uuid = require('uuid/v4');

const transform = new Factory()
.attr('id', () => uuid())
.option('network', null)
.option('nodes', null)
.attr('nodes', ['network', 'nodes'], (network, nodes) => {
if (nodes) { return nodes; }
if (!network) { return []; }

const nodeCount = Math.ceil((network.nodes.length * 0.3 * Math.random()) + 1);

let networkNodes = [];

while (networkNodes.length < nodeCount) {
const randomNode = network.nodes[Math.floor(Math.random() * network.nodes.length)];
// eslint-disable-next-line no-underscore-dangle
networkNodes = uniq([...networkNodes, randomNode._uid]);
}

return networkNodes;
})
.attr('attributes', {});

module.exports = {
default: transform,
transform,
};
4 changes: 4 additions & 0 deletions src/main/MainApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ const createApp = () => {
label: 'Generate small test dataset...',
click: () => generateTestSessions(100),
},
{
label: 'Generate tiny test dataset...',
click: () => generateTestSessions(3),
},
{ type: 'separator' },
{
label: 'Regenerate Certificates...',
Expand Down
Loading

0 comments on commit b20fa56

Please sign in to comment.