Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

The Properties Mapper dialog does not reflect the latest properties

0 votes

I was experimenting with the Custom Properties and how it imports the Excel data.

During the experiment, I renamed two custom properties as follows:
Label 1 -> L1
Label 2 -> L2.

Afterward, I came across the following situation:

The Custom Properties dialog (screenshot) shows two node properties, named L1 and L2.

But the Properties Mapper dialog shows properties called Label 1 and Label 2, which do not exist! It also shows the new properties: L1 and L2; but allows me to use the old properties. (screenshot)

[BUG]

Desired:

If the custom properties are modified, the Properties Mapper should not display the old properties; or if it shows them, it should also show an error against the non-existing properties.

asked Jul 27, 2018 in Feature Requests by Raindrops (1,420 points)
edited Jul 27, 2018 by Raindrops

1 Answer

0 votes

Actually, this is the desired behavior for properties mapper. Otherwise you cannot create/modify/store mappings independently from diagrams. (It is already cumbersome enough since you have to create all custom properties you want to map. Clearing properties mapper's "memory" would make this even worse.)
E.g. suppose you import a diagram from Excel and you need to map a property A in some way. The typical workflow would be:

  1. Import the diagram once without any property mapping.
  2. Create an appropriate property mapping.
  3. Import the diagram a second time to verify the mapping works as intended.

In your next yEd session you create a new, completely unrelated diagram with e.g. no custom proerties at all.
In the session after that, you decide to import a diagram from Excel once more. If the Excel file has the same structure and the same properties but different data, you can reuse the mapping you defined for the previous import - even though the corresponding properties do not exists before the import.

If we implemented your request, you could not use the existing mapping in the last step, because the second-to-last step would have cleared all custom properties.

answered Jul 27, 2018 by thomas.behr [yWorks] (123,120 points)
edited Jul 27, 2018 by thomas.behr
I do not get this:

For the use case you described, the first step is to open an excel data, but without putting a tick in the "Use configuration" check box in the "Presentation" tab.

I tried that, and yEd used the currently selected node in the palette, and simply replicated it 58 times (that's the number of rows in the Excel sheet). But it simply replicated the default node, and did not replace any of the label texts.

But this experiment made use of NEITHER the old NOR new properties. So how do the new and old property names play a part here?
Your response was edited after I posted the first comment.
Unfortunately this platform does not allow a series of Q&A.
So when I tried to post a response, the old comment box itself was opened for me.

[Edit] After my second response was posted, I could see that my comments are listed in a series, which means that my earlier comments are preserved.

________________________
My first import creates some nodes using the old properties.
My second import creates new nodes with the latest properties.

So if I delete some properties after creating some nodes, the structure of old nodes would become questionable.

Is that why the Property Mapper still shows the old (deleted/renamed) properties?

If so, even the Custom Properties dialog should retain old properties.
 
In other words, both dialogs must behave consistently.
I conducted another experiment:
1. I created a custom property called "Property 1", and made it Binary, with default=false.

2. Created two nodes, and entered values of "Property 1" as True for one node. The second node took the default value of False.

3. Edited the custom property to be decimal, with default value of 10.

4. Checked the nodes that I had already created. The values of the property had changed for both the nodes: The first node, which had a value of TRUE, now has a value of 1. The second value, which had a default value of 0, now has default value of 10.

5. Changed the label of the property, from "Property1" to "XXX". Now both nodes show the property as "XXX". The old label is nowhere to be seen.

All this is logical.

6. The Properties manager also shows only one Data source: XXX. (apart from the URL and Tooltip). This also is logical.

So how did the Properties Mapper behave differently in my earlier experiment??
Ok I did two additional steps and found a pattern: If I change the name of the Custom Property, the Properties Mapping dialog continues to show the old mapping, but it also shows the new value as an ADDITIONAL data source. If I replace the old label with the new label, and press OK, and then reopen the custom properties dialog, then it stops showing the old label.

Thus I confirm that there *is* a BUG.

I am not completely sure I understand what you did, so I am going to summarize what I think you did:

  1. "Edit" -> "Manage Custom Properties": Create a custom property for nodes named "Property 1".
  2. "Edit" -> "Properties Mapper": Create a configuration for nodes that uses "Property 1".
  3. "Edit" -> "Manage Custom Properties": Rename "Property 1" to "XXX".
  4. "Edit" -> "Properties Mapper": Edit data source of configuration from step 2. The drop-down list shows entries "Property 1" and "XXX". Select "XXX".
  5. "Edit" -> "Properties Mapper": Choose "Ok" to commit previous edit and close the dialog.
  6. "Edit" -> "Properties Mapper": Edit data source of configuration from step 2 once more. The drop-down list shows ent "XXX" but it does not show "Property 1" anymore.

This is the intended behavior! It is not a bug.

Not only is it the intended behavior, it is also the necessary behavior for the most important use case of properties mapper: Reusing existing configurations for repeated imports from Excel with new data but old "structure". (Think five spreadsheets, all with the same columns but each with different cell values.)

Yes, that's what I did.

BTW now I get it. Yes, what you say makes sense.
I will make a short video to explain this interesting feature.

Thanks for your patience!
Imprint | Privacy Policy