add opacity to nodeview for strangeness repr
This commit is contained in:
@@ -146,3 +146,12 @@ export function getRelation (node) {
|
||||
}
|
||||
return { parentId: node.id }
|
||||
}
|
||||
|
||||
|
||||
export function getStrangenessOpacity (currentStrangeness, node) {
|
||||
if (currentStrangeness === undefined) return 1
|
||||
const strangeness = (
|
||||
node.type === 'prod' && node.parents && node.parents.length ? node.parents[0] : node
|
||||
).strangeness
|
||||
return 1 / (Math.abs(strangeness - currentStrangeness) + 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user