separate cases for text-margin-x

This commit is contained in:
Cindy Chang
2024-08-19 11:53:14 +08:00
parent aebf25a271
commit 0950214f19

View File

@@ -164,7 +164,9 @@ export default function cytoscapeMap(mapData, dataLayerType, dataLayerOption, cu
'text-wrap': 'wrap', 'text-wrap': 'wrap',
'text-max-width': 'data(width)', // 在 div 內換行 'text-max-width': 'data(width)', // 在 div 內換行
'text-overflow-wrap': 'anywhere', // 在 div 內換行 'text-overflow-wrap': 'anywhere', // 在 div 內換行
'text-margin-x': '-10px', 'text-margin-x': function(node) {
return node.data('type') === 'activity' ? -10 : 0;
},
'text-halign': 'center', 'text-halign': 'center',
'text-valign': 'center', 'text-valign': 'center',
'height': 'data(height)', 'height': 'data(height)',