|
@@ -15,8 +15,15 @@ export function computePointDistanceAndRowSlope(rawWholeData) {
|
|
|
const distanceList = []
|
|
|
const rowSlopeList = []
|
|
|
for (let index = 0; index < sampleNumber; index++) {
|
|
|
- const sampleIdx = Math.floor(Math.random() * rawWholeData.length)
|
|
|
- const sample = rawWholeData[sampleIdx]
|
|
|
+ let sample = null
|
|
|
+ // eslint-disable-next-line
|
|
|
+ while(true) {
|
|
|
+ const sampleIdx = Math.floor(Math.random() * rawWholeData.length)
|
|
|
+ sample = rawWholeData[sampleIdx]
|
|
|
+ if (!sample.isManuallyAdded) {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
for (const neighbourId of sample.ids.slice(0, 4)) {
|
|
|
if (neighbourId !== "-1") {
|
|
|
// if (!rawWholeData[neighbourId - 1]) {
|