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.
3131user hovers over a node or link.
3232
3333|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.
3536
3637|Color Scheme |List | |The color scheme to use for the slices. Colors
3738are 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
88import { isCyclic } from '../../Utils' ;
99import { extensionEnabled } from '../../../ExtensionUtils' ;
1010
11+ const UNWEIGHTED_SANKEY_PROPERTY = 'SANKEY_UNWEIGHTED' ;
12+
1113/**
1214 * Embeds a SankeyChart (from Charts) into NeoDash.
1315 */
@@ -74,7 +76,16 @@ const NeoSankeyChart = (props: ChartProps) => {
7476 links [ `${ value . start . low } ,${ value . end . low } ` ] = [ ] ;
7577 }
7678 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 ] ) ) {
7889 addItem ( links [ `${ value . start . low } ,${ value . end . low } ` ] , {
7990 id : value . identity . low ,
8091 source : value . start . low ,
You can’t perform that action at this time.
0 commit comments