iVis-at-Bilkent / newt

A web application to visualize and edit pathway models
http://newteditor.org
GNU Lesser General Public License v3.0
53 stars 27 forks source link

Solid color scheme not loading #689

Closed SelbiEreshova closed 3 months ago

SelbiEreshova commented 2 years ago

On unstable branch saving maps with solid color scheme and uploading them back to newt gives an error.

Try this:

ugurdogrusoz commented 4 months ago

Might be related to #708 item 1.

okg21 commented 3 months ago

I believe this bug has been introduced with this commit for fixing https://github.com/iVis-at-Bilkent/newt/commit/e9666554593dc79688a61add64984148b470d2ea #574. Actions to remove background image related style properties have been added. And these fields are saved to the file with empty('') values. For the following properties: ['background-fit', 'background-image-opacity', 'background-position-x', 'background-position-y', 'background-height', 'background-width']

Having empty fields in the saved file results in NaN values when parsed. And cytoscape's style does not accept these NaN values.

Removing these actions fixes this bug, without the clone marker bug mentioned on the #574 reappearing and undo does not take two times. But I wonder if we do lose any utility in this case.

Another solution is checking for NaN values before applying node.style(). But this seems like a bad practice.

ugurdogrusoz commented 3 months ago

Let's try reverting the incorrect parts of the mentioned commit. We'll test it thoroughly later.

okg21 commented 3 months ago

I committed a fix for the clone marker bug. Now color schemes are loading correctly. And clone marker bug for unspecified entity and perturbing agent is fixed.

ugurdogrusoz commented 3 months ago

All samples are loading as solid right now. Most should be 3D or gradient.

ugurdogrusoz commented 3 months ago

@okg21 When we load a sample, the color scheme is incorrect. Let's first fix that so we can see if this original issue is fixed. The picture below is what we get when we load the first PD sample; what's wrong is red, whereas what is correct is in green:

Screenshot 2024-06-20 at 17 40 33
okg21 commented 3 months ago

With the latest rebuild color schemes are displayed correctly on unstable. ScreenRecording2024-06-26at14 11 17-ezgif com-video-to-gif-converter