-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
1730 lines (1703 loc) · 46.9 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package main
import (
"encoding/json"
"fmt"
"log"
)
// 資料格式規劃: 如以下
// 因為若節點都全名會變很長,譬如由id為 "2021C2_人_產品_操作名稱",太長
// 直接把他取一個label名稱,譬如只留下操作名稱
// 或者像是2021C2_人_產品的label為人 \n 農產品名稱
// 為了讓判斷是否所有操作完成
// fields: 產品名稱、jsonArray of all types of operations
// 會有一個節點的總圖table,multi-fields
// nodeID、label、type(tableName)
// 不同type的node會有該
// 目前設計node詳細資料是單筆查,點擊節點才會觸發
// 沒有大量掃描的情況,切換table查指定nodeID不至於太難
// (若要查某產品下節點,只設置下level,上則為0,0就不觸發if條件上爬)
// {node ID, relationU{} relationD{} , ....}
// 會有一個serial 作為圖新舊,可以用取最大serial
// SELECT my_id, col2, col3
// FROM mytable
// order by my_id desc
// limit 1
// graph 格式會長成下面這個形式,應該會採用jsonb,因為id順序沒有特別重要,會以key-value做indexing
//{
// "node1":{"relationU":[], "relationD":["node2", "node3"]}
// "node2":{"relationU":["node1"], "relationD":["node4"]},
// "node3":{"relationU":["node1"], "relationD":["node4"]}
//}
type NodeRelation struct {
// json一般都是小寫開頭,可駝峰
RelationU []string `json:"relationU"`
RelationD []string `json:"relationD"`
}
// Item : queue裡面的內容,會有當前node,以及他從哪裡來(為了建構正確的edge方向用途),以及走多遠
type Item struct {
Node string
From string
Distance int64
}
type Edge struct {
Source string `json:"source"`
Target string `json:"target"`
}
type NodeStyle struct {
Id string `json:"id"`
GroupId string `json:"groupId"`
Size int64 `json:"size"`
Label string `json:"label"`
LabelCfg LabelStyle `json:"labelCfg"`
Style CircleStyle `json:"style"`
}
type LabelStyle struct {
Style FontStyle
}
type FontStyle struct {
FontSize int64 `json:"fontSize"`
Fill string `json:"fill"`
}
type CircleStyle struct {
Stroke string `json:"stroke"`
Fill string `json:"fill"`
}
// list實踐queue的方法
//queue := make([]int, 0) // 透過make創建一個大小為0的list
//// Push to the queue
//queue = append(queue, 1) // 透過append放入queue中,現在放入1,他是逐個遞增append,會得到1|2|3 ...
//// Top (just get next element, don't remove it)
//x = queue[0] // 取出來很單純取0就是最前面的(queue是先進先出,FIFO),indexing 0即可實踐
//// Discard top element
//queue = queue[1:] // 從第二個做為list address,前面那個放棄掉,這方面的損耗還好(當然code變巨大時候要注意)
//// Is empty ?
//if len(queue) == 0 { //下面這個可以判斷該list是否為空透過built-in len方法,我們這邊還有distance要素,滿足distance也會結束
//fmt.Println("Queue is empty !")
//}
// 會有renderNode,用於最終回傳給前端list
// 會有renderEdge可能會有兩個不同方向(但我只想一個)
// 會有一個渲染的node、edge list不斷render加進去,最後會Marshal成json回傳frontend
// 另外會有一個實際node map struct(包含名稱以及包含換行...)該node的樣時
// 另外移動會有UP跟down兩種,都會queue取出的時候產生edge以及node
// edge會因為UP或down在render edge時候產生反向的target與source
// 佔位用途(不會耗費空間)
type void struct{}
// NodeSet : 這邊因為我想利用map的索引,確認node存在與否,因此我NodeSet才採用map,所以內容是放空的void{}(聽說他不占空間)
var NodeSet = make(map[string]void)
var EdgeList []Edge
var Style []NodeStyle
func GetRelationNodes(relation []string) {
}
func GetNodeStyle(styles map[string]NodeStyle) {
for k, _ := range NodeSet {
Style = append(Style, styles[k])
}
}
func UpMove(nodeName string, maps map[string]NodeRelation, level int64) {
// 起始點是隨func進來,nodeName
// 建立一個0大小的list,item包含Node str/From str/Distance int
queue := make([]Item, 0)
// 移動距離初始化為0,置到累積到level要求距離
var d int64
d = 0
// 初始將出發節點nodeName放進來,From root表示非來自他人
queue = append(queue, Item{Node: nodeName, From: "root", Distance: d})
// 第一次一定會取出,從起始點出發
top := queue[0]
// 下面是確認NodeSet沒有該node,透過comma ok,這邊不對NodeSet做事,因此_,因為在判斷存在與否
if _, ok := NodeSet[top.Node]; !ok {
NodeSet[top.Node] = void{}
}
// queue重整address,再第一次取出後,UpMove只看RelationU
queue = queue[1:]
// 看是否能往上,若沒不進到下面移動迴圈(所有演算法都能以forLoop實踐,這是很重要觀念)
if len(maps[top.Node].RelationU) != 0 {
// key沒有要用到_,同一個節點取出來的RelationU都是當前距離加1、top.Distance + 1
// 另一方面也是From: top.Node
for _, value := range maps[top.Node].RelationU {
queue = append(queue, Item{Node: value, From: top.Node, Distance: top.Distance + 1})
}
}
// 下面以while方式來持續移動,直到queue為空,裡面也有distance滿足地跳出條件
for len(queue) != 0 {
// 這是取出最上面的,然後以位址指派方式,模擬一個queue取出的模式
top = queue[0]
queue = queue[1:]
// 這是先判斷,因為當前queue的node都尚未放入之後要用的nodeSet,若發現他有大於distance的就該跳出,因為不會放入
if top.Distance > level {
break
}
// UpMove方向是反過來的,From放在Target、Source則是當前Node(top.Node)
EdgeList = append(EdgeList, Edge{Source: top.Node, Target: top.From})
// 這邊因為我想利用map的索引,確認node存在與否,因此我NodeSet才採用map,所以內容是放空的void{}(聽說他不占空間)
if _, ok := NodeSet[top.Node]; !ok {
// 若不存在就加入該nodeKey:{}
NodeSet[top.Node] = void{}
}
// 檢查該node是否能繼續往上,添入queue
if len(maps[top.Node].RelationU) != 0 {
// for窮盡list/array也會有index 0、1、2,不用_
for _, value := range maps[top.Node].RelationU {
queue = append(queue, Item{Node: value, From: top.Node, Distance: top.Distance + 1})
}
}
}
}
func DownMove(nodeName string, maps map[string]NodeRelation, level int64) {
// 建立一個0大小的list,item包含Node str/From str/Distance int
queue := make([]Item, 0)
// 移動距離初始化為0,置到累積到level要求距離
var d int64
d = 0
// 初始將出發節點nodeName放進來,From root表示非來自他人
queue = append(queue, Item{Node: nodeName, From: "root", Distance: d})
top := queue[0]
// 下面是確認NodeSet沒有該node
if _, ok := NodeSet[top.Node]; !ok {
NodeSet[top.Node] = void{}
}
queue = queue[1:]
// DownMove差異在於往下是看RelationD
if len(maps[top.Node].RelationD) != 0 {
for _, value := range maps[top.Node].RelationD {
queue = append(queue, Item{Node: value, From: top.Node, Distance: top.Distance + 1})
}
}
for len(queue) != 0 {
// 這是取出最上面的,然後以位址指派方式,模擬一個queue取出的模式
top = queue[0]
queue = queue[1:]
if top.Distance > level {
break
}
// EdgeList,DownMove,source會是From,不用反過來(Up的From則是target)
EdgeList = append(EdgeList, Edge{Source: top.From, Target: top.Node})
if _, ok := NodeSet[top.Node]; !ok {
NodeSet[top.Node] = void{}
}
// DownMove差異在於往下是看RelationD
if len(maps[top.Node].RelationD) != 0 {
for _, value := range maps[top.Node].RelationD {
queue = append(queue, Item{Node: value, From: top.Node, Distance: top.Distance + 1})
}
}
}
}
func main() {
// {"nodeName" :
maps := make(map[string]NodeRelation)
styles := make(map[string]NodeStyle)
//jsonStr := `{
// "node1":{"relationU":[], "relationD":["node2", "node3"]},
// "node2":{"relationU":["node1"], "relationD":["node4"]},
// "node3":{"relationU":["node1"], "relationD":["node4"]},
// "node4":{"relationU":["node2","node3"], "relationD":["node5", "node6"]},
// "node5":{"relationU":["node4"], "relationD":["node7"]},
// "node6":{"relationU":["node4"], "relationD":["node7"]},
// "node7":{"relationU":["node5","node6"], "relationD":[]}
//}`
jsonGraph := `{
"2020-C1_Lu-Ming Rice_Tainan 16": {
"relationU": [],
"relationD": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh"
]
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tainan 16"
],
"relationD": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Site Preparation",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Irrigation",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Fertilization",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Biotic Suppression Operation",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Delivering"
]
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tainan 16"
],
"relationD": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Site Preparation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Irrigation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Fertilization",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Biotic Suppression Operation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Delivering"
]
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tainan 16"
],
"relationD": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Site Preparation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Irrigation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Biotic Suppression Operation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Delivering"
]
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tainan 16"
],
"relationD": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Site Preparation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Irrigation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Biotic Suppression Operation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Delivering"
]
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Site Preparation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu"
],
"relationD": [
"Cheng-Po Hsu_Organic Farm","Tractor"
]
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Rice Seed Transplantation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu"
],
"relationD": [
"Cheng-Po Hsu_Organic Farm","Rice Transplanter"
]
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Irrigation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu"
],
"relationD": [
"Cheng-Po Hsu_Organic Farm",
"Drainage",
"Irrigating"
]
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Fertilization": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu"
],
"relationD": [
"Cheng-Po Hsu_Organic Farm",
"Fwusow organic fertilizer 426",
"Fwusow special fertilizer for organic cultivation 522",
"Fagopyrum Esculentum Seed",
"Ear fertilizer"
]
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Biotic Suppression Operation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu"
],
"relationD": [
"Cheng-Po Hsu_Organic Farm",
"Tea Seed Meal"
]
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu"
],
"relationD": [
"Rice House",
"Low Temperature Bin",
"Low Temperature Paddy Dryer",
"Brown Rice Milling And Package",
"Milled Rice And Package",
"Paddy complete harvester"
]
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Pesticide And Detecting": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu"
],
"relationD": [
"Rice House",
"Pass"
]
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Delivering": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu"
],
"relationD": [
"Rice House"
]
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Site Preparation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang"
],
"relationD": [
"Tian-Shang Chang_Organic Farm",
"Tractor"
]
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Rice Seed Transplantation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang"
],
"relationD": [
"Tian-Shang Chang_Organic Farm",
"Rice Transplanter"
]
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Irrigation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang"
],
"relationD": [
"Tian-Shang Chang_Organic Farm",
"Drainage",
"Irrigating"
]
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Fertilization": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang"
],
"relationD": [
"Tian-Shang Chang_Organic Farm",
"Fwusow organic fertilizer 426",
"Fwusow special fertilizer for organic cultivation 522",
"Fagopyrum Esculentum Seed",
"Ear fertilizer"
]
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Biotic Suppression Operation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang"
],
"relationD": [
"Tian-Shang Chang_Organic Farm",
"Tea Seed Meal"
]
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Harvesting And Milling": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang"
],
"relationD": [
"Rice House",
"Low Temperature Bin",
"Low Temperature Paddy Dryer",
"Brown Rice Milling And Package",
"Milled Rice And Package",
"Paddy complete harvester"
]
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Pesticide And Detecting": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang"
],
"relationD": [
"Rice House",
"Pass"
]
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Delivering": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang"
],
"relationD": [
"Rice House"
]
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Site Preparation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh"
],
"relationD": [
"Jin-Shi Hsieh_Organic Farm",
"Tractor"
]
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Rice Seed Transplantation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh"
],
"relationD": [
"Jin-Shi Hsieh_Organic Farm",
"Rice Transplanter"
]
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Irrigation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh"
],
"relationD": [
"Jin-Shi Hsieh_Organic Farm",
"Drainage",
"Irrigating"
]
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Fertilization": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh"
],
"relationD": [
"Jin-Shi Hsieh_Organic Farm",
"Fwusow organic fertilizer 426",
"Fwusow special fertilizer for organic cultivation 522",
"Fagopyrum Esculentum Seed",
"Ear fertilizer"
]
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Biotic Suppression Operation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh"
],
"relationD": [
"Jin-Shi Hsieh_Organic Farm",
"Tea Seed Meal"
]
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Harvesting And Milling": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh"
],
"relationD": [
"Rice House",
"Low Temperature Bin",
"Low Temperature Paddy Dryer",
"Brown Rice Milling And Package",
"Milled Rice And Package",
"Paddy complete harvester"
]
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Pesticide And Detecting": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh"
],
"relationD": [
"Rice House",
"Pass"
]
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Delivering": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh"
],
"relationD": [
"Rice House"
]
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Site Preparation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh"
],
"relationD": [
"Jin-Nan Hsieh_Organic Farm",
"Tractor"
]
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Rice Seed Transplantation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh"
],
"relationD": [
"Jin-Nan Hsieh_Organic Farm",
"Rice Transplanter"
]
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Irrigation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh"
],
"relationD": [
"Jin-Nan Hsieh_Organic Farm",
"Drainage",
"Irrigating"
]
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Fertilization": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh"
],
"relationD": [
"Jin-Nan Hsieh_Organic Farm",
"Fwusow organic fertilizer 426",
"Fwusow special fertilizer for organic cultivation 522",
"Fagopyrum Esculentum Seed",
"Ear fertilizer"
]
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Biotic Suppression Operation": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh"
],
"relationD": [
"Jin-Nan Hsieh_Organic Farm",
"Tea Seed Meal"
]
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Harvesting And Milling": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh"
],
"relationD": [
"Rice House",
"Low Temperature Bin",
"Low Temperature Paddy Dryer",
"Brown Rice Milling And Package",
"Milled Rice And Package",
"Paddy complete harvester"
]
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Pesticide And Detecting": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh"
],
"relationD": [
"Rice House",
"Pass"
]
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Delivering": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh"
],
"relationD": [
"Rice House"
]
},
"Rice House": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Delivering",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Delivering",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Delivering",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Delivering"
],
"relationD": []
},
"Cheng-Po Hsu_Organic Farm": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Site Preparation",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Irrigation",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Fertilization",
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Biotic Suppression Operation"
],
"relationD": []
},
"Tian-Shang Chang_Organic Farm": {
"relationU": [
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Site Preparation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Irrigation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Fertilization",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Biotic Suppression Operation"
],
"relationD": []
},
"Jin-Shi Hsieh_Organic Farm": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Site Preparation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Irrigation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Biotic Suppression Operation"
],
"relationD": []
},
"Jin-Nan Hsieh_Organic Farm": {
"relationU": [
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Site Preparation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Irrigation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Biotic Suppression Operation"
],
"relationD": []
},
"Tractor": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Site Preparation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Site Preparation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Site Preparation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Site Preparation"
],
"relationD": []
},
"Rice Transplanter": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Rice Seed Transplantation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Rice Seed Transplantation"
],
"relationD": []
},
"Drainage": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Irrigation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Irrigation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Irrigation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Irrigation"
],
"relationD": []
},
"Irrigating": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Irrigation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Irrigation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Irrigation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Irrigation"
],
"relationD": []
},
"Fwusow organic fertilizer 426": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Fertilization",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Fertilization"
],
"relationD": []
},
"Fwusow special fertilizer for organic cultivation 522": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Fertilization",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Fertilization"
],
"relationD": []
},
"Fagopyrum Esculentum Seed": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Fertilization",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Fertilization"
],
"relationD": []
},
"Ear fertilizer": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Fertilization",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Fertilization",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Fertilization"
],
"relationD": []
},
"Tea Seed Meal": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Biotic Suppression Operation",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Biotic Suppression Operation",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Biotic Suppression Operation",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Biotic Suppression Operation"
],
"relationD": []
},
"Low Temperature Bin": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Harvesting And Milling"
],
"relationD": []
},
"Low Temperature Paddy Dryer": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Harvesting And Milling"
],
"relationD": []
},
"Brown Rice Milling And Package": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Harvesting And Milling"
],
"relationD": []
},
"Milled Rice And Package": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Harvesting And Milling"
],
"relationD": []
},
"Paddy complete harvester": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Harvesting And Milling",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Harvesting And Milling"
],
"relationD": []
},
"Pass": {
"relationU": [
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh_Pesticide And Detecting",
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh_Pesticide And Detecting"
],
"relationD": []
}
}`
jsonStyle := `{
"2020-C1_Lu-Ming Rice_Tainan 16": {
"id": "2020-C1_Lu-Ming Rice_Tainan 16",
"groupId": "product",
"size": 170,
"label": "2020-C1\nLu-Ming Rice\nTainan 16",
"labelCfg": {
"style": {
"fontSize": 16,
"fill": "#ffffff"
}
},
"style": {
"stroke": "#413960",
"fill": "#413960"
}
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu": {
"id": "2020-C1_Lu-Ming Rice_Cheng-Po Hsu",
"groupId": "product",
"size": 170,
"label": "2020-C1\nLu-Ming Rice\nCheng-Po Hsu",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#fe917d"
}
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang": {
"id": "2020-C1_Lu-Ming Rice_Tian-Shang Chang",
"groupId": "product",
"size": 170,
"label": "2020-C1\nLu-Ming Rice\nTian-Shang Chang",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#fe917d"
}
},
"2020-C1_Lu-Ming Rice_Jin-Shi Hsieh": {
"id": "2020-C1_Lu-Ming Rice_Jin-Shi Hsieh",
"groupId": "product",
"size": 170,
"label": "2020-C1\nLu-Ming Rice\nJin-Shi Hsieh",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#fe917d"
}
},
"2020-C1_Lu-Ming Rice_Jin-Nan Hsieh": {
"id": "2020-C1_Lu-Ming Rice_Jin-Nan Hsieh",
"groupId": "product",
"size": 170,
"label": "2020-C1\nLu-Ming Rice\nJin-Nan Hsieh",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#fe917d"
}
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Site Preparation": {
"id": "2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Site Preparation",
"groupId": "operation",
"size": 170,
"label": "Site Preparation",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#85d0a0"
}
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Rice Seed Transplantation": {
"id": "2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Rice Seed Transplantation",
"groupId": "operation",
"size": 170,
"label": "Rice Seed\n Transplantation",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#85d0a0"
}
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Irrigation": {
"id": "2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Irrigation",
"groupId": "operation",
"size": 170,
"label": "Irrigation",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#85d0a0"
}
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Fertilization": {
"id": "2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Fertilization",
"groupId": "operation",
"size": 170,
"label": "Fertilization",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#85d0a0"
}
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Biotic Suppression Operation": {
"id": "2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Biotic Suppression Operation",
"groupId": "operation",
"size": 170,
"label": "Biotic\n Suppression Operation",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#85d0a0"
}
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling": {
"id": "2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Harvesting And Milling",
"groupId": "operation",
"size": 170,
"label": "Harvesting\n And Milling",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#85d0a0"
}
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Pesticide And Detecting": {
"id": "2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Pesticide And Detecting",
"groupId": "operation",
"size": 170,
"label": "Pesticide\n And Detecting",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#85d0a0"
}
},
"2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Delivering": {
"id": "2020-C1_Lu-Ming Rice_Cheng-Po Hsu_Delivering",
"groupId": "operation",
"size": 170,
"label": "Delivering",
"labelCfg": {
"style": {
"fontSize": 16
}
},
"style": {
"stroke": "#413960",
"fill": "#85d0a0"
}
},
"2020-C1_Lu-Ming Rice_Tian-Shang Chang_Site Preparation": {
"id": "2020-C1_Lu-Ming Rice_Tian-Shang Chang_Site Preparation",
"groupId": "operation",
"size": 170,
"label": "Site Preparation",
"labelCfg": {
"style": {
"fontSize": 16
}