aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-08-04 01:17:29 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-08-04 01:17:29 -0400
commit02346eabdefd428ca23d6a3fbefdcd51ef62b738 (patch)
treeb5b6eb3a124c9f7b1d9da2aa762e2726825bd84d /src/client/views/collections/collectionFreeForm
parentbbca58e2ff087bbd4bb2ee12e6c4567e146450e3 (diff)
fixed errors/warnings
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index b4d065d26..c943fac74 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -40,7 +40,7 @@ import v5 = require("uuid/v5");
import { setScheduler } from "bluebird";
import { DocumentType, Docs } from "../../../documents/Documents";
-library.add(faEye, faTable, faPaintBrush, faExpandArrowsAlt, faCompressArrowsAlt, faCompass, faUpload);
+library.add(faEye as any, faTable, faPaintBrush, faExpandArrowsAlt, faCompressArrowsAlt, faCompass, faUpload);
export const panZoomSchema = createSchema({
panX: "number",
@@ -206,8 +206,9 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
let cy = NumCast(cd.y) - this._clusterDistance;
let cw = NumCast(cd.width) + 2 * this._clusterDistance;
let ch = NumCast(cd.height) + 2 * this._clusterDistance;
- if (!cd.z && this.intersectRect({ left: cx, top: cy, width: cw, height: ch }, { left: probe[0], top: probe[1], width: 1, height: 1 }))
+ if (!cd.z && this.intersectRect({ left: cx, top: cy, width: cw, height: ch }, { left: probe[0], top: probe[1], width: 1, height: 1 })) {
return NumCast(cd.cluster);
+ }
return cluster;
}, -1);
if (cluster !== -1) {
@@ -236,20 +237,20 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
updateClusters() {
this.sets.length = 0;
this.childDocs.map(c => {
- let included = []
+ let included = [];
for (let i = 0; i < this.sets.length; i++) {
- for (let j = 0; j < this.sets[i].length; j++) {
- if (this.boundsOverlap(c, this.sets[i][j])) {
+ for (let member of this.sets[i]) {
+ if (this.boundsOverlap(c, member)) {
included.push(i);
break;
}
}
}
- if (included.length === 0)
+ if (included.length === 0) {
this.sets.push([c]);
- else if (included.length === 1)
+ } else if (included.length === 1) {
this.sets[included[0]].push(c);
- else {
+ } else {
this.sets[included[0]].push(c);
for (let s = 1; s < included.length; s++) {
this.sets[included[0]].push(...this.sets[included[s]]);
@@ -257,11 +258,7 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
}
}
});
- for (let s = 0; s < this.sets.length; s++) {
- for (let i = 0; i < this.sets[s].length; i++) {
- this.sets[s][i].cluster = s;
- }
- }
+ this.sets.map((set, i) => set.map(member => member.cluster = i));
}
getClusterColor = (doc: Doc) => {