feat: redesign tooltips for schema and nodelink
Besides redesign tooltips Additional features:
- schema: same fit to screen button on app
- schema: fit to screen button funtionality
- schema: add minimap
Merge request reports
Activity
assigned to @milho001
62 render: (args) => { 63 return ( 64 <div className="w-1/4 my-10 m-auto flex items-center justify-center"> 65 <CardToolTipVis {...args} /> 66 </div> 67 ); 68 }, 69 args: { 70 name: 'Person', 71 type: 'popupvis', 72 data: { 73 bio: 'From wikipedia was born in usa from a firefighter father', 74 name: 'Charlotte Henry', 75 born: {}, 76 imdbRank: 21213, 77 imdbVotesddddddddddddddddddddd: 1213, changed this line in version 8 of the diff
1 import React from 'react'; changed this line in version 8 of the diff
101 {type === 'schema' ? ( 102 <Icon 103 className="ml-auto text-right flex-shrink-0" 104 component={ 105 v === 'int' || v === 'float' ? ( 106 <CarbonStringInteger /> 107 ) : v === 'string' ? ( 108 <CarbonStringText /> 109 ) : v === 'boolean' ? ( 110 <CarbonBoolean /> 111 ) : v === 'date' ? ( 112 <CarbonCalendar /> 113 ) : v === 'undefined' ? ( 114 <CarbonUndefined /> 115 ) : ( 116 <CarbonUndefined /> changed this line in version 8 of the diff
115 120 ); 116 121 }, [searchResults]); 117 122 123 const nodeColor = (node: any) => { 124 switch (node.type) { 125 case 'entity': 126 return '#fb7b04'; 127 case 'relation': 128 return '#0676C1'; 129 default: 130 return '#ff0072'; 131 } 132 }; 60 <div> 61 <CardToolTipVis 62 type="schema" 63 typeOfSchema="node" 64 name={data.name} 65 colorHeader="#fb7b04" 66 numberOfElements={1000} 67 data={data.attributes.reduce( 68 (acc, attr) => { 69 if (attr.name && attr.type) { 70 acc[attr.name] = attr.type; 71 } 72 return acc; 73 }, 74 {} as Record<string, string>, 75 )} - Comment on lines +67 to +75
A tip here is that you can pass elements as children instead of all by props. This means that the VisualizationTooltip do not necessarily need to implement how to show data, but instead you could have a VisualizationTooltip component with a VisualizationTooltipData component inside it which does that. I think this would make the VisualizationTooltip more generic and usable by the Nodelink and other visualizations. In fact, isn't there one like that already in Nodelink?
31 31 return ( changed this line in version 8 of the diff
74 numberOfElements={1000} 75 connectedFrom={data.from} 76 connectedTo={data.to} 77 data={ 78 data.attributes.length > 0 79 ? data.attributes.reduce( 80 (acc, attr) => { 81 if (attr.name && attr.type) { 82 acc[attr.name] = attr.type; 83 } 84 return acc; 85 }, 86 {} as Record<string, string>, 87 ) 88 : {} 89 } added 1 commit
- f0c523fc - fix: refactor: memoize children ref to prevent recreating virtual elements every update
added 6 commits
-
51c332db...60f3fb41 - 4 commits from branch
main
- d675d579 - feat: merged
- e7719d20 - Merge branch 'tooltipSchema' of git.science.uu.nl:graphpolaris/frontend-v2 into tooltipSchema
-
51c332db...60f3fb41 - 4 commits from branch
enabled an automatic merge when the pipeline for 6ddb8986 succeeds
This MR is included in version 1.67.0The release is available on GitLab release.
Your semantic-release bot