iVis-at-Bilkent/newt

Solid color scheme not loading

SelbiEreshova opened this issue · 7 comments

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

Try this:

  • Open first PD sample
  • Change color scheme to solid
  • Save the file
  • Load this file back to Newt

Might be related to #708 item 1.

I believe this bug has been introduced with this commit for fixing e966655 #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.

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

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.

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

@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

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