Skip to content

Commit

Permalink
revert changes to fix Solid color scheme not loading #689
Browse files Browse the repository at this point in the history
  • Loading branch information
okg21 committed Jun 20, 2024
1 parent 9cdd447 commit 2408881
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 1 addition & 8 deletions app/js/app-cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1386,14 +1386,7 @@ module.exports = function (chiseInstance) {

var opt = {};
keys.forEach(function(key) {
var value = node.data(key);
var isSpecialClass = node.data('class') === 'unspecified entity' || node.data('class') === 'perturbing agent';

if (isNaN(value) && key !== 'background-image' && !isSpecialClass) {
opt[key] = undefined;
} else {
opt[key] = value;
}
opt[key] = node.data(key);
});

node.style(opt);
Expand Down
9 changes: 8 additions & 1 deletion app/js/app-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -2479,7 +2479,6 @@ appUtilities.getActionsToApplyMapColorScheme = function(newColorScheme, scheme_t
};

if(scheme_type == 'solid'){

var idMap = appUtilities.mapEleClassToId(eles, mapColorSchemes[newColorScheme]['values']);
var collapsedChildren = cy.expandCollapse('get').getAllCollapsedChildrenRecursively().filter("node");
var collapsedIdMap = appUtilities.mapEleClassToId(collapsedChildren, mapColorSchemes[newColorScheme]['values']);
Expand All @@ -2498,6 +2497,14 @@ appUtilities.getActionsToApplyMapColorScheme = function(newColorScheme, scheme_t

// edit style of the current map elements, in solid scheme just change background-color
actions.push({name: "changeData", param: {eles: eles, name: 'background-color', valueMap: idMap}});

// collapsed nodes' style should also be changed, special edge case
actions.push({name: "changeDataDirty", param: {eles: collapsedChildren, name: 'background-color', valueMap: collapsedIdMap}});

// if background-image isn't deleted from css, it is shown as soon as the node is expanded until the end of animation
actions.push({name: "changeCss", param: {eles: collapsedChildren, name: 'background-image', valueMap: ""}});

actions.push({name: "refreshColorSchemeMenu", param: {value: newColorScheme, self: self, scheme_type: scheme_type}});

// first clear the background images of already present collapsed elements
actions.push({name: "changeDataDirty", param: {eles: collapsedChildren, name: 'background-image', valueMap: mapIdToValue(collapsedChildren, '')}});
Expand Down

1 comment on commit 2408881

@okg21
Copy link
Contributor Author

@okg21 okg21 commented on 2408881 Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted to the old code and changed sbgnviz to fix the issue. Here is the sbgnviz.js pull request: iVis-at-Bilkent/sbgnviz.js#218

Please sign in to comment.