I thought I would share what I did to style my edges by namespace. Basically I manipulated the files with sed based on filenames that include the namespace.
Initially I tried exporting the map to a JSON file, one edge of which was styled as desired with a simple colour change. I added the color element to some more of the edges in the JSON and imported them back in. However, while TW would see the file as an import file it would never indicate there were any tiddlers to import and indeed never imported anything. After a bit of fiddling I moved on. It might be nice to know why this didn't work.
{
"edges": [
{
"id": "9ed087ce-abff-48df-a043-18afab924a18",
"from": "51b38c02-0bf1-4de0-b391-1cc0dfe96476",
"to": "c04185d7-ea68-4ca1-8125-98cdbf5e9187",
"type": "flow clear: POS_BLTYESBP",
"label": " POS_BLTYESBP",
"color": {
"color": "rgba(209,19,26,1)"
}
},
{
"id": "7f7c655d-8408-42c4-a0cb-d296dbfd3a18",
"from": "d1a1826b-bd43-4b99-9055-f75f2b5e028f",
"to": "2bdf023d-580b-4201-96f6-c81ecdc51a7d",
"type": "flow clear: APIGW_LDMS",
"label": " APIGW_LDMS"
Aside from the lengthy names that start with a dollar sign (why? - I'm certain there is a good reason but you have to escape the dollar sign at times), the edge tiddlers themselves are obviously quite simple as seen below.
created: 20161230124851953
description: Clear [[POS Services|POS_BLTYESBP]]
modified: 20161231214952583
style: {"color":{"color":"rgba(255,0,0,1)"}}
title: $:/plugins/felixhayashi/tiddlymap/graph/edgeTypes/flow clear: POS_BLTYESBP
type: text/vnd.tiddlywiki
With some concern over ordering (the file with style added through TW had the color statement in the middle of the file), I used sed to append different color statements to the last line of the file based on the file name that included my name space of flow_clear or flow_token.
find . -name "*flow_clear*" -exec sed -i '$ a style: {"color":{"color":"rgba(255,0,0,1)"}}' {} \;
find . -name "*flow_token*" -exec sed -i '$ a style: {"color":{"color":"rgba(0,255,0,1)"}}' {} \;
While the files were being updated I was getting some funky results - things not updating even after a restart of the server. I noticed that some files were showing an extended access control indicator with a plus sign at the end of the permissions. (rw_rw_r__+) On getting the extended acl with getfacl, the file name appeared garbage. It just showed ".tid". A little playing around revealed either I cannot or should not be editing these files with the node server is up. I'm not sure if this is expected/common of something to do with the Google Drive drivers, but stopping the server, doing the editing, and starting worked. Also note that the Google Drive access is VERY slow. I am mildly concerned.
Finally, one other niggle during the process caused a little consternation. The changes were still not showing up given the combination of the sed command I used and the construct of the file. It turned out to be the blank line above my new color statement. The following sed command removed the blank lines.
find . -name "*flow_token*" -exec sed -i '/^$/d' {} \;
I'd love to figure out how to script this from within TW, but working with some more familiar tools (even though it's probably been almost 10 years since I've actively used Linux) got the job done for now.
Greg