I look for a way to avoid sorting dictionary data in dcc.Store. In another word, I want the data keep intact when store it.
Here is an example of using dcc.Store. The order of key names before saving in dcc.Store is [X, 2, 1], however it becomes [1, 2, X] after loading it from Store. Is there any way to avoid sorting it?
I see. So it depends on which brower used, but I still look for a way to fix it. One way I can think of is to save a list of key names along side with dict data in dcc.Store.
it comes from using JSON.parse() function or similar. When the key names are neat numbers, they will be ordered automatically.
When they are string-type, there won’t be any ordering.
You can try it here:
var saved_data = '{"A": 2, "1": 4, "0": 3}';
var parsedData = JSON.parse(saved_data);
console.log(parsedData);