File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
docs/modules/ROOT/pages/user-guide/reports
src/extensions/advancedcharts/chart/sankey Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ the visualization.
31
31
user hovers over a node or link.
32
32
33
33
|Relationship Property |text | value | Name of the property with an integer value that is going
34
- to be used to determine thickness of links.
34
+ to be used to determine thickness of links. Using 'SANKEY_UNWEIGHTED', this sankey will assume
35
+ every relationship with a weight of 1.
35
36
36
37
|Color Scheme |List | |The color scheme to use for the slices. Colors
37
38
are assigned automatically (consecutively) to the different categories
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import NeoCodeViewerComponent from '../../../../component/editor/CodeViewerCompo
8
8
import { isCyclic } from '../../Utils' ;
9
9
import { extensionEnabled } from '../../../ExtensionUtils' ;
10
10
11
+ const UNWEIGHTED_SANKEY_PROPERTY = 'SANKEY_UNWEIGHTED' ;
12
+
11
13
/**
12
14
* Embeds a SankeyChart (from Charts) into NeoDash.
13
15
*/
@@ -74,7 +76,16 @@ const NeoSankeyChart = (props: ChartProps) => {
74
76
links [ `${ value . start . low } ,${ value . end . low } ` ] = [ ] ;
75
77
}
76
78
const addItem = ( arr , item ) => arr . find ( ( x ) => x . id === item . id ) || arr . push ( item ) ;
77
- if ( value . properties [ labelProperty ] !== undefined && ! isNaN ( value . properties [ labelProperty ] ) ) {
79
+ if ( labelProperty === UNWEIGHTED_SANKEY_PROPERTY ) {
80
+ addItem ( links [ `${ value . start . low } ,${ value . end . low } ` ] , {
81
+ id : value . identity . low ,
82
+ source : value . start . low ,
83
+ target : value . end . low ,
84
+ type : value . type ,
85
+ properties : value . properties ,
86
+ value : 1 ,
87
+ } ) ;
88
+ } else if ( value . properties [ labelProperty ] !== undefined && ! isNaN ( value . properties [ labelProperty ] ) ) {
78
89
addItem ( links [ `${ value . start . low } ,${ value . end . low } ` ] , {
79
90
id : value . identity . low ,
80
91
source : value . start . low ,
You can’t perform that action at this time.
0 commit comments