For using as menu navigation:
- use node "href" values
- add request/ask params:
- showTitle: false // no need top ui with: memodraw logo, title & clear button
- showOptions: false // no need bottom menu
- skinBackground: "grey" // back ground choices
- useWheel: false // no mouse wheel for zooming because change usual interaction scolling
- usePinch: false // no need pinch for zoom because break scoll on object
- useMenuTheme: false // normaly not need this menu on this context
- useMenuEmpty: false // normaly not need this menu on this context
(see all possible params on resquest)
Essential JSON:
This is the minimal/classical JSON file need to describe a complete graph
(ie. https://memodraw.com/?source=Cat&target=Dog)
{
"request": {
"ask": {
"search": "tree",
"source": "coucou",
"entry": "fr.wiki",
"showOptions": false,
"showTitle": false,
"skinBackground": "grey",
"useWheel": false,
"usePinch": false,
"useMenuTheme": false,
"useMenuEmpty": false
}
},
"nodes": [
{
"text": "Dog",
"description": "domestic animal",
"image": "https://www.memodraw.com/images/dog.jpg",
"width": 200,
"height": 148,
"href": "https://www.myWebSite.com/menu_dog.html"
},
{
"text": "Cat",
"description": "domesticated feline",
"image": "https://www.memodraw.com/images/cat.jpg",
"width": 200,
"height": 148
"href": "#cat"
},
{
"text": "Coyote",
"description": "species of canine",
"image": "https://www.memodraw.com/images/coyote.jpg",
"width": 200,
"height": 180
},
{
"text": "Pet",
"description": "animal kept for companionship and a person's enjoyment"
}
],
"edges": [
{
"from": 1,
"to": 0,
"context", "Hearing|Sociability|Fighting"
"href": "#dog2cat"
},
{
"from": 1,
"to": 2,
"context": "Hunting and feeding"
},
{
"from": 2,
"to": 0,
"context": "Evolution|DNA evidence"
},
{
"from": 1,
"to": 3,
"context": "Feral cats"
},
{
"from": 3,
"to": 1,
"context": "Mammals"
}
]
}
Preporcessor JSON:
It's tricks to simplify JSON writing
- nodesDefault: define rules applying to every nodes
- edgesDefault: define rules applying to every edge
- field substitution: permit subtitutions with systax as: "${field}"
(with special ${from.text} & ${to.text} to not retrieve id but text concerned)
{
"nodesDefault": {
"site": "https://www.myWebSite.com",
"path": "https://www.myWebSite.com/images",
"href": "#${text}",
"image": "https://www.myWebSite.com/images/${text}.jpg"
},
"nodes": [
{
"text": "first",
"href": "${site}/first.html"
}, {
"text": "second"
}, {
"text": "third"
}
],
"edgesDefault": {
"href": "#${from.text}_${to.text}",
"weight": 1,
"lod": 0,
"width": 200,
"height": 100
},
"edges": [
{ "fromTo": "first->second" },
{ "fromTo": "second->third" },
{ "fromTo": "first->third" }
]
}
gererate this:
{
"nodes": [
{
"text": "first",
"href": "https://www.myWebSite.com/first.html",
"image": "https://www.myWebSite.com/images/first.jpg",
"width": 200,
"height": 100
}, {
"text": "second",
"href": "#second",
"image": "https://www.myWebSite.com/images/second.jpg",
"width": 200,
"height": 100
}, {
"text": "third",
"href": "#third",
"image": "https://www.myWebSite.com/images/third.jpg",
"width": 200,
"height": 100
}
],
"edges": [
{
"from": 0,
"to": 1,
"href": "#first_second",
"weight": 1,
"log": 0
}, {
"from": 1,
"to": 2,
"href": "#second_third",
"weight": 1,
"log": 0
}, {
"from": 0,
"to": 2,
"href": "#first_third",
"weight": 1,
"log": 0
}
]
}
Complete JSON:
This is the complete JSON file need to describe a complete graph
optional nodes:
- "request" [only usefull for server & integrity request, except 'ask']
- "lods" [Level Of Detail, if usefull]
- "clusters" [groups of nodes, if usefull]
{
"request": {
"status": "ok",
"ask": {
"search": "tree",
"source": "coucou",
"target": "toi",
"levelIn": 0,
"levelOut": 2,
"distMax": -1,
"stepMax": -1
"weightMax": -1,
"nodeDegree": 5,
"useTerminal": 0,
"clusterSubset": 0,
"method": "embed",
"entry": "fr.wikt"
},
"solvedTime": "188.5ms",
"overflow": false
},
"lods": [
{
"lod": 1.8871,
"links": 11
},
{
"lod": 2.29717,
"links": 10
}
],
"clusters": {
"4308": {
"name": "Dé",
"coor": "246.335,-1620.89,450.745,123.427,269.972,471.155,873.103,609.854,346.389",
"used": 22
},
"4309": {
"name": "Lac",
"coor": "176.191,-1515.58,330.908,-18.2949,331.11,124.042,596.005,669.288,342.233",
"used": 20
}
},
"nodes": [
{
"text": "fr.wiki:Rat",
"description": "nom ambigu de rongeurs",
"dist": 1.38462,
"image": "https://www.memodraw.com/images/Ratvxd.jpg",
"cluster": 4308,
"coor": "-291.608,538.132,445.294,-7912.62,6203.71,13456.9,-6476.7,13136.2,-110.908",
"width": 200,
"height": 148
},
{
"text": "fr.wiki:Souris",
"description": "nom vernaculaire pour les animaux du genre Mus",
"dist": 1.84011,
"image": "https://www.memodraw.com/images/Mouse-19-Dec-2004.jpg",
"cluster": 4308,
"coor": "511.162,-94.2752,1821.52,-1572.86,9461.31,14135,-7891.57,16634.5,-4569",
"width": 200,
"height": 133
}
],
"edges": [
{
"from": 0,
"to": 1,
"weight": 0.455492,
"context": "Étymologie et histoire du mot/Évolution du terme|Physiologie, comportement et écologie/Caractéristiques communes|Rats et humains/Considérés comme nuisibles|Rats et humains/Aspects culturels/En Occident|Voir aussi/Articles connexes",
"lod": 0
},
{
"from": 2,
"to": 0,
"weight": 1.38462,
"context": "Histoire/Domestication|Histoire/Littérature/Fiction/Contes, fables et poésie",
"lod": 0
}
]
}