update NodeMap to display DotButton and add zoom/pan
This commit is contained in:
Vendored
+4
-6
@@ -22,7 +22,7 @@ function getLinked (text) {
|
||||
}
|
||||
|
||||
export function toSingleManyData (rawData) {
|
||||
rawData.first = true
|
||||
rawData.isOrigin = true
|
||||
const h = hierarchy(rawData, d => getLinked(d))
|
||||
h.each(node => {
|
||||
if (node.parent && node.children) {
|
||||
@@ -35,8 +35,7 @@ export function toSingleManyData (rawData) {
|
||||
const links = h.links()
|
||||
nodes.forEach(node => {
|
||||
Object.assign(node.data, {
|
||||
type: node.data.type.toLowerCase(),
|
||||
class: 'family-' + node.data.families[0].id
|
||||
type: node.data.type.toLowerCase()
|
||||
})
|
||||
})
|
||||
return { nodes, links }
|
||||
@@ -44,7 +43,7 @@ export function toSingleManyData (rawData) {
|
||||
|
||||
|
||||
export function toManyManyData (rawData) {
|
||||
rawData.first = true
|
||||
rawData.isOrigin = true
|
||||
const h = hierarchy(rawData, d => getLinked(d))
|
||||
h.each(node => {
|
||||
if (node.parent && node.children) {
|
||||
@@ -79,8 +78,7 @@ export function toManyManyData (rawData) {
|
||||
id: data.id,
|
||||
data: {
|
||||
...data,
|
||||
type: data.type.toLowerCase(),
|
||||
class: 'family-' + data.families[0].id
|
||||
type: data.type.toLowerCase()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user